Skip to content

Commit c828edb

Browse files
author
维术
committed
[Exposed]: set the XPOSED_BRIDEGE_VERSION, becuase some plugin use it.
1 parent 728fb69 commit c828edb

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

exposed-core/src/main/java/me/weishu/exposed/ExposedBridge.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ public class ExposedBridge {
6464
public static final String BASE_DIR = Build.VERSION.SDK_INT >= 24
6565
? "/data/user_de/0/de.robv.android.xposed.installer/" : BASE_DIR_LEGACY;
6666

67+
private static final int FAKE_XPOSED_VERSION = 91;
6768
private static final String VERSION_KEY = "version";
6869
private static boolean SYSTEM_CLASSLOADER_INJECT = true;
6970

@@ -104,7 +105,7 @@ enum ModuleLoadResult {
104105

105106
public static void initOnce(Context context, ApplicationInfo applicationInfo, ClassLoader appClassLoader) {
106107
SYSTEM_CLASSLOADER_INJECT = patchSystemClassLoader();
107-
108+
XposedBridge.XPOSED_BRIDGE_VERSION = FAKE_XPOSED_VERSION;
108109
appContext = context;
109110
ReLinker.loadLibrary(context, "epic");
110111
ExposedHelper.initSeLinux(applicationInfo.processName);
@@ -311,8 +312,7 @@ private static void initForXposedInstaller(Context context, ApplicationInfo appl
311312
}
312313

313314
// XposedInstaller
314-
final int fakeXposedVersion = 91;
315-
final String fakeVersionString = String.valueOf(fakeXposedVersion);
315+
final String fakeVersionString = String.valueOf(FAKE_XPOSED_VERSION);
316316
final File xposedProp = context.getFileStreamPath("xposed_prop");
317317
if (!xposedProp.exists()) {
318318
writeXposedProperty(xposedProp, fakeVersionString, false);
@@ -338,14 +338,14 @@ private static void initForXposedInstaller(Context context, ApplicationInfo appl
338338
@Override
339339
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
340340
super.beforeHookedMethod(param);
341-
param.setResult(fakeXposedVersion);
341+
param.setResult(FAKE_XPOSED_VERSION);
342342
}
343343
});
344344
DexposedBridge.findAndHookMethod(xposedApp, "getInstalledXposedVersion", new XC_MethodHook() {
345345
@Override
346346
protected void beforeHookedMethod(XC_MethodHook.MethodHookParam param) throws Throwable {
347347
super.beforeHookedMethod(param);
348-
param.setResult(fakeXposedVersion);
348+
param.setResult(FAKE_XPOSED_VERSION);
349349
}
350350
});
351351

0 commit comments

Comments
 (0)