/AndroidAppProcess

Run Android app_process just like Android Service.

Primary LanguageJavaGNU Lesser General Public License v3.0LGPL-3.0

Android AppProcess

Encapsulation of Android app_process, you can use it just like Android Service.

Maven Central

How to use it

Import library

implementation 'io.github.iamr0s:AndroidAppProcess:<version>'

1. New Process

  • Default
AppProcess process = new AppProcess.Default();
process.init(context.getPackageName());
  • Root
AppProcess process = new AppProcess.Root();
process.init(context.getPackageName());

2. Use it.

  • Remote Binder Transact
AppProcess process = new AppProcess.Root();
process.init(context.getPackageName());
IPackageManager manager = android.os.ServiceManager.getService("package");
IBinder binderWrapper = process.binderWrapper(manager.asBinder());
IPackageManager managerWrapper = IPackageManager.Stub.asInterface(binderWrapper);

managerWrapper.uninstall(...) // will call it in root.
  • More

See the demo.

3. Close

You must close the AppProcess after use it.

process.close()