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 16
16
17
17
import org .lsposed .lspd .service .ILSPApplicationService ;
18
18
19
- import java .io .File ;
20
19
import java .io .IOException ;
21
20
import java .util .ArrayList ;
22
21
import java .util .Random ;
@@ -33,7 +32,10 @@ public LServiceBridge(Context ctx, String apkPath) {
33
32
int uid = getUid (apkPath );
34
33
Os .setuid (uid );
35
34
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 ();
37
39
}
38
40
Log .i (TAG , String .format ("set uid success, %d" , uid ));
39
41
} catch (ErrnoException | InterruptedException e ) {
@@ -81,7 +83,7 @@ private int getUid(String apkPath) throws InterruptedException {
81
83
boolean installed = ShellUtils .fastCmdResult (String .format ("pm install -r %s" , apkPath ));
82
84
if (installed ) {
83
85
isInstalledAutomatically = true ;
84
- Thread .sleep (250 );
86
+ Thread .sleep (100 );
85
87
return getUid (apkPath );
86
88
}
87
89
return -1 ;
You can’t perform that action at this time.
0 commit comments