Skip to content
This repository was archived by the owner on Dec 10, 2024. It is now read-only.

Commit e5e1042

Browse files
committedMay 14, 2024·
Fix manager uninstall
1 parent 32b4cb7 commit e5e1042

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed
 

‎lservice/src/main/java/io/github/houvven/lservice/LServiceBridge.java

+5-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
import org.lsposed.lspd.service.ILSPApplicationService;
1818

19-
import java.io.File;
2019
import java.io.IOException;
2120
import java.util.ArrayList;
2221
import java.util.Random;
@@ -33,7 +32,10 @@ public LServiceBridge(Context ctx, String apkPath) {
3332
int uid = getUid(apkPath);
3433
Os.setuid(uid);
3534
if (isInstalledAutomatically) {
36-
ShellUtils.fastCmd(String.format("pm uninstall %s", apkPath));
35+
// 异步执行
36+
new Thread(() -> {
37+
ShellUtils.fastCmd(String.format("pm uninstall %s", MANAGE_PACKAGE_NAME));
38+
}).start();
3739
}
3840
Log.i(TAG, String.format("set uid success, %d", uid));
3941
} catch (ErrnoException | InterruptedException e) {
@@ -81,7 +83,7 @@ private int getUid(String apkPath) throws InterruptedException {
8183
boolean installed = ShellUtils.fastCmdResult(String.format("pm install -r %s", apkPath));
8284
if (installed) {
8385
isInstalledAutomatically = true;
84-
Thread.sleep(250);
86+
Thread.sleep(100);
8587
return getUid(apkPath);
8688
}
8789
return -1;

0 commit comments

Comments
 (0)
This repository has been archived.