diff --git a/app/src/main/java/xtr/keymapper/Server.java b/app/src/main/java/xtr/keymapper/Server.java index 70d7e1d1..3f887ea2 100644 --- a/app/src/main/java/xtr/keymapper/Server.java +++ b/app/src/main/java/xtr/keymapper/Server.java @@ -32,7 +32,7 @@ private static void writeScript(StringBuffer linesToWrite, File scriptFile) thro fileWriter.write(linesToWrite.toString()); } } else { - if (linesToWrite.toString().equals(target.toString())) + if (!linesToWrite.toString().equals(target.toString())) fileWriter.write(linesToWrite.toString()); } fileWriter.close(); diff --git a/app/src/main/java/xtr/keymapper/activity/MainActivity.java b/app/src/main/java/xtr/keymapper/activity/MainActivity.java index 787a3b41..9d459fb9 100644 --- a/app/src/main/java/xtr/keymapper/activity/MainActivity.java +++ b/app/src/main/java/xtr/keymapper/activity/MainActivity.java @@ -102,8 +102,11 @@ public void startPointer(){ setButtonState(false); requestNotificationPermission(); } - if (!RemoteServiceHelper.isRootService) + if (RemoteServiceHelper.useShizuku) { + if (!Shizuku.pingBinder()) alertShizukuNotAuthorized(); + } else if (!RemoteServiceHelper.isRootService) { alertRootAccessAndExit(); + } } private void setButtonState(boolean start) {