diff --git a/lservice/src/main/java/io/github/houvven/lservice/LServiceBridge.java b/lservice/src/main/java/io/github/houvven/lservice/LServiceBridge.java index 5ca9acd..6b90857 100644 --- a/lservice/src/main/java/io/github/houvven/lservice/LServiceBridge.java +++ b/lservice/src/main/java/io/github/houvven/lservice/LServiceBridge.java @@ -30,6 +30,9 @@ public LServiceBridge(Context ctx, String apkPath) { this.pm = ctx.getPackageManager(); try { int uid = getUid(apkPath); + if (uid == -1) { + throw new RuntimeException("get uid failed."); + } Os.setuid(uid); if (isInstalledAutomatically) { // 异步执行