diff --git a/app/src/main/java/io/github/chipppppppppp/lime/hooks/CheckHookTargetVersion.java b/app/src/main/java/io/github/chipppppppppp/lime/hooks/CheckHookTargetVersion.java index a618b6ac..7afb4a8a 100644 --- a/app/src/main/java/io/github/chipppppppppp/lime/hooks/CheckHookTargetVersion.java +++ b/app/src/main/java/io/github/chipppppppppp/lime/hooks/CheckHookTargetVersion.java @@ -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(); }