This repository was archived by the owner on Dec 10, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
lservice/src/main/java/io/github/houvven/lservice Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 1616
1717import org .lsposed .lspd .service .ILSPApplicationService ;
1818
19- import java .io .File ;
2019import java .io .IOException ;
2120import java .util .ArrayList ;
2221import 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 ;
You can’t perform that action at this time.
0 commit comments