mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-25 22:07:38 +00:00
Fix SN check errors on some devices
This commit is contained in:
parent
41499d4b3c
commit
b75018b03b
@ -43,14 +43,14 @@ public class CheckSafetyNet extends ParallelTask<Void, Void, Exception> {
|
|||||||
conn.disconnect();
|
conn.disconnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void dyload() throws ReflectiveOperationException {
|
private void dyload() throws Exception {
|
||||||
loader = new DexClassLoader(dexPath.getPath(), dexPath.getParent(),
|
loader = new DexClassLoader(dexPath.getPath(), dexPath.getParent(),
|
||||||
null, ClassLoader.getSystemClassLoader());
|
null, ClassLoader.getSystemClassLoader());
|
||||||
helperClazz = loader.loadClass(Const.SNET_PKG + ".SafetyNetHelper");
|
helperClazz = loader.loadClass(Const.SNET_PKG + ".SafetyNetHelper");
|
||||||
callbackClazz = loader.loadClass(Const.SNET_PKG + ".SafetyNetCallback");
|
callbackClazz = loader.loadClass(Const.SNET_PKG + ".SafetyNetCallback");
|
||||||
int snet_ver = (int) helperClazz.getMethod("getVersion").invoke(null);
|
int snet_ver = (int) helperClazz.getMethod("getVersion").invoke(null);
|
||||||
if (snet_ver != Const.SNET_VER) {
|
if (snet_ver != Const.SNET_VER) {
|
||||||
throw new ReflectiveOperationException();
|
throw new Exception();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,7 +59,7 @@ public class CheckSafetyNet extends ParallelTask<Void, Void, Exception> {
|
|||||||
try {
|
try {
|
||||||
try {
|
try {
|
||||||
dyload();
|
dyload();
|
||||||
} catch (ReflectiveOperationException e) {
|
} catch (Exception e) {
|
||||||
// If dynamic load failed, try re-downloading and reload
|
// If dynamic load failed, try re-downloading and reload
|
||||||
dlSnet();
|
dlSnet();
|
||||||
dyload();
|
dyload();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user