GithubHelp home page GithubHelp logo

dhizuku-api's Introduction

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

API interface and changes

Binder Wrapper

IBinder is often used for basic communication between applications and systems. Dhizuku provides an interface for proxy IBinder, the applications can communicate with the system as Dhizuku.

BinderWrapper Demo

User Service

Dhizuku.getVersionCode() >= 3

A simple Service based on the AIDL mechanism that runs in the isolated space provided by Dhizuku.

Usage: Declare an AIDL file, implement it in Service, and then launch it through the interface provided by Dhizuku.

UserService Demo

Delegated Scopes

Dhizuku.getVersionCode() >= 5

Invoking the DevicePolicyManager from either the Binder Wrapper or the User Service can be complicated, but Delegated Scopes can simplify this operation.

Usage: You grant Delegated Scopes to your application, which can then invoke the interface included in the Delegated Scopes itself through DevicePolicyManager.

DelegatedScopes Demo

dhizuku-api's People

Contributors

iamr0s avatar yxsra avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.