Skip to content

Commit

Permalink
バージョンコードを取得するように訂正
Browse files Browse the repository at this point in the history
  • Loading branch information
areteruhiro authored Oct 7, 2024
1 parent 0d041b8 commit a054aac
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 a054aac

Please sign in to comment.