Skip to content

Commit

Permalink
修复支付宝金额格式化错误
Browse files Browse the repository at this point in the history
修复金额格式化错误;开了混淆;增加版本号;
  • Loading branch information
su committed Mar 1, 2018
1 parent 752f570 commit 55a1672
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 12 deletions.
22 changes: 18 additions & 4 deletions fakebalance/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
}
Expand Down
2 changes: 2 additions & 0 deletions fakebalance/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -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 { *; }
3 changes: 0 additions & 3 deletions fakebalance/src/main/java/com/wuxiaosu/fakebalance/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

0 comments on commit 55a1672

Please sign in to comment.