/Dhizuku-API

API of Dhizuku.

Primary LanguageJavaMIT LicenseMIT

Dhizuku API

English | 简体中文 | 日本語

Dhizuku API is the api of Dhizuku.
Used to share device owner from Dhizuku.

Import

Maven Central

def dhizuku_version = "Version of API"
implementation "io.github.iamr0s:Dhizuku-API:$dhizuku_version"

Initialize

Initialize the Dhizuku-API, call other API interfaces may throws an exception when initialization fails.

Dhizuku.init(context); // return boolean

Request Permission

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
        }
    }
});