Commit 1765196c by sikang

remove 字符串混淆

parent 0630f7eb
......@@ -82,8 +82,8 @@ dependencies {
api 'com.android.support:multidex-instrumentation:1.0.3'
// 字符串资源替换
implementation 'com.jcminarro:Philology:1.0.1'
implementation 'io.github.inflationx:viewpump:1.0.0'
// implementation 'com.jcminarro:Philology:1.0.1'
// implementation 'io.github.inflationx:viewpump:1.0.0'
//support包
//noinspection GradleCompatible
......
......@@ -15,14 +15,12 @@ import android.view.LayoutInflater;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import com.jcminarro.philology.Philology;
import com.qmuiteam.qmui.util.QMUIStatusBarHelper;
import com.trello.rxlifecycle2.LifecycleTransformer;
import com.trello.rxlifecycle2.RxLifecycle;
import com.trello.rxlifecycle2.android.ActivityEvent;
import com.trello.rxlifecycle2.android.RxLifecycleAndroid;
import io.github.inflationx.viewpump.ViewPumpContextWrapper;
import io.reactivex.Observable;
import io.reactivex.subjects.BehaviorSubject;
import tech.starwin.LibConfig;
......@@ -31,11 +29,9 @@ import tech.starwin.base.BasePresenter;
import tech.starwin.mvp.IView;
import tech.starwin.mvp.presenter.UserPresenter;
import tech.starwin.utils.context_utils.AppLanguageUtils;
import tech.starwin.utils.PresenterHoler;
import tech.starwin.utils.context_utils.FragmentLauncher;
import tech.starwin.utils.format_utils.StringDecrypt;
import tech.starwin.utils.ui_utils.DialogFactory;
import tech.starwin.utils.ui_utils.QMUIHelper;
......@@ -87,9 +83,9 @@ public abstract class BaseActivity extends AppCompatActivity implements IView {
@Override
protected void attachBaseContext(Context newBase) {
// super.attachBaseContext(AppLanguageUtils.attachBaseContext(newBase, LibConfig.LANGUAGE));
Context languageContext = AppLanguageUtils.attachBaseContext(newBase, LibConfig.LANGUAGE);
super.attachBaseContext(ViewPumpContextWrapper.wrap(Philology.INSTANCE.wrap(languageContext)));
super.attachBaseContext(AppLanguageUtils.attachBaseContext(newBase, LibConfig.LANGUAGE));
// Context languageContext = AppLanguageUtils.attachBaseContext(newBase, LibConfig.LANGUAGE);
// super.attachBaseContext(ViewPumpContextWrapper.wrap(Philology.INSTANCE.wrap(languageContext)));
}
@Override
......
......@@ -8,19 +8,9 @@ import android.support.multidex.MultiDex;
import android.support.multidex.MultiDexApplication;
import android.text.TextUtils;
import com.jcminarro.philology.Philology;
import com.jcminarro.philology.PhilologyInterceptor;
import com.jcminarro.philology.PhilologyRepository;
import com.jcminarro.philology.PhilologyRepositoryFactory;
import com.tencent.bugly.crashreport.CrashReport;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Locale;
import io.github.inflationx.viewpump.ViewPump;
import io.github.inflationx.viewpump.ViewPumpContextWrapper;
import tech.starwin.LibConfig;
import tech.starwin.network.Gateway;
import tech.starwin.utils.InstallReferrerHelper;
......@@ -61,35 +51,28 @@ public abstract class BaseApplication extends MultiDexApplication {
AppLanguageUtils.setLanguage(this, LibConfig.LANGUAGE);
PhilologyRepositoryFactory repositoryFactory = locale -> new DefaultPhilologyRepository();
// ViewTransformerFactory viewTransformerFactory = view -> new TextViewTransformer();
Philology.INSTANCE.init(repositoryFactory);
ViewPump.init(ViewPump.builder().addInterceptor(PhilologyInterceptor.INSTANCE).build());
// PhilologyRepositoryFactory repositoryFactory = locale -> new DefaultPhilologyRepository();
//// ViewTransformerFactory viewTransformerFactory = view -> new TextViewTransformer();
// Philology.INSTANCE.init(repositoryFactory);
// ViewPump.init(ViewPump.builder().addInterceptor(PhilologyInterceptor.INSTANCE).build());
InstallReferrerHelper.refershInstallReferrer(this);
LibConfig.initLib(this);
// //已签名的APP,这里会输出当前签名的 hashCode 值,将 hashCode 在服务端备份(更换签名时要同时更新备份)
// LogUtils.d("Signal_Log", "hashCode: " + JNISignal.getKeyStoreHashCode(this));
// /*
// * 获取暗号,每一个 http 请求,都在 header 中加入此暗号
// * 服务端收到请求,根据header中的包名和已备份的hashCode,用同样的方式生成暗号,然后和 Header 中收到的暗号进行对比,如果暗号不一样,则拒绝返回数据
// * */
// LogUtils.d("Signal_Log", "signal: " + JNISignal.getSignal(this));
}
public class DefaultPhilologyRepository implements PhilologyRepository {
@Nullable
@Override
public CharSequence getText(@NotNull String key) {
try {
int resId = getResources().getIdentifier(key, "string", LibConfig.APPLICATION_ID);
return StringDecrypt.uncodeString(getResources().getString(resId));
} catch (Exception e) {
return "--";
}
}
}
// public class DefaultPhilologyRepository implements PhilologyRepository {
// @Nullable
// @Override
// public CharSequence getText(@NotNull String key) {
// try {
// int resId = getResources().getIdentifier(key, "string", LibConfig.APPLICATION_ID);
// return StringDecrypt.uncodeString(getResources().getString(resId));
// } catch (Exception e) {
// return "--";
// }
// }
// }
/**
......
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