Skip to content

Commit 39a016c

Browse files
khang-tikijkasten2
authored andcommitted
Workaround issue in Lenovo devices
Fixes #857
1 parent 53c6761 commit 39a016c

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

OneSignalSDK/onesignal/src/main/java/com/onesignal/RootToolsInternalMethods.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,15 @@ static boolean isRooted() {
3030
"/system/sd/xbin/", "/system/bin/failsafe/",
3131
"/data/local/"};
3232

33-
for (String where : places) {
34-
if (new java.io.File(where + "su").exists())
35-
return true;
33+
try {
34+
for (String where : places) {
35+
if (new java.io.File(where + "su").exists())
36+
return true;
37+
}
38+
} catch (Throwable ignore) {
39+
// workaround crash issue in Lenovo devices
40+
// issues #857
3641
}
37-
3842
return false;
3943
}
40-
}
44+
}

0 commit comments

Comments
 (0)