-
Notifications
You must be signed in to change notification settings - Fork 40.8k
Expand file tree
/
Copy pathza lal thuam mlbb injacktor
More file actions
45 lines (28 loc) · 2.1 KB
/
za lal thuam mlbb injacktor
File metadata and controls
45 lines (28 loc) · 2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Introduction
Shizuku can help normal apps uses system APIs directly with adb/root privileges with a Java process started with app_process.
The name Shizuku comes from [a character](https://danbooru.donmai.us/posts/3553474).
## Why was Shizuku born?
The birth of Shizuku has two main purposes.
1. Provide a convenient way to use system APIs
2. Convenient for the development of some apps that only requires adb permissions
## Shizuku vs. "Old school" method
### "Old school" method
For example, to enable/disable components, some apps that require root privileges execute `pm disable` directly in `su`.
1. Execute `su`
2. Execute `pm disable`
3. (pre-Pie) Start the Java process with app_process ([see here](https://android.googlesource.com/platform/frameworks/base/+/oreo-release/cmds/pm/pm))
4. (Pie+) Execute the native program `cmd` ([see here](https://android.googlesource.com/platform/frameworks/native/+/pie-release/cmds/cmd/))
5. Process the parameters, interact with the system server through the binder, and process the result to output the text result.
Each of the "Execute" means a new process creation, su internally uses sockets to interact with the su daemon, and a lot of time and performance are consumed in such process. (Some poorly designed app will even execute `su` **every time** for each command)
The disadvantages of this type of method are:
1. **Extremely slow**
2. Need to process the text to get the result
3. Features are subject to available commands
4. Even if adb has sufficient permissions, the app requires root privileges to run
### Shizuku method
The Shizuku app will direct the user to run a process (Shizuku service process) using root or adb.
1. When the app process starts, the Shizuku service process sends the binder to the app process.
2. The app interacts with the Shizuku service through the binder, and the Shizuku service process interacts with the system server through the binder.
The advantages of Shizuku are:
1. Minimal extra time and performance consumption
2. It is almost identical to the direct invocation API experience (app developers only need to add a small amount of code)