From eaadfe580028e56b51647b5054e2ef769fbcbc38 Mon Sep 17 00:00:00 2001 From: areteruhiro <108941410+areteruhiro@users.noreply.github.com> Date: Mon, 7 Oct 2024 22:58:44 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7=E3=83=B3?= =?UTF-8?q?=E6=A4=9C=E8=A8=BC=E3=81=8C=E6=AD=A3=E3=81=97=E3=81=8F=E8=A1=8C?= =?UTF-8?q?=E3=82=8F=E3=82=8C=E3=81=A6=E3=81=84=E3=81=AA=E3=81=84=E5=95=8F?= =?UTF-8?q?=E9=A1=8C=E3=82=92=E4=BF=AE=E6=AD=A3=20(#181)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chipppppppppp/lime/hooks/CheckHookTargetVersion.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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(); }