From 5814ceb24b35497b669c4cc2b988460e1da4f71d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=97=E5=AE=AB=E9=9B=AA=E7=8F=8A?= Date: Sat, 14 Oct 2023 13:57:46 +0800 Subject: [PATCH] Delete old pid file (#2816) --- .../java/org/lsposed/manager/ui/fragment/HomeFragment.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/lsposed/manager/ui/fragment/HomeFragment.java b/app/src/main/java/org/lsposed/manager/ui/fragment/HomeFragment.java index 64b2acf3..039e1e12 100644 --- a/app/src/main/java/org/lsposed/manager/ui/fragment/HomeFragment.java +++ b/app/src/main/java/org/lsposed/manager/ui/fragment/HomeFragment.java @@ -272,7 +272,12 @@ private boolean isDeveloper() { Os.kill(pid, 0); developer.set(true); } catch (ErrnoException e) { - if (e.errno != OsConstants.ESRCH) { + if (e.errno == OsConstants.ESRCH) { + try { + Files.delete(name); + } catch (IOException ignored) { + } + } else { developer.set(true); } }