Snapchat uses the SafetyNet Certification API Google and does not check if XPosed is valid . Snapchat launches SafetyNet when it first launches the application.
To make sure that Snapchat doesn't specifically test the XPosed framework, I decompiled Snapchat and ran grep -lri xposed . Your search returned no results.
Verifying XPosed Installation:
I am sure there are many ways to check if Xposed is installed. I wrote the following method, which gets the currently installed version of Xposed or returns null if XposedBridge.jar is not found on the device:
public static Integer getXposedVersion(Context context) { try { File xposedBridge = new File("/system/framework/XposedBridge.jar"); if (xposedBridge.exists()) { File optimizedDir = context.getDir("dex", Context.MODE_PRIVATE); DexClassLoader dexClassLoader = new DexClassLoader(xposedBridge.getPath(), optimizedDir.getPath(), null, ClassLoader.getSystemClassLoader()); Class<?> XposedBridge = dexClassLoader.loadClass("de.robv.android.xposed.XposedBridge"); Method getXposedVersion = XposedBridge.getDeclaredMethod("getXposedVersion"); if (!getXposedVersion.isAccessible()) getXposedVersion.setAccessible(true); return (Integer) getXposedVersion.invoke(null); } } catch (Exception ignored) { } return null; }
As far as I can tell, Xposed always had XposedBridge.jar in / system / framework, so this should work for official releases of Xposed, but may break in future releases.
source share