What a Terrible Failure (#868)

This commit is contained in:
vvb2060 2021-08-07 21:09:35 +08:00 committed by GitHub
parent 29afb441d8
commit 7ea7f9e9b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 2 deletions

View File

@ -25,6 +25,7 @@ import static org.lsposed.lspd.service.ServiceManager.TAG;
import android.app.IServiceConnection;
import android.content.ComponentName;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
@ -123,8 +124,18 @@ public class LSPManagerService extends ILSPManagerService.Stub {
@Override
public boolean enableModule(String packageName) throws RemoteException {
PackageInfo pkgInfo = PackageService.getPackageInfo(packageName, PackageService.MATCH_ALL_FLAGS, 0);
if (pkgInfo == null) return false;
return ConfigManager.getInstance().enableModule(packageName, pkgInfo.applicationInfo);
if (pkgInfo != null) {
ApplicationInfo appInfo;
try {
appInfo = pkgInfo.applicationInfo;
} catch (Throwable t) {
Log.wtf(TAG, t);
throw t;
}
return ConfigManager.getInstance().enableModule(packageName, appInfo);
} else {
return false;
}
}
@Override