From b330d0d6f1fc82ca61b01fb7bfc4d9b4f18380e4 Mon Sep 17 00:00:00 2001 From: 2751162017 <123456yaole@sina.com> Date: Thu, 11 Apr 2024 16:20:23 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E4=BA=86=E5=9C=A8=E4=B8=80?= =?UTF-8?q?=E4=BA=9B=E6=83=85=E5=86=B5=E4=B8=8B=E4=BF=AE=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E9=92=BB=E7=9F=B3=E4=BC=9A=E5=91=98=E6=97=A0=E6=95=88=E7=9A=84?= =?UTF-8?q?=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../im/hoho/alipayInstallB/PluginMain.java | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/app/src/main/java/im/hoho/alipayInstallB/PluginMain.java b/app/src/main/java/im/hoho/alipayInstallB/PluginMain.java index 12e09e3..b26e007 100644 --- a/app/src/main/java/im/hoho/alipayInstallB/PluginMain.java +++ b/app/src/main/java/im/hoho/alipayInstallB/PluginMain.java @@ -19,6 +19,9 @@ import de.robv.android.xposed.XposedHelpers; import de.robv.android.xposed.callbacks.XC_LoadPackage; +import android.content.Context; +import android.os.Bundle; +import android.database.sqlite.SQLiteDatabase; /** * Created by qzj_ on 2016/5/9. */ @@ -53,6 +56,30 @@ protected void afterHookedMethod(MethodHookParam param1MethodHookParam) throws T } }); + XposedHelpers.findAndHookMethod("android.app.Activity", lpparam.classLoader, "onCreate", Bundle.class, new XC_MethodHook() { + @Override + protected void afterHookedMethod(MethodHookParam param) throws Throwable { + Context context = (Context) param.thisObject; // 获取到Activity作为Context + XposedBridge.log("--------------DATABASE_UPDATER--------------"); + File dbFile = context.getDatabasePath("alipayclient.db"); + if (dbFile.exists()) { + XposedBridge.log("GET DATABASE: " + context.getDatabasePath("alipayclient.db").getParentFile()); + try (SQLiteDatabase db = SQLiteDatabase.openDatabase(dbFile.getPath(), null, SQLiteDatabase.OPEN_READWRITE)) + { + // 将本来的普通会员直接替换为钻石会员 + db.execSQL("UPDATE 'main'.'userinfo' SET 'memberGrade' = 'diamond'"); + XposedBridge.log("Database update successful!"); + } catch (Exception e) { + XposedBridge.log("Database update error: " + e); + } + }else{ + XposedBridge.log("CAN NOT GET DATABASE: " + context.getDatabasePath("alipayclient.db").getParentFile()+",PASS!"); + } + XposedBridge.log("--------------DATABASE_UPDATER--------------"); + } + }); + + //region modify skin // final Class ConfigUtilBiz = lpparam.classLoader.loadClass("com.alipay.mobile.onsitepaystatic.ConfigUtilBiz"); final Class OspSkinModel = lpparam.classLoader.loadClass("com.alipay.mobile.onsitepaystatic.skin.OspSkinModel");