diff --git a/fakebalance/build.gradle b/fakebalance/build.gradle index 495e9b4..ea69c27 100644 --- a/fakebalance/build.gradle +++ b/fakebalance/build.gradle @@ -7,14 +7,28 @@ android { applicationId "com.wuxiaosu.fakebalance" minSdkVersion 21 targetSdkVersion 23 - versionCode 1 - versionName "1.0" - + versionCode 2 + versionName "1.01" } buildTypes { release { - minifyEnabled false + minifyEnabled true + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + + applicationVariants.all { variant -> + variant.outputs.all { output -> + def oldFile = output.outputFile + def newName = oldFile.name + if (variant.buildType.name == 'release') { + newName = oldFile.name.replace(".", "-v" + variant.versionName + '.') + } + outputFileName = newName + } + } + } + debug { + minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } diff --git a/fakebalance/proguard-rules.pro b/fakebalance/proguard-rules.pro index f1b4245..f93bbb3 100644 --- a/fakebalance/proguard-rules.pro +++ b/fakebalance/proguard-rules.pro @@ -19,3 +19,5 @@ # If you keep the line number information, uncomment this to # hide the original source file name. #-renamesourcefileattribute SourceFile +-keep class com.wuxiaosu.fakebalance.Main { *; } +-keep class com.wuxiaosu.fakebalance.MainActivity { *; } diff --git a/fakebalance/src/main/java/com/wuxiaosu/fakebalance/Main.java b/fakebalance/src/main/java/com/wuxiaosu/fakebalance/Main.java index 5010c70..7d84ad8 100644 --- a/fakebalance/src/main/java/com/wuxiaosu/fakebalance/Main.java +++ b/fakebalance/src/main/java/com/wuxiaosu/fakebalance/Main.java @@ -5,9 +5,6 @@ import android.content.pm.ApplicationInfo; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; -import android.text.TextUtils; -import android.util.Log; -import android.widget.TextView; import com.wuxiaosu.fakebalance.hook.AliPayHook; import com.wuxiaosu.fakebalance.hook.TimHook; diff --git a/fakebalance/src/main/java/com/wuxiaosu/fakebalance/util/NumberUtils.java b/fakebalance/src/main/java/com/wuxiaosu/fakebalance/util/NumberUtils.java index 2b995a4..ebf8510 100644 --- a/fakebalance/src/main/java/com/wuxiaosu/fakebalance/util/NumberUtils.java +++ b/fakebalance/src/main/java/com/wuxiaosu/fakebalance/util/NumberUtils.java @@ -28,11 +28,11 @@ public static String num2num00(String number) { * @return */ public static String num2num00WithComma(String number) { - String temp = num2num00(number); - if (temp.equals("0.00")) { - return temp; - } DecimalFormat df = new DecimalFormat("#,###.00"); - return df.format(Double.valueOf(temp)); + String result = df.format(Double.valueOf(num2num00(number))); + if (result.startsWith(".")) { + result = "0" + result; + } + return result; } }