Skip to content

Commit

Permalink
支持支付宝复杂密码、umeng bug修复、界面优化
Browse files Browse the repository at this point in the history
  • Loading branch information
eritpchy committed Oct 26, 2017
1 parent 79f5ac1 commit 3edde2d
Show file tree
Hide file tree
Showing 13 changed files with 225 additions and 72 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

已适配版本:\
微信: 6.5.8 [6.5.10-1080](https://github.com/eritpchy/Xposed-Fingerprint-pay/releases/download/1.3/weixin6510.apk) 6.5.13-1081 [6.5.13-1100](https://github.com/eritpchy/Xposed-Fingerprint-pay/releases/download/1.4.1/WeChat-6.5.13-1100.apk) [6.5.16-1101](https://github.com/eritpchy/Xposed-Fingerprint-pay/releases/download/2.4.0/WeChat-6.5.16-1101.apk) [6.5.16-1120](https://github.com/eritpchy/Xposed-Fingerprint-pay/releases/download/2.3.0/WeChat-6.5.16-1120.apk)\
支付宝: 10.1.0.090418-114\
淘宝: 6.11.0-161
支付宝: 10.1.0.090418-114及以上\
淘宝: 6.11.0-161及以上

以下软件经测试过测试, 可以正常调用支付宝、微信:\
猫眼\
Expand All @@ -27,7 +27,7 @@


使用步骤:
1. 下载并安装插件: https://github.com/eritpchy/Xposed-Fingerprint-pay/releases/download/2.4.0/WeChatFp-2.4.0-release.apk
1. 下载并安装插件: https://github.com/eritpchy/Xposed-Fingerprint-pay/releases/download/2.5.0/WeChatFp-2.5.0-release.apk
2. 下载并安装微信6.5.16-1120版本 https://github.com/eritpchy/Xposed-Fingerprint-pay/releases/download/2.3.0/WeChat-6.5.16-1120.apk
3. 下载并安装支付宝10.1.0.090418-114版本 https://github.com/eritpchy/Xposed-Fingerprint-pay/releases/download/2.0.0/Alipay-10.1.0.090418-114.apk
4. 下载并安装淘宝6.11.0-161版本 https://github.com/eritpchy/Xposed-Fingerprint-pay/releases/download/2.1.0/Taobao-6.11.0-161.apk
Expand All @@ -38,9 +38,9 @@
链接: https://pan.baidu.com/s/1eSq0QNw 密码: fbrg

友情提示:
1. 由于没有复杂密码的支付宝账号, 支付宝的支付密码只支持6位简单密码噢.
2. 以上提供的安装包均为 支付宝/微信/淘宝官方提供的安装包, 没有任何添加修改, 提供安装包只为方便找到指定适配过的安装包.
3. 本软件的网络功能仅限检查自己软件更新功能, 如不放心, 欢迎REVIEW代码.
1. 以上提供的安装包均为 支付宝/微信/淘宝官方提供的安装包, 没有任何添加修改, 提供安装包只为方便找到指定适配过的安装包.
2. 本软件的网络功能仅限检查自己软件更新功能, 如不放心, 欢迎REVIEW代码.
3. 不支持QQ, 别问我为什么, 反正就是不支持!

![qq](https://github.com/eritpchy/Xposed-Fingerprint-pay/raw/master/doc/qqGroup.png)

Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ android {
applicationId "com.yyxx.wechatfp"
minSdkVersion 14
targetSdkVersion 26
versionCode 11
versionName "2.4.0"
versionCode 12
versionName "2.5.0"
buildConfigField "String", "APP_PRODUCT_NAME", "\"WeChatFp\""
}

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/yyxx/wechatfp/Constant.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class Constant {
public static final String HELP_URL_WECHAT = "https://github.com/eritpchy/Xposed-Fingerprint-pay/blob/master/doc/WeChat/README.md";
public static final String HELP_URL_ALIPAY = "https://github.com/eritpchy/Xposed-Fingerprint-pay/blob/master/doc/Alipay/README.md";
public static final String HELP_URL_TAOBAO = "https://github.com/eritpchy/Xposed-Fingerprint-pay/blob/master/doc/Taobao/README.md";
public static final String PROJECT_URL = "https://github.com/eritpchy/WechatFp";
public static final String PROJECT_URL = "https://github.com/eritpchy/Xposed-Fingerprint-pay";
public static final String UPDATE_URL_GITHUB = "https://api.github.com/repos/eritpchy/Xposed-Fingerprint-pay/releases/latest";
public static final String DONATE_ID_ALIPAY = "https://qr.alipay.com/FKX012222QIU52C6LATAB7";
public static final String DONATE_ID_WECHAT = "wxp://f2f0-1_Hm7XAY7SXA3B_0R0v-VJD71jYCWog";
Expand Down
8 changes: 7 additions & 1 deletion app/src/main/java/com/yyxx/wechatfp/Lang.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ public class Lang {
public static final int TOAST_PASSWORD_NOT_SET_ALIPAY = 0x01000010;
public static final int TOAST_PASSWORD_NOT_SET_WECHAT = 0x01000011;
public static final int TOAST_PASSWORD_AUTO_ENTER_FAIL = 0x01000012;
public static final int TOAST_GOTO_DONATE_PAGE_FAIL_ALIPAY = 0x01000013;
public static final int TOAST_GOTO_DONATE_PAGE_FAIL_WECHAT = 0x01000014;

private static final int TEMPLATE = 0xFFFFFFFF;

Expand Down Expand Up @@ -117,7 +119,7 @@ public static String getString(int res) {
case SETTINGS_TITLE_WECHAT:
return tr("微信", "微信", "WeChat");
case ENTER_PASSWORD:
return tr("请输入密码", "請輸入密碼", "Enter password");
return tr("输入密码", "輸入密碼", "Enter password");
case SETTINGS_TITLE_SWITCH:
return tr("启用", "啟用", "Enable");
case SETTINGS_TITLE_PASSWORD:
Expand Down Expand Up @@ -173,6 +175,10 @@ public static String getString(int res) {
return tr("未设定支付密码,请前往設置->指紋設置中设定微信的支付密码", "未設定支付密碼,請前往設置 -> 指紋設置中設定微信的支付密碼", "Payment password not set, please goto Settings -> Fingerprint to enter you payment password");
case TOAST_PASSWORD_AUTO_ENTER_FAIL:
return tr("Oops.. 输入失败了. 请手动输入密码", "Oops.. 輸入失敗了. 請手動輸入密碼", "Oops... auto input failure, switch to manual input");
case TOAST_GOTO_DONATE_PAGE_FAIL_ALIPAY:
return tr("调用支付宝捐赠页失败, 您可以手动转账捐赠哦, 帐号: " + Constant.AUTHOR_ALIPAY, "調用支付寶捐贈頁失敗, 您可以手動轉賬捐贈哦, 帳號: " + Constant.AUTHOR_ALIPAY, "Can't jump to Alipay donate page, You can do it manually by transfer to account: " + Constant.AUTHOR_ALIPAY);
case TOAST_GOTO_DONATE_PAGE_FAIL_WECHAT:
return tr("调用微信捐赠页失败, 您可以手动转账捐赠哦, 帐号: " + Constant.AUTHOR_WECHAT, "調用微信捐贈頁失敗, 您可以手動轉賬捐贈哦, 帳號: " + Constant.AUTHOR_WECHAT, "Can't jump to WeChat donate page, You can do it manually by transfer to account: " + Constant.AUTHOR_WECHAT);
case TEMPLATE:
return tr("", "", "");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public void onCreate(Bundle savedInstanceState) {
list.add(new PreferenceAdapter.Data(Lang.getString(Lang.SETTINGS_TITLE_HELP_ALIPAY), Lang.getString(Lang.SETTINGS_SUB_TITLE_HELP_ALIPAY)));
list.add(new PreferenceAdapter.Data(Lang.getString(Lang.SETTINGS_TITLE_HELP_TAOBAO), Lang.getString(Lang.SETTINGS_SUB_TITLE_HELP_TAOBAO)));
list.add(new PreferenceAdapter.Data(Lang.getString(Lang.SETTINGS_TITLE_CHECKUPDATE), Lang.getString(Lang.SETTINGS_SUB_TITLE_CHECKUPDATE)));
list.add(new PreferenceAdapter.Data(Lang.getString(Lang.SETTINGS_TITLE_WEBSIDE), Lang.getString(Lang.SETTINGS_SUB_TITLE_WEBSIDE)));
list.add(new PreferenceAdapter.Data(Lang.getString(Lang.SETTINGS_TITLE_WEBSIDE), PROJECT_URL));
list.add(new PreferenceAdapter.Data(Lang.getString(Lang.SETTINGS_TITLE_VERSION), BuildConfig.VERSION_NAME));
mListAdapter = new PreferenceAdapter(list);
listView.setAdapter(mListAdapter);
Expand Down
14 changes: 6 additions & 8 deletions app/src/main/java/com/yyxx/wechatfp/util/DonateUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,25 +33,23 @@ public static boolean openAlipayPayPage(Context context, String qrcode) {
return false;
}

public static void openWeChatPay(Context context) {
public static boolean openWeChatPay(Context context) {
try {
Intent donateIntent = new Intent();
donateIntent.setClassName(context, "com.tencent.mm.plugin.remittance.ui.RemittanceAdapterUI");
donateIntent.putExtra("scene", 1);
donateIntent.putExtra("pay_channel", 13);
donateIntent.putExtra("receiver_name", Constant.DONATE_ID_WECHAT);
context.startActivity(donateIntent);
return true;
} catch (Exception e) {
L.e(e);
}
return false;
}

private static void openUri(Context context, String s) {
try {
Intent intent = Intent.parseUri(s, Intent.URI_INTENT_SCHEME);
context.startActivity(intent);
} catch (Exception e) {
L.e(e);
}
private static void openUri(Context context, String s) throws Exception {
Intent intent = Intent.parseUri(s, Intent.URI_INTENT_SCHEME);
context.startActivity(intent);
}
}
8 changes: 7 additions & 1 deletion app/src/main/java/com/yyxx/wechatfp/util/UrlUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import android.net.Uri;
import android.util.Log;

import com.yyxx.wechatfp.util.log.L;

/**
* Created by Jason on 2017/7/7.
*/
Expand Down Expand Up @@ -59,7 +61,11 @@ public static void openUrl(Context context, String url){
Uri content_url = Uri.parse(url);
intent.setData(content_url);
}
context.startActivity(intent);
try {
context.startActivity(intent);
} catch (Exception e) {
L.d(e);
}
}

}
2 changes: 1 addition & 1 deletion app/src/main/java/com/yyxx/wechatfp/util/ViewUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public static void recursiveLoopChildren(ViewGroup parent) {
} else {
if (child != null) {
try {
L.d("view", getViewInfo(child));
L.d("view", getViewInfo(child), child.getTag());
} catch (Exception e) {

}
Expand Down
9 changes: 7 additions & 2 deletions app/src/main/java/com/yyxx/wechatfp/view/DonateView.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import android.widget.AdapterView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.Toast;

import com.yyxx.wechatfp.Constant;
import com.yyxx.wechatfp.Lang;
Expand Down Expand Up @@ -80,9 +81,13 @@ public void onItemClick(AdapterView<?> adapterView, View view, int position, lon
PreferenceAdapter.Data data = mListAdapter.getItem(position);
final Context context = getContext();
if (Lang.getString(Lang.SETTINGS_TITLE_ALIPAY).equals(data.title)) {
DonateUtil.openAlipayPayPage(context);
if (!DonateUtil.openAlipayPayPage(context)) {
Toast.makeText(context, Lang.getString(Lang.TOAST_GOTO_DONATE_PAGE_FAIL_ALIPAY), Toast.LENGTH_LONG).show();
}
} else if (Lang.getString(Lang.SETTINGS_TITLE_WECHAT).equals(data.title)) {
DonateUtil.openWeChatPay(context);
if (!DonateUtil.openWeChatPay(context)) {
Toast.makeText(context, Lang.getString(Lang.TOAST_GOTO_DONATE_PAGE_FAIL_WECHAT), Toast.LENGTH_LONG).show();
}
}
}
}
15 changes: 12 additions & 3 deletions app/src/main/java/com/yyxx/wechatfp/view/PasswordInputView.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;

import com.yyxx.wechatfp.Constant;
import com.yyxx.wechatfp.Lang;
import com.yyxx.wechatfp.util.DpUtil;

Expand Down Expand Up @@ -44,9 +45,17 @@ private void initView(Context context) {
mInputView.setFocusable(true);
mInputView.setFocusableInTouchMode(true);
mInputView.setTransformationMethod(HideReturnsTransformationMethod.getInstance());
mInputView.setInputType(InputType.TYPE_CLASS_NUMBER
| InputType.TYPE_NUMBER_VARIATION_PASSWORD
);
String packageName = context.getPackageName();
if (Constant.PACKAGE_NAME_ALIPAY.equals(packageName)
|| Constant.PACKAGE_NAME_TAOBAO.equals(packageName)) {
mInputView.setInputType(InputType.TYPE_CLASS_TEXT
| InputType.TYPE_TEXT_VARIATION_PASSWORD
);
} else {
mInputView.setInputType(InputType.TYPE_CLASS_NUMBER
| InputType.TYPE_NUMBER_VARIATION_PASSWORD
);
}

LayoutParams layoutParam = new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
int defHMargin = DpUtil.dip2px(context, 15);
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/yyxx/wechatfp/view/SettingsView.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ private void init(Context context) {
}
mSettingsDataList.add(new PreferenceAdapter.Data(Lang.getString(Lang.SETTINGS_TITLE_DONATE), Lang.getString(Lang.SETTINGS_SUB_TITLE_DONATE)));
mSettingsDataList.add(new PreferenceAdapter.Data(Lang.getString(Lang.SETTINGS_TITLE_CHECKUPDATE), Lang.getString(Lang.SETTINGS_SUB_TITLE_CHECKUPDATE)));
mSettingsDataList.add(new PreferenceAdapter.Data(Lang.getString(Lang.SETTINGS_TITLE_WEBSIDE), Lang.getString(Lang.SETTINGS_SUB_TITLE_WEBSIDE)));
mSettingsDataList.add(new PreferenceAdapter.Data(Lang.getString(Lang.SETTINGS_TITLE_WEBSIDE), Constant.PROJECT_URL));
mListAdapter = new PreferenceAdapter(mSettingsDataList);

rootVerticalLayout.addView(settingsTitle);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
Expand Down Expand Up @@ -254,27 +255,15 @@ public void showFingerPrintDialog(final Activity activity) {
return;
}

String modulePackageName = "com.alipay.android.phone.safepaybase";
View keysView[] = new View[] {
ViewUtil.findViewByName(activity, modulePackageName, "key_num_1"),
ViewUtil.findViewByName(activity, modulePackageName, "key_num_2"),
ViewUtil.findViewByName(activity, modulePackageName, "key_num_3"),
ViewUtil.findViewByName(activity, modulePackageName, "key_num_4", "key_4"),
ViewUtil.findViewByName(activity, modulePackageName, "key_num_5"),
ViewUtil.findViewByName(activity, modulePackageName, "key_num_6"),
ViewUtil.findViewByName(activity, modulePackageName, "key_num_7"),
ViewUtil.findViewByName(activity, modulePackageName, "key_num_8"),
ViewUtil.findViewByName(activity, modulePackageName, "key_num_9"),
ViewUtil.findViewByName(activity, modulePackageName, "key_num_0"),
};

try {
inputPassword(pwd, keysView);
} catch (NullPointerException e) {
Toast.makeText(context, Lang.getString(Lang.TOAST_PASSWORD_AUTO_ENTER_FAIL), Toast.LENGTH_LONG).show();
} catch (Exception e) {
Toast.makeText(context, Lang.getString(Lang.TOAST_PASSWORD_AUTO_ENTER_FAIL), Toast.LENGTH_LONG).show();
L.e(e);
if (!tryInputGenericPassword(activity, pwd)) {
try {
inputDigitPassword(activity, pwd);
} catch (NullPointerException e) {
Toast.makeText(context, Lang.getString(Lang.TOAST_PASSWORD_AUTO_ENTER_FAIL), Toast.LENGTH_LONG).show();
} catch (Exception e) {
Toast.makeText(context, Lang.getString(Lang.TOAST_PASSWORD_AUTO_ENTER_FAIL), Toast.LENGTH_LONG).show();
L.e(e);
}
}
AlertDialog dialog = mFingerPrintAlertDialog;
if (dialog != null) {
Expand Down Expand Up @@ -364,7 +353,20 @@ private void doSettingsMenuInject(final Activity activity) {
}
}

private void inputPassword(String password, View[] ks) {
private void inputDigitPassword(Activity activity, String password) {
String modulePackageName = "com.alipay.android.phone.safepaybase";
View ks[] = new View[] {
ViewUtil.findViewByName(activity, modulePackageName, "key_num_1"),
ViewUtil.findViewByName(activity, modulePackageName, "key_num_2"),
ViewUtil.findViewByName(activity, modulePackageName, "key_num_3"),
ViewUtil.findViewByName(activity, modulePackageName, "key_num_4", "key_4"),
ViewUtil.findViewByName(activity, modulePackageName, "key_num_5"),
ViewUtil.findViewByName(activity, modulePackageName, "key_num_6"),
ViewUtil.findViewByName(activity, modulePackageName, "key_num_7"),
ViewUtil.findViewByName(activity, modulePackageName, "key_num_8"),
ViewUtil.findViewByName(activity, modulePackageName, "key_num_9"),
ViewUtil.findViewByName(activity, modulePackageName, "key_num_0"),
};
char[] chars = password.toCharArray();
for (char c : chars) {
View v;
Expand Down Expand Up @@ -405,4 +407,57 @@ private void inputPassword(String password, View[] ks) {
ViewUtil.performActionClick(v);
}
}

private boolean tryInputGenericPassword(Activity activity, String password) {
ViewGroup rootView = (ViewGroup) activity.getWindow().getDecorView();
EditText pwdEditText = findPasswordEditText(rootView);
L.d("pwdEditText", pwdEditText);
if (pwdEditText == null) {
return false;
}
View confirmPwdBtn = findConfirmPasswordBtn(rootView);
L.d("confirmPwdBtn", confirmPwdBtn);
if (confirmPwdBtn == null) {
return false;
}
pwdEditText.setText(password);
((View)confirmPwdBtn.getParent()).performClick();
return true;
}

private EditText findPasswordEditText(ViewGroup viewGroup) {
List<View> outList = new ArrayList<>();
ViewUtil.getChildViews(viewGroup, "", outList);
for (View view : outList) {
if (view instanceof EditText) {
if (view.getId() != -1) {
continue;
}
if (!view.isShown()) {
continue;
}
return (EditText) view;
}
}
return null;
}

private View findConfirmPasswordBtn(ViewGroup viewGroup) {

List<View> outList = new ArrayList<>();
ViewUtil.getChildViews(viewGroup, "付款", outList);
if (outList.isEmpty()) {
ViewUtil.getChildViews(viewGroup, "Pay", outList);
}
for (View view : outList) {
if (view.getId() != -1) {
continue;
}
if (!view.isShown()) {
continue;
}
return view;
}
return null;
}
}
Loading

0 comments on commit 3edde2d

Please sign in to comment.