Dhizuku API is the api of Dhizuku.
Used to share device owner from Dhizuku.
def dhizuku_version = "Version of API"
implementation "io.github.iamr0s:Dhizuku-API:$dhizuku_version"
Initialize the Dhizuku-API, call other API interfaces may throws an exception when initialization fails.
Dhizuku.init(context); // return boolean
Some API interfaces require permission to run.
if (Dhizuku.isPermissionGranted()) return;
Dhizuku.requestPermission(new DhizukuRequestPermissionListener() {
@Override
public void onRequestPermission(int grantResult) throws RemoteException {
if (grantResult == PackageManager.PERMISSION_GRANTED) {
// do success code
} else {
// do failure code
}
}
});