Skip to content

Commit

Permalink
バージョン検証が正しく行われていない問題を修正 (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
areteruhiro authored Oct 7, 2024
1 parent 0d041b8 commit eaadfe5
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ public void hook(LimeOptions limeOptions, XC_LoadPackage.LoadPackageParam loadPa
loadPackageParam.classLoader.loadClass("jp.naver.line.android.activity.SplashActivity"),
"onCreate",
new XC_MethodHook() {
@Deprecated
@Override
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
Context context = (Context) param.thisObject;
PackageManager pm = context.getPackageManager();
if (!BuildConfig.HOOK_TARGET_VERSION.equals(pm.getPackageInfo(loadPackageParam.packageName, 0).versionCode)) {
long versionCode = pm.getPackageInfo(loadPackageParam.packageName, 0).getLongVersionCode();
String versionCodeStr = String.valueOf(versionCode);

if (!BuildConfig.HOOK_TARGET_VERSION.equals(versionCodeStr)) {
Utils.addModuleAssetPath(context);
Toast.makeText(context.getApplicationContext(), context.getString(R.string.incompatible_version), Toast.LENGTH_SHORT).show();
}
Expand Down

0 comments on commit eaadfe5

Please sign in to comment.