diff --git a/.idea/.name b/.idea/.name deleted file mode 100644 index 287dfdc..0000000 --- a/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -Alipay MemberGrade \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 3d21ecd..584e4ae 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -27,16 +27,6 @@ - - - - - - - - - - diff --git a/.idea/modules.xml b/.idea/modules.xml index d0a472e..b3ad796 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -2,7 +2,7 @@ - + diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index 8aad827..59832eb 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -6,10 +6,10 @@ android { defaultConfig { applicationId "im.hoho.alipayInstallB" - minSdkVersion 22 + minSdkVersion 21 targetSdkVersion 25 - versionCode 1 - versionName "1.0" + versionCode 3 + versionName "1.0.4" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { @@ -27,10 +27,10 @@ repositories { dependencies { provided 'de.robv.android.xposed:api:82' compile fileTree(include: ['*.jar'], dir: 'libs') - androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { - exclude group: 'com.android.support', module: 'support-annotations' - }) +// androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { +// exclude group: 'com.android.support', module: 'support-annotations' +// }) compile 'com.android.support:appcompat-v7:25.3.1' - compile 'com.android.support.constraint:constraint-layout:1.0.2' +// compile 'com.android.support.constraint:constraint-layout:1.0.2' testCompile 'junit:junit:4.12' } diff --git a/app/src/main/java/im/hoho/alipayInstallB/MainActivity.java b/app/src/main/java/im/hoho/alipayInstallB/MainActivity.java index 028cdc1..8085af5 100644 --- a/app/src/main/java/im/hoho/alipayInstallB/MainActivity.java +++ b/app/src/main/java/im/hoho/alipayInstallB/MainActivity.java @@ -6,12 +6,17 @@ import android.os.Bundle; import android.text.Editable; import android.text.TextWatcher; +import android.view.View; +import android.widget.CompoundButton; import android.widget.EditText; +import android.widget.Switch; public class MainActivity extends AppCompatActivity { private EditText editText; private EditText editText2; + private Switch switchYuEBao; + private Switch switchBackground; private SharedPreferences sp; @@ -40,15 +45,37 @@ protected void onCreate(Bundle savedInstanceState) { editor.apply(); -// R.layout.activity_main = sp.edit(); -// editor.putString("test_put", "test_put"); - editText = (EditText) findViewById(R.id.editText); editText.setText(sp.getString("yuebaoIncreaseAmount", "20000000")); editText2 = (EditText) findViewById(R.id.editText2); editText2.setText(sp.getString("yuebaoTotalProfit", "172823.23")); + switchBackground = (Switch) findViewById(R.id.switchBackground); + if (sp.getString("enableBackground", "true").equals("true")) + switchBackground.setChecked(true); + switchYuEBao = (Switch) findViewById(R.id.switchYuEBao); + if (sp.getString("enableYuEBao", "true").equals("true")) + switchYuEBao.setChecked(true); + + switchYuEBao.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { + editor.putString("enableYuEBao", Boolean.toString(isChecked).toLowerCase()); + editor.apply(); + } + }); + + switchBackground.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { + editor.putString("enableBackground", Boolean.toString(isChecked).toLowerCase()); + editor.apply(); + } + }); + + + editText.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { diff --git a/app/src/main/java/im/hoho/alipayInstallB/PluginMain.java b/app/src/main/java/im/hoho/alipayInstallB/PluginMain.java index a0c928d..b6927ac 100644 --- a/app/src/main/java/im/hoho/alipayInstallB/PluginMain.java +++ b/app/src/main/java/im/hoho/alipayInstallB/PluginMain.java @@ -71,7 +71,7 @@ public void handleLoadPackage(final XC_LoadPackage.LoadPackageParam lpparam) thr // if (lpparam.packageName.contains("com.eg.android.AlipayGphone")) { XposedBridge.log("Loaded App: " + lpparam.packageName); - XposedBridge.log("Powered by HOHO`` 20170309"); + XposedBridge.log("Powered by HOHO`` 20170821"); // //StackTraceElement[] getStackTrace //// throw Exception @@ -145,6 +145,16 @@ public void handleLoadPackage(final XC_LoadPackage.LoadPackageParam lpparam) thr protected void afterHookedMethod(MethodHookParam param) throws Throwable { XposedBridge.log("Now, let's install B..."); + XSharedPreferences pre = new XSharedPreferences("im.hoho.alipayInstallB", "prefs"); + pre.makeWorldReadable(); + String enabledBackground = pre.getString("enableBackground", "true"); + XposedBridge.log("enableBackground value: " + enabledBackground); + + if (!enabledBackground.equals("true")) { + XposedBridge.log("Install B is failed! Not enabled."); + return; + } + Map result = (Map) param.getResult(); if (result.containsKey("memberGrade")) { XposedBridge.log("Original member grade: " + result.get("memberGrade")); @@ -170,65 +180,65 @@ protected void afterHookedMethod(MethodHookParam param) } }); - //download url - XposedHelpers.findAndHookMethod( - "com.alipay.mobile.framework.service.ext.openplatform.domain.AppEntity", - lpparam.classLoader, - "setDownloadUrl", - String.class, - new XC_MethodHook() { - @Override - protected void afterHookedMethod(MethodHookParam param) - throws Throwable { - XposedBridge.log("setDownloadUrl: " + param.args[0]); - } - }); +// //download url +// XposedHelpers.findAndHookMethod( +// "com.alipay.mobile.framework.service.ext.openplatform.domain.AppEntity", +// lpparam.classLoader, +// "setDownloadUrl", +// String.class, +// new XC_MethodHook() { +// @Override +// protected void afterHookedMethod(MethodHookParam param) +// throws Throwable { +// XposedBridge.log("setDownloadUrl: " + param.args[0]); +// } +// }); - //setPageUrl - XposedHelpers.findAndHookMethod( - "com.alipay.mobile.framework.service.ext.openplatform.domain.AppEntity", - lpparam.classLoader, - "setPageUrl", - String.class, - new XC_MethodHook() { - @Override - protected void afterHookedMethod(MethodHookParam param) - throws Throwable { - XposedBridge.log("setPageUrl: " + param.args[0]); - } - }); +// //setPageUrl +// XposedHelpers.findAndHookMethod( +// "com.alipay.mobile.framework.service.ext.openplatform.domain.AppEntity", +// lpparam.classLoader, +// "setPageUrl", +// String.class, +// new XC_MethodHook() { +// @Override +// protected void afterHookedMethod(MethodHookParam param) +// throws Throwable { +// XposedBridge.log("setPageUrl: " + param.args[0]); +// } +// }); - //feeAmount - XposedHelpers.findAndHookMethod( - "com.alipay.wealth.common.ui.PopupFloatView", - lpparam.classLoader, - "setFeeAmount", - String.class, - String.class, - new XC_MethodHook() { - @Override - protected void afterHookedMethod(MethodHookParam param) - throws Throwable { - XposedBridge.log("setFeeAmount 1st: " + param.args[0]); - XposedBridge.log("setFeeAmount 2st: " + param.args[1]); - } - }); +// //feeAmount +// XposedHelpers.findAndHookMethod( +// "com.alipay.wealth.common.ui.PopupFloatView", +// lpparam.classLoader, +// "setFeeAmount", +// String.class, +// String.class, +// new XC_MethodHook() { +// @Override +// protected void afterHookedMethod(MethodHookParam param) +// throws Throwable { +// XposedBridge.log("setFeeAmount 1st: " + param.args[0]); +// XposedBridge.log("setFeeAmount 2st: " + param.args[1]); +// } +// }); - //feeAmount2 - XposedHelpers.findAndHookMethod( - "com.alipay.wealth.common.ui.PopupFloatView", - lpparam.classLoader, - "setFeeAmountValue", - String.class, - boolean.class, - new XC_MethodHook() { - @Override - protected void afterHookedMethod(MethodHookParam param) - throws Throwable { - XposedBridge.log("setFeeAmountValue 1st: " + param.args[0]); - XposedBridge.log("setFeeAmountValue 2st: " + param.args[1].toString()); - } - }); +// //feeAmount2 +// XposedHelpers.findAndHookMethod( +// "com.alipay.wealth.common.ui.PopupFloatView", +// lpparam.classLoader, +// "setFeeAmountValue", +// String.class, +// boolean.class, +// new XC_MethodHook() { +// @Override +// protected void afterHookedMethod(MethodHookParam param) +// throws Throwable { +// XposedBridge.log("setFeeAmountValue 1st: " + param.args[0]); +// XposedBridge.log("setFeeAmountValue 2st: " + param.args[1].toString()); +// } +// }); //Yu'ebao @@ -245,6 +255,17 @@ protected void afterHookedMethod(MethodHookParam param) protected void beforeHookedMethod(MethodHookParam param) throws Throwable { XposedBridge.log("Let's do it...Changing me to GaoShuaiFu!"); + XSharedPreferences pre = new XSharedPreferences("im.hoho.alipayInstallB", "prefs"); + pre.makeWorldReadable(); + String enableYuEBao = pre.getString("enableYuEBao", "true"); + XposedBridge.log("enableYuEBao value: " + enableYuEBao); + if (!enableYuEBao.equals("true")) { + XposedBridge.log("Not enabled, keep original..."); + return; + } + + String increaseString = pre.getString("yuebaoIncreaseAmount", "512345"); + String totalProfitSetString = pre.getString("yuebaoTotalProfit", "512345"); boolean canSetPreProfit = false; Field previousProfitField = FundHomeInfoV99ResultPB.getDeclaredField("previousProfit"); @@ -265,10 +286,6 @@ protected void beforeHookedMethod(MethodHookParam param) } BigDecimal totalAmountProcessing = new BigDecimal(totalAmount); - XSharedPreferences pre = new XSharedPreferences("im.hoho.alipayInstallB", "prefs"); - pre.makeWorldReadable(); - String increaseString = pre.getString("yuebaoIncreaseAmount","512345"); - String totalProfitSetString = pre.getString("yuebaoTotalProfit","512345"); if (!increaseString.equals("1130")) { BigDecimal increaseTotal = new BigDecimal(increaseString); @@ -284,12 +301,12 @@ protected void beforeHookedMethod(MethodHookParam param) totalAmountProcessing = totalAmountProcessing.add(increaseTotal).setScale(2, RoundingMode.HALF_EVEN); previousProfitProcessing = totalAmountProcessing.divide(profitRatio, 2, RoundingMode.HALF_EVEN); - XposedBridge.log("totalProfit before: " +(String)totalProfitField.get(param.args[0])); + XposedBridge.log("totalProfit before: " + (String) totalProfitField.get(param.args[0])); XposedBridge.log("previousProfit before: " + previousProfit); XposedBridge.log("totalAmount before: " + totalAmount); XposedBridge.log("totalProfit settings value: " + totalProfitSetString); - totalProfitField.set(param.args[0],totalProfitDec.toString()); + totalProfitField.set(param.args[0], totalProfitDec.toString()); if (canSetPreProfit) previousProfitField.set(param.args[0], previousProfitProcessing.toPlainString()); totalAmountField.set(param.args[0], totalAmountProcessing.toPlainString()); @@ -297,10 +314,10 @@ protected void beforeHookedMethod(MethodHookParam param) XposedBridge.log("previousProfit after: " + (String) previousProfitField.get(param.args[0])); XposedBridge.log("totalAmount after: " + (String) totalAmountField.get(param.args[0])); XposedBridge.log("totalProfit after: " + (String) totalProfitField.get(param.args[0])); - }else{ + } else { previousProfitField.set(param.args[0], "神!"); - totalAmountField.set(param.args[0],"高端大气上档次"); - weekRateField.set(param.args[0],"狂拽酷炫吊炸天"); + totalAmountField.set(param.args[0], "高端大气上档次"); + weekRateField.set(param.args[0], "狂拽酷炫吊炸天"); } } }); diff --git a/app/src/main/java/im/hoho/alipayInstallB/PreferencesUtils.java b/app/src/main/java/im/hoho/alipayInstallB/PreferencesUtils.java new file mode 100644 index 0000000..44f7135 --- /dev/null +++ b/app/src/main/java/im/hoho/alipayInstallB/PreferencesUtils.java @@ -0,0 +1,36 @@ +package im.hoho.alipayInstallB; + +import de.robv.android.xposed.XSharedPreferences; + +public class PreferencesUtils { + + private static XSharedPreferences instance = null; + + private static XSharedPreferences getInstance() { + if (instance == null) { + instance = new XSharedPreferences(PreferencesUtils.class.getPackage().getName()); + instance.makeWorldReadable(); + } else { + instance.reload(); + } + return instance; + } + + public static boolean open() { + return getInstance().getBoolean("open", false); + } + + + public static boolean delay() { + return getInstance().getBoolean("delay", false); + } + + public static int delayTime() { + return getInstance().getInt("delay_time", 0); + } + + public static boolean quickOpen() { + return getInstance().getBoolean("quick_open", false); + } + +} diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 5321a7b..5796f48 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -10,15 +10,34 @@ tools:context="im.hoho.alipayInstallB.MainActivity"> + + + + + android:textAppearance="?android:attr/textAppearanceLarge" + android:layout_below="@+id/switchBackground" + android:layout_alignParentStart="true" + android:layout_marginTop="51dp" /> + android:layout_centerHorizontal="true" /> + android:layout_below="@+id/textView3" + android:layout_alignParentStart="true" + android:layout_marginTop="41dp" /> + android:layout_below="@+id/textView2" + android:layout_alignParentStart="true" /> + android:layout_alignParentStart="true" /> + diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.png b/app/src/main/res/mipmap-hdpi/ic_launcher.png index cde69bc..5c7daa3 100644 Binary files a/app/src/main/res/mipmap-hdpi/ic_launcher.png and b/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.png b/app/src/main/res/mipmap-mdpi/ic_launcher.png index c133a0c..59f0384 100644 Binary files a/app/src/main/res/mipmap-mdpi/ic_launcher.png and b/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/app/src/main/res/mipmap-xhdpi/ic_launcher.png index bfa42f0..98f07c5 100644 Binary files a/app/src/main/res/mipmap-xhdpi/ic_launcher.png and b/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png index 324e72c..5fa73a0 100644 Binary files a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png index aee44e1..750f3c6 100644 Binary files a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index c1c9e46..070b9a7 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,4 +1,4 @@ -#Thu Aug 10 16:00:43 CST 2017 +#Mon Aug 21 20:30:54 CST 2017 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME