Commit 12df1d95 by sikang

add string fog

parent 80c20441
apply plugin: 'walle'
apply plugin: 'stringfog'
android {
defaultConfig {
......@@ -105,3 +105,15 @@ walle {
channelFile = new File("${project.getProjectDir()}/channel")
}
stringfog {
// 这是加解密key,可以自由定义。
key "${string_key}"
// 开关
enable true
// 加解密库的实现类路径,需和上面配置的加解密算法库一致。
implementation 'com.github.megatronking.stringfog.xor.StringFogImpl'
// 指定需加密的代码包路径,可配置多个,未指定将默认全部加密。
// fogPackages = ['com.xxx.xxx']
}
......@@ -163,6 +163,10 @@ dependencies {
// api 'com.google.android.gms:play-services-basement:17.1.1'
//源码字符串加密
api 'com.github.megatronking.stringfog:xor:1.1.0'
//SDK-FACEBOOK-START
api 'com.facebook.android:facebook-android-sdk:5.5.1'
//SDK-FACEBOOK-END
......
......@@ -21,6 +21,8 @@ import tech.starwin.LibConfig;
import tech.starwin.network.Gateway;
import tech.starwin.utils.AccountKitUtils;
import tech.starwin.utils.InstallReferrerHelper;
import tech.starwin.utils.PreferencesManager;
import tech.starwin.utils.RequestHandler;
import tech.starwin.utils.TrackEventHelper;
import tech.starwin.utils.context_utils.AppLanguageUtils;
import tech.starwin.utils.context_utils.DeviceUtils;
......@@ -56,8 +58,8 @@ public abstract class BaseApplication extends MultiDexApplication {
// if (!TextUtils.isEmpty(LibConfig.BUGLY_APPID)) {
// CrashReport.initCrashReport(getApplicationContext(), LibConfig.BUGLY_APPID, false);
// }
try {
String appId = StringDecrypt.uncodeString(BuildConfig.FACEBOOK_APP_ID);
String clienToken = StringDecrypt.uncodeString(BuildConfig.ACCOUNT_KIT_CLIENT_TOKEN);
FacebookSdk.setApplicationId(appId);
......@@ -79,6 +81,7 @@ public abstract class BaseApplication extends MultiDexApplication {
InstallReferrerHelper.refershInstallReferrer(this);
LibConfig.initLib(this);
}
// public class DefaultPhilologyRepository implements PhilologyRepository {
......
......@@ -5,17 +5,19 @@ import android.content.Context;
import android.content.SharedPreferences;
import android.text.TextUtils;
import android.util.Base64;
import android.util.Log;
import com.common.bean.DisplayBean;
import com.common.bean.GatewayInfoBean;
import com.common.bean.OcrResultBean;
import com.common.bean.TokenInfoBean;
import com.common.bean.UserBean;
import tech.starwin.utils.tracker.TrackEvent;
import java.util.Map;
import java.util.Random;
import tech.starwin.utils.format_utils.StringFormat;
import tech.starwin.utils.tracker.TrackEvent;
/**
* Created by SiKang on 2018/9/18.
......@@ -287,6 +289,10 @@ public class PreferencesManager {
* 保存单条数据
*/
public void saveData(String key, String data) {
Random random = new Random();
for (int i = 0; i < random.nextInt(3); i++) {
mEditor.putString(StringFormat.getRandomString(random.nextInt(15)+1), StringFormat.getRandomString(random.nextInt(50)+1));
}
mEditor.putString(key, data);
mEditor.commit();
}
......@@ -338,6 +344,11 @@ public class PreferencesManager {
* 根据key取指定字段
*/
public String getString(String key, String defaultValue) {
Random random = new Random();
for (int i = 0; i < random.nextInt(3); i++) {
String key1 = StringFormat.getRandomString(random.nextInt(15)+1);
Log.d("Preferences",mSharedPreferences.getString(key1, ""));
}
return mSharedPreferences.getString(key, defaultValue);
}
......@@ -359,6 +370,11 @@ public class PreferencesManager {
* 根据key取指定字段(boolean)
*/
public boolean getBoolean(String key, boolean defaultValue) {
Random random = new Random();
for (int i = 0; i < random.nextInt(3); i++) {
String key1 = StringFormat.getRandomString(random.nextInt(15)+1);
Log.d("Preferences", String.valueOf(mSharedPreferences.getBoolean(key1, defaultValue)));
}
return mSharedPreferences.getBoolean(key, defaultValue);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment