diff --git a/patch-loader/src/main/java/org/lsposed/lspatch/loader/LSPApplication.java b/patch-loader/src/main/java/org/lsposed/lspatch/loader/LSPApplication.java index 3180350..ced217f 100644 --- a/patch-loader/src/main/java/org/lsposed/lspatch/loader/LSPApplication.java +++ b/patch-loader/src/main/java/org/lsposed/lspatch/loader/LSPApplication.java @@ -208,6 +208,10 @@ public class LSPApplication { File curProfileFile = new File(profileDir, splitName == null ? "primary.prof" : splitName + ".split.prof").getAbsoluteFile(); Log.d(TAG, "Processing " + curProfileFile.getAbsolutePath()); try { + if (!curProfileFile.exists()) { + Files.createFile(curProfileFile.toPath(), attrs); + continue; + } if (!curProfileFile.canWrite() && Files.size(curProfileFile.toPath()) == 0) { Log.d(TAG, "Skip profile " + curProfileFile.getAbsolutePath()); continue; @@ -219,8 +223,6 @@ public class LSPApplication { Log.e(TAG, "Failed to delete and clear profile file " + curProfileFile.getAbsolutePath(), e); } Os.chmod(curProfileFile.getAbsolutePath(), 00400); - } else { - Files.createFile(curProfileFile.toPath(), attrs); } } catch (Throwable e) { Log.e(TAG, "Failed to disable profile file " + curProfileFile.getAbsolutePath(), e);