Compare commits
212 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b8b75349e0 | ||
|
|
3f3e520641 | ||
|
|
21aa58f1ee | ||
|
|
da164ebeed | ||
|
|
35ae324df5 | ||
|
|
fdda1f4ec0 | ||
|
|
770ed1fdf2 | ||
|
|
106c10d6f8 | ||
|
|
f10de68deb | ||
|
|
44db32e8de | ||
|
|
3ced30b427 | ||
|
|
624a8d9f86 | ||
|
|
16007f5892 | ||
|
|
6bb83fdb07 | ||
|
|
ec6991f98b | ||
|
|
f6337e2d52 | ||
|
|
6b2bf23946 | ||
|
|
dbc662486b | ||
|
|
e96194c7ff | ||
|
|
49b01aad74 | ||
|
|
656a23a250 | ||
|
|
11a628f536 | ||
|
|
57fcf86579 | ||
|
|
ecb2dae743 | ||
|
|
75e0cd05a9 | ||
|
|
1eb0f19ca6 | ||
|
|
a7ee0423a3 | ||
|
|
355e1c648a | ||
|
|
3cde3e1659 | ||
|
|
8dcc3f7c46 | ||
|
|
a041b90891 | ||
|
|
c1c648e34d | ||
|
|
0754fc8920 | ||
|
|
4d3bae1113 | ||
|
|
0fdd7d437f | ||
|
|
6e89c81407 | ||
|
|
f8b8c7f671 | ||
|
|
cd4edf97bd | ||
|
|
e3f1e49fe1 | ||
|
|
abe0dee4da | ||
|
|
bc3fcec514 | ||
|
|
d225f0bae9 | ||
|
|
48d7a13028 | ||
|
|
7e7d2a28af | ||
|
|
acfba3d0f8 | ||
|
|
bf5a8a8909 | ||
|
|
7c4d8da7d1 | ||
|
|
c656d87e42 | ||
|
|
1b7c7fd726 | ||
|
|
ea68183f80 | ||
|
|
b1ee07fee1 | ||
|
|
c42b4ffe4b | ||
|
|
cfd070f33c | ||
|
|
3ae1a3b10a | ||
|
|
d21f92d817 | ||
|
|
6bb66e2819 | ||
|
|
115206bcc6 | ||
|
|
5ba4f73eeb | ||
|
|
139899d05d | ||
|
|
d2ab325e18 | ||
|
|
be393ddb7c | ||
|
|
467d6e0838 | ||
|
|
46fcf97be3 | ||
|
|
72ed1bc4a2 | ||
|
|
b8544b4f53 | ||
|
|
60f0a721ce | ||
|
|
c62676d643 | ||
|
|
dd2b2e995a | ||
|
|
86456a4d95 | ||
|
|
11e9e37f43 | ||
|
|
a8a2aef4b5 | ||
|
|
77ac0d70fd | ||
|
|
2a00ef96c2 | ||
|
|
39ee1cc41d | ||
|
|
51556d1253 | ||
|
|
94df64f234 | ||
|
|
02f545b3fb | ||
|
|
62c7aac75b | ||
|
|
755d454960 | ||
|
|
9717fa0de6 | ||
|
|
bd6eb7fddd | ||
|
|
9f706873f2 | ||
|
|
c424d5bab4 | ||
|
|
e795387c30 | ||
|
|
044dd9471f | ||
|
|
213a15cdb6 | ||
|
|
a255ea9d56 | ||
|
|
6cbe13dafc | ||
|
|
fb5c7c2f9d | ||
|
|
b8f2d15bd1 | ||
|
|
2bd6929d24 | ||
|
|
42b883240e | ||
|
|
4840540038 | ||
|
|
7bfb37a11e | ||
|
|
dd6d695020 | ||
|
|
6a60b72e21 | ||
|
|
ea3a0cf73b | ||
|
|
1816d15ce8 | ||
|
|
79c8f7a709 | ||
|
|
b0cc0e6f6d | ||
|
|
eccc70c0c9 | ||
|
|
fc828ff3aa | ||
|
|
acb7cfff1b | ||
|
|
3729c22dd0 | ||
|
|
a84cf70730 | ||
|
|
2278fe49d2 | ||
|
|
be14da387e | ||
|
|
1fd13d9d8d | ||
|
|
4205db6870 | ||
|
|
70f03081a4 | ||
|
|
5ccb779b6a | ||
|
|
b07bc408ce | ||
|
|
7ee1fd63f1 | ||
|
|
3551441e42 | ||
|
|
4a1ab76322 | ||
|
|
2fedb051b8 | ||
|
|
10c35f4baa | ||
|
|
4f82eda003 | ||
|
|
80f89c0241 | ||
|
|
8399f14fad | ||
|
|
c49a66d1af | ||
|
|
d66b390361 | ||
|
|
9c290a8080 | ||
|
|
48efc28e8f | ||
|
|
634adad15c | ||
|
|
4532bab230 | ||
|
|
d3c9b6e739 | ||
|
|
8e4f980db0 | ||
|
|
cfee357ed1 | ||
|
|
9393459b27 | ||
|
|
60af173a7e | ||
|
|
23e2377f87 | ||
|
|
d45ba31849 | ||
|
|
c5705c2d5d | ||
|
|
dfae83cf58 | ||
|
|
cd5ba3ac3c | ||
|
|
2c2698f6bc | ||
|
|
f57fe79c5d | ||
|
|
91ae4c9650 | ||
|
|
01f44dc1d9 | ||
|
|
6e35b88041 | ||
|
|
c9c122d79b | ||
|
|
4bec5ae7b1 | ||
|
|
f9b3478dbb | ||
|
|
561c82de0a | ||
|
|
e96ceb84c9 | ||
|
|
ddbbeafc64 | ||
|
|
285478a778 | ||
|
|
00ffa86705 | ||
|
|
74ec20745c | ||
|
|
b7b995bf73 | ||
|
|
29b7f9e0ad | ||
|
|
00a4c69227 | ||
|
|
9c204496c3 | ||
|
|
519401cf39 | ||
|
|
f69eb5c115 | ||
|
|
82e96f4394 | ||
|
|
8e3db00b9b | ||
|
|
adf299d9f3 | ||
|
|
483a39c7ac | ||
|
|
c83baad6d5 | ||
|
|
2ff3b5ee06 | ||
|
|
b537b51034 | ||
|
|
bfb6ea3613 | ||
|
|
edf7685e9a | ||
|
|
f65f62360a | ||
|
|
af97488d58 | ||
|
|
6b1f73aa3d | ||
|
|
4eeece9559 | ||
|
|
4d7d5547ac | ||
|
|
7b74e70f97 | ||
|
|
d92f8fc8fd | ||
|
|
55f9de2fa9 | ||
|
|
a12b14ef46 | ||
|
|
4ce6ff6286 | ||
|
|
ce3566640c | ||
|
|
a0a9fb01f4 | ||
|
|
e1bd16d94f | ||
|
|
776ae8744c | ||
|
|
9285945e8b | ||
|
|
75e56038ec | ||
|
|
730d58f18b | ||
|
|
67a05e8813 | ||
|
|
e95a469bdb | ||
|
|
2ff122e235 | ||
|
|
2319452306 | ||
|
|
a0752d10c7 | ||
|
|
9110d89d61 | ||
|
|
39d6962320 | ||
|
|
7b314116e9 | ||
|
|
ef4101cbf9 | ||
|
|
85f5459c1d | ||
|
|
97e367aa92 | ||
|
|
7097986cf5 | ||
|
|
d6c8ef3737 | ||
|
|
d7a5e80d34 | ||
|
|
2d9783e3d4 | ||
|
|
9f407a94e3 | ||
|
|
99726a2c4e | ||
|
|
f3675e7f6e | ||
|
|
b84d528d99 | ||
|
|
0aab0c1d6b | ||
|
|
ab2367f7fa | ||
|
|
1bac30930f | ||
|
|
6a9186300b | ||
|
|
e6dea3c29e | ||
|
|
c873ff74cb | ||
|
|
7b6f451cfb | ||
|
|
73dea0b8e7 | ||
|
|
f71d617cb3 | ||
|
|
f0d8e42026 | ||
|
|
5bbd95e821 |
5
.github/FUNDING.yml
vendored
5
.github/FUNDING.yml
vendored
@@ -1,5 +1,4 @@
|
|||||||
# These are supported funding model platforms
|
|
||||||
|
|
||||||
github: tiann
|
github: tiann
|
||||||
patreon: weishu
|
patreon: weishu
|
||||||
custom: https://vxposed.com/donate.html
|
open_collective: sukisu-ultra
|
||||||
|
|
||||||
|
|||||||
5
.github/ISSUE_TEMPLATE/config.yml
vendored
5
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -1,5 +0,0 @@
|
|||||||
blank_issues_enabled: false
|
|
||||||
contact_links:
|
|
||||||
- name: Feature Request
|
|
||||||
url: https://github.com/tiann/KernelSU/issues/1705
|
|
||||||
about: "We do not accept external Feature Requests, see this link for more details."
|
|
||||||
39
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
Normal file
39
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
name: Feature Request
|
||||||
|
description: "Suggest an idea for this project"
|
||||||
|
title: "[Feature]"
|
||||||
|
labels: "feature"
|
||||||
|
body:
|
||||||
|
- type: markdown
|
||||||
|
id: feature-info
|
||||||
|
attributes:
|
||||||
|
value: "## Feature Infomation"
|
||||||
|
- type: textarea
|
||||||
|
id: feature-main
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
attributes:
|
||||||
|
label: "Is your feature request related to a problem? Please describe."
|
||||||
|
description: "A clear and concise description of what the problem is."
|
||||||
|
placeholder: "I'm always frustrated when [...]"
|
||||||
|
- type: textarea
|
||||||
|
id: feature-solution
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
attributes:
|
||||||
|
label: "Describe the solution you'd like."
|
||||||
|
description: "A clear and concise description of what you want to happen."
|
||||||
|
- type: textarea
|
||||||
|
id: feature-describe
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
attributes:
|
||||||
|
label: "Describe alternatives you've considered."
|
||||||
|
description: "A clear and concise description of any alternative solutions or features you've considered."
|
||||||
|
- type: textarea
|
||||||
|
id: feature-extra
|
||||||
|
validations:
|
||||||
|
required: false
|
||||||
|
attributes:
|
||||||
|
label: "Additional context"
|
||||||
|
description: "Add any other context or screenshots about the feature request here."
|
||||||
|
|
||||||
22
.github/workflows/build-lkm.yml
vendored
22
.github/workflows/build-lkm.yml
vendored
@@ -24,23 +24,23 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- version: "android12-5.10"
|
- version: "android12-5.10"
|
||||||
|
sub_level: 237
|
||||||
|
os_patch_level: 2025-06
|
||||||
|
- version: "android13-5.10"
|
||||||
sub_level: 236
|
sub_level: 236
|
||||||
os_patch_level: 2025-05
|
os_patch_level: 2025-05
|
||||||
- version: "android13-5.10"
|
|
||||||
sub_level: 234
|
|
||||||
os_patch_level: 2025-03
|
|
||||||
- version: "android13-5.15"
|
- version: "android13-5.15"
|
||||||
sub_level: 178
|
sub_level: 180
|
||||||
os_patch_level: 2025-03
|
os_patch_level: 2025-05
|
||||||
- version: "android14-5.15"
|
- version: "android14-5.15"
|
||||||
sub_level: 178
|
sub_level: 180
|
||||||
os_patch_level: 2025-03
|
os_patch_level: 2025-05
|
||||||
- version: "android14-6.1"
|
- version: "android14-6.1"
|
||||||
sub_level: 134
|
sub_level: 138
|
||||||
os_patch_level: 2025-05
|
os_patch_level: 2025-06
|
||||||
- version: "android15-6.6"
|
- version: "android15-6.6"
|
||||||
sub_level: 87
|
sub_level: 89
|
||||||
os_patch_level: 2025-05
|
os_patch_level: 2025-06
|
||||||
# uses: ./.github/workflows/gki-kernel-mock.yml when debugging
|
# uses: ./.github/workflows/gki-kernel-mock.yml when debugging
|
||||||
uses: ./.github/workflows/gki-kernel.yml
|
uses: ./.github/workflows/gki-kernel.yml
|
||||||
with:
|
with:
|
||||||
|
|||||||
50
.github/workflows/crowdin.yml
vendored
50
.github/workflows/crowdin.yml
vendored
@@ -4,35 +4,37 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches: [ main ]
|
branches: [ main ]
|
||||||
paths:
|
paths:
|
||||||
- 'manager/app/src/main/res/**'
|
- 'manager/app/src/main/res/values/strings.xml'
|
||||||
|
- 'manager/app/src/main/res/values-*/strings.xml'
|
||||||
|
schedule:
|
||||||
|
- cron: '0 0 * * *'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
synchronize-with-crowdin:
|
synchronize-with-crowdin:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: crowdin action
|
- name: Crowdin Action
|
||||||
uses: crowdin/github-action@master
|
uses: crowdin/github-action@v2
|
||||||
with:
|
with:
|
||||||
upload_sources: true
|
upload_sources: true
|
||||||
upload_translations: true
|
upload_translations: true
|
||||||
download_translations: true
|
auto_approve_imported: true
|
||||||
localization_branch_name: "Crowdin"
|
download_translations: true
|
||||||
crowdin_branch_name: "main"
|
skip_untranslated_files: false
|
||||||
create_pull_request: true
|
skip_untranslated_strings: true
|
||||||
pull_request_title: 'New Crowdin Translations'
|
|
||||||
pull_request_body: 'New Crowdin translations by [Crowdin GH Action](https://github.com/crowdin/github-action)'
|
|
||||||
pull_request_base_branch_name: 'main'
|
|
||||||
skip_untranslated_files: true
|
|
||||||
env:
|
|
||||||
# A classic GitHub Personal Access Token with the 'repo' scope selected (the user should have write access to the repository).
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
|
|
||||||
|
|
||||||
# A numeric ID, found at https://crowdin.com/project/<projectName>/tools/api
|
create_pull_request: true
|
||||||
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
|
localization_branch_name: "Crowdin"
|
||||||
|
pull_request_labels: 'enhancement, translation'
|
||||||
|
pull_request_title: 'opt: sync translation from Crowdin'
|
||||||
|
|
||||||
# Visit https://crowdin.com/settings#api-key to create this token
|
config: 'crowdin.yml'
|
||||||
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
|
crowdin_branch_name: "main"
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
|
||||||
|
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
|
||||||
|
CROWDIN_API_TOKEN: ${{ secrets.CROWDIN_API_TOKEN }}
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,2 +1,3 @@
|
|||||||
.idea
|
.idea
|
||||||
.vscode
|
.vscode
|
||||||
|
.DS_Store
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
project_id_env: CROWDIN_PROJECT_ID
|
||||||
|
api_token_env: CROWDIN_API_TOKEN
|
||||||
|
preserve_hierarchy: 1
|
||||||
files:
|
files:
|
||||||
- source: /manager/app/src/main/res/values/strings.xml
|
- source: /manager/app/src/main/res/values/strings.xml
|
||||||
translation: /manager/app/src/main/res/values-%two_letters_code%/strings.xml
|
translation: /manager/app/src/main/res/values-%two_letters_code%/strings.xml
|
||||||
|
|||||||
@@ -1,145 +0,0 @@
|
|||||||
# SukiSU Ultra
|
|
||||||
|
|
||||||
**English** | [简体中文](README.md) | [日本語](README-ja.md) | [Türkçe](README-tr.md)
|
|
||||||
|
|
||||||
Android device root solution based on [KernelSU](https://github.com/tiann/KernelSU)
|
|
||||||
|
|
||||||
**Experimental! Use at your own risk!** This solution is based on [KernelSU](https://github.com/tiann/KernelSU) and is experimental!
|
|
||||||
|
|
||||||
> This is an unofficial fork. All rights are reserved to [@tiann](https://github.com/tiann)
|
|
||||||
>
|
|
||||||
> However, we will be a separately maintained branch of KSU in the future
|
|
||||||
|
|
||||||
## How to add
|
|
||||||
|
|
||||||
Using main branching (non-GKI device builds are not supported) (requires manual integration of susfs)
|
|
||||||
```
|
|
||||||
curl -LSs "https://raw.githubusercontent.com/SukiSU-Ultra/SukiSU-Ultra/main/kernel/setup.sh" | bash -s main
|
|
||||||
```
|
|
||||||
|
|
||||||
Using branches that support non-GKI devices (requires manual integration of susfs)
|
|
||||||
```
|
|
||||||
curl -LSs "https://raw.githubusercontent.com/SukiSU-Ultra/SukiSU-Ultra/main/kernel/setup.sh" | bash -s nongki
|
|
||||||
```
|
|
||||||
|
|
||||||
## How to use integrated susfs
|
|
||||||
|
|
||||||
1. Use the susfs-dev branch directly without any patching (Support for non-GKI device builds)
|
|
||||||
|
|
||||||
```
|
|
||||||
curl -LSs "https://raw.githubusercontent.com/SukiSU-Ultra/SukiSU-Ultra/main/kernel/setup.sh" | bash -s susfs-dev
|
|
||||||
```
|
|
||||||
|
|
||||||
## KPM Support
|
|
||||||
|
|
||||||
- Based on KernelPatch, we have removed duplicates of KSU and kept only KPM support.
|
|
||||||
- We will introduce more APatch-compatible functions to ensure the integrity of KPM functionality.
|
|
||||||
|
|
||||||
We will introduce more APatch-compatible functions to ensure the completeness of KPM functionality.
|
|
||||||
|
|
||||||
KPM templates: https://github.com/udochina/KPM-Build-Anywhere
|
|
||||||
|
|
||||||
> [!Note]
|
|
||||||
> 1. `CONFIG_KPM=y` needs to be added.
|
|
||||||
> 2. Non-GKI devices need to add `CONFIG_KALLSYMS=y` and `CONFIG_KALLSYMS_ALL=y` as well.
|
|
||||||
> 3. Some kernel source code below `4.19` also needs to be backport from `4.19` to the header file `set_memory.h`.
|
|
||||||
|
|
||||||
## How to do a system update to retain ROOT
|
|
||||||
- After OTA, don't reboot first, go to the manager flashing/patching kernel interface, find `GKI/non_GKI install` and select the Anykernel3 kernel zip file that needs to be flashed, select the slot that is opposite to the current running slot of the system for flashing, and then reboot to retain the GKI mode update (This method is not supported for all non-GKI devices, so please try it yourself. It is the safest way to use TWRP for non-GKI devices.)
|
|
||||||
- Or use LKM mode to install to the unused slot (after OTA).
|
|
||||||
|
|
||||||
## Compatibility Status
|
|
||||||
- KernelSU (versions prior to v1.0.0) officially supports Android GKI 2.0 devices (kernel 5.10+)
|
|
||||||
|
|
||||||
- Older kernels (4.4+) are also compatible, but the kernel must be built manually
|
|
||||||
|
|
||||||
- KernelSU can support 3.x kernels (3.4-3.18) through additional reverse ports
|
|
||||||
|
|
||||||
- Currently supports `arm64-v8a`, `armeabi-v7a (bare)` and some `X86_64`
|
|
||||||
|
|
||||||
|
|
||||||
## More links
|
|
||||||
|
|
||||||
**If you need to submit a translation for the manager go to** https://crowdin.com/project/SukiSU-Ultra
|
|
||||||
|
|
||||||
Projects compiled based on Sukisu and susfs
|
|
||||||
- [GKI](https://github.com/ShirkNeko/GKI_KernelSU_SUSFS)
|
|
||||||
- [OnePlus](https://github.com/ShirkNeko/Action_OnePlus_MKSU_SUSFS)
|
|
||||||
|
|
||||||
## Hook method
|
|
||||||
- This method references the hook method from (https://github.com/rsuntk/KernelSU)
|
|
||||||
|
|
||||||
1. **KPROBES hook:**
|
|
||||||
- Also used for Loadable Kernel Module (LKM)
|
|
||||||
- Default hook method on GKI kernels.
|
|
||||||
- Need `CONFIG_KPROBES=y`
|
|
||||||
|
|
||||||
2. **Manual hook:**
|
|
||||||
- Standard KernelSU hook: https://kernelsu.org/guide/how-to-integrate-for-non-gki.html#manually-modify-the-kernel-source
|
|
||||||
- backslashxx's syscall manual hook: https://github.com/backslashxx/KernelSU/issues/5
|
|
||||||
- Default hook method on Non-GKI kernels.
|
|
||||||
- Need `CONFIG_KSU_MANUAL_HOOK=y`
|
|
||||||
|
|
||||||
## Usage
|
|
||||||
|
|
||||||
### Universal GKI
|
|
||||||
|
|
||||||
Please **all** refer to https://kernelsu.org/zh_CN/guide/installation.html
|
|
||||||
|
|
||||||
> [!Note]
|
|
||||||
> 1. for devices with GKI 2.0 such as Xiaomi, Redmi, Samsung, etc. (excludes kernel-modified manufacturers such as Meizu, OnePlus, Zenith, and oppo)
|
|
||||||
> 2. Find the GKI build in [more links](#%E6%9B%B4%E5%A4%9A%E9%93%BE%E6%8E%A5). Find the device kernel version. Then download it and use TWRP or kernel flashing tool to flash the zip file with AnyKernel3 suffix.
|
|
||||||
> 3. The .zip archive without suffix is uncompressed, the gz suffix is the compression used by Tenguet models.
|
|
||||||
|
|
||||||
|
|
||||||
### OnePlus
|
|
||||||
|
|
||||||
1. Use the link mentioned in the 'More Links' section to create a customized build with your device information, and then flash the zip file with the AnyKernel3 suffix.
|
|
||||||
|
|
||||||
> [!Note]
|
|
||||||
> - You only need to fill in the first two parts of kernel versions, such as 5.10, 5.15, 6.1, or 6.6.
|
|
||||||
> - Please search for the processor codename by yourself, usually it is all English without numbers.
|
|
||||||
> - You can find the branch and configuration files from the OnePlus open-source kernel repository.
|
|
||||||
|
|
||||||
## Features
|
|
||||||
|
|
||||||
1. Kernel-based `su` and root access management.
|
|
||||||
2. Not based on [OverlayFS](https://en.wikipedia.org/wiki/OverlayFS) module system, but based on [Magic Mount](https://github.com/5ec1cff/KernelSU) from 5ec1cff
|
|
||||||
3. [App Profile](https://kernelsu.org/guide/app-profile.html): Lock root privileges in a cage.
|
|
||||||
4. Bringing back non-GKI/GKI 1.0 support
|
|
||||||
5. More customization
|
|
||||||
6. Support for KPM kernel modules
|
|
||||||
|
|
||||||
## Troubleshooting
|
|
||||||
|
|
||||||
1. Uninstalling the KernelSU Manager device is stuck. → Uninstall the application with package name com.sony.playmemories.mobile.
|
|
||||||
|
|
||||||
## License
|
|
||||||
|
|
||||||
- The file in the “kernel” directory is under [GPL-2.0-only](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html) license.
|
|
||||||
|
|
||||||
- The images of the files `ic_launcher(?!.*alt.*).*` with anime character emoticons are copyrighted by [五十根大虾仁](https://space.bilibili.com/370927), the Brand Intellectual Property in the images is owned by [明风OuO](https://space.bilibili.com/274939213), and the vectorization is done by @MiRinChan. Before using these files, in addition to complying with [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode.txt), you also need to comply with the authorization of the two authors to use these artistic contents.
|
|
||||||
|
|
||||||
- Except for the files or directories mentioned above, all other parts are under [GPL-3.0 or later](https://www.gnu.org/licenses/gpl-3.0.html) license.
|
|
||||||
|
|
||||||
## Sponsorship list
|
|
||||||
|
|
||||||
- [Ktouls](https://github.com/Ktouls) Thanks so much for bringing me support
|
|
||||||
- [zaoqi123](https://github.com/zaoqi123) It's not a bad idea to buy me a milk tea
|
|
||||||
- [wswzgdg](https://github.com/wswzgdg) Many thanks for supporting this project
|
|
||||||
- [yspbwx2010](https://github.com/yspbwx2010) Many thanks
|
|
||||||
- [DARKWWEE](https://github.com/DARKWWEE) Thanks for the 100 USDT Lao
|
|
||||||
- [Saksham Singla](https://github.com/TypeFlu) Website provision as well as maintenance
|
|
||||||
- [OukaroMF](https://github.com/OukaroMF) Donation of website domain name
|
|
||||||
|
|
||||||
## Contributions
|
|
||||||
|
|
||||||
- [KernelSU](https://github.com/tiann/KernelSU): original project
|
|
||||||
- [MKSU](https://github.com/5ec1cff/KernelSU): Used project
|
|
||||||
- [RKSU](https://github.com/rsuntk/KernelsU): Reintroduced the support of non-GKI devices using the kernel of this project
|
|
||||||
- [susfs](https://gitlab.com/simonpunk/susfs4ksu):Used susfs file system
|
|
||||||
- [KernelSU](https://git.zx2c4.com/kernel-assisted-superuser/about/): KernelSU conceptualization
|
|
||||||
- [Magisk](https://github.com/topjohnwu/Magisk): Powerful root utility
|
|
||||||
- [genuine](https://github.com/brevent/genuine/): APK v2 Signature Verification
|
|
||||||
- [Diamorphine](https://github.com/m0nad/Diamorphine): Some rootkit utilities.
|
|
||||||
- [KernelPatch](https://github.com/bmax121/KernelPatch): KernelPatch is a key part of the APatch implementation of the kernel module
|
|
||||||
@@ -1,141 +0,0 @@
|
|||||||
# SukiSU Ultra
|
|
||||||
|
|
||||||
**日本語** | [简体中文](README.md) | [English](README-en.md) | [Türkçe](README-tr.md)
|
|
||||||
|
|
||||||
[KernelSU](https://github.com/tiann/KernelSU) をベースとした Android デバイスの root ソリューション
|
|
||||||
|
|
||||||
**試験中なビルドです!自己責任で使用してください!**<br>
|
|
||||||
このソリューションは [KernelSU](https://github.com/tiann/KernelSU) に基づいていますが、試験中なビルドです。
|
|
||||||
|
|
||||||
> これは非公式なフォークです。すべての権利は [@tiann](https://github.com/tiann) に帰属します。
|
|
||||||
>
|
|
||||||
> ただし、将来的には KSU とは別に管理されるブランチとなる予定です。
|
|
||||||
|
|
||||||
## 追加方法
|
|
||||||
|
|
||||||
メイン分岐の使用(GKI デバイス以外のビルドはサポートされていません。) (手動によるサスフ統合が必要)
|
|
||||||
```
|
|
||||||
curl -LSs "https://raw.githubusercontent.com/SukiSU-Ultra/SukiSU-Ultra/main/kernel/setup.sh" | bash -s main
|
|
||||||
```
|
|
||||||
|
|
||||||
GKI以外のデバイスをサポートするブランチを使用する (手動によるサスフ統合が必要)
|
|
||||||
```
|
|
||||||
curl -LSs "https://raw.githubusercontent.com/SukiSU-Ultra/SukiSU-Ultra/main/kernel/setup.sh" | bash -s nongki
|
|
||||||
```
|
|
||||||
|
|
||||||
## 統合された susfs の使い方
|
|
||||||
|
|
||||||
1. パッチを当てずに susfs-dev ブランチを直接使用してください (非GKIデバイスビルドをサポート)
|
|
||||||
```
|
|
||||||
curl -LSs "https://raw.githubusercontent.com/SukiSU-Ultra/SukiSU-Ultra/main/kernel/setup.sh" | bash -s susfs-dev
|
|
||||||
```
|
|
||||||
|
|
||||||
## KPM に対応
|
|
||||||
|
|
||||||
- KernelPatch に基づいて重複した KSU の機能を削除、KPM の対応を維持させています。
|
|
||||||
- KPM 機能の整合性を確保するために、APatch の互換機能を更に向上させる予定です。
|
|
||||||
|
|
||||||
オープンソースアドレス: https://github.com/ShirkNeko/SukiSU_KernelPatch_patch
|
|
||||||
|
|
||||||
KPM テンプレートのアドレス: https://github.com/udochina/KPM-Build-Anywhere
|
|
||||||
|
|
||||||
> [!Note]
|
|
||||||
> 1. `CONFIG_KPM=y` が必要である。
|
|
||||||
> 2.非 GKI デバイスには `CONFIG_KALLSYMS=y` と `CONFIG_KALLSYMS_ALL=y` も必要です。
|
|
||||||
> 3.いくつかのカーネル `4.19` およびそれ以降のソースコードでは、 `4.19` からバックポートされた `set_memory.h` ヘッダーファイルも必要です。
|
|
||||||
|
|
||||||
|
|
||||||
## ROOT を保持するシステムアップデートの方法
|
|
||||||
- OTAの後、最初に再起動せず、マネージャのフラッシュ/パッチカーネルインターフェイスに移動し、`GKI/non_GKI 取り付け`を見つけ、フラッシュする必要があるAnykernel3カーネルzipファイルを選択し、フラッシュするためにシステムの現在の実行スロットと反対のスロットを選択し、GKIモードアップデートを保持するために再起動します(この方法は、現時点ではすべてのnon_GKIデバイスでサポートされていませんので、各自でお試しください。 (この方法は、すべての非GKIデバイスでサポートされていませんので、ご自身でお試しください)。
|
|
||||||
- または、LKMモードを使用して未使用のスロットにインストールします(OTA後)。
|
|
||||||
|
|
||||||
## 互換性ステータス
|
|
||||||
- KernelSU(v1.0.0より前のバージョン)はAndroid GKI 2.0デバイス(カーネル5.10以上)を公式にサポートしています。
|
|
||||||
|
|
||||||
- 古いカーネル(4.4+)も互換性がありますが、カーネルは手動でビルドする必要があります。
|
|
||||||
|
|
||||||
- KernelSU は追加のリバースポートを通じて 3.x カーネル (3.4-3.18) をサポートしています。
|
|
||||||
|
|
||||||
- 現在は `arm64-v8a`、`armeabi-v7a (bare)`、いくつかの `X86_64` をサポートしています。
|
|
||||||
|
|
||||||
## その他のリンク
|
|
||||||
|
|
||||||
**監督に翻訳を提出する必要がある場合は、https://crowdin.com/project/SukiSU-Ultra。
|
|
||||||
|
|
||||||
- [GKI](https://github.com/ShirkNeko/GKI_KernelSU_SUSFS)
|
|
||||||
- [OnePlus](https://github.com/ShirkNeko/Action_OnePlus_MKSU_SUSFS)
|
|
||||||
|
|
||||||
## フックの方式
|
|
||||||
|
|
||||||
- この方式は (https://github.com/rsuntk/KernelSU) のフック方式を参照してください。
|
|
||||||
|
|
||||||
1. **KPROBES フック:**
|
|
||||||
- 読み込み可能なカーネルモジュールの場合 (LKM)
|
|
||||||
- GKI カーネルのデフォルトとなるフック方式
|
|
||||||
- `CONFIG_KPROBES=y` が必要です
|
|
||||||
|
|
||||||
2. **手動でフック:**
|
|
||||||
- 標準の KernelSU フック: https://kernelsu.org/guide/how-to-integrate-for-non-gki.html#manually-modify-the-kernel-source
|
|
||||||
- backslashxx syscall フック: https://github.com/backslashxx/KernelSU/issues/5
|
|
||||||
- 非 GKI カーネル用のデフォルトフッキングメソッド
|
|
||||||
- `CONFIG_KSU_MANUAL_HOOK=y` が必要です
|
|
||||||
|
|
||||||
## 使い方
|
|
||||||
|
|
||||||
### ユニバーサルGKI
|
|
||||||
|
|
||||||
https://kernelsu.org/zh_CN/guide/installation.html をご参照ください。
|
|
||||||
|
|
||||||
> [!Note]
|
|
||||||
> 1.Xiaomi、Redmi、Samsung などの GKI 2.0 を搭載したデバイス用 (Meizu、Yiga、Zenith、oppo などのマジックカーネルを搭載したメーカーは除く)。
|
|
||||||
> 2. [more links](#%E6%9B%B4%E5%A4%9A%E9%93%BE%E6%8E%A5) で GKI ビルドを検索します。 デバイスのカーネルバージョンを検索します。 次に、それをダウンロードし、TWRPまたはカーネルフラッシングツールを使用して、AnyKernel3の接尾辞が付いたzipファイルをフラッシュします。
|
|
||||||
> 接尾辞なしの.zipアーカイブは非圧縮で、接尾辞gzはTenguetモデルで使用されている圧縮方法です。
|
|
||||||
### OnePlus
|
|
||||||
|
|
||||||
1. `その他のリンク`の項目に記載されているリンクを開き、デバイス情報を使用してカスタマイズされたカーネルをビルドし、AnyKernel3 の接頭辞を持つ .zip ファイルをフラッシュします。
|
|
||||||
|
|
||||||
> [!Note]
|
|
||||||
> - 5.10、5.15、6.1、6.6 などのカーネルバージョンの最初の 2 文字のみを入力する必要があります。
|
|
||||||
> - SoC のコードネームは自分で検索してください。通常は、数字がなく英語表記のみです。
|
|
||||||
> - ブランチと構成ファイルは、OnePlus オープンソースカーネルリポジトリから見つけることができます。
|
|
||||||
|
|
||||||
## 機能
|
|
||||||
|
|
||||||
1. カーネルベースな `su` および root アクセスの管理。
|
|
||||||
2. [OverlayFS](https://en.wikipedia.org/wiki/OverlayFS) モジュールシステムではなく、 5ec1cff 氏の [Magic Mount](https://github.com/5ec1cff/KernelSU) に基づいています。
|
|
||||||
3. [アプリプロファイル](https://kernelsu.org/guide/app-profile.html): root 権限をケージ内にロックします。
|
|
||||||
4. 非 GKI / GKI 1.0 の対応を復活
|
|
||||||
5. その他のカスタマイズ
|
|
||||||
6. KPM カーネルモジュールに対応
|
|
||||||
|
|
||||||
## トラブルシューティング
|
|
||||||
|
|
||||||
1.KernelSU Managerのアンインストールができない。 →パッケージ名com.sony.playmemories.mobile.KernelSU Managerのアプリケーションをアンインストールする。
|
|
||||||
|
|
||||||
## ライセンス
|
|
||||||
|
|
||||||
- `kernel` ディレクトリ以下のファイルは[GPL-2.0-only](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)です。
|
|
||||||
- アニメキャラクターの絵文字を含むファイル `ic_launcher(?!.*alt.*).*` の画像は[五十根大虾仁](https://space.bilibili.com/370927)が著作権を所有しており、画像内のブランド知的財産権は[明风OuO](https://space.bilibili.com/274939213)が所有しています。ベクトル化は @MiRinChan が行っています。これらのファイルを使用する前に、[Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode.txt)に準拠することに加えて、これらの芸術コンテンツを使用するには、2人の著者の許可にも従う必要があります。
|
|
||||||
- 上記のファイルまたはディレクトリを除き、その他のすべての部分は[GPL-3.0以降](https://www.gnu.org/licenses/gpl-3.0.html)です。
|
|
||||||
|
|
||||||
## スポンサーシップの一覧
|
|
||||||
|
|
||||||
- [Ktouls](https://github.com/Ktouls) 応援をしてくれたことに感謝。
|
|
||||||
- [zaoqi123](https://github.com/zaoqi123) ミルクティーを買ってあげるのも良い考えですね。
|
|
||||||
- [wswzgdg](https://github.com/wswzgdg) このプロジェクトを支援していただき、ありがとうございます。
|
|
||||||
- [yspbwx2010](https://github.com/yspbwx2010) どうもありがとう。
|
|
||||||
- [DARKWWEE](https://github.com/DARKWWEE) ラオウ100USDTありがとう!
|
|
||||||
- [Saksham Singla](https://github.com/TypeFlu) ウェブサイトの提供およびメンテナンス
|
|
||||||
- [OukaroMF](https://github.com/OukaroMF) ウェブサイトドメイン名の寄付
|
|
||||||
|
|
||||||
## 貢献者
|
|
||||||
|
|
||||||
- [KernelSU](https://github.com/tiann/KernelSU): オリジナルのプロジェクトです。
|
|
||||||
- [MKSU](https://github.com/5ec1cff/KernelSU): 使用しているプロジェクトです。
|
|
||||||
- [RKSU](https://github.com/rsuntk/KernelsU): このプロジェクトのカーネルを使用して非 GKI デバイスのサポートを追加しています。
|
|
||||||
- [susfs](https://gitlab.com/simonpunk/susfs4ksu):使用している susfs ファイルシステムです。
|
|
||||||
- [KernelSU](https://git.zx2c4.com/kernel-assisted-superuser/about/): KernelSU について。
|
|
||||||
- [Magisk](https://github.com/topjohnwu/Magisk): パワフルな root ユーティリティです。
|
|
||||||
- [genuine](https://github.com/brevent/genuine/): APK v2 署名認証で使用しています。
|
|
||||||
- [Diamorphine](https://github.com/m0nad/Diamorphine): いくつかの rootkit ユーティリティを使用しています。
|
|
||||||
- [KernelPatch](https://github.com/bmax121/KernelPatch): KernelPatch はカーネルモジュールの APatch 実装での重要な部分となります。
|
|
||||||
185
docs/README.md
185
docs/README.md
@@ -1,156 +1,101 @@
|
|||||||
|
<img align='right' src='zakomonochrome-128.svg' width='100px' alt="logo">
|
||||||
|
|
||||||
# SukiSU Ultra
|
# SukiSU Ultra
|
||||||
|
|
||||||
**简体中文** | [English](README-en.md) | [日本語](README-ja.md) | [Türkçe](README-tr.md)
|
**English** | [简体中文](./zh/README.md) | [日本語](./ja/README.md) | [Türkçe](./tr/README.md)
|
||||||
|
|
||||||
基于 [KernelSU](https://github.com/tiann/KernelSU) 的安卓设备 root 解决方案
|
A kernel-based root solution for Android devices, forked from [`tiann/KernelSU`](https://github.com/tiann/KernelSU), and added some interesting changes.
|
||||||
|
|
||||||
**实验性! 使用风险自负!**
|
[](https://github.com/tiann/KernelSU/releases/latest)
|
||||||
|
[](https://t.me/Sukiksu)
|
||||||
|
[](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)
|
||||||
|
[](/LICENSE)
|
||||||
|
|
||||||
> 这是非官方分支,保留所有权利 [@tiann](https://github.com/tiann)
|
## Features
|
||||||
>
|
|
||||||
> 但是,我们将会在未来成为一个单独维护的 KSU 分支
|
|
||||||
|
|
||||||
## 如何添加
|
1. Kernel-based `su` and root access management
|
||||||
|
2. Module system based on [Magic Mount](https://github.com/5ec1cff/KernelSU)
|
||||||
|
3. [App Profile](https://kernelsu.org/guide/app-profile.html): Lock up the root power in a cage
|
||||||
|
4. Support non-GKI and GKI 1.0
|
||||||
|
5. KPM Support
|
||||||
|
6. Tweaks to the manager theme and the built-in susfs management tool.
|
||||||
|
|
||||||
在内核源码的根目录下执行以下命令:
|
## Compatibility Status
|
||||||
|
|
||||||
使用 main 分支 (不支持非 GKI 设备构建) (需要手动集成 susfs)
|
- KernelSU (before v1.0.0) officially supports Android GKI 2.0 devices (kernel 5.10+).
|
||||||
|
|
||||||
```
|
- Older kernels (4.4+) are also compatible, but the kernel will have to be built manually.
|
||||||
curl -LSs "https://raw.githubusercontent.com/SukiSU-Ultra/SukiSU-Ultra/main/kernel/setup.sh" | bash -s main
|
|
||||||
```
|
|
||||||
|
|
||||||
使用支持非 GKI 设备的分支 (需要手动集成 susfs)
|
- With more backports, KernelSU can supports 3.x kernel (3.4-3.18).
|
||||||
|
|
||||||
```
|
- Currently, only `arm64-v8a`, `armeabi-v7a (bare)` and `X86_64`(some) are supported.
|
||||||
curl -LSs "https://raw.githubusercontent.com/SukiSU-Ultra/SukiSU-Ultra/main/kernel/setup.sh" | bash -s nongki
|
|
||||||
```
|
|
||||||
|
|
||||||
## 如何集成 susfs
|
## Installation
|
||||||
|
|
||||||
1. 直接使用 susfs-stable 或者 susfs-dev 分支,不需要再集成 susfs (支持非 GKI 设备构建)
|
See [`guide/installation.md`](guide/installation.md)
|
||||||
|
|
||||||
```
|
## Integration
|
||||||
curl -LSs "https://raw.githubusercontent.com/SukiSU-Ultra/SukiSU-Ultra/main/kernel/setup.sh" | bash -s susfs-dev
|
|
||||||
```
|
|
||||||
|
|
||||||
## 钩子方法
|
See [`guide/how-to-integrate.md`](guide/how-to-integrate.md)
|
||||||
|
|
||||||
- 此部分引用自 [rsuntk 的钩子方法](https://github.com/rsuntk/KernelSU)
|
## Translation
|
||||||
|
|
||||||
1. **KPROBES 钩子:**
|
If you need to submit a translation for the manager, please go to [Crowdin](https://crowdin.com/project/SukiSU-Ultra).
|
||||||
|
|
||||||
- 用于可加载内核模块 (LKM)
|
## KPM Support
|
||||||
- GKI 2.0 内核的默认钩子方法
|
|
||||||
- 需要 `CONFIG_KPROBES=y`
|
|
||||||
|
|
||||||
2. **手动钩子:**
|
- Based on KernelPatch, we removed features redundant with KSU and retained only KPM support.
|
||||||
- 标准的 KernelSU 钩子:https://kernelsu.org/guide/how-to-integrate-for-non-gki.html#manually-modify-the-kernel-source
|
- Work in Progress: Expanding APatch compatibility by integrating additional functions to ensure compatibility across different implementations.
|
||||||
- backslashxx 的 syscall 手动钩子:https://github.com/backslashxx/KernelSU/issues/5
|
|
||||||
- 非 GKI 内核的默认挂钩方法
|
|
||||||
- 需要 `CONFIG_KSU_MANUAL_HOOK=y`
|
|
||||||
|
|
||||||
## KPM 支持
|
**Open-source repository**: [https://github.com/ShirkNeko/SukiSU_KernelPatch_patch](https://github.com/ShirkNeko/SukiSU_KernelPatch_patch)
|
||||||
|
|
||||||
- 我们基于 KernelPatch 去掉了和 KSU 重复的功能,仅保留了 KPM 支持
|
**KPM template**: [https://github.com/udochina/KPM-Build-Anywhere](https://github.com/udochina/KPM-Build-Anywhere)
|
||||||
- 我们将会引入更多的兼容 APatch 的函数来确保 KPM 功能的完整性
|
|
||||||
|
|
||||||
开源地址: https://github.com/ShirkNeko/SukiSU_KernelPatch_patch
|
|
||||||
|
|
||||||
KPM 模板地址: https://github.com/udochina/KPM-Build-Anywhere
|
|
||||||
|
|
||||||
> [!Note]
|
> [!Note]
|
||||||
>
|
>
|
||||||
> 1. 需要 `CONFIG_KPM=y`
|
> 1. Requires `CONFIG_KPM=y`
|
||||||
> 2. 非 GKI 设备还需要 `CONFIG_KALLSYMS=y` 和 `CONFIG_KALLSYMS_ALL=y`
|
> 2. Non-GKI devices requires `CONFIG_KALLSYMS=y` and `CONFIG_KALLSYMS_ALL=y`
|
||||||
> 3. 部分内核 `4.19` 以下源码还需要从 `4.19` 向后移植头文件 `set_memory.h`
|
> 3. For kernels below `4.19`, backporting from `set_memory.h` from `4.19` is required.
|
||||||
|
|
||||||
## 如何进行系统更新保留 ROOT
|
## Troubleshooting
|
||||||
|
|
||||||
- OTA 后先不要重启,进入管理器刷写/修补内核界面,找到 `GKI/non_GKI安装` 选择需要刷写的 Anykernel3 内核压缩文件,选择与现在系统运行槽位相反的槽位进行刷写并重启即可保留 GKI 模式更新(暂不支持所有非 GKI 设备使用这种方法,请自行尝试。非 GKI 设备使用 TWRP 刷写是最稳妥的)
|
1. Device stuck upon manager app uninstallation?
|
||||||
- 或者使用 LKM 模式的安装到未使用的槽位(OTA 后)
|
Uninstall _com.sony.playmemories.mobile_
|
||||||
|
|
||||||
## 兼容状态
|
## Sponsor
|
||||||
|
|
||||||
- KernelSU(v1.0.0 之前版本)正式支持 Android GKI 2.0 设备(内核 5.10+)
|
- [ShirkNeko](https://afdian.com/a/shirkneko) (maintainer of SukiSU)
|
||||||
|
- [weishu](https://github.com/sponsors/tiann) (author of KernelSU)
|
||||||
|
|
||||||
- 旧内核(4.4+)也兼容,但必须手动构建内核
|
## ShirkNeko's sponsorship list
|
||||||
|
|
||||||
- 通过更多的反向移植,KernelSU 可以支持 3.x 内核(3.4-3.18)
|
- [Ktouls](https://github.com/Ktouls) Thanks so much for bringing me support.
|
||||||
|
- [zaoqi123](https://github.com/zaoqi123) Thanks for the milk tea.
|
||||||
|
- [wswzgdg](https://github.com/wswzgdg) Many thanks for supporting this project.
|
||||||
|
- [yspbwx2010](https://github.com/yspbwx2010) Many thanks.
|
||||||
|
- [DARKWWEE](https://github.com/DARKWWEE) 100 USDT
|
||||||
|
- [Saksham Singla](https://github.com/TypeFlu) Provide and maintain the website
|
||||||
|
- [OukaroMF](https://github.com/OukaroMF) Donation of website domain name
|
||||||
|
|
||||||
- 目前支持 `arm64-v8a` ,`armeabi-v7a (bare)` 和部分 `X86_64`
|
## License
|
||||||
|
|
||||||
## 更多链接
|
- The file in the “kernel” directory is under [GPL-2.0-only](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html) license.
|
||||||
|
- The images of the files `ic_launcher(?!.*alt.*).*` with anime character sticker are copyrighted by [怡子曰曰](https://space.bilibili.com/10545509), the Brand Intellectual Property in the images is owned by [明风 OuO](https://space.bilibili.com/274939213), and the vectorization is done by @MiRinChan. Before using these files, in addition to complying with [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode.txt), you also need to comply with the authorization of the two authors to use these artistic contents.
|
||||||
|
- Except for the files or directories mentioned above, all other parts are under [GPL-3.0 or later](https://www.gnu.org/licenses/gpl-3.0.html) license.
|
||||||
|
|
||||||
**如果你需要为管理器提交翻译请前往** https://crowdin.com/project/SukiSU-Ultra
|
## Credit
|
||||||
|
|
||||||
基于 SukiSU 和 susfs 编译的项目
|
- [KernelSU](https://github.com/tiann/KernelSU): upstream
|
||||||
|
- [MKSU](https://github.com/5ec1cff/KernelSU): Magic Mount
|
||||||
|
- [RKSU](https://github.com/rsuntk/KernelsU): support non-GKI
|
||||||
|
- [susfs](https://gitlab.com/simonpunk/susfs4ksu): An addon root hiding kernel patches and userspace module for KernelSU.
|
||||||
|
- [KernelPatch](https://github.com/bmax121/KernelPatch): KernelPatch is a key part of the APatch implementation of the kernel module
|
||||||
|
|
||||||
- [GKI](https://github.com/ShirkNeko/GKI_KernelSU_SUSFS)
|
<details>
|
||||||
- [一加](https://github.com/ShirkNeko/Action_OnePlus_MKSU_SUSFS)
|
<summary>KernelSU's credit</summary>
|
||||||
|
|
||||||
## 使用方法
|
- [Kernel-Assisted Superuser](https://git.zx2c4.com/kernel-assisted-superuser/about/): The KernelSU idea.
|
||||||
|
- [Magisk](https://github.com/topjohnwu/Magisk): The powerful root tool.
|
||||||
### 普适的 GKI
|
- [genuine](https://github.com/brevent/genuine/): APK v2 signature validation.
|
||||||
|
- [Diamorphine](https://github.com/m0nad/Diamorphine): Some rootkit skills.
|
||||||
请**全部**参考 https://kernelsu.org/zh_CN/guide/installation.html
|
</details>
|
||||||
|
|
||||||
> [!Note]
|
|
||||||
>
|
|
||||||
> 1. 适用于如小米、红米、三星等的 GKI 2.0 的设备 (不包含魔改内核的厂商如魅族、一加、真我和 oppo)
|
|
||||||
> 2. 找到[更多链接](#%E6%9B%B4%E5%A4%9A%E9%93%BE%E6%8E%A5)里的 GKI 构建的项目。找到设备内核版本。然后下载下来,用 TWRP 或者内核刷写工具刷入带 AnyKernel3 后缀的压缩包即可
|
|
||||||
> 3. 一般不带后缀的 .zip 压缩包是未压缩的,gz 后缀的为天玑机型所使用的压缩方式
|
|
||||||
|
|
||||||
### 一加
|
|
||||||
|
|
||||||
1.找到更多链接里的一加项目进行自行填写,然后云编译构建,最后刷入带 AnyKernel3 后缀的压缩包即可
|
|
||||||
|
|
||||||
> [!Note]
|
|
||||||
>
|
|
||||||
> - 内核版本只需要填写前两位即可,如 5.10,5.15,6.1,6.6
|
|
||||||
> - 处理器代号请自行搜索,一般为全英文不带数字的代号
|
|
||||||
> - 分支和配置文件请自行到一加内核开源地址进行填写
|
|
||||||
|
|
||||||
## 特点
|
|
||||||
|
|
||||||
1. 基于内核的 `su` 和 root 访问管理
|
|
||||||
2. 基于 5ec1cff 的 [Magic Mount](https://github.com/5ec1cff/KernelSU) 的模块系统
|
|
||||||
3. [App Profile](https://kernelsu.org/guide/app-profile.html):将 root 权限锁在笼子里
|
|
||||||
4. 恢复对非 GKI 2.0 内核的支持
|
|
||||||
5. 更多自定义功能
|
|
||||||
6. 对 KPM 内核模块的支持
|
|
||||||
|
|
||||||
## 疑难解答
|
|
||||||
1. 卸载 KernelSU 管理器设备卡死。→ 卸载包名为 com.sony.playmemories.mobile 的应用。
|
|
||||||
|
|
||||||
## 许可证
|
|
||||||
|
|
||||||
- `kernel` 目录下的文件是 [GPL-2.0-only](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)。
|
|
||||||
- 有动漫人物图片表情包的这些文件 `ic_launcher(?!.*alt.*).*` 的图像版权为[五十根大虾仁](https://space.bilibili.com/370927)所有,图像中的 Brand Intellectual Property 由[明风OuO](https://space.bilibili.com/274939213)所有,矢量化由 @MiRinChan 完成,在使用这些文件之前,除了必须遵守 [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode.txt) 以外,还需要遵守向前两者索要使用这些艺术内容的授权。
|
|
||||||
- 除了以上所述的文件或目录外,所有其他部分均为 [GPL-3.0 或更高版本](https://www.gnu.org/licenses/gpl-3.0.html)。
|
|
||||||
|
|
||||||
## 爱发电链接
|
|
||||||
|
|
||||||
- https://afdian.com/a/shirkneko
|
|
||||||
|
|
||||||
## 赞助名单
|
|
||||||
|
|
||||||
- [Ktouls](https://github.com/Ktouls) 非常感谢你给我带来的支持
|
|
||||||
- [zaoqi123](https://github.com/zaoqi123) 请我喝奶茶也不错
|
|
||||||
- [wswzgdg](https://github.com/wswzgdg) 非常感谢对此项目的支持
|
|
||||||
- [yspbwx2010](https://github.com/yspbwx2010) 非常感谢
|
|
||||||
- [DARKWWEE](https://github.com/DARKWWEE) 感谢老哥的 100 USDT
|
|
||||||
- [Saksham Singla](https://github.com/TypeFlu) 网站的提供以及维护
|
|
||||||
- [OukaroMF](https://github.com/OukaroMF) 网站域名捐赠
|
|
||||||
|
|
||||||
## 贡献
|
|
||||||
|
|
||||||
- [KernelSU](https://github.com/tiann/KernelSU):原始项目
|
|
||||||
- [MKSU](https://github.com/5ec1cff/KernelSU):使用的项目
|
|
||||||
- [RKSU](https://github.com/rsuntk/KernelsU):使用该项目的 kernel 对非 GKI 设备重新进行支持
|
|
||||||
- [susfs4ksu](https://gitlab.com/simonpunk/susfs4ksu):使用的 susfs 文件系统
|
|
||||||
- [kernel-assisted-superuser](https://git.zx2c4.com/kernel-assisted-superuser/about/):KernelSU 的构想
|
|
||||||
- [Magisk](https://github.com/topjohnwu/Magisk):强大的 root 工具
|
|
||||||
- [genuine](https://github.com/brevent/genuine/):APK v2 签名验证
|
|
||||||
- [Diamorphine](https://github.com/m0nad/Diamorphine):一些 rootkit 技能
|
|
||||||
- [KernelPatch](https://github.com/bmax121/KernelPatch): KernelPatch 是 APatch 实现内核模块的关键部分
|
|
||||||
|
|||||||
97
docs/guide/how-to-integrate.md
Normal file
97
docs/guide/how-to-integrate.md
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
# Integrate
|
||||||
|
|
||||||
|
SukiSU can be integrated into both _GKI_ and _non-GKI_ kernels and has been backported to _4.14_.
|
||||||
|
|
||||||
|
<!-- It should be 3.4, but backslashxx's syscall manual hook cannot use in SukiSU-->
|
||||||
|
|
||||||
|
Some OEMs' customization could result in as much as 50% of kernel code being out-of-tree code and not from upstream Linux kernels or ACKs. Due to this, the custom nature of _non-GKI_ kernels resulted in significant kernel fragmentation, and we lacked a universal method for building them. Therefore, we cannot provide boot images of _non-GKI_ kernels.
|
||||||
|
|
||||||
|
Prerequisites: open source bootable kernel.
|
||||||
|
|
||||||
|
### Hook method
|
||||||
|
|
||||||
|
1. **KPROBES hook:**
|
||||||
|
|
||||||
|
- Default hook method on GKI kernels.
|
||||||
|
- Requires `# CONFIG_KSU_MANUAL_HOOK is not set` & `CONFIG_KPROBES=y`
|
||||||
|
- Used for Loadable Kernel Module (LKM).
|
||||||
|
|
||||||
|
2. **Manual hook:**
|
||||||
|
|
||||||
|
<!-- - backslashxx's syscall manual hook: https://github.com/backslashxx/KernelSU/issues/5 (v1.5 version is not available at the moment, if you want to use it, please use v1.4 version, or standard KernelSU hooks)-->
|
||||||
|
|
||||||
|
- Requires `CONFIG_KSU_MANUAL_HOOK=y`
|
||||||
|
- Requires [`guide/how-to-integrate.md`](guide/how-to-integrate.md)
|
||||||
|
- Requires [https://github.com/~](https://github.com/tiann/KernelSU/blob/main/website/docs/guide/how-to-integrate-for-non-gki.md#manually-modify-the-kernel-source)
|
||||||
|
|
||||||
|
3. **Tracepoint Hook:**
|
||||||
|
|
||||||
|
- Hook method introduced since SukiSU commit [49b01aad](https://github.com/SukiSU-Ultra/SukiSU-Ultra/commit/49b01aad74bcca6dba5a8a2e053bb54b648eb124)
|
||||||
|
- Requires `CONFIG_KSU_TRACEPOINT_HOOK=y`
|
||||||
|
- Requires [`guide/tracepoint-hook.md`](tracepoint-hook.md)
|
||||||
|
|
||||||
|
<!-- This part refer to [rsuntk/KernelSU](https://github.com/rsuntk/KernelSU). -->
|
||||||
|
|
||||||
|
If you're able to build a bootable kernel, there are two ways to integrate KernelSU into the kernel source code:
|
||||||
|
|
||||||
|
1. Automatically with `kprobe`
|
||||||
|
2. Manually
|
||||||
|
|
||||||
|
## Integrate with kprobe
|
||||||
|
|
||||||
|
Applicable:
|
||||||
|
|
||||||
|
- _GKI_ kernel
|
||||||
|
|
||||||
|
Not applicable:
|
||||||
|
|
||||||
|
- _non-GKI_ kernel
|
||||||
|
|
||||||
|
KernelSU uses kprobe to do kernel hooks. If kprobe runs well in your kernel, it's recommended to use it this way.
|
||||||
|
|
||||||
|
Please refer to this document [https://github.com/~](https://github.com/tiann/KernelSU/blob/main/website/docs/guide/how-to-integrate-for-non-gki.md#integrate-with-kprobe). Although it is titled “for _non-GKI_,” it only applies to _GKI_.
|
||||||
|
|
||||||
|
The execution command for the step that adds KernelSU to your kernel source tree is replaced with:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
curl -LSs "https://raw.githubusercontent.com/SukiSU-Ultra/SukiSU-Ultra/main/kernel/setup.sh" | bash -s main
|
||||||
|
```
|
||||||
|
|
||||||
|
## Manually modify the kernel source
|
||||||
|
|
||||||
|
Applicable:
|
||||||
|
|
||||||
|
- GKI kernel
|
||||||
|
- non-GKI kernel
|
||||||
|
|
||||||
|
Please refer to this document [https://github.com/~ (Integrate for non-GKI)](https://github.com/tiann/KernelSU/blob/main/website/docs/guide/how-to-integrate-for-non-gki.md#manually-modify-the-kernel-source) and [https://github.com/~ (Build for GKI)](https://kernelsu.org/zh_CN/guide/how-to-build.html) to integrate manually, although first link is titled “for non-GKI,” it also applies to GKI. It can work on them both.
|
||||||
|
|
||||||
|
There is another way to integrate but still work in the process.
|
||||||
|
|
||||||
|
<!-- It is backslashxx's syscall manual hook, but it cannot be used now. -->
|
||||||
|
|
||||||
|
Run command for the step that adds KernelSU(SukiSU) to your kernel source tree is replaced with:
|
||||||
|
|
||||||
|
### GKI kernel
|
||||||
|
|
||||||
|
```sh
|
||||||
|
curl -LSs "https://raw.githubusercontent.com/SukiSU-Ultra/SukiSU-Ultra/main/kernel/setup.sh" | bash -s main
|
||||||
|
```
|
||||||
|
|
||||||
|
### non-GKI kernel
|
||||||
|
|
||||||
|
```sh
|
||||||
|
curl -LSs "https://raw.githubusercontent.com/SukiSU-Ultra/SukiSU-Ultra/main/kernel/setup.sh" | bash -s nongki
|
||||||
|
```
|
||||||
|
|
||||||
|
### GKI / non-GKI kernel with susfs (experiment)
|
||||||
|
|
||||||
|
```sh
|
||||||
|
curl -LSs "https://raw.githubusercontent.com/SukiSU-Ultra/SukiSU-Ultra/main/kernel/setup.sh" | bash -s susfs-{{branch}}
|
||||||
|
```
|
||||||
|
|
||||||
|
Branch:
|
||||||
|
|
||||||
|
- `main` (susfs-main)
|
||||||
|
- `test` (susfs-test)
|
||||||
|
- version (for example: susfs-1.5.7, you should check the [branches](https://github.com/SukiSU-Ultra/SukiSU-Ultra/branches))
|
||||||
34
docs/guide/installation.md
Normal file
34
docs/guide/installation.md
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
# Installation
|
||||||
|
|
||||||
|
You can go to [KernelSU Documentation - Installation](https://kernelsu.org/guide/installation.html) for a reference on how to install it, here are just additional instructions.
|
||||||
|
|
||||||
|
## Installation by loading the Loadable Kernel Module(LKM)
|
||||||
|
|
||||||
|
See [KernelSU Documentation - LKM Installation](https://kernelsu.org/guide/installation.html#lkm-installation)
|
||||||
|
|
||||||
|
Beginning with **Android™** (trademark meaning licensed Google Mobile Services) 12, devices shipping with kernel version 5.10 or higher must ship with the GKI kernel. You may be able to use LKM mode.
|
||||||
|
|
||||||
|
## Installation by installing the kernel
|
||||||
|
|
||||||
|
See [KernelSU Documentation - GKI mode Installation](https://kernelsu.org/guide/installation.html#gki-mode-installation)
|
||||||
|
|
||||||
|
We provide pre-built kernels for you to use:
|
||||||
|
|
||||||
|
- [ShirkNeko flavor kernel](https://github.com/ShirkNeko/GKI_KernelSU_SUSFS) (add ZRAM compression algorithm patch, susfs, KPM. Works on many devices.)
|
||||||
|
- [MiRinFork flavored kernel](https://github.com/MiRinFork/GKI_SukiSU_SUSFS) (adds susfs, KPM. Closest kernel to GKI, works on most devices.)
|
||||||
|
|
||||||
|
Although some devices can be installed using LKM mode, they cannot be installed on the device by using the GKI kernel; therefore, the kernel needs to be modified manually to compile it. For example:
|
||||||
|
|
||||||
|
- OPPO(OnePlus, REALME)
|
||||||
|
- Meizu
|
||||||
|
|
||||||
|
Also, we provide pre-built kernels for your OnePlus device to use:
|
||||||
|
|
||||||
|
- [ShirkNeko/Action_OnePlus_MKSU_SUSFS](https://github.com/ShirkNeko/Action_OnePlus_MKSU_SUSFS) (add ZRAM compression algorithm patch, susfs, KPM.)
|
||||||
|
|
||||||
|
Using the link above, Fork into GitHub Action, fill in the build parameters, compile, and finally flush in the zip with the AnyKernel3 suffix.
|
||||||
|
|
||||||
|
> [!Note]
|
||||||
|
>
|
||||||
|
> - You only need to fill in the first two parts of the version number, e.g. `5.10`, `6.1`...
|
||||||
|
> - Make sure you know the processor designation, kernel version, etc. before you use it.
|
||||||
270
docs/guide/tracepoint-hook.md
Normal file
270
docs/guide/tracepoint-hook.md
Normal file
@@ -0,0 +1,270 @@
|
|||||||
|
# Tracepoint Hook Integration
|
||||||
|
|
||||||
|
## Introduction
|
||||||
|
|
||||||
|
Since commit [49b01aad](https://github.com/SukiSU-Ultra/SukiSU-Ultra/commit/49b01aad74bcca6dba5a8a2e053bb54b648eb124), SukiSU has introduced Tracepoint Hook
|
||||||
|
|
||||||
|
This Hook theoretically has lower performance overhead compared to Kprobes Hook, but is inferior to Manual Hook / Syscall Hook
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
> This tutorial references the syscall hook v1.4 version from [backslashxx/KernelSU#5](https://github.com/backslashxx/KernelSU/issues/5), as well as the original KernelSU's [Manual Hook](https://kernelsu.org/guide/how-to-integrate-for-non-gki.html#manually-modify-the-kernel-source)
|
||||||
|
|
||||||
|
## Guide
|
||||||
|
|
||||||
|
### execve Hook (`exec.c`)
|
||||||
|
|
||||||
|
Generally need to modify the `do_execve` and `compat_do_execve` methods in `fs/exec.c`
|
||||||
|
|
||||||
|
```patch
|
||||||
|
--- a/fs/exec.c
|
||||||
|
+++ b/fs/exec.c
|
||||||
|
@@ -78,6 +78,10 @@
|
||||||
|
#include <trace/hooks/sched.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
+#if defined(CONFIG_KSU) && defined(CONFIG_KSU_TRACEPOINT_HOOK)
|
||||||
|
+#include <../drivers/kernelsu/ksu_trace.h>
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
EXPORT_TRACEPOINT_SYMBOL_GPL(task_rename);
|
||||||
|
|
||||||
|
static int bprm_creds_from_file(struct linux_binprm *bprm);
|
||||||
|
@@ -2037,6 +2041,9 @@ static int do_execve(struct filename *filename,
|
||||||
|
{
|
||||||
|
struct user_arg_ptr argv = { .ptr.native = __argv };
|
||||||
|
struct user_arg_ptr envp = { .ptr.native = __envp };
|
||||||
|
+#if defined(CONFIG_KSU) && defined(CONFIG_KSU_TRACEPOINT_HOOK)
|
||||||
|
+ trace_ksu_trace_execveat_hook((int *)AT_FDCWD, &filename, &argv, &envp, 0);
|
||||||
|
+#endif
|
||||||
|
return do_execveat_common(AT_FDCWD, filename, argv, envp, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -2064,6 +2071,9 @@ static int compat_do_execve(struct filename *filename,
|
||||||
|
.is_compat = true,
|
||||||
|
.ptr.compat = __envp,
|
||||||
|
};
|
||||||
|
+#if defined(CONFIG_KSU) && defined(CONFIG_KSU_TRACEPOINT_HOOK)
|
||||||
|
+ trace_ksu_trace_execveat_sucompat_hook((int *)AT_FDCWD, &filename, NULL, NULL, NULL); /* 32-bit su */
|
||||||
|
+#endif
|
||||||
|
return do_execveat_common(AT_FDCWD, filename, argv, envp, 0);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### faccessat Hook (`open.c`)
|
||||||
|
|
||||||
|
Generally need to modify the `do_faccessat` method in `/fs/open.c`
|
||||||
|
|
||||||
|
```patch
|
||||||
|
--- a/fs/open.c
|
||||||
|
+++ b/fs/open.c
|
||||||
|
@@ -37,6 +37,10 @@
|
||||||
|
#include "internal.h"
|
||||||
|
#include <trace/hooks/syscall_check.h>
|
||||||
|
|
||||||
|
+#if defined(CONFIG_KSU) && defined(CONFIG_KSU_TRACEPOINT_HOOK)
|
||||||
|
+#include <../drivers/kernelsu/ksu_trace.h>
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
int do_truncate(struct user_namespace *mnt_userns, struct dentry *dentry,
|
||||||
|
loff_t length, unsigned int time_attrs, struct file *filp)
|
||||||
|
{
|
||||||
|
@@ -468,6 +472,9 @@ static long do_faccessat(int dfd, const char __user *filename, int mode, int fla
|
||||||
|
|
||||||
|
SYSCALL_DEFINE3(faccessat, int, dfd, const char __user *, filename, int, mode)
|
||||||
|
{
|
||||||
|
+#if defined(CONFIG_KSU) && defined(CONFIG_KSU_TRACEPOINT_HOOK)
|
||||||
|
+ trace_ksu_trace_faccessat_hook(&dfd, &filename, &mode, NULL);
|
||||||
|
+#endif
|
||||||
|
return do_faccessat(dfd, filename, mode, 0);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
If there's no `do_faccessat` method, you can find the `faccessat` SYSCALL definition (for kernels earlier than 4.17)
|
||||||
|
|
||||||
|
```patch
|
||||||
|
--- a/fs/open.c
|
||||||
|
+++ b/fs/open.c
|
||||||
|
@@ -31,6 +31,9 @@
|
||||||
|
#include <linux/ima.h>
|
||||||
|
#include <linux/dnotify.h>
|
||||||
|
#include <linux/compat.h>
|
||||||
|
+#if defined(CONFIG_KSU) && defined(CONFIG_KSU_TRACEPOINT_HOOK)
|
||||||
|
+#include <../drivers/kernelsu/ksu_trace.h>
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
#include "internal.h"
|
||||||
|
|
||||||
|
@@ -369,6 +372,9 @@ SYSCALL_DEFINE3(faccessat, int, dfd, const char __user *, filename, int, mode)
|
||||||
|
int res;
|
||||||
|
unsigned int lookup_flags = LOOKUP_FOLLOW;
|
||||||
|
|
||||||
|
+#if defined(CONFIG_KSU) && defined(CONFIG_KSU_TRACEPOINT_HOOK)
|
||||||
|
+ trace_ksu_trace_faccessat_hook(&dfd, &filename, &mode, NULL);
|
||||||
|
+#endif
|
||||||
|
if (mode & ~S_IRWXO) /* where's F_OK, X_OK, W_OK, R_OK? */
|
||||||
|
return -EINVAL;
|
||||||
|
```
|
||||||
|
|
||||||
|
### sys_read Hook (`read_write.c`)
|
||||||
|
|
||||||
|
Need to modify the `sys_read` method in `fs/read_write.c` (4.19 and above)
|
||||||
|
|
||||||
|
```patch
|
||||||
|
--- a/fs/read_write.c
|
||||||
|
+++ b/fs/read_write.c
|
||||||
|
@@ -25,6 +25,10 @@
|
||||||
|
#include <linux/uaccess.h>
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
|
||||||
|
+#if defined(CONFIG_KSU) && defined(CONFIG_KSU_TRACEPOINT_HOOK)
|
||||||
|
+#include <../drivers/kernelsu/ksu_trace.h>
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
const struct file_operations generic_ro_fops = {
|
||||||
|
.llseek = generic_file_llseek,
|
||||||
|
.read_iter = generic_file_read_iter,
|
||||||
|
@@ -630,6 +634,9 @@ ssize_t ksys_read(unsigned int fd, char __user *buf, size_t count)
|
||||||
|
|
||||||
|
SYSCALL_DEFINE3(read, unsigned int, fd, char __user *, buf, size_t, count)
|
||||||
|
{
|
||||||
|
+#if defined(CONFIG_KSU) && defined(CONFIG_KSU_TRACEPOINT_HOOK)
|
||||||
|
+ trace_ksu_trace_sys_read_hook(fd, &buf, &count);
|
||||||
|
+#endif
|
||||||
|
return ksys_read(fd, buf, count);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Or the `read` SYSCALL definition (4.14 and below)
|
||||||
|
|
||||||
|
```patch
|
||||||
|
--- a/fs/read_write.c
|
||||||
|
+++ b/fs/read_write.c
|
||||||
|
@@ -25,6 +25,11 @@
|
||||||
|
#include <linux/uaccess.h>
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
|
||||||
|
+#if defined(CONFIG_KSU) && defined(CONFIG_KSU_TRACEPOINT_HOOK)
|
||||||
|
+#include <../drivers/kernelsu/ksu_trace.h>
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
+
|
||||||
|
const struct file_operations generic_ro_fops = {
|
||||||
|
.llseek = generic_file_llseek,
|
||||||
|
.read_iter = generic_file_read_iter,
|
||||||
|
@@ -575,6 +580,9 @@ SYSCALL_DEFINE3(read, unsigned int, fd, char __user *, buf, size_t, count)
|
||||||
|
|
||||||
|
if (f.file) {
|
||||||
|
loff_t pos = file_pos_read(f.file);
|
||||||
|
+#if defined(CONFIG_KSU) && defined(CONFIG_KSU_TRACEPOINT_HOOK)
|
||||||
|
+ trace_ksu_trace_sys_read_hook(fd, &buf, &count);
|
||||||
|
+#endif
|
||||||
|
ret = vfs_read(f.file, buf, count, &pos);
|
||||||
|
if (ret >= 0)
|
||||||
|
file_pos_write(f.file, pos);
|
||||||
|
```
|
||||||
|
|
||||||
|
### fstatat Hook (`stat.c`)
|
||||||
|
|
||||||
|
Need to modify the `newfstatat` SYSCALL definition in `stat.c`
|
||||||
|
|
||||||
|
If 32-bit support is needed, also need to modify the `statat64` SYSCALL definition
|
||||||
|
|
||||||
|
```patch
|
||||||
|
--- a/fs/stat.c
|
||||||
|
+++ b/fs/stat.c
|
||||||
|
@@ -24,6 +24,10 @@
|
||||||
|
#include "internal.h"
|
||||||
|
#include "mount.h"
|
||||||
|
|
||||||
|
+#if defined(CONFIG_KSU) && defined(CONFIG_KSU_TRACEPOINT_HOOK)
|
||||||
|
+#include <../drivers/kernelsu/ksu_trace.h>
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
/**
|
||||||
|
* generic_fillattr - Fill in the basic attributes from the inode struct
|
||||||
|
* @mnt_userns: user namespace of the mount the inode was found from
|
||||||
|
@@ -408,6 +412,10 @@ SYSCALL_DEFINE4(newfstatat, int, dfd, const char __user *, filename,
|
||||||
|
struct kstat stat;
|
||||||
|
int error;
|
||||||
|
|
||||||
|
+#if defined(CONFIG_KSU) && defined(CONFIG_KSU_TRACEPOINT_HOOK)
|
||||||
|
+ trace_ksu_trace_stat_hook(&dfd, &filename, &flag);
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
error = vfs_fstatat(dfd, filename, &stat, flag);
|
||||||
|
if (error)
|
||||||
|
return error;
|
||||||
|
@@ -559,6 +567,10 @@ SYSCALL_DEFINE4(fstatat64, int, dfd, const char __user *, filename,
|
||||||
|
struct kstat stat;
|
||||||
|
int error;
|
||||||
|
|
||||||
|
+#if defined(CONFIG_KSU) && defined(CONFIG_KSU_TRACEPOINT_HOOK)
|
||||||
|
+ trace_ksu_trace_stat_hook(&dfd, &filename, &flag); /* 32-bit su support */
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
error = vfs_fstatat(dfd, filename, &stat, flag);
|
||||||
|
if (error)
|
||||||
|
return error;
|
||||||
|
```
|
||||||
|
|
||||||
|
### input Hook (`input.c`, for entering KSU built-in security mode)
|
||||||
|
|
||||||
|
Need to modify the `input_event` method in `drivers/input/input.c`, not `input_handle_event`
|
||||||
|
|
||||||
|
```patch
|
||||||
|
--- a/drivers/input/input.c
|
||||||
|
+++ b/drivers/input/input.c
|
||||||
|
@@ -26,6 +26,10 @@
|
||||||
|
#include "input-compat.h"
|
||||||
|
#include "input-poller.h"
|
||||||
|
|
||||||
|
+#if defined(CONFIG_KSU) && defined(CONFIG_KSU_TRACEPOINT_HOOK)
|
||||||
|
+#include <../../drivers/kernelsu/ksu_trace.h>
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
MODULE_AUTHOR("Vojtech Pavlik <vojtech@suse.cz>");
|
||||||
|
MODULE_DESCRIPTION("Input core");
|
||||||
|
MODULE_LICENSE("GPL");
|
||||||
|
@@ -451,6 +455,10 @@ void input_event(struct input_dev *dev,
|
||||||
|
{
|
||||||
|
unsigned long flags;
|
||||||
|
|
||||||
|
+#if defined(CONFIG_KSU) && defined(CONFIG_KSU_TRACEPOINT_HOOK)
|
||||||
|
+ trace_ksu_trace_input_hook(&type, &code, &value);
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
if (is_event_supported(type, dev->evbit, EV_MAX)) {
|
||||||
|
|
||||||
|
spin_lock_irqsave(&dev->event_lock, flags);
|
||||||
|
```
|
||||||
|
|
||||||
|
### devpts Hook (`pty.c`)
|
||||||
|
|
||||||
|
Need to modify the `pts_unix98_lookup` method in `drivers/tty/pty.c`
|
||||||
|
|
||||||
|
```patch
|
||||||
|
--- a/drivers/tty/pty.c
|
||||||
|
+++ b/drivers/tty/pty.c
|
||||||
|
@@ -31,6 +31,10 @@
|
||||||
|
#include <linux/compat.h>
|
||||||
|
#include "tty.h"
|
||||||
|
|
||||||
|
+#if defined(CONFIG_KSU) && defined(CONFIG_KSU_TRACEPOINT_HOOK)
|
||||||
|
+#include <../../drivers/kernelsu/ksu_trace.h>
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
#undef TTY_DEBUG_HANGUP
|
||||||
|
#ifdef TTY_DEBUG_HANGUP
|
||||||
|
# define tty_debug_hangup(tty, f, args...) tty_debug(tty, f, ##args)
|
||||||
|
@@ -707,6 +711,10 @@ static struct tty_struct *pts_unix98_lookup(struct tty_driver *driver,
|
||||||
|
{
|
||||||
|
struct tty_struct *tty;
|
||||||
|
|
||||||
|
+#if defined(CONFIG_KSU) && defined(CONFIG_KSU_TRACEPOINT_HOOK)
|
||||||
|
+ trace_ksu_trace_devpts_hook((struct inode *)file->f_path.dentry->d_inode);
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
mutex_lock(&devpts_mutex);
|
||||||
|
tty = devpts_get_priv(file->f_path.dentry);
|
||||||
|
mutex_unlock(&devpts_mutex);
|
||||||
|
```
|
||||||
151
docs/ja/README.md
Normal file
151
docs/ja/README.md
Normal file
@@ -0,0 +1,151 @@
|
|||||||
|
# SukiSU Ultra
|
||||||
|
|
||||||
|
[English](../README.md) | [简体中文](../zh/README.md) | **日本語** | [Türkçe](../tr/README.md)
|
||||||
|
|
||||||
|
[KernelSU](https://github.com/tiann/KernelSU) をベースとした Android デバイスの root ソリューション
|
||||||
|
|
||||||
|
**試験中なビルドです!自己責任で使用してください!**<br>
|
||||||
|
このソリューションは [KernelSU](https://github.com/tiann/KernelSU) に基づいていますが、試験中なビルドです。
|
||||||
|
|
||||||
|
> これは非公式なフォークです。すべての権利は [@tiann](https://github.com/tiann) に帰属します。
|
||||||
|
>
|
||||||
|
> ただし、将来的には KSU とは別に管理されるブランチとなる予定です。
|
||||||
|
|
||||||
|
## 追加する方法
|
||||||
|
|
||||||
|
メインブランチを使用 (非 GKI のデバイスのビルドは非対応) (susfs を手動で統合が必要)
|
||||||
|
|
||||||
|
```
|
||||||
|
curl -LSs "https://raw.githubusercontent.com/SukiSU-Ultra/SukiSU-Ultra/main/kernel/setup.sh" | bash -s main
|
||||||
|
```
|
||||||
|
|
||||||
|
非 GKI のデバイスに対応するブランチを使用 (susfs を手動で統合が必要)
|
||||||
|
|
||||||
|
```
|
||||||
|
curl -LSs "https://raw.githubusercontent.com/SukiSU-Ultra/SukiSU-Ultra/main/kernel/setup.sh" | bash -s nongki
|
||||||
|
```
|
||||||
|
|
||||||
|
## 統合された susfs の使い方
|
||||||
|
|
||||||
|
1. susfs-main または他の susfs-\* ブランチを直接で使用、susfs の統合は不要 (非 GKI デバイスのビルドに対応)
|
||||||
|
|
||||||
|
```
|
||||||
|
curl -LSs "https://raw.githubusercontent.com/SukiSU-Ultra/SukiSU-Ultra/main/kernel/setup.sh" | bash -s susfs-main
|
||||||
|
```
|
||||||
|
|
||||||
|
## フックの方式
|
||||||
|
|
||||||
|
- この方式は (https://github.com/rsuntk/KernelSU) のフック方式を参照してください。
|
||||||
|
|
||||||
|
1. **KPROBES でフック:**
|
||||||
|
|
||||||
|
- 読み込み可能なカーネルモジュールの場合 (LKM)
|
||||||
|
- GKI カーネルのデフォルトとなるフック方式
|
||||||
|
- `CONFIG_KPROBES=y` が必要です
|
||||||
|
|
||||||
|
2. **手動でフック:**
|
||||||
|
- 標準の KernelSU フック: https://kernelsu.org/guide/how-to-integrate-for-non-gki.html#manually-modify-the-kernel-source
|
||||||
|
- backslashxx syscall フック: https://github.com/backslashxx/KernelSU/issues/5
|
||||||
|
- 非 GKI カーネル用のデフォルトフック方式
|
||||||
|
- `CONFIG_KSU_MANUAL_HOOK=y` が必要です
|
||||||
|
|
||||||
|
## KPM に対応
|
||||||
|
|
||||||
|
- KernelPatch に基づいて重複した KSU の機能を削除、KPM の対応を維持させています。
|
||||||
|
- KPM 機能の整合性を確保するために、APatch の互換機能を更に向上させる予定です。
|
||||||
|
|
||||||
|
オープンソースアドレス: https://github.com/ShirkNeko/SukiSU_KernelPatch_patch
|
||||||
|
|
||||||
|
KPM テンプレートのアドレス: https://github.com/udochina/KPM-Build-Anywhere
|
||||||
|
|
||||||
|
> [!Note]
|
||||||
|
>
|
||||||
|
> 1. `CONFIG_KPM=y` が必要です。
|
||||||
|
> 2. 非 GKI デバイスには `CONFIG_KALLSYMS=y` と `CONFIG_KALLSYMS_ALL=y` も必要です。
|
||||||
|
> 3. いくつかのカーネル `4.19` およびそれ以降のソースコードでは、 `4.19` からバックポートされた `set_memory.h` ヘッダーファイルも必要です。
|
||||||
|
|
||||||
|
## ROOT を保持した状態でのシステムアップデートの方法
|
||||||
|
|
||||||
|
- 始めに OTA 後すぐに再起動せずにマネージャーのカーネルのフラッシュ、パッチのインターフェースを開いて`GKI/非 GKI のインストール`を見つけます。フラッシュする AnyKernel3 の zip ファイルを選択し、フラッシュする実行中のスロットと逆のスロットを選択後に再起動をして GKI モードの更新が保持できます (この方法はすべての非 GKI のデバイスが対応している訳ではないので、自分でお試しください。これは非 GKI のデバイスで TWRP を使用する最も安全な方法です)。
|
||||||
|
- または LKM モードを使用して未使用のスロットにインストールします (OTA 後)。
|
||||||
|
|
||||||
|
## 互換性の状態
|
||||||
|
|
||||||
|
- KernelSU (v1.0.0 より前) は Android GKI 2.0 のデバイス (カーネル 5.10 以降) を公式に対応しています。
|
||||||
|
|
||||||
|
- 古いカーネル (4.4 以降) も互換性がありますが、カーネルを手動で再ビルドする必要があります。
|
||||||
|
|
||||||
|
- KernelSU は追加のリバースポートを通じて 3.x カーネル (3.4-3.18) で対応可能です。
|
||||||
|
|
||||||
|
- 現在 `arm64-v8a`, `armeabi-v7a (bare)` および一部の `X86_64` に対応しています。
|
||||||
|
|
||||||
|
## その他のリンク
|
||||||
|
|
||||||
|
**マネージャーの翻訳を行う場合** https://crowdin.com/project/SukiSU-Ultra
|
||||||
|
|
||||||
|
- [その他パッチ済み GKI](https://github.com/ShirkNeko/GKI_KernelSU_SUSFS) ZRAM パッチ、KPM、susfs が含まれています...
|
||||||
|
- [パッチの少ない GKI](https://github.com/MiRinFork/GKI_SukiSU_SUSFS/releases) susfs のみ
|
||||||
|
- [OnePlus](https://github.com/ShirkNeko/Action_OnePlus_MKSU_SUSFS)
|
||||||
|
|
||||||
|
## 使い方
|
||||||
|
|
||||||
|
### Universal GKI
|
||||||
|
|
||||||
|
**すべて**参照してください https://kernelsu.org/ja_JP/guide/installation.html
|
||||||
|
|
||||||
|
> [!Note]
|
||||||
|
>
|
||||||
|
> 1. Xiaomi、Redmi、Samsung などの GKI 2.0 を搭載したデバイス向け (Meizu、OnePlus、Zenith、Oppo などカーネルが変更されているメーカーを除く)
|
||||||
|
> 2. GKI のビルドは[その他のリンク](#その他のリンク)から入手できます。デバイスのカーネルバージョンを確認してください。ダウンロード後に TWRP またはカーネルフラッシュツールを使用して AnyKernel3 の接頭辞を持つ zip ファイルをフラッシュしてください。Pixel のユーザーは、パッチの少ない GKI を使用する必要があります。
|
||||||
|
> 3. 接頭辞のない .zip アーカイブは圧縮されていません。.gz の接頭辞は Tenguet モデルで使用される圧縮になります。
|
||||||
|
|
||||||
|
### OnePlus
|
||||||
|
|
||||||
|
1. `その他のリンク`の項目に記載されているリンクを開き、デバイス情報を使用してカスタマイズされたカーネルをビルドし、AnyKernel3 の接頭辞を持つ .zip ファイルをフラッシュします。
|
||||||
|
|
||||||
|
> [!Note]
|
||||||
|
>
|
||||||
|
> - 5.10、5.15、6.1、6.6 などのカーネルバージョンの最初の 2 文字のみを入力する必要があります。
|
||||||
|
> - SoC のコードネームは自分で検索してください。通常は、数字がなく英語表記のみです。
|
||||||
|
> - ブランチと構成ファイルは、OnePlus オープンソースカーネルリポジトリから見つけることができます。
|
||||||
|
|
||||||
|
## 機能
|
||||||
|
|
||||||
|
1. カーネルベースな `su` および root アクセスの管理。
|
||||||
|
2. [OverlayFS](https://en.wikipedia.org/wiki/OverlayFS) モジュールシステムではなく、 5ec1cff 氏の [Magic Mount](https://github.com/5ec1cff/KernelSU) に基づいています。
|
||||||
|
3. [アプリプロファイル](https://kernelsu.org/guide/app-profile.html): root 権限をケージ内にロックします。
|
||||||
|
4. 非 GKI / GKI 1.0 の対応を復活
|
||||||
|
5. その他のカスタマイズ
|
||||||
|
6. KPM カーネルモジュールに対応
|
||||||
|
|
||||||
|
## トラブルシューティング
|
||||||
|
|
||||||
|
1. KernelSU Manager のアンインストールが停止してしまう → com.sony.playmemories.mobile のアプリをアンインストールしてください。
|
||||||
|
|
||||||
|
## ライセンス
|
||||||
|
|
||||||
|
- 「kernel」のディレクトリ内のファイルは [GPL-2.0-only](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html) のライセンスに基づいています。
|
||||||
|
- アニメキャラクター画像とスタンプを含むこれらのファイルの `ic_launcher(?!.*alt.*).*` は[怡子曰曰](https://space.bilibili.com/10545509)によって著作権保護されており、画像の Brand Intellectual Property は[明风 OuO](https://space.bilibili.com/274939213)によって所有され、ベクター化は @MiRinChan によって行われています。 これらのファイルを使用する前に、[Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode.txt)を遵守することに加えて、アートコンテンツを使用するために前の 2 人の作者から許可を得る必要があります。
|
||||||
|
- 上記のファイルまたはディレクトリを除き、その他のすべての部分は[GPL-3.0 以降](https://www.gnu.org/licenses/gpl-3.0.html)です。
|
||||||
|
|
||||||
|
## スポンサーシップの一覧
|
||||||
|
|
||||||
|
- [Ktouls](https://github.com/Ktouls) 応援してくれてありがとう
|
||||||
|
- [zaoqi123](https://github.com/zaoqi123) ミルクティーを買ってあげるのも良い考えですね
|
||||||
|
- [wswzgdg](https://github.com/wswzgdg) このプロジェクトにご支援いただき、ありがとうございます
|
||||||
|
- [yspbwx2010](https://github.com/yspbwx2010) ありがとうございます
|
||||||
|
- [DARKWWEE](https://github.com/DARKWWEE) ラオスから 100 USDT の支援に感謝します
|
||||||
|
- [Saksham Singla](https://github.com/TypeFlu) ウェブサイトの提供とメンテナンス
|
||||||
|
- [OukaroMF](https://github.com/OukaroMF) ウェブサイトのドメインと寄付
|
||||||
|
|
||||||
|
## 貢献者
|
||||||
|
|
||||||
|
- [KernelSU](https://github.com/tiann/KernelSU): オリジナルのプロジェクト
|
||||||
|
- [MKSU](https://github.com/5ec1cff/KernelSU): 使用しているプロジェクト
|
||||||
|
- [RKSU](https://github.com/rsuntk/KernelsU): このプロジェクトのカーネルを使用した非 GKI デバイスのサポートの再導入
|
||||||
|
- [susfs](https://gitlab.com/simonpunk/susfs4ksu): susfs ファイルシステムの使用
|
||||||
|
- [KernelSU](https://git.zx2c4.com/kernel-assisted-superuser/about/): KernelSU の概念化
|
||||||
|
- [Magisk](https://github.com/topjohnwu/Magisk): パワフルな root ユーティリティ
|
||||||
|
- [genuine](https://github.com/brevent/genuine/): APK v2 署名認証
|
||||||
|
- [Diamorphine](https://github.com/m0nad/Diamorphine): いくつかの root キットユーティリティ
|
||||||
|
- [KernelPatch](https://github.com/bmax121/KernelPatch): KernelPatch はカーネルモジュールの APatch 実装の重要な部分での活用
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
# SukiSU Ultra
|
# SukiSU Ultra
|
||||||
|
|
||||||
**Türkçe** | [简体中文](README.md) | [English](README-en.md) | [日本語](README-ja.md)
|
[English](../README.md) | [简体中文](../zh/README.md) | [日本語](../ja/README.md) | **Türkçe**
|
||||||
|
|
||||||
[KernelSU](https://github.com/tiann/KernelSU) tabanlı Android cihaz root çözümü
|
[KernelSU](https://github.com/tiann/KernelSU) tabanlı Android cihaz root çözümü
|
||||||
|
|
||||||
@@ -28,10 +28,10 @@ curl -LSs "https://raw.githubusercontent.com/SukiSU-Ultra/SukiSU-Ultra/main/kern
|
|||||||
|
|
||||||
## susfs Nasıl Entegre Edilir
|
## susfs Nasıl Entegre Edilir
|
||||||
|
|
||||||
1. Doğrudan susfs-stable veya susfs-dev dalını kullanın, susfs entegrasyonuna gerek yok
|
1. Doğrudan susfs-main veya susfs-\* dalını kullanın, susfs entegrasyonuna gerek yok
|
||||||
|
|
||||||
```
|
```
|
||||||
curl -LSs "https://raw.githubusercontent.com/SukiSU-Ultra/SukiSU-Ultra/main/kernel/setup.sh" | bash -s susfs-dev
|
curl -LSs "https://raw.githubusercontent.com/SukiSU-Ultra/SukiSU-Ultra/main/kernel/setup.sh" | bash -s susfs-main
|
||||||
```
|
```
|
||||||
|
|
||||||
## Kanca Yöntemleri
|
## Kanca Yöntemleri
|
||||||
@@ -121,7 +121,7 @@ Lütfen **tümünü** https://kernelsu.org/zh_CN/guide/installation.html adresin
|
|||||||
## Lisans
|
## Lisans
|
||||||
|
|
||||||
- `kernel` dizinindeki dosyalar [GPL-2.0-only](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html) lisansı altındadır.
|
- `kernel` dizinindeki dosyalar [GPL-2.0-only](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html) lisansı altındadır.
|
||||||
- Anime karakter ifadeleri içeren `ic_launcher(?!.*alt.*).*` dosyalarının görüntüleri [五十根大虾仁](https://space.bilibili.com/370927) tarafından telif hakkıyla korunmaktadır, görüntülerdeki Marka Fikri Mülkiyeti [明风 OuO](https://space.bilibili.com/274939213)'ye aittir ve vektörleştirme @MiRinChan tarafından yapılmıştır. Bu dosyaları kullanmadan önce, [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode.txt) ile uyumlu olmanın yanı sıra, bu sanatsal içerikleri kullanmak için iki yazarın yetkilendirmesine de uymanız gerekir.
|
- Anime karakter ifadeleri içeren `ic_launcher(?!.*alt.*).*` dosyalarının görüntüleri [怡子曰曰](https://space.bilibili.com/10545509) tarafından telif hakkıyla korunmaktadır, görüntülerdeki Marka Fikri Mülkiyeti [明风 OuO](https://space.bilibili.com/274939213)'ye aittir ve vektörleştirme @MiRinChan tarafından yapılmıştır. Bu dosyaları kullanmadan önce, [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode.txt) ile uyumlu olmanın yanı sıra, bu sanatsal içerikleri kullanmak için iki yazarın yetkilendirmesine de uymanız gerekir.
|
||||||
- Yukarıda belirtilen dosyalar veya dizinler hariç, diğer tüm parçalar [GPL-3.0 veya üzeri](https://www.gnu.org/licenses/gpl-3.0.html)'dir.
|
- Yukarıda belirtilen dosyalar veya dizinler hariç, diğer tüm parçalar [GPL-3.0 veya üzeri](https://www.gnu.org/licenses/gpl-3.0.html)'dir.
|
||||||
|
|
||||||
## Afdian Bağlantısı
|
## Afdian Bağlantısı
|
||||||
65
docs/zakomonochrome-128.svg
Normal file
65
docs/zakomonochrome-128.svg
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||||
|
|
||||||
|
<svg
|
||||||
|
width="128"
|
||||||
|
height="128"
|
||||||
|
viewBox="0 0 128 128"
|
||||||
|
version="1.1"
|
||||||
|
id="svg1"
|
||||||
|
inkscape:version="1.4.2 (ebf0e940d0, 2025-05-08)"
|
||||||
|
sodipodi:docname="zakomonochrome-128.svg"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg">
|
||||||
|
<sodipodi:namedview
|
||||||
|
id="namedview1"
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#999999"
|
||||||
|
borderopacity="1"
|
||||||
|
inkscape:showpageshadow="2"
|
||||||
|
inkscape:pageopacity="0"
|
||||||
|
inkscape:pagecheckerboard="0"
|
||||||
|
inkscape:deskcolor="#d1d1d1"
|
||||||
|
inkscape:document-units="px"
|
||||||
|
inkscape:zoom="2.6185048"
|
||||||
|
inkscape:cx="59.957881"
|
||||||
|
inkscape:cy="71.032903"
|
||||||
|
inkscape:window-width="1280"
|
||||||
|
inkscape:window-height="696"
|
||||||
|
inkscape:window-x="0"
|
||||||
|
inkscape:window-y="0"
|
||||||
|
inkscape:window-maximized="1"
|
||||||
|
inkscape:current-layer="layer1" />
|
||||||
|
<defs
|
||||||
|
id="defs1" />
|
||||||
|
<g
|
||||||
|
inkscape:label="图层 1"
|
||||||
|
inkscape:groupmode="layer"
|
||||||
|
id="layer1">
|
||||||
|
<rect
|
||||||
|
style="fill:#ffffff;stroke:#000000;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.3;stroke-dasharray:none;paint-order:fill markers stroke;fill-opacity:1"
|
||||||
|
id="rect1"
|
||||||
|
width="128"
|
||||||
|
height="128"
|
||||||
|
x="0"
|
||||||
|
y="0"
|
||||||
|
rx="7.772471"
|
||||||
|
ry="7.772471" />
|
||||||
|
<path
|
||||||
|
id="path101"
|
||||||
|
style="fill:#ffffff;fill-opacity:0.734285;stroke:#000000;stroke-width:4.27504;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.3;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke"
|
||||||
|
d="m 42.510282,81.796052 c 0,0 -7.224141,-5.638356 -10.043315,-9.338525 M 14.847106,81.97224 25.41902,71.576535 m 0.17619,-6.695549 2.819179,19.910444 M 11.675534,73.338532 38.281518,71.047931 M 43.567475,62.7666 34.40515,62.942814 M 34.22896,62.590425 33.524162,48.494537 m -18.500855,1.58577 17.972249,-1.409582 m -11.8053,-5.462154 0.352397,18.853251"
|
||||||
|
inkscape:label="杂" />
|
||||||
|
<path
|
||||||
|
id="path111"
|
||||||
|
style="fill:#ffffff;fill-opacity:0.734285;stroke:#000000;stroke-width:3.94824;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.3;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke"
|
||||||
|
d="M 55.912937,82.876745 79.671596,81.412163 M 59.330273,75.391135 74.952411,74.089291 m -9.43837,-14.157553 1.139102,14.645756 m -8.299247,-7.160159 16.273048,-1.464569 m 0.650926,8.136525 0.325472,-14.808482 m -0.162747,0.162739 -17.900363,0.976379 m 0,-0.162738 1.952774,14.645756 m 12.042061,-21.154974 1.464576,-6.346492 m 0,-0.650928 -12.042063,0.650928 m -0.650918,6.509218 0.325459,-8.787441"
|
||||||
|
inkscape:label="鱼" />
|
||||||
|
<path
|
||||||
|
d="m 95.08569,51.121163 c -1.90515,0.116064 -3.64694,0.97349 -4.86738,2.391307 -1.34538,1.56738 -1.91476,3.733159 -1.59523,6.070852 0.40842,2.982962 2.1502,6.17135 5.13887,9.411078 0.63424,0.68546 1.08109,1.129773 1.98202,1.967071 1.58321,1.469144 3.01507,2.634638 4.9875,4.052454 0.70392,0.50905 2.09253,1.453525 2.61627,1.781734 l 0.15133,0.09594 0.22103,-0.140663 c 0.80481,-0.515755 2.23909,-1.504852 3.08956,-2.130057 3.21689,-2.364488 5.79232,-4.737902 7.70228,-7.100167 3.09676,-3.831409 4.4133,-7.562359 3.80549,-10.773058 -0.42043,-2.210414 -1.82588,-4.039057 -3.81992,-4.967887 -0.85767,-0.399664 -1.69132,-0.607312 -2.6355,-0.656431 -1.22285,-0.0647 -2.42648,0.178619 -3.57485,0.721182 -1.95561,0.922124 -3.58927,2.719503 -4.61752,5.081755 -0.072,0.165235 -0.1394,0.310355 -0.14895,0.319295 -0.0312,0.02902 -0.0648,-0.02679 -0.19458,-0.330457 -0.30752,-0.714476 -0.91055,-1.752718 -1.38382,-2.377871 -0.4853,-0.645282 -1.2661,-1.431214 -1.84749,-1.862143 -1.50155,-1.114153 -3.26013,-1.658924 -5.00914,-1.553996 z"
|
||||||
|
id="path1-4"
|
||||||
|
style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.00231605" />
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 3.9 KiB |
101
docs/zh/README.md
Normal file
101
docs/zh/README.md
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
<img align='right' src='zakomonochrome-128.svg' width='100px' alt="logo">
|
||||||
|
|
||||||
|
# SukiSU Ultra
|
||||||
|
|
||||||
|
[English](../README.md) | **简体中文** | [日本語](../ja/README.md) | [Türkçe](../tr/README.md)
|
||||||
|
|
||||||
|
一个 Android 上基于内核的 root 方案,由 [`tiann/KernelSU`](https://github.com/tiann/KernelSU) 分叉而来,添加了一些有趣的变更。
|
||||||
|
|
||||||
|
[](https://github.com/tiann/KernelSU/releases/latest)
|
||||||
|
[](https://t.me/Sukiksu)
|
||||||
|
[](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)
|
||||||
|
[](/LICENSE)
|
||||||
|
|
||||||
|
## 特性
|
||||||
|
|
||||||
|
1. 基于内核的 `su` 和权限管理。
|
||||||
|
2. 基于 [Magic Mount](https://github.com/5ec1cff/KernelSU) 的模块系统。
|
||||||
|
3. [App Profile](https://kernelsu.org/zh_CN/guide/app-profile.html): 把 Root 权限关进笼子里。
|
||||||
|
4. 支持 non-GKI 与 GKI 1.0。
|
||||||
|
5. KPM 支持
|
||||||
|
6. 可调整管理器外观,可自定义 susfs 配置。
|
||||||
|
|
||||||
|
## 兼容状态
|
||||||
|
|
||||||
|
- KernelSU 官方支持 GKI 2.0 的设备(内核版本 5.10 以上)。
|
||||||
|
|
||||||
|
- 旧内核也是兼容的(最低 4.14+),不过需要自己编译内核。
|
||||||
|
|
||||||
|
- 通过更多的反向移植,KernelSU 可以支持 3.x 内核(3.4-3.18)。
|
||||||
|
|
||||||
|
- 目前支持架构 : `arm64-v8a`、`armeabi-v7a (bare)`、`X86_64`。
|
||||||
|
|
||||||
|
## 安装指导
|
||||||
|
|
||||||
|
查看 [`guide/installation.md`](guide/installation.md)
|
||||||
|
|
||||||
|
## 集成指导
|
||||||
|
|
||||||
|
查看 [`guide/how-to-integrate.md`](guide/how-to-integrate.md)
|
||||||
|
|
||||||
|
## 参与翻译
|
||||||
|
|
||||||
|
要将 SukiSU 翻译成您的语言,或完善现有的翻译,请使用 [Crowdin](https://crowdin.com/project/SukiSU-Ultra).
|
||||||
|
|
||||||
|
## KPM 支持
|
||||||
|
|
||||||
|
- 基于 KernelPatch 开发,移除了与 KernelSU 重复的功能。
|
||||||
|
- 正在进行(WIP):通过集成附加功能来扩展 APatch 兼容性,以确保跨不同实现的兼容性。
|
||||||
|
|
||||||
|
**开源仓库**: [https://github.com/ShirkNeko/SukiSU_KernelPatch_patch](https://github.com/ShirkNeko/SukiSU_KernelPatch_patch)
|
||||||
|
|
||||||
|
**KPM 模板**: [https://github.com/udochina/KPM-Build-Anywhere](https://github.com/udochina/KPM-Build-Anywhere)
|
||||||
|
|
||||||
|
> [!Note]
|
||||||
|
>
|
||||||
|
> 1. 需要 `CONFIG_KPM=y`
|
||||||
|
> 2. Non-GKI 设备需要 `CONFIG_KALLSYMS=y` and `CONFIG_KALLSYMS_ALL=y`
|
||||||
|
> 3. 对于低于 `4.19` 的内核,需要从 `4.19` 的 `set_memory.h` 进行反向移植。
|
||||||
|
|
||||||
|
## 故障排除
|
||||||
|
|
||||||
|
1. 卸载管理器后系统卡住?
|
||||||
|
卸载 _com.sony.playmemories.mobile_
|
||||||
|
|
||||||
|
## 许可证
|
||||||
|
|
||||||
|
- 目录 `kernel` 下所有文件为 [GPL-2.0-only](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)。
|
||||||
|
- 有动漫人物图片表情包的这些文件 `ic_launcher(?!.*alt.*).*` 的图像版权为[怡子曰曰](https://space.bilibili.com/10545509)所有,图像中的知识产权由[明风 OuO](https://space.bilibili.com/274939213)所有,矢量化由 @MiRinChan 完成,在使用这些文件之前,除了必须遵守 [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode.txt) 以外,还需要遵守向前两者索要使用这些艺术内容的授权。
|
||||||
|
- 除上述文件及目录的其他部分均为 [GPL-3.0-or-later](https://www.gnu.org/licenses/gpl-3.0.html)。
|
||||||
|
|
||||||
|
## 赞助
|
||||||
|
|
||||||
|
- [ShirkNeko](https://afdian.com/a/shirkneko) (SukiSU 主要维护者)
|
||||||
|
- [weishu](https://github.com/sponsors/tiann) (KernelSU 作者)
|
||||||
|
|
||||||
|
## ShirkNeko 的赞助列表
|
||||||
|
|
||||||
|
- [Ktouls](https://github.com/Ktouls) 非常感谢你给我带来的支持
|
||||||
|
- [zaoqi123](https://github.com/zaoqi123) 请我喝奶茶也不错
|
||||||
|
- [wswzgdg](https://github.com/wswzgdg) 非常感谢对此项目的支持
|
||||||
|
- [yspbwx2010](https://github.com/yspbwx2010) 非常感谢
|
||||||
|
- [DARKWWEE](https://github.com/DARKWWEE) 感谢老哥的 100 USDT
|
||||||
|
- [Saksham Singla](https://github.com/TypeFlu) 网站的提供以及维护
|
||||||
|
- [OukaroMF](https://github.com/OukaroMF) 网站域名捐赠
|
||||||
|
|
||||||
|
## 鸣谢
|
||||||
|
|
||||||
|
- [KernelSU](https://github.com/tiann/KernelSU): 上游
|
||||||
|
- [MKSU](https://github.com/5ec1cff/KernelSU): 魔法坐骑支持
|
||||||
|
- [RKSU](https://github.com/rsuntk/KernelsU): non-GKI 支持
|
||||||
|
- [susfs](https://gitlab.com/simonpunk/susfs4ksu): 隐藏内核补丁以及用户空间模组的 KernelSU 附件
|
||||||
|
- [KernelPatch](https://github.com/bmax121/KernelPatch): KernelPatch 是内核模块 APatch 实现的关键部分
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>KernelSU 的鸣谢</summary>
|
||||||
|
|
||||||
|
- [kernel-assisted-superuser](https://git.zx2c4.com/kernel-assisted-superuser/about/):KernelSU 的灵感。
|
||||||
|
- [Magisk](https://github.com/topjohnwu/Magisk):强大的 root 工具箱。
|
||||||
|
- [genuine](https://github.com/brevent/genuine/):apk v2 签名验证。
|
||||||
|
- [Diamorphine](https://github.com/m0nad/Diamorphine):一些 rootkit 技巧。
|
||||||
|
</details>
|
||||||
97
docs/zh/guide/how-to-integrate.md
Normal file
97
docs/zh/guide/how-to-integrate.md
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
# 集成指导
|
||||||
|
|
||||||
|
SukiSU 可以集成到 GKI 和 non-GKI 内核中,并且已反向移植到 4.14 版本。
|
||||||
|
|
||||||
|
<!-- 应该是 3.4 版本,但 backslashxx 的 syscall manual hook 无法在 SukiSU 中使用-->
|
||||||
|
|
||||||
|
有些 OEM 定制可能导致多达 50% 的内核代码超出内核树代码,而非来自上游 Linux 内核或 ACK。因此,non-GKI 内核的定制特性导致了严重的内核碎片化,而且我们缺乏构建它们的通用方法。因此,我们无法提供 non-GKI 内核的启动映像。
|
||||||
|
|
||||||
|
前提条件:开源的、可启动的内核。
|
||||||
|
|
||||||
|
## Hook 方法
|
||||||
|
|
||||||
|
1. **KPROBES hook:**
|
||||||
|
|
||||||
|
- GKI kernels 的默认 hook 方法。
|
||||||
|
- 需要 `# CONFIG_KSU_MANUAL_HOOK is not set`(未设定) & `CONFIG_KPROBES=y`
|
||||||
|
- 用作可加载的内核模块 (LKM).
|
||||||
|
|
||||||
|
2. **Manual hook:**
|
||||||
|
|
||||||
|
<!-- - backslashxx's syscall manual hook: https://github.com/backslashxx/KernelSU/issues/5 (v1.5 version is not available at the moment, if you want to use it, please use v1.4 version, or standard KernelSU hooks)-->
|
||||||
|
|
||||||
|
- 需要 `CONFIG_KSU_MANUAL_HOOK=y`
|
||||||
|
- 需要 [`guide/how-to-integrate.md`](how-to-integrate.md)
|
||||||
|
- 需要 [https://github.com/~](https://github.com/tiann/KernelSU/blob/main/website/docs/guide/how-to-integrate-for-non-gki.md#manually-modify-the-kernel-source)
|
||||||
|
|
||||||
|
3. **Tracepoint Hook:**
|
||||||
|
|
||||||
|
- 自 SukiSU commit [49b01aad](https://github.com/SukiSU-Ultra/SukiSU-Ultra/commit/49b01aad74bcca6dba5a8a2e053bb54b648eb124) 引入的 hook 方法
|
||||||
|
- 需要 `CONFIG_KSU_TRACEPOINT_HOOK=y`
|
||||||
|
- 需要 [`guide/tracepoint-hook.md`](tracepoint-hook.md)
|
||||||
|
|
||||||
|
<!-- This part refer to [rsuntk/KernelSU](https://github.com/rsuntk/KernelSU). -->
|
||||||
|
|
||||||
|
如果您能够构建可启动内核,有两种方法可以将 KernelSU 集成到内核源代码中:
|
||||||
|
|
||||||
|
1. 使用 `kprobe` 自动集成
|
||||||
|
2. 手动集成
|
||||||
|
|
||||||
|
## 与 kprobe 集成
|
||||||
|
|
||||||
|
适用:
|
||||||
|
|
||||||
|
- GKI 内核
|
||||||
|
|
||||||
|
不适用:
|
||||||
|
|
||||||
|
- non-GKI 内核
|
||||||
|
|
||||||
|
KernelSU 使用 kprobe 机制来做内核的相关 hook,如果 _kprobe_ 可以在你编译的内核中正常运行,那么推荐用这个方法来集成。
|
||||||
|
|
||||||
|
请参阅此文档 [https://github.com/~](https://github.com/tiann/KernelSU/blob/main/website/docs/guide/how-to-integrate-for-non-gki.md#integrate-with-kprobe)。虽然标题为“适用于 non-GKI”,但仅适用于 GKI。
|
||||||
|
|
||||||
|
替换 KernelSU 添加到内核源代码树的步骤的执行命令为:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
curl -LSs "https://raw.githubusercontent.com/SukiSU-Ultra/SukiSU-Ultra/main/kernel/setup.sh" | bash -s main
|
||||||
|
```
|
||||||
|
|
||||||
|
## 手动修改内核源代码
|
||||||
|
|
||||||
|
适用:
|
||||||
|
|
||||||
|
- GKI 内核
|
||||||
|
- non-GKI 内核
|
||||||
|
|
||||||
|
请参考此文档 [https://github.com/~ (non-GKI 内核集成)](https://github.com/tiann/KernelSU/blob/main/website/docs/guide/how-to-integrate-for-non-gki.md#manually-modify-the-kernel-source) 和 [https://github.com/~ (GKI 内核构建)](https://kernelsu.org/zh_CN/guide/how-to-build.html) 进行手动集成。虽然第一个链接的标题是“适用于 non-GKI”,但它也适用于 GKI。两者都可以正常工作。
|
||||||
|
|
||||||
|
还有另一种集成方法,但是仍在开发中。
|
||||||
|
|
||||||
|
<!-- 这是 backslashxx 的syscall manual hook,但目前无法使用。 -->
|
||||||
|
|
||||||
|
将 KernelSU(SukiSU)添加到内核源代码树的步骤的运行命令将被替换为:
|
||||||
|
|
||||||
|
### GKI 内核
|
||||||
|
|
||||||
|
```sh
|
||||||
|
curl -LSs "https://raw.githubusercontent.com/SukiSU-Ultra/SukiSU-Ultra/main/kernel/setup.sh" | bash -s main
|
||||||
|
```
|
||||||
|
|
||||||
|
### non-GKI 内核
|
||||||
|
|
||||||
|
```sh
|
||||||
|
curl -LSs "https://raw.githubusercontent.com/SukiSU-Ultra/SukiSU-Ultra/main/kernel/setup.sh" | bash -s nongki
|
||||||
|
```
|
||||||
|
|
||||||
|
### 带有 susfs 的 GKI / non-GKI 内核(实验)
|
||||||
|
|
||||||
|
```sh
|
||||||
|
curl -LSs "https://raw.githubusercontent.com/SukiSU-Ultra/SukiSU-Ultra/main/kernel/setup.sh" | bash -s susfs-{{branch}}
|
||||||
|
```
|
||||||
|
|
||||||
|
分支:
|
||||||
|
|
||||||
|
- `main` (susfs-main)
|
||||||
|
- `test` (susfs-test)
|
||||||
|
- 版本号 (例如: susfs-1.5.7, 你需要在 [分支](https://github.com/SukiSU-Ultra/SukiSU-Ultra/branches) 里找到它)
|
||||||
34
docs/zh/guide/installation.md
Normal file
34
docs/zh/guide/installation.md
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
# 安装指导
|
||||||
|
|
||||||
|
您可以前往 [KernelSU 文档 - 安装](https://kernelsu.org/guide/installation.html) 获取有关如何安装的参考,这里只是额外的说明。
|
||||||
|
|
||||||
|
## 通过加载可加载内核模块 (LKM) 进行安装
|
||||||
|
|
||||||
|
请参阅 [KernelSU 文档 - LKM 安装](https://kernelsu.org/guide/installation.html#lkm-installation)
|
||||||
|
|
||||||
|
从 **Android™**(商标,意为获得 Google 移动服务的许可)12 开始,搭载内核版本 5.10 或更高版本的设备必须搭载 GKI 内核。因此你或许可以使用 LKM 模式。
|
||||||
|
|
||||||
|
## 通过安装内核进行安装
|
||||||
|
|
||||||
|
请参阅 [KernelSU 文档 - GKI 模式安装](https://kernelsu.org/guide/installation.html#gki-mode-installation)
|
||||||
|
|
||||||
|
我们提供预编译的内核供您使用:
|
||||||
|
|
||||||
|
- [ShirkNeko 内核](https://github.com/ShirkNeko/GKI_KernelSU_SUSFS)(添加了 ZRAM 压缩算法补丁、susfs 文件和 KPM 文件。适用于很多设备。)
|
||||||
|
- [MiRinFork 内核](https://github.com/MiRinFork/GKI_SukiSU_SUSFS)(添加了 susfs 文件和 KPM 文件。最接近 GKI 的内核,适用于大多数设备。)
|
||||||
|
|
||||||
|
虽然某些设备可以使用 LKM 模式安装,但无法使用 GKI 内核将其安装到设备上;因此,需要手动修改内核进行编译。例如:
|
||||||
|
|
||||||
|
- 欧珀(一加、真我)
|
||||||
|
- 魅族
|
||||||
|
|
||||||
|
此外,我们还为您的 OnePlus 设备提供预编译的内核:
|
||||||
|
|
||||||
|
- [ShirkNeko/Action_OnePlus_MKSU_SUSFS](https://github.com/ShirkNeko/Action_OnePlus_MKSU_SUSFS)(添加 ZRAM 压缩算法补丁、susfs 和 KPM。)
|
||||||
|
|
||||||
|
使用上面的链接,Fork 到 GitHub Action,填写构建参数,进行编译,最后将 zip 文件以 AnyKernel3 后缀上传到 GitHub Action。
|
||||||
|
|
||||||
|
> [!Note]
|
||||||
|
>
|
||||||
|
> - 使用时,您只需填写版本号的前两部分,例如 `5.10`、`6.1`...
|
||||||
|
> - 使用前请确保您了解处理器名称、内核版本等信息。
|
||||||
270
docs/zh/guide/tracepoint-hook.md
Normal file
270
docs/zh/guide/tracepoint-hook.md
Normal file
@@ -0,0 +1,270 @@
|
|||||||
|
# Tracepoint Hook 集成
|
||||||
|
|
||||||
|
## 介绍
|
||||||
|
|
||||||
|
自 commit [49b01aad](https://github.com/SukiSU-Ultra/SukiSU-Ultra/commit/49b01aad74bcca6dba5a8a2e053bb54b648eb124) 起,SukiSU 引入了 Tracepoint Hook
|
||||||
|
|
||||||
|
该 Hook 理论上相比于 Kprobes Hook,性能开销更小,但次于 Manual Hook / Syscall Hook
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
> 本教程参考了 [backslashxx/KernelSU#5](https://github.com/backslashxx/KernelSU/issues/5) 的 syscall hook v1.4 版本钩子,以及原版 KernelSU 的 [Manual Hook](https://kernelsu.org/guide/how-to-integrate-for-non-gki.html#manually-modify-the-kernel-source)
|
||||||
|
|
||||||
|
## Guide
|
||||||
|
|
||||||
|
### execve 钩子(`exec.c`)
|
||||||
|
|
||||||
|
一般需要修改 `fs/exec.c` 的 `do_execve` 和 `compat_do_execve` 方法
|
||||||
|
|
||||||
|
```patch
|
||||||
|
--- a/fs/exec.c
|
||||||
|
+++ b/fs/exec.c
|
||||||
|
@@ -78,6 +78,10 @@
|
||||||
|
#include <trace/hooks/sched.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
+#if defined(CONFIG_KSU) && defined(CONFIG_KSU_TRACEPOINT_HOOK)
|
||||||
|
+#include <../drivers/kernelsu/ksu_trace.h>
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
EXPORT_TRACEPOINT_SYMBOL_GPL(task_rename);
|
||||||
|
|
||||||
|
static int bprm_creds_from_file(struct linux_binprm *bprm);
|
||||||
|
@@ -2037,6 +2041,9 @@ static int do_execve(struct filename *filename,
|
||||||
|
{
|
||||||
|
struct user_arg_ptr argv = { .ptr.native = __argv };
|
||||||
|
struct user_arg_ptr envp = { .ptr.native = __envp };
|
||||||
|
+#if defined(CONFIG_KSU) && defined(CONFIG_KSU_TRACEPOINT_HOOK)
|
||||||
|
+ trace_ksu_trace_execveat_hook((int *)AT_FDCWD, &filename, &argv, &envp, 0);
|
||||||
|
+#endif
|
||||||
|
return do_execveat_common(AT_FDCWD, filename, argv, envp, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -2064,6 +2071,9 @@ static int compat_do_execve(struct filename *filename,
|
||||||
|
.is_compat = true,
|
||||||
|
.ptr.compat = __envp,
|
||||||
|
};
|
||||||
|
+#if defined(CONFIG_KSU) && defined(CONFIG_KSU_TRACEPOINT_HOOK)
|
||||||
|
+ trace_ksu_trace_execveat_sucompat_hook((int *)AT_FDCWD, &filename, NULL, NULL, NULL); /* 32-bit su */
|
||||||
|
+#endif
|
||||||
|
return do_execveat_common(AT_FDCWD, filename, argv, envp, 0);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### faccessat 钩子 (`open.c`)
|
||||||
|
|
||||||
|
一般需要修改 `/fs/open.c` 的 `do_faccessat` 方法
|
||||||
|
|
||||||
|
```patch
|
||||||
|
--- a/fs/open.c
|
||||||
|
+++ b/fs/open.c
|
||||||
|
@@ -37,6 +37,10 @@
|
||||||
|
#include "internal.h"
|
||||||
|
#include <trace/hooks/syscall_check.h>
|
||||||
|
|
||||||
|
+#if defined(CONFIG_KSU) && defined(CONFIG_KSU_TRACEPOINT_HOOK)
|
||||||
|
+#include <../drivers/kernelsu/ksu_trace.h>
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
int do_truncate(struct user_namespace *mnt_userns, struct dentry *dentry,
|
||||||
|
loff_t length, unsigned int time_attrs, struct file *filp)
|
||||||
|
{
|
||||||
|
@@ -468,6 +472,9 @@ static long do_faccessat(int dfd, const char __user *filename, int mode, int fla
|
||||||
|
|
||||||
|
SYSCALL_DEFINE3(faccessat, int, dfd, const char __user *, filename, int, mode)
|
||||||
|
{
|
||||||
|
+#if defined(CONFIG_KSU) && defined(CONFIG_KSU_TRACEPOINT_HOOK)
|
||||||
|
+ trace_ksu_trace_faccessat_hook(&dfd, &filename, &mode, NULL);
|
||||||
|
+#endif
|
||||||
|
return do_faccessat(dfd, filename, mode, 0);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
如果没有 `do_faccessat` 方法,可以找 `faccessat` 的 SYSCALL 定义(对于早于 4.17 的内核)
|
||||||
|
|
||||||
|
```patch
|
||||||
|
--- a/fs/open.c
|
||||||
|
+++ b/fs/open.c
|
||||||
|
@@ -31,6 +31,9 @@
|
||||||
|
#include <linux/ima.h>
|
||||||
|
#include <linux/dnotify.h>
|
||||||
|
#include <linux/compat.h>
|
||||||
|
+#if defined(CONFIG_KSU) && defined(CONFIG_KSU_TRACEPOINT_HOOK)
|
||||||
|
+#include <../drivers/kernelsu/ksu_trace.h>
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
#include "internal.h"
|
||||||
|
|
||||||
|
@@ -369,6 +372,9 @@ SYSCALL_DEFINE3(faccessat, int, dfd, const char __user *, filename, int, mode)
|
||||||
|
int res;
|
||||||
|
unsigned int lookup_flags = LOOKUP_FOLLOW;
|
||||||
|
|
||||||
|
+#if defined(CONFIG_KSU) && defined(CONFIG_KSU_TRACEPOINT_HOOK)
|
||||||
|
+ trace_ksu_trace_faccessat_hook(&dfd, &filename, &mode, NULL);
|
||||||
|
+#endif
|
||||||
|
if (mode & ~S_IRWXO) /* where's F_OK, X_OK, W_OK, R_OK? */
|
||||||
|
return -EINVAL;
|
||||||
|
```
|
||||||
|
|
||||||
|
### sys_read 钩子 ( `read_write.c` )
|
||||||
|
|
||||||
|
需要修改 `fs/read_write.c` 的 `sys_read` 方法(4.19 及以上)
|
||||||
|
|
||||||
|
```patch
|
||||||
|
--- a/fs/read_write.c
|
||||||
|
+++ b/fs/read_write.c
|
||||||
|
@@ -25,6 +25,10 @@
|
||||||
|
#include <linux/uaccess.h>
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
|
||||||
|
+#if defined(CONFIG_KSU) && defined(CONFIG_KSU_TRACEPOINT_HOOK)
|
||||||
|
+#include <../drivers/kernelsu/ksu_trace.h>
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
const struct file_operations generic_ro_fops = {
|
||||||
|
.llseek = generic_file_llseek,
|
||||||
|
.read_iter = generic_file_read_iter,
|
||||||
|
@@ -630,6 +634,9 @@ ssize_t ksys_read(unsigned int fd, char __user *buf, size_t count)
|
||||||
|
|
||||||
|
SYSCALL_DEFINE3(read, unsigned int, fd, char __user *, buf, size_t, count)
|
||||||
|
{
|
||||||
|
+#if defined(CONFIG_KSU) && defined(CONFIG_KSU_TRACEPOINT_HOOK)
|
||||||
|
+ trace_ksu_trace_sys_read_hook(fd, &buf, &count);
|
||||||
|
+#endif
|
||||||
|
return ksys_read(fd, buf, count);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
或者是 `read` 的 SYSCALL 定义(4.14 及以下)
|
||||||
|
|
||||||
|
```patch
|
||||||
|
--- a/fs/read_write.c
|
||||||
|
+++ b/fs/read_write.c
|
||||||
|
@@ -25,6 +25,11 @@
|
||||||
|
#include <linux/uaccess.h>
|
||||||
|
#include <asm/unistd.h>
|
||||||
|
|
||||||
|
+#if defined(CONFIG_KSU) && defined(CONFIG_KSU_TRACEPOINT_HOOK)
|
||||||
|
+#include <../drivers/kernelsu/ksu_trace.h>
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
+
|
||||||
|
const struct file_operations generic_ro_fops = {
|
||||||
|
.llseek = generic_file_llseek,
|
||||||
|
.read_iter = generic_file_read_iter,
|
||||||
|
@@ -575,6 +580,9 @@ SYSCALL_DEFINE3(read, unsigned int, fd, char __user *, buf, size_t, count)
|
||||||
|
|
||||||
|
if (f.file) {
|
||||||
|
loff_t pos = file_pos_read(f.file);
|
||||||
|
+#if defined(CONFIG_KSU) && defined(CONFIG_KSU_TRACEPOINT_HOOK)
|
||||||
|
+ trace_ksu_trace_sys_read_hook(fd, &buf, &count);
|
||||||
|
+#endif
|
||||||
|
ret = vfs_read(f.file, buf, count, &pos);
|
||||||
|
if (ret >= 0)
|
||||||
|
file_pos_write(f.file, pos);
|
||||||
|
```
|
||||||
|
|
||||||
|
### fstatat 钩子 ( `stat.c` )
|
||||||
|
|
||||||
|
需要修改 `stat.c` 的 `newfstatat` SYSCALL 定义
|
||||||
|
|
||||||
|
如果需要 32 位支持,还需要修改 `statat64` SYSCALL 定义
|
||||||
|
|
||||||
|
```patch
|
||||||
|
--- a/fs/stat.c
|
||||||
|
+++ b/fs/stat.c
|
||||||
|
@@ -24,6 +24,10 @@
|
||||||
|
#include "internal.h"
|
||||||
|
#include "mount.h"
|
||||||
|
|
||||||
|
+#if defined(CONFIG_KSU) && defined(CONFIG_KSU_TRACEPOINT_HOOK)
|
||||||
|
+#include <../drivers/kernelsu/ksu_trace.h>
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
/**
|
||||||
|
* generic_fillattr - Fill in the basic attributes from the inode struct
|
||||||
|
* @mnt_userns: user namespace of the mount the inode was found from
|
||||||
|
@@ -408,6 +412,10 @@ SYSCALL_DEFINE4(newfstatat, int, dfd, const char __user *, filename,
|
||||||
|
struct kstat stat;
|
||||||
|
int error;
|
||||||
|
|
||||||
|
+#if defined(CONFIG_KSU) && defined(CONFIG_KSU_TRACEPOINT_HOOK)
|
||||||
|
+ trace_ksu_trace_stat_hook(&dfd, &filename, &flag);
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
error = vfs_fstatat(dfd, filename, &stat, flag);
|
||||||
|
if (error)
|
||||||
|
return error;
|
||||||
|
@@ -559,6 +567,10 @@ SYSCALL_DEFINE4(fstatat64, int, dfd, const char __user *, filename,
|
||||||
|
struct kstat stat;
|
||||||
|
int error;
|
||||||
|
|
||||||
|
+#if defined(CONFIG_KSU) && defined(CONFIG_KSU_TRACEPOINT_HOOK)
|
||||||
|
+ trace_ksu_trace_stat_hook(&dfd, &filename, &flag); /* 32-bit su support */
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
error = vfs_fstatat(dfd, filename, &stat, flag);
|
||||||
|
if (error)
|
||||||
|
return error;
|
||||||
|
```
|
||||||
|
|
||||||
|
### input 钩子 (`input.c` ,用于进入KSU系的内置安全模式)
|
||||||
|
|
||||||
|
需要修改 `drivers/input/input.c` 的 `input_event` 方法,而不是 `input_handle_event`
|
||||||
|
|
||||||
|
```patch
|
||||||
|
--- a/drivers/input/input.c
|
||||||
|
+++ b/drivers/input/input.c
|
||||||
|
@@ -26,6 +26,10 @@
|
||||||
|
#include "input-compat.h"
|
||||||
|
#include "input-poller.h"
|
||||||
|
|
||||||
|
+#if defined(CONFIG_KSU) && defined(CONFIG_KSU_TRACEPOINT_HOOK)
|
||||||
|
+#include <../../drivers/kernelsu/ksu_trace.h>
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
MODULE_AUTHOR("Vojtech Pavlik <vojtech@suse.cz>");
|
||||||
|
MODULE_DESCRIPTION("Input core");
|
||||||
|
MODULE_LICENSE("GPL");
|
||||||
|
@@ -451,6 +455,10 @@ void input_event(struct input_dev *dev,
|
||||||
|
{
|
||||||
|
unsigned long flags;
|
||||||
|
|
||||||
|
+#if defined(CONFIG_KSU) && defined(CONFIG_KSU_TRACEPOINT_HOOK)
|
||||||
|
+ trace_ksu_trace_input_hook(&type, &code, &value);
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
if (is_event_supported(type, dev->evbit, EV_MAX)) {
|
||||||
|
|
||||||
|
spin_lock_irqsave(&dev->event_lock, flags);
|
||||||
|
```
|
||||||
|
|
||||||
|
### devpts 钩子 (`pty.c`)
|
||||||
|
|
||||||
|
需要修改 `drivers/tty/pty.c` 的 `pts_unix98_lookup` 方法
|
||||||
|
|
||||||
|
```patch
|
||||||
|
--- a/drivers/tty/pty.c
|
||||||
|
+++ b/drivers/tty/pty.c
|
||||||
|
@@ -31,6 +31,10 @@
|
||||||
|
#include <linux/compat.h>
|
||||||
|
#include "tty.h"
|
||||||
|
|
||||||
|
+#if defined(CONFIG_KSU) && defined(CONFIG_KSU_TRACEPOINT_HOOK)
|
||||||
|
+#include <../../drivers/kernelsu/ksu_trace.h>
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
#undef TTY_DEBUG_HANGUP
|
||||||
|
#ifdef TTY_DEBUG_HANGUP
|
||||||
|
# define tty_debug_hangup(tty, f, args...) tty_debug(tty, f, ##args)
|
||||||
|
@@ -707,6 +711,10 @@ static struct tty_struct *pts_unix98_lookup(struct tty_driver *driver,
|
||||||
|
{
|
||||||
|
struct tty_struct *tty;
|
||||||
|
|
||||||
|
+#if defined(CONFIG_KSU) && defined(CONFIG_KSU_TRACEPOINT_HOOK)
|
||||||
|
+ trace_ksu_trace_devpts_hook((struct inode *)file->f_path.dentry->d_inode);
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
mutex_lock(&devpts_mutex);
|
||||||
|
tty = devpts_get_priv(file->f_path.dentry);
|
||||||
|
mutex_unlock(&devpts_mutex);
|
||||||
|
```
|
||||||
65
docs/zh/zakomonochrome-128.svg
Normal file
65
docs/zh/zakomonochrome-128.svg
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||||
|
|
||||||
|
<svg
|
||||||
|
width="128"
|
||||||
|
height="128"
|
||||||
|
viewBox="0 0 128 128"
|
||||||
|
version="1.1"
|
||||||
|
id="svg1"
|
||||||
|
inkscape:version="1.4.2 (ebf0e940d0, 2025-05-08)"
|
||||||
|
sodipodi:docname="zakomonochrome-128.svg"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg">
|
||||||
|
<sodipodi:namedview
|
||||||
|
id="namedview1"
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#999999"
|
||||||
|
borderopacity="1"
|
||||||
|
inkscape:showpageshadow="2"
|
||||||
|
inkscape:pageopacity="0"
|
||||||
|
inkscape:pagecheckerboard="0"
|
||||||
|
inkscape:deskcolor="#d1d1d1"
|
||||||
|
inkscape:document-units="px"
|
||||||
|
inkscape:zoom="2.6185048"
|
||||||
|
inkscape:cx="59.957881"
|
||||||
|
inkscape:cy="71.032903"
|
||||||
|
inkscape:window-width="1280"
|
||||||
|
inkscape:window-height="696"
|
||||||
|
inkscape:window-x="0"
|
||||||
|
inkscape:window-y="0"
|
||||||
|
inkscape:window-maximized="1"
|
||||||
|
inkscape:current-layer="layer1" />
|
||||||
|
<defs
|
||||||
|
id="defs1" />
|
||||||
|
<g
|
||||||
|
inkscape:label="图层 1"
|
||||||
|
inkscape:groupmode="layer"
|
||||||
|
id="layer1">
|
||||||
|
<rect
|
||||||
|
style="fill:#ffffff;stroke:#000000;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.3;stroke-dasharray:none;paint-order:fill markers stroke;fill-opacity:1"
|
||||||
|
id="rect1"
|
||||||
|
width="128"
|
||||||
|
height="128"
|
||||||
|
x="0"
|
||||||
|
y="0"
|
||||||
|
rx="7.772471"
|
||||||
|
ry="7.772471" />
|
||||||
|
<path
|
||||||
|
id="path101"
|
||||||
|
style="fill:#ffffff;fill-opacity:0.734285;stroke:#000000;stroke-width:4.27504;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.3;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke"
|
||||||
|
d="m 42.510282,81.796052 c 0,0 -7.224141,-5.638356 -10.043315,-9.338525 M 14.847106,81.97224 25.41902,71.576535 m 0.17619,-6.695549 2.819179,19.910444 M 11.675534,73.338532 38.281518,71.047931 M 43.567475,62.7666 34.40515,62.942814 M 34.22896,62.590425 33.524162,48.494537 m -18.500855,1.58577 17.972249,-1.409582 m -11.8053,-5.462154 0.352397,18.853251"
|
||||||
|
inkscape:label="杂" />
|
||||||
|
<path
|
||||||
|
id="path111"
|
||||||
|
style="fill:#ffffff;fill-opacity:0.734285;stroke:#000000;stroke-width:3.94824;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.3;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke"
|
||||||
|
d="M 55.912937,82.876745 79.671596,81.412163 M 59.330273,75.391135 74.952411,74.089291 m -9.43837,-14.157553 1.139102,14.645756 m -8.299247,-7.160159 16.273048,-1.464569 m 0.650926,8.136525 0.325472,-14.808482 m -0.162747,0.162739 -17.900363,0.976379 m 0,-0.162738 1.952774,14.645756 m 12.042061,-21.154974 1.464576,-6.346492 m 0,-0.650928 -12.042063,0.650928 m -0.650918,6.509218 0.325459,-8.787441"
|
||||||
|
inkscape:label="鱼" />
|
||||||
|
<path
|
||||||
|
d="m 95.08569,51.121163 c -1.90515,0.116064 -3.64694,0.97349 -4.86738,2.391307 -1.34538,1.56738 -1.91476,3.733159 -1.59523,6.070852 0.40842,2.982962 2.1502,6.17135 5.13887,9.411078 0.63424,0.68546 1.08109,1.129773 1.98202,1.967071 1.58321,1.469144 3.01507,2.634638 4.9875,4.052454 0.70392,0.50905 2.09253,1.453525 2.61627,1.781734 l 0.15133,0.09594 0.22103,-0.140663 c 0.80481,-0.515755 2.23909,-1.504852 3.08956,-2.130057 3.21689,-2.364488 5.79232,-4.737902 7.70228,-7.100167 3.09676,-3.831409 4.4133,-7.562359 3.80549,-10.773058 -0.42043,-2.210414 -1.82588,-4.039057 -3.81992,-4.967887 -0.85767,-0.399664 -1.69132,-0.607312 -2.6355,-0.656431 -1.22285,-0.0647 -2.42648,0.178619 -3.57485,0.721182 -1.95561,0.922124 -3.58927,2.719503 -4.61752,5.081755 -0.072,0.165235 -0.1394,0.310355 -0.14895,0.319295 -0.0312,0.02902 -0.0648,-0.02679 -0.19458,-0.330457 -0.30752,-0.714476 -0.91055,-1.752718 -1.38382,-2.377871 -0.4853,-0.645282 -1.2661,-1.431214 -1.84749,-1.862143 -1.50155,-1.114153 -3.26013,-1.658924 -5.00914,-1.553996 z"
|
||||||
|
id="path1-4"
|
||||||
|
style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.00231605" />
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 3.9 KiB |
@@ -24,5 +24,34 @@ config KPM
|
|||||||
Enabling this option will activate the KPM feature of SukiSU.
|
Enabling this option will activate the KPM feature of SukiSU.
|
||||||
This option is suitable for scenarios where you need to force KPM to be enabled.
|
This option is suitable for scenarios where you need to force KPM to be enabled.
|
||||||
but it may affect system stability.
|
but it may affect system stability.
|
||||||
|
select KALLSYMS
|
||||||
|
select KALLSYMS_ALL
|
||||||
|
|
||||||
|
choice
|
||||||
|
prompt "KernelSU hook type"
|
||||||
|
depends on KSU
|
||||||
|
default KSU_KPROBES_HOOK
|
||||||
|
help
|
||||||
|
Hook type for KernelSU
|
||||||
|
|
||||||
|
config KSU_KPROBES_HOOK
|
||||||
|
bool "Hook KernelSU with Kprobes"
|
||||||
|
depends on KPROBES
|
||||||
|
help
|
||||||
|
If enabled, Hook required KernelSU syscalls with Kernel-probe.
|
||||||
|
|
||||||
|
config KSU_TRACEPOINT_HOOK
|
||||||
|
bool "Hook KernelSU with Tracepoint"
|
||||||
|
depends on TRACEPOINTS
|
||||||
|
help
|
||||||
|
If enabled, Hook required KernelSU syscalls with Tracepoint.
|
||||||
|
|
||||||
|
config KSU_MANUAL_HOOK
|
||||||
|
bool "Hook KernelSU manually"
|
||||||
|
depends on KSU != m
|
||||||
|
help
|
||||||
|
If enabled, Hook required KernelSU syscalls with manually-patched function.
|
||||||
|
|
||||||
|
endchoice
|
||||||
|
|
||||||
endmenu
|
endmenu
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
kernelsu-objs := ksu.o
|
kernelsu-objs := ksu.o
|
||||||
kernelsu-objs += allowlist.o
|
kernelsu-objs += allowlist.o
|
||||||
|
kernelsu-objs += dynamic_manager.o
|
||||||
kernelsu-objs += apk_sign.o
|
kernelsu-objs += apk_sign.o
|
||||||
kernelsu-objs += sucompat.o
|
kernelsu-objs += sucompat.o
|
||||||
kernelsu-objs += throne_tracker.o
|
kernelsu-objs += throne_tracker.o
|
||||||
@@ -8,6 +9,10 @@ kernelsu-objs += ksud.o
|
|||||||
kernelsu-objs += embed_ksud.o
|
kernelsu-objs += embed_ksud.o
|
||||||
kernelsu-objs += kernel_compat.o
|
kernelsu-objs += kernel_compat.o
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_KSU_TRACEPOINT_HOOK), y)
|
||||||
|
kernelsu-objs += ksu_trace.o
|
||||||
|
endif
|
||||||
|
|
||||||
kernelsu-objs += selinux/selinux.o
|
kernelsu-objs += selinux/selinux.o
|
||||||
kernelsu-objs += selinux/sepolicy.o
|
kernelsu-objs += selinux/sepolicy.o
|
||||||
kernelsu-objs += selinux/rules.o
|
kernelsu-objs += selinux/rules.o
|
||||||
@@ -15,29 +20,71 @@ ccflags-y += -I$(srctree)/security/selinux -I$(srctree)/security/selinux/include
|
|||||||
ccflags-y += -I$(objtree)/security/selinux -include $(srctree)/include/uapi/asm-generic/errno.h
|
ccflags-y += -I$(objtree)/security/selinux -include $(srctree)/include/uapi/asm-generic/errno.h
|
||||||
|
|
||||||
obj-$(CONFIG_KSU) += kernelsu.o
|
obj-$(CONFIG_KSU) += kernelsu.o
|
||||||
|
obj-$(CONFIG_KSU_TRACEPOINT_HOOK) += ksu_trace_export.o
|
||||||
|
|
||||||
obj-$(CONFIG_KPM) += kpm/
|
obj-$(CONFIG_KPM) += kpm/
|
||||||
|
|
||||||
|
|
||||||
# .git is a text file while the module is imported by 'git submodule add'.
|
REPO_OWNER := SukiSU-Ultra
|
||||||
ifeq ($(shell test -e $(srctree)/$(src)/../.git; echo $$?),0)
|
REPO_NAME := SukiSU-Ultra
|
||||||
$(shell cd $(srctree)/$(src); /usr/bin/env PATH="$$PATH":/usr/bin:/usr/local/bin [ -f ../.git/shallow ] && git fetch --unshallow)
|
REPO_BRANCH := main
|
||||||
KSU_GIT_VERSION := $(shell cd $(srctree)/$(src); /usr/bin/env PATH="$$PATH":/usr/bin:/usr/local/bin git rev-list --count main)
|
KSU_VERSION_API := 3.1.9
|
||||||
# ksu_version: major * 10000 + git version + 606 for historical reasons
|
|
||||||
$(eval KSU_VERSION=$(shell expr 10000 + $(KSU_GIT_VERSION) + 606))
|
GIT_BIN := /usr/bin/env PATH="$$PATH":/usr/bin:/usr/local/bin git
|
||||||
$(info -- KernelSU version: $(KSU_VERSION))
|
CURL_BIN := /usr/bin/env PATH="$$PATH":/usr/bin:/usr/local/bin curl
|
||||||
|
|
||||||
|
KSU_GITHUB_VERSION := $(shell $(CURL_BIN) -s "https://api.github.com/repos/$(REPO_OWNER)/$(REPO_NAME)/releases/latest" | grep '"tag_name":' | sed -E 's/.*"v([^"]+)".*/\1/')
|
||||||
|
KSU_GITHUB_VERSION_COMMIT := $(shell $(CURL_BIN) -sI "https://api.github.com/repos/$(REPO_OWNER)/$(REPO_NAME)/commits?sha=$(REPO_BRANCH)&per_page=1" | grep -i "link:" | sed -n 's/.*page=\([0-9]*\)>; rel="last".*/\1/p')
|
||||||
|
|
||||||
|
LOCAL_GIT_EXISTS := $(shell test -e $(srctree)/$(src)/../.git && echo 1 || echo 0)
|
||||||
|
|
||||||
|
define get_ksu_version_full
|
||||||
|
v$1-$(shell cd $(srctree)/$(src); $(GIT_BIN) rev-parse --short=8 HEAD)@$(shell cd $(srctree)/$(src); $(GIT_BIN) rev-parse --abbrev-ref HEAD)
|
||||||
|
endef
|
||||||
|
|
||||||
|
ifeq ($(KSU_GITHUB_VERSION_COMMIT),)
|
||||||
|
ifeq ($(LOCAL_GIT_EXISTS),1)
|
||||||
|
$(shell cd $(srctree)/$(src); [ -f ../.git/shallow ] && $(GIT_BIN) fetch --unshallow)
|
||||||
|
KSU_LOCAL_VERSION := $(shell cd $(srctree)/$(src); $(GIT_BIN) rev-list --count $(REPO_BRANCH))
|
||||||
|
KSU_VERSION := $(shell expr 10000 + $(KSU_LOCAL_VERSION) + 700)
|
||||||
|
$(info -- $(REPO_NAME) version (local .git): $(KSU_VERSION))
|
||||||
|
else
|
||||||
|
KSU_VERSION := 13000
|
||||||
|
$(warning -- Could not fetch version online or via local .git! Using fallback version: $(KSU_VERSION))
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
KSU_VERSION := $(shell expr 10000 + $(KSU_GITHUB_VERSION_COMMIT) + 700)
|
||||||
|
$(info -- $(REPO_NAME) version (GitHub): $(KSU_VERSION))
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(KSU_GITHUB_VERSION),)
|
||||||
|
ifeq ($(LOCAL_GIT_EXISTS),1)
|
||||||
|
$(shell cd $(srctree)/$(src); [ -f ../.git/shallow ] && $(GIT_BIN) fetch --unshallow)
|
||||||
|
KSU_VERSION_FULL := $(call get_ksu_version_full,$(KSU_VERSION_API))
|
||||||
|
$(info -- $(REPO_NAME) version (local .git): $(KSU_VERSION_FULL))
|
||||||
|
$(info -- $(REPO_NAME) Formatted version (local .git): $(KSU_VERSION))
|
||||||
|
else
|
||||||
|
KSU_VERSION_FULL := v$(KSU_VERSION_API)-$(REPO_NAME)-unknown@unknown
|
||||||
|
$(warning -- $(REPO_NAME) version: $(KSU_VERSION_FULL))
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
$(shell cd $(srctree)/$(src); [ -f ../.git/shallow ] && $(GIT_BIN) fetch --unshallow)
|
||||||
|
KSU_VERSION_FULL := $(call get_ksu_version_full,$(KSU_GITHUB_VERSION))
|
||||||
|
$(info -- $(REPO_NAME) version (Github): $(KSU_VERSION_FULL))
|
||||||
|
endif
|
||||||
|
|
||||||
ccflags-y += -DKSU_VERSION=$(KSU_VERSION)
|
ccflags-y += -DKSU_VERSION=$(KSU_VERSION)
|
||||||
else # If there is no .git file, the default version will be passed.
|
ccflags-y += -DKSU_VERSION_FULL=\"$(KSU_VERSION_FULL)\"
|
||||||
$(warning "KSU_GIT_VERSION not defined! It is better to make KernelSU a git submodule!")
|
|
||||||
ccflags-y += -DKSU_VERSION=16
|
# Custom Signs
|
||||||
|
ifdef KSU_EXPECTED_SIZE
|
||||||
|
ccflags-y += -DEXPECTED_SIZE=$(KSU_EXPECTED_SIZE)
|
||||||
|
$(info -- Custom KernelSU Manager signature size: $(KSU_EXPECTED_SIZE))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifndef KSU_EXPECTED_SIZE
|
ifdef KSU_EXPECTED_HASH
|
||||||
KSU_EXPECTED_SIZE := 0x35c
|
ccflags-y += -DEXPECTED_HASH=\"$(KSU_EXPECTED_HASH)\"
|
||||||
endif
|
$(info -- Custom KernelSU Manager signature hash: $(KSU_EXPECTED_HASH))
|
||||||
|
|
||||||
ifndef KSU_EXPECTED_HASH
|
|
||||||
KSU_EXPECTED_HASH := 947ae944f3de4ed4c21a7e4f7953ecf351bfa2b36239da37a34111ad29993eef
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef KSU_MANAGER_PACKAGE
|
ifdef KSU_MANAGER_PACKAGE
|
||||||
@@ -45,9 +92,16 @@ ccflags-y += -DKSU_MANAGER_PACKAGE=\"$(KSU_MANAGER_PACKAGE)\"
|
|||||||
$(info -- SukiSU Manager package name: $(KSU_MANAGER_PACKAGE))
|
$(info -- SukiSU Manager package name: $(KSU_MANAGER_PACKAGE))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
$(info -- SukiSU Manager signature size: $(KSU_EXPECTED_SIZE))
|
|
||||||
$(info -- SukiSU Manager signature hash: $(KSU_EXPECTED_HASH))
|
|
||||||
$(info -- Supported Unofficial Manager: 5ec1cff (GKI) ShirkNeko udochina (GKI and KPM))
|
$(info -- Supported Unofficial Manager: 5ec1cff (GKI) ShirkNeko udochina (GKI and KPM))
|
||||||
|
|
||||||
|
ifeq ($(strip $(CONFIG_KSU_KPROBES_HOOK)),y)
|
||||||
|
$(info -- SukiSU: CONFIG_KSU_KPROBES_HOOK)
|
||||||
|
else ifeq ($(strip $(CONFIG_KSU_TRACEPOINT_HOOK)),y)
|
||||||
|
$(info -- SukiSU: CONFIG_KSU_TRACEPOINT_HOOK)
|
||||||
|
else ifeq ($(strip $(CONFIG_KSU_MANUAL_HOOK)),y)
|
||||||
|
$(info -- SukiSU: CONFIG_KSU_MANUAL_HOOK)
|
||||||
|
endif
|
||||||
|
|
||||||
KERNEL_VERSION := $(VERSION).$(PATCHLEVEL)
|
KERNEL_VERSION := $(VERSION).$(PATCHLEVEL)
|
||||||
KERNEL_TYPE := Non-GKI
|
KERNEL_TYPE := Non-GKI
|
||||||
# Check for GKI 2.0 (5.10+ or 6.x+)
|
# Check for GKI 2.0 (5.10+ or 6.x+)
|
||||||
@@ -69,10 +123,6 @@ else
|
|||||||
$(info -- KPM is disabled)
|
$(info -- KPM is disabled)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
ccflags-y += -DEXPECTED_SIZE=$(KSU_EXPECTED_SIZE)
|
|
||||||
ccflags-y += -DEXPECTED_HASH=\"$(KSU_EXPECTED_HASH)\"
|
|
||||||
|
|
||||||
ccflags-y += -Wno-implicit-function-declaration -Wno-strict-prototypes -Wno-int-conversion -Wno-gcc-compat
|
ccflags-y += -Wno-implicit-function-declaration -Wno-strict-prototypes -Wno-int-conversion -Wno-gcc-compat
|
||||||
ccflags-y += -Wno-declaration-after-statement -Wno-unused-function
|
ccflags-y += -Wno-declaration-after-statement -Wno-unused-function
|
||||||
|
|
||||||
|
|||||||
@@ -15,15 +15,27 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "apk_sign.h"
|
#include "apk_sign.h"
|
||||||
|
#include "dynamic_manager.h"
|
||||||
#include "klog.h" // IWYU pragma: keep
|
#include "klog.h" // IWYU pragma: keep
|
||||||
#include "kernel_compat.h"
|
#include "kernel_compat.h"
|
||||||
|
#include "manager_sign.h"
|
||||||
|
|
||||||
struct sdesc {
|
struct sdesc {
|
||||||
struct shash_desc shash;
|
struct shash_desc shash;
|
||||||
char ctx[];
|
char ctx[];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static struct apk_sign_key {
|
||||||
|
unsigned size;
|
||||||
|
const char *sha256;
|
||||||
|
} apk_sign_keys[] = {
|
||||||
|
{EXPECTED_SIZE_SHIRKNEKO, EXPECTED_HASH_SHIRKNEKO}, // ShirkNeko/SukiSU
|
||||||
|
{EXPECTED_SIZE_OTHER, EXPECTED_HASH_OTHER}, // Dynamic Sign
|
||||||
|
#ifdef EXPECTED_SIZE
|
||||||
|
{EXPECTED_SIZE, EXPECTED_HASH}, // Custom
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
static struct sdesc *init_sdesc(struct crypto_shash *alg)
|
static struct sdesc *init_sdesc(struct crypto_shash *alg)
|
||||||
{
|
{
|
||||||
struct sdesc *sdesc;
|
struct sdesc *sdesc;
|
||||||
@@ -70,10 +82,12 @@ static int ksu_sha256(const unsigned char *data, unsigned int datalen,
|
|||||||
crypto_free_shash(alg);
|
crypto_free_shash(alg);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
static bool check_block(struct file *fp, u32 *size4, loff_t *pos, u32 *offset, int *matched_index)
|
||||||
static bool check_block(struct file *fp, u32 *size4, loff_t *pos, u32 *offset,
|
|
||||||
unsigned expected_size, const char *expected_sha256)
|
|
||||||
{
|
{
|
||||||
|
int i;
|
||||||
|
struct apk_sign_key sign_key;
|
||||||
|
bool signature_valid = false;
|
||||||
|
|
||||||
ksu_kernel_read_compat(fp, size4, 0x4, pos); // signer-sequence length
|
ksu_kernel_read_compat(fp, size4, 0x4, pos); // signer-sequence length
|
||||||
ksu_kernel_read_compat(fp, size4, 0x4, pos); // signer length
|
ksu_kernel_read_compat(fp, size4, 0x4, pos); // signer length
|
||||||
ksu_kernel_read_compat(fp, size4, 0x4, pos); // signed data length
|
ksu_kernel_read_compat(fp, size4, 0x4, pos); // signed data length
|
||||||
@@ -89,7 +103,20 @@ static bool check_block(struct file *fp, u32 *size4, loff_t *pos, u32 *offset,
|
|||||||
ksu_kernel_read_compat(fp, size4, 0x4, pos); // certificate length
|
ksu_kernel_read_compat(fp, size4, 0x4, pos); // certificate length
|
||||||
*offset += 0x4 * 2;
|
*offset += 0x4 * 2;
|
||||||
|
|
||||||
if (*size4 == expected_size) {
|
for (i = 0; i < ARRAY_SIZE(apk_sign_keys); i++) {
|
||||||
|
sign_key = apk_sign_keys[i];
|
||||||
|
|
||||||
|
if (i == 1) { // Dynamic Sign indexing
|
||||||
|
unsigned int size;
|
||||||
|
const char *hash;
|
||||||
|
if (ksu_get_dynamic_manager_config(&size, &hash)) {
|
||||||
|
sign_key.size = size;
|
||||||
|
sign_key.sha256 = hash;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (*size4 != sign_key.size)
|
||||||
|
continue;
|
||||||
*offset += *size4;
|
*offset += *size4;
|
||||||
|
|
||||||
#define CERT_MAX_LENGTH 1024
|
#define CERT_MAX_LENGTH 1024
|
||||||
@@ -109,13 +136,17 @@ static bool check_block(struct file *fp, u32 *size4, loff_t *pos, u32 *offset,
|
|||||||
hash_str[SHA256_DIGEST_SIZE * 2] = '\0';
|
hash_str[SHA256_DIGEST_SIZE * 2] = '\0';
|
||||||
|
|
||||||
bin2hex(hash_str, digest, SHA256_DIGEST_SIZE);
|
bin2hex(hash_str, digest, SHA256_DIGEST_SIZE);
|
||||||
pr_info("sha256: %s, expected: %s\n", hash_str,
|
pr_info("sha256: %s, expected: %s, index: %d\n", hash_str, sign_key.sha256, i);
|
||||||
expected_sha256);
|
|
||||||
if (strcmp(expected_sha256, hash_str) == 0) {
|
if (strcmp(sign_key.sha256, hash_str) == 0) {
|
||||||
return true;
|
signature_valid = true;
|
||||||
|
if (matched_index) {
|
||||||
|
*matched_index = i;
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return signature_valid;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct zip_entry_header {
|
struct zip_entry_header {
|
||||||
@@ -155,8 +186,7 @@ static bool has_v1_signature_file(struct file *fp)
|
|||||||
fileName[header.file_name_length] = '\0';
|
fileName[header.file_name_length] = '\0';
|
||||||
|
|
||||||
// Check if the entry matches META-INF/MANIFEST.MF
|
// Check if the entry matches META-INF/MANIFEST.MF
|
||||||
if (strncmp(MANIFEST, fileName, sizeof(MANIFEST) - 1) ==
|
if (strncmp(MANIFEST, fileName, sizeof(MANIFEST) - 1) == 0) {
|
||||||
0) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -171,21 +201,17 @@ static bool has_v1_signature_file(struct file *fp)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static __always_inline bool check_v2_signature(char *path,
|
static __always_inline bool check_v2_signature(char *path, bool check_multi_manager, int *signature_index)
|
||||||
unsigned expected_size,
|
|
||||||
const char *expected_sha256)
|
|
||||||
{
|
{
|
||||||
unsigned char buffer[0x11] = { 0 };
|
unsigned char buffer[0x11] = { 0 };
|
||||||
u32 size4;
|
u32 size4;
|
||||||
u64 size8, size_of_block;
|
u64 size8, size_of_block;
|
||||||
|
|
||||||
loff_t pos;
|
loff_t pos;
|
||||||
|
|
||||||
bool v2_signing_valid = false;
|
bool v2_signing_valid = false;
|
||||||
int v2_signing_blocks = 0;
|
int v2_signing_blocks = 0;
|
||||||
bool v3_signing_exist = false;
|
bool v3_signing_exist = false;
|
||||||
bool v3_1_signing_exist = false;
|
bool v3_1_signing_exist = false;
|
||||||
|
int matched_index = -1;
|
||||||
int i;
|
int i;
|
||||||
struct file *fp = ksu_filp_open_compat(path, O_RDONLY, 0);
|
struct file *fp = ksu_filp_open_compat(path, O_RDONLY, 0);
|
||||||
if (IS_ERR(fp)) {
|
if (IS_ERR(fp)) {
|
||||||
@@ -193,6 +219,12 @@ static __always_inline bool check_v2_signature(char *path,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If you want to check for multi-manager APK signing, but dynamic managering is not enabled, skip
|
||||||
|
if (check_multi_manager && !ksu_is_dynamic_manager_enabled()) {
|
||||||
|
filp_close(fp, 0);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
// disable inotify for this file
|
// disable inotify for this file
|
||||||
fp->f_mode |= FMODE_NONOTIFY;
|
fp->f_mode |= FMODE_NONOTIFY;
|
||||||
|
|
||||||
@@ -244,9 +276,10 @@ static __always_inline bool check_v2_signature(char *path,
|
|||||||
offset = 4;
|
offset = 4;
|
||||||
if (id == 0x7109871au) {
|
if (id == 0x7109871au) {
|
||||||
v2_signing_blocks++;
|
v2_signing_blocks++;
|
||||||
v2_signing_valid =
|
bool result = check_block(fp, &size4, &pos, &offset, &matched_index);
|
||||||
check_block(fp, &size4, &pos, &offset,
|
if (result) {
|
||||||
expected_size, expected_sha256);
|
v2_signing_valid = true;
|
||||||
|
}
|
||||||
} else if (id == 0xf05368c0u) {
|
} else if (id == 0xf05368c0u) {
|
||||||
// http://aospxref.com/android-14.0.0_r2/xref/frameworks/base/core/java/android/util/apk/ApkSignatureSchemeV3Verifier.java#73
|
// http://aospxref.com/android-14.0.0_r2/xref/frameworks/base/core/java/android/util/apk/ApkSignatureSchemeV3Verifier.java#73
|
||||||
v3_signing_exist = true;
|
v3_signing_exist = true;
|
||||||
@@ -287,7 +320,24 @@ clean:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return v2_signing_valid;
|
if (v2_signing_valid) {
|
||||||
|
if (signature_index) {
|
||||||
|
*signature_index = matched_index;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (check_multi_manager) {
|
||||||
|
// 0: ShirkNeko/SukiSU, 1: Dynamic Sign
|
||||||
|
if (matched_index == 0 || matched_index == 1) {
|
||||||
|
pr_info("Multi-manager APK detected (dynamic_manager enabled): signature_index=%d\n", matched_index);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
// Common manager check: any valid signature will do
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_KSU_DEBUG
|
#ifdef CONFIG_KSU_DEBUG
|
||||||
@@ -316,5 +366,10 @@ module_param_cb(ksu_debug_manager_uid, &expected_size_ops,
|
|||||||
|
|
||||||
bool is_manager_apk(char *path)
|
bool is_manager_apk(char *path)
|
||||||
{
|
{
|
||||||
return check_v2_signature(path, EXPECTED_SIZE, EXPECTED_HASH);
|
return check_v2_signature(path, false, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ksu_is_dynamic_manager_apk(char *path, int *signature_index)
|
||||||
|
{
|
||||||
|
return check_v2_signature(path, true, signature_index);
|
||||||
}
|
}
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
#define __KSU_H_APK_V2_SIGN
|
#define __KSU_H_APK_V2_SIGN
|
||||||
|
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
|
#include "ksu.h"
|
||||||
|
|
||||||
bool is_manager_apk(char *path);
|
bool is_manager_apk(char *path);
|
||||||
|
|
||||||
|
|||||||
@@ -42,10 +42,10 @@
|
|||||||
#include "manager.h"
|
#include "manager.h"
|
||||||
#include "selinux/selinux.h"
|
#include "selinux/selinux.h"
|
||||||
#include "throne_tracker.h"
|
#include "throne_tracker.h"
|
||||||
#include "throne_tracker.h"
|
|
||||||
#include "kernel_compat.h"
|
#include "kernel_compat.h"
|
||||||
|
|
||||||
#include "kpm/kpm.h"
|
#include "kpm/kpm.h"
|
||||||
|
#include "dynamic_manager.h"
|
||||||
|
|
||||||
static bool ksu_module_mounted = false;
|
static bool ksu_module_mounted = false;
|
||||||
|
|
||||||
@@ -110,6 +110,7 @@ static void setup_groups(struct root_profile *profile, struct cred *cred)
|
|||||||
|
|
||||||
groups_sort(group_info);
|
groups_sort(group_info);
|
||||||
set_groups(cred, group_info);
|
set_groups(cred, group_info);
|
||||||
|
put_group_info(group_info);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void disable_seccomp()
|
static void disable_seccomp()
|
||||||
@@ -134,18 +135,18 @@ void escape_to_root(void)
|
|||||||
{
|
{
|
||||||
struct cred *cred;
|
struct cred *cred;
|
||||||
|
|
||||||
rcu_read_lock();
|
cred = prepare_creds();
|
||||||
|
if (!cred) {
|
||||||
do {
|
pr_warn("prepare_creds failed!\n");
|
||||||
cred = (struct cred *)__task_cred((current));
|
return;
|
||||||
BUG_ON(!cred);
|
}
|
||||||
} while (!get_cred_rcu(cred));
|
|
||||||
|
|
||||||
if (cred->euid.val == 0) {
|
if (cred->euid.val == 0) {
|
||||||
pr_warn("Already root, don't escape!\n");
|
pr_warn("Already root, don't escape!\n");
|
||||||
rcu_read_unlock();
|
abort_creds(cred);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct root_profile *profile = ksu_get_root_profile(cred->uid.val);
|
struct root_profile *profile = ksu_get_root_profile(cred->uid.val);
|
||||||
|
|
||||||
cred->uid.val = profile->uid;
|
cred->uid.val = profile->uid;
|
||||||
@@ -176,7 +177,7 @@ void escape_to_root(void)
|
|||||||
|
|
||||||
setup_groups(profile, cred);
|
setup_groups(profile, cred);
|
||||||
|
|
||||||
rcu_read_unlock();
|
commit_creds(cred);
|
||||||
|
|
||||||
// Refer to kernel/seccomp.c: seccomp_set_mode_strict
|
// Refer to kernel/seccomp.c: seccomp_set_mode_strict
|
||||||
// When disabling Seccomp, ensure that current->sighand->siglock is held during the operation.
|
// When disabling Seccomp, ensure that current->sighand->siglock is held during the operation.
|
||||||
@@ -243,11 +244,22 @@ static void nuke_ext4_sysfs() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ext4_unregister_sysfs(sb);
|
ext4_unregister_sysfs(sb);
|
||||||
|
path_put(&path);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
static inline void nuke_ext4_sysfs() { }
|
static inline void nuke_ext4_sysfs() { }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static bool is_system_bin_su()
|
||||||
|
{
|
||||||
|
// YES in_execve becomes 0 when it succeeds.
|
||||||
|
if (!current->mm || current->in_execve)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// quick af check
|
||||||
|
return (current->mm->exe_file && !strcmp(current->mm->exe_file->f_path.dentry->d_name.name, "su"));
|
||||||
|
}
|
||||||
|
|
||||||
int ksu_handle_prctl(int option, unsigned long arg2, unsigned long arg3,
|
int ksu_handle_prctl(int option, unsigned long arg2, unsigned long arg3,
|
||||||
unsigned long arg4, unsigned long arg5)
|
unsigned long arg4, unsigned long arg5)
|
||||||
{
|
{
|
||||||
@@ -270,7 +282,8 @@ int ksu_handle_prctl(int option, unsigned long arg2, unsigned long arg3,
|
|||||||
bool from_root = 0 == current_uid().val;
|
bool from_root = 0 == current_uid().val;
|
||||||
bool from_manager = is_manager();
|
bool from_manager = is_manager();
|
||||||
|
|
||||||
if (!from_root && !from_manager) {
|
if (!from_root && !from_manager
|
||||||
|
&& !(is_allow_su() && is_system_bin_su())) {
|
||||||
// only root or manager can access this interface
|
// only root or manager can access this interface
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -306,7 +319,7 @@ int ksu_handle_prctl(int option, unsigned long arg2, unsigned long arg3,
|
|||||||
if (copy_to_user(arg3, &version, sizeof(version))) {
|
if (copy_to_user(arg3, &version, sizeof(version))) {
|
||||||
pr_err("prctl reply error, cmd: %lu\n", arg2);
|
pr_err("prctl reply error, cmd: %lu\n", arg2);
|
||||||
}
|
}
|
||||||
u32 version_flags = 0;
|
u32 version_flags = 2;
|
||||||
#ifdef MODULE
|
#ifdef MODULE
|
||||||
version_flags |= 0x1;
|
version_flags |= 0x1;
|
||||||
#endif
|
#endif
|
||||||
@@ -317,6 +330,72 @@ int ksu_handle_prctl(int option, unsigned long arg2, unsigned long arg3,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Allow root manager to get full version strings
|
||||||
|
if (arg2 == CMD_GET_FULL_VERSION) {
|
||||||
|
char ksu_version_full[KSU_FULL_VERSION_STRING] = {0};
|
||||||
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 13, 0)
|
||||||
|
strscpy(ksu_version_full, KSU_VERSION_FULL, KSU_FULL_VERSION_STRING);
|
||||||
|
#else
|
||||||
|
strlcpy(ksu_version_full, KSU_VERSION_FULL, KSU_FULL_VERSION_STRING);
|
||||||
|
#endif
|
||||||
|
if (copy_to_user((void __user *)arg3, ksu_version_full, KSU_FULL_VERSION_STRING)) {
|
||||||
|
pr_err("prctl reply error, cmd: %lu\n", arg2);
|
||||||
|
return -EFAULT;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Allow the root manager to configure dynamic manageratures
|
||||||
|
if (arg2 == CMD_DYNAMIC_MANAGER) {
|
||||||
|
if (!from_root && !from_manager) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct dynamic_manager_user_config config;
|
||||||
|
|
||||||
|
if (copy_from_user(&config, (void __user *)arg3, sizeof(config))) {
|
||||||
|
pr_err("copy dynamic manager config failed\n");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int ret = ksu_handle_dynamic_manager(&config);
|
||||||
|
|
||||||
|
if (ret == 0 && config.operation == DYNAMIC_MANAGER_OP_GET) {
|
||||||
|
if (copy_to_user((void __user *)arg3, &config, sizeof(config))) {
|
||||||
|
pr_err("copy dynamic manager config back failed\n");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ret == 0) {
|
||||||
|
if (copy_to_user(result, &reply_ok, sizeof(reply_ok))) {
|
||||||
|
pr_err("dynamic_manager: prctl reply error\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Allow root manager to get active managers
|
||||||
|
if (arg2 == CMD_GET_MANAGERS) {
|
||||||
|
if (!from_root && !from_manager) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct manager_list_info manager_info;
|
||||||
|
int ret = ksu_get_active_managers(&manager_info);
|
||||||
|
|
||||||
|
if (ret == 0) {
|
||||||
|
if (copy_to_user((void __user *)arg3, &manager_info, sizeof(manager_info))) {
|
||||||
|
pr_err("copy manager list failed\n");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if (copy_to_user(result, &reply_ok, sizeof(reply_ok))) {
|
||||||
|
pr_err("get_managers: prctl reply error\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (arg2 == CMD_REPORT_EVENT) {
|
if (arg2 == CMD_REPORT_EVENT) {
|
||||||
if (!from_root) {
|
if (!from_root) {
|
||||||
return 0;
|
return 0;
|
||||||
@@ -328,6 +407,9 @@ int ksu_handle_prctl(int option, unsigned long arg2, unsigned long arg3,
|
|||||||
post_fs_data_lock = true;
|
post_fs_data_lock = true;
|
||||||
pr_info("post-fs-data triggered\n");
|
pr_info("post-fs-data triggered\n");
|
||||||
on_post_fs_data();
|
on_post_fs_data();
|
||||||
|
// Initializing Dynamic Signatures
|
||||||
|
ksu_dynamic_manager_init();
|
||||||
|
pr_info("Dynamic sign config loaded during post-fs-data\n");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -416,6 +498,30 @@ int ksu_handle_prctl(int option, unsigned long arg2, unsigned long arg3,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (arg2 == CMD_ENABLE_SU) {
|
||||||
|
bool enabled = (arg3 != 0);
|
||||||
|
if (enabled == ksu_su_compat_enabled) {
|
||||||
|
pr_info("cmd enable su but no need to change.\n");
|
||||||
|
if (copy_to_user(result, &reply_ok, sizeof(reply_ok))) {// return the reply_ok directly
|
||||||
|
pr_err("prctl reply error, cmd: %lu\n", arg2);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (enabled) {
|
||||||
|
ksu_sucompat_init();
|
||||||
|
} else {
|
||||||
|
ksu_sucompat_exit();
|
||||||
|
}
|
||||||
|
ksu_su_compat_enabled = enabled;
|
||||||
|
|
||||||
|
if (copy_to_user(result, &reply_ok, sizeof(reply_ok))) {
|
||||||
|
pr_err("prctl reply error, cmd: %lu\n", arg2);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_KPM
|
#ifdef CONFIG_KPM
|
||||||
// ADD: 添加KPM模块控制
|
// ADD: 添加KPM模块控制
|
||||||
if(sukisu_is_kpm_control_code(arg2)) {
|
if(sukisu_is_kpm_control_code(arg2)) {
|
||||||
@@ -436,6 +542,28 @@ int ksu_handle_prctl(int option, unsigned long arg2, unsigned long arg3,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Checking hook usage
|
||||||
|
if (arg2 == CMD_HOOK_TYPE) {
|
||||||
|
const char *hook_type = "Kprobes";
|
||||||
|
#if defined(CONFIG_KSU_TRACEPOINT_HOOK)
|
||||||
|
hook_type = "Tracepoint";
|
||||||
|
#elif defined(CONFIG_KSU_MANUAL_HOOK)
|
||||||
|
hook_type = "Manual";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
size_t len = strlen(hook_type) + 1;
|
||||||
|
if (copy_to_user((void __user *)arg3, hook_type, len)) {
|
||||||
|
pr_err("hook_type: copy_to_user failed\n");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (copy_to_user(result, &reply_ok, sizeof(reply_ok))) {
|
||||||
|
pr_err("hook_type: prctl reply error\n");
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// all other cmds are for 'root manager'
|
// all other cmds are for 'root manager'
|
||||||
if (!from_manager) {
|
if (!from_manager) {
|
||||||
return 0;
|
return 0;
|
||||||
@@ -490,30 +618,6 @@ int ksu_handle_prctl(int option, unsigned long arg2, unsigned long arg3,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arg2 == CMD_ENABLE_SU) {
|
|
||||||
bool enabled = (arg3 != 0);
|
|
||||||
if (enabled == ksu_su_compat_enabled) {
|
|
||||||
pr_info("cmd enable su but no need to change.\n");
|
|
||||||
if (copy_to_user(result, &reply_ok, sizeof(reply_ok))) {// return the reply_ok directly
|
|
||||||
pr_err("prctl reply error, cmd: %lu\n", arg2);
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (enabled) {
|
|
||||||
ksu_sucompat_init();
|
|
||||||
} else {
|
|
||||||
ksu_sucompat_exit();
|
|
||||||
}
|
|
||||||
ksu_su_compat_enabled = enabled;
|
|
||||||
|
|
||||||
if (copy_to_user(result, &reply_ok, sizeof(reply_ok))) {
|
|
||||||
pr_err("prctl reply error, cmd: %lu\n", arg2);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -564,11 +668,13 @@ static void try_umount(const char *mnt, bool check_mnt, int flags)
|
|||||||
|
|
||||||
if (path.dentry != path.mnt->mnt_root) {
|
if (path.dentry != path.mnt->mnt_root) {
|
||||||
// it is not root mountpoint, maybe umounted by others already.
|
// it is not root mountpoint, maybe umounted by others already.
|
||||||
|
path_put(&path);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// we are only interest in some specific mounts
|
// we are only interest in some specific mounts
|
||||||
if (check_mnt && !should_umount(&path)) {
|
if (check_mnt && !should_umount(&path)) {
|
||||||
|
path_put(&path);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -724,6 +830,19 @@ static int ksu_task_fix_setuid(struct cred *new, const struct cred *old,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifndef MODULE
|
#ifndef MODULE
|
||||||
|
|
||||||
|
extern int __ksu_handle_devpts(struct inode *inode);
|
||||||
|
static int ksu_inode_permission(struct inode *inode, int mask)
|
||||||
|
{
|
||||||
|
if (unlikely(inode->i_sb && inode->i_sb->s_magic == DEVPTS_SUPER_MAGIC)) {
|
||||||
|
#ifdef CONFIG_KSU_DEBUG
|
||||||
|
pr_info("%s: devpts inode accessed with mask: %x\n", __func__, mask);
|
||||||
|
#endif
|
||||||
|
__ksu_handle_devpts(inode);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static struct security_hook_list ksu_hooks[] = {
|
static struct security_hook_list ksu_hooks[] = {
|
||||||
LSM_HOOK_INIT(task_prctl, ksu_task_prctl),
|
LSM_HOOK_INIT(task_prctl, ksu_task_prctl),
|
||||||
LSM_HOOK_INIT(inode_rename, ksu_inode_rename),
|
LSM_HOOK_INIT(inode_rename, ksu_inode_rename),
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
#define __KSU_H_KSU_CORE
|
#define __KSU_H_KSU_CORE
|
||||||
|
|
||||||
#include <linux/init.h>
|
#include <linux/init.h>
|
||||||
|
#include "apk_sign.h"
|
||||||
|
|
||||||
void __init ksu_core_init(void);
|
void __init ksu_core_init(void);
|
||||||
void ksu_core_exit(void);
|
void ksu_core_exit(void);
|
||||||
|
|||||||
505
kernel/dynamic_manager.c
Normal file
505
kernel/dynamic_manager.c
Normal file
@@ -0,0 +1,505 @@
|
|||||||
|
#include <linux/err.h>
|
||||||
|
#include <linux/fs.h>
|
||||||
|
#include <linux/gfp.h>
|
||||||
|
#include <linux/kernel.h>
|
||||||
|
#include <linux/slab.h>
|
||||||
|
#include <linux/version.h>
|
||||||
|
#include <linux/workqueue.h>
|
||||||
|
#ifdef CONFIG_KSU_DEBUG
|
||||||
|
#include <linux/moduleparam.h>
|
||||||
|
#endif
|
||||||
|
#include <crypto/hash.h>
|
||||||
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 11, 0)
|
||||||
|
#include <crypto/sha2.h>
|
||||||
|
#else
|
||||||
|
#include <crypto/sha.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "dynamic_manager.h"
|
||||||
|
#include "klog.h" // IWYU pragma: keep
|
||||||
|
#include "kernel_compat.h"
|
||||||
|
#include "manager.h"
|
||||||
|
|
||||||
|
#define MAX_MANAGERS 2
|
||||||
|
|
||||||
|
// Dynamic sign configuration
|
||||||
|
static struct dynamic_manager_config dynamic_manager = {
|
||||||
|
.size = 0x300,
|
||||||
|
.hash = "0000000000000000000000000000000000000000000000000000000000000000",
|
||||||
|
.is_set = 0
|
||||||
|
};
|
||||||
|
|
||||||
|
// Multi-manager state
|
||||||
|
static struct manager_info active_managers[MAX_MANAGERS];
|
||||||
|
static DEFINE_SPINLOCK(managers_lock);
|
||||||
|
static DEFINE_SPINLOCK(dynamic_manager_lock);
|
||||||
|
|
||||||
|
// Work queues for persistent storage
|
||||||
|
static struct work_struct ksu_save_dynamic_manager_work;
|
||||||
|
static struct work_struct ksu_load_dynamic_manager_work;
|
||||||
|
static struct work_struct ksu_clear_dynamic_manager_work;
|
||||||
|
|
||||||
|
bool ksu_is_dynamic_manager_enabled(void)
|
||||||
|
{
|
||||||
|
unsigned long flags;
|
||||||
|
bool enabled;
|
||||||
|
|
||||||
|
spin_lock_irqsave(&dynamic_manager_lock, flags);
|
||||||
|
enabled = dynamic_manager.is_set;
|
||||||
|
spin_unlock_irqrestore(&dynamic_manager_lock, flags);
|
||||||
|
|
||||||
|
return enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ksu_add_manager(uid_t uid, int signature_index)
|
||||||
|
{
|
||||||
|
unsigned long flags;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
if (!ksu_is_dynamic_manager_enabled()) {
|
||||||
|
pr_info("Dynamic sign not enabled, skipping multi-manager add\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
spin_lock_irqsave(&managers_lock, flags);
|
||||||
|
|
||||||
|
// Check if manager already exists and update
|
||||||
|
for (i = 0; i < MAX_MANAGERS; i++) {
|
||||||
|
if (active_managers[i].is_active && active_managers[i].uid == uid) {
|
||||||
|
active_managers[i].signature_index = signature_index;
|
||||||
|
spin_unlock_irqrestore(&managers_lock, flags);
|
||||||
|
pr_info("Updated manager uid=%d, signature_index=%d\n", uid, signature_index);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Find free slot for new manager
|
||||||
|
for (i = 0; i < MAX_MANAGERS; i++) {
|
||||||
|
if (!active_managers[i].is_active) {
|
||||||
|
active_managers[i].uid = uid;
|
||||||
|
active_managers[i].signature_index = signature_index;
|
||||||
|
active_managers[i].is_active = true;
|
||||||
|
spin_unlock_irqrestore(&managers_lock, flags);
|
||||||
|
pr_info("Added manager uid=%d, signature_index=%d\n", uid, signature_index);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
spin_unlock_irqrestore(&managers_lock, flags);
|
||||||
|
pr_warn("Failed to add manager, no free slots\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
void ksu_remove_manager(uid_t uid)
|
||||||
|
{
|
||||||
|
unsigned long flags;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
if (!ksu_is_dynamic_manager_enabled()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
spin_lock_irqsave(&managers_lock, flags);
|
||||||
|
|
||||||
|
for (i = 0; i < MAX_MANAGERS; i++) {
|
||||||
|
if (active_managers[i].is_active && active_managers[i].uid == uid) {
|
||||||
|
active_managers[i].is_active = false;
|
||||||
|
pr_info("Removed manager uid=%d\n", uid);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
spin_unlock_irqrestore(&managers_lock, flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ksu_is_any_manager(uid_t uid)
|
||||||
|
{
|
||||||
|
unsigned long flags;
|
||||||
|
bool is_manager = false;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
if (!ksu_is_dynamic_manager_enabled()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
spin_lock_irqsave(&managers_lock, flags);
|
||||||
|
|
||||||
|
for (i = 0; i < MAX_MANAGERS; i++) {
|
||||||
|
if (active_managers[i].is_active && active_managers[i].uid == uid) {
|
||||||
|
is_manager = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
spin_unlock_irqrestore(&managers_lock, flags);
|
||||||
|
return is_manager;
|
||||||
|
}
|
||||||
|
|
||||||
|
int ksu_get_manager_signature_index(uid_t uid)
|
||||||
|
{
|
||||||
|
unsigned long flags;
|
||||||
|
int signature_index = -1;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
// Check traditional manager first
|
||||||
|
if (ksu_manager_uid != KSU_INVALID_UID && uid == ksu_manager_uid) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!ksu_is_dynamic_manager_enabled()) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
spin_lock_irqsave(&managers_lock, flags);
|
||||||
|
|
||||||
|
for (i = 0; i < MAX_MANAGERS; i++) {
|
||||||
|
if (active_managers[i].is_active && active_managers[i].uid == uid) {
|
||||||
|
signature_index = active_managers[i].signature_index;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
spin_unlock_irqrestore(&managers_lock, flags);
|
||||||
|
return signature_index;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void clear_dynamic_manager(void)
|
||||||
|
{
|
||||||
|
unsigned long flags;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
spin_lock_irqsave(&managers_lock, flags);
|
||||||
|
|
||||||
|
for (i = 0; i < MAX_MANAGERS; i++) {
|
||||||
|
if (active_managers[i].is_active) {
|
||||||
|
pr_info("Clearing dynamic manager uid=%d (signature_index=%d) for rescan\n",
|
||||||
|
active_managers[i].uid, active_managers[i].signature_index);
|
||||||
|
active_managers[i].is_active = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
spin_unlock_irqrestore(&managers_lock, flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
int ksu_get_active_managers(struct manager_list_info *info)
|
||||||
|
{
|
||||||
|
unsigned long flags;
|
||||||
|
int i, count = 0;
|
||||||
|
|
||||||
|
if (!info) {
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add traditional manager first
|
||||||
|
if (ksu_manager_uid != KSU_INVALID_UID && count < 2) {
|
||||||
|
info->managers[count].uid = ksu_manager_uid;
|
||||||
|
info->managers[count].signature_index = 0;
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add dynamic managers
|
||||||
|
if (ksu_is_dynamic_manager_enabled()) {
|
||||||
|
spin_lock_irqsave(&managers_lock, flags);
|
||||||
|
|
||||||
|
for (i = 0; i < MAX_MANAGERS && count < 2; i++) {
|
||||||
|
if (active_managers[i].is_active) {
|
||||||
|
info->managers[count].uid = active_managers[i].uid;
|
||||||
|
info->managers[count].signature_index = active_managers[i].signature_index;
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
spin_unlock_irqrestore(&managers_lock, flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
info->count = count;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void do_save_dynamic_manager(struct work_struct *work)
|
||||||
|
{
|
||||||
|
u32 magic = DYNAMIC_MANAGER_FILE_MAGIC;
|
||||||
|
u32 version = DYNAMIC_MANAGER_FILE_VERSION;
|
||||||
|
struct dynamic_manager_config config_to_save;
|
||||||
|
loff_t off = 0;
|
||||||
|
unsigned long flags;
|
||||||
|
struct file *fp;
|
||||||
|
|
||||||
|
spin_lock_irqsave(&dynamic_manager_lock, flags);
|
||||||
|
config_to_save = dynamic_manager;
|
||||||
|
spin_unlock_irqrestore(&dynamic_manager_lock, flags);
|
||||||
|
|
||||||
|
if (!config_to_save.is_set) {
|
||||||
|
pr_info("Dynamic sign config not set, skipping save\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
fp = ksu_filp_open_compat(KERNEL_SU_DYNAMIC_MANAGER, O_WRONLY | O_CREAT | O_TRUNC, 0644);
|
||||||
|
if (IS_ERR(fp)) {
|
||||||
|
pr_err("save_dynamic_manager create file failed: %ld\n", PTR_ERR(fp));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ksu_kernel_write_compat(fp, &magic, sizeof(magic), &off) != sizeof(magic)) {
|
||||||
|
pr_err("save_dynamic_manager write magic failed.\n");
|
||||||
|
goto exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ksu_kernel_write_compat(fp, &version, sizeof(version), &off) != sizeof(version)) {
|
||||||
|
pr_err("save_dynamic_manager write version failed.\n");
|
||||||
|
goto exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ksu_kernel_write_compat(fp, &config_to_save, sizeof(config_to_save), &off) != sizeof(config_to_save)) {
|
||||||
|
pr_err("save_dynamic_manager write config failed.\n");
|
||||||
|
goto exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
pr_info("Dynamic sign config saved successfully\n");
|
||||||
|
|
||||||
|
exit:
|
||||||
|
filp_close(fp, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void do_load_dynamic_manager(struct work_struct *work)
|
||||||
|
{
|
||||||
|
loff_t off = 0;
|
||||||
|
ssize_t ret = 0;
|
||||||
|
struct file *fp = NULL;
|
||||||
|
u32 magic;
|
||||||
|
u32 version;
|
||||||
|
struct dynamic_manager_config loaded_config;
|
||||||
|
unsigned long flags;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
fp = ksu_filp_open_compat(KERNEL_SU_DYNAMIC_MANAGER, O_RDONLY, 0);
|
||||||
|
if (IS_ERR(fp)) {
|
||||||
|
if (PTR_ERR(fp) == -ENOENT) {
|
||||||
|
pr_info("No saved dynamic manager config found\n");
|
||||||
|
} else {
|
||||||
|
pr_err("load_dynamic_manager open file failed: %ld\n", PTR_ERR(fp));
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ksu_kernel_read_compat(fp, &magic, sizeof(magic), &off) != sizeof(magic) ||
|
||||||
|
magic != DYNAMIC_MANAGER_FILE_MAGIC) {
|
||||||
|
pr_err("dynamic manager file invalid magic: %x!\n", magic);
|
||||||
|
goto exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ksu_kernel_read_compat(fp, &version, sizeof(version), &off) != sizeof(version)) {
|
||||||
|
pr_err("dynamic manager read version failed\n");
|
||||||
|
goto exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
pr_info("dynamic manager file version: %d\n", version);
|
||||||
|
|
||||||
|
ret = ksu_kernel_read_compat(fp, &loaded_config, sizeof(loaded_config), &off);
|
||||||
|
if (ret <= 0) {
|
||||||
|
pr_info("load_dynamic_manager read err: %zd\n", ret);
|
||||||
|
goto exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ret != sizeof(loaded_config)) {
|
||||||
|
pr_err("load_dynamic_manager read incomplete config: %zd/%zu\n", ret, sizeof(loaded_config));
|
||||||
|
goto exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (loaded_config.size < 0x100 || loaded_config.size > 0x1000) {
|
||||||
|
pr_err("Invalid saved config size: 0x%x\n", loaded_config.size);
|
||||||
|
goto exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (strlen(loaded_config.hash) != 64) {
|
||||||
|
pr_err("Invalid saved config hash length: %zu\n", strlen(loaded_config.hash));
|
||||||
|
goto exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate hash format
|
||||||
|
for (i = 0; i < 64; i++) {
|
||||||
|
char c = loaded_config.hash[i];
|
||||||
|
if (!((c >= '0' && c <= '9') || (c >= 'a' && c <= 'f'))) {
|
||||||
|
pr_err("Invalid saved config hash character at position %d: %c\n", i, c);
|
||||||
|
goto exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
spin_lock_irqsave(&dynamic_manager_lock, flags);
|
||||||
|
dynamic_manager = loaded_config;
|
||||||
|
spin_unlock_irqrestore(&dynamic_manager_lock, flags);
|
||||||
|
|
||||||
|
pr_info("Dynamic sign config loaded: size=0x%x, hash=%.16s...\n",
|
||||||
|
loaded_config.size, loaded_config.hash);
|
||||||
|
|
||||||
|
exit:
|
||||||
|
filp_close(fp, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool persistent_dynamic_manager(void)
|
||||||
|
{
|
||||||
|
return ksu_queue_work(&ksu_save_dynamic_manager_work);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void do_clear_dynamic_manager(struct work_struct *work)
|
||||||
|
{
|
||||||
|
loff_t off = 0;
|
||||||
|
struct file *fp;
|
||||||
|
char zero_buffer[512];
|
||||||
|
|
||||||
|
memset(zero_buffer, 0, sizeof(zero_buffer));
|
||||||
|
|
||||||
|
fp = ksu_filp_open_compat(KERNEL_SU_DYNAMIC_MANAGER, O_WRONLY | O_CREAT | O_TRUNC, 0644);
|
||||||
|
if (IS_ERR(fp)) {
|
||||||
|
pr_err("clear_dynamic_manager create file failed: %ld\n", PTR_ERR(fp));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Write null bytes to overwrite the file content
|
||||||
|
if (ksu_kernel_write_compat(fp, zero_buffer, sizeof(zero_buffer), &off) != sizeof(zero_buffer)) {
|
||||||
|
pr_err("clear_dynamic_manager write null bytes failed.\n");
|
||||||
|
} else {
|
||||||
|
pr_info("Dynamic sign config file cleared successfully\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
filp_close(fp, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool clear_dynamic_manager_file(void)
|
||||||
|
{
|
||||||
|
return ksu_queue_work(&ksu_clear_dynamic_manager_work);
|
||||||
|
}
|
||||||
|
|
||||||
|
int ksu_handle_dynamic_manager(struct dynamic_manager_user_config *config)
|
||||||
|
{
|
||||||
|
unsigned long flags;
|
||||||
|
int ret = 0;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
if (!config) {
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (config->operation) {
|
||||||
|
case DYNAMIC_MANAGER_OP_SET:
|
||||||
|
if (config->size < 0x100 || config->size > 0x1000) {
|
||||||
|
pr_err("invalid size: 0x%x\n", config->size);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (strlen(config->hash) != 64) {
|
||||||
|
pr_err("invalid hash length: %zu\n", strlen(config->hash));
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate hash format
|
||||||
|
for (i = 0; i < 64; i++) {
|
||||||
|
char c = config->hash[i];
|
||||||
|
if (!((c >= '0' && c <= '9') || (c >= 'a' && c <= 'f'))) {
|
||||||
|
pr_err("invalid hash character at position %d: %c\n", i, c);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
spin_lock_irqsave(&dynamic_manager_lock, flags);
|
||||||
|
dynamic_manager.size = config->size;
|
||||||
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 13, 0)
|
||||||
|
strscpy(dynamic_manager.hash, config->hash, sizeof(dynamic_manager.hash));
|
||||||
|
#else
|
||||||
|
strlcpy(dynamic_manager.hash, config->hash, sizeof(dynamic_manager.hash));
|
||||||
|
#endif
|
||||||
|
dynamic_manager.is_set = 1;
|
||||||
|
spin_unlock_irqrestore(&dynamic_manager_lock, flags);
|
||||||
|
|
||||||
|
persistent_dynamic_manager();
|
||||||
|
pr_info("dynamic manager updated: size=0x%x, hash=%.16s... (multi-manager enabled)\n",
|
||||||
|
config->size, config->hash);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case DYNAMIC_MANAGER_OP_GET:
|
||||||
|
spin_lock_irqsave(&dynamic_manager_lock, flags);
|
||||||
|
if (dynamic_manager.is_set) {
|
||||||
|
config->size = dynamic_manager.size;
|
||||||
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 13, 0)
|
||||||
|
strscpy(config->hash, dynamic_manager.hash, sizeof(config->hash));
|
||||||
|
#else
|
||||||
|
strlcpy(config->hash, dynamic_manager.hash, sizeof(config->hash));
|
||||||
|
#endif
|
||||||
|
ret = 0;
|
||||||
|
} else {
|
||||||
|
ret = -ENODATA;
|
||||||
|
}
|
||||||
|
spin_unlock_irqrestore(&dynamic_manager_lock, flags);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case DYNAMIC_MANAGER_OP_CLEAR:
|
||||||
|
spin_lock_irqsave(&dynamic_manager_lock, flags);
|
||||||
|
dynamic_manager.size = 0x300;
|
||||||
|
strcpy(dynamic_manager.hash, "0000000000000000000000000000000000000000000000000000000000000000");
|
||||||
|
dynamic_manager.is_set = 0;
|
||||||
|
spin_unlock_irqrestore(&dynamic_manager_lock, flags);
|
||||||
|
|
||||||
|
// Clear only dynamic managers, preserve default manager
|
||||||
|
clear_dynamic_manager();
|
||||||
|
|
||||||
|
// Clear file using the same method as save
|
||||||
|
clear_dynamic_manager_file();
|
||||||
|
|
||||||
|
pr_info("Dynamic sign config cleared (multi-manager disabled)\n");
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
pr_err("Invalid dynamic manager operation: %d\n", config->operation);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ksu_load_dynamic_manager(void)
|
||||||
|
{
|
||||||
|
return ksu_queue_work(&ksu_load_dynamic_manager_work);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ksu_dynamic_manager_init(void)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
INIT_WORK(&ksu_save_dynamic_manager_work, do_save_dynamic_manager);
|
||||||
|
INIT_WORK(&ksu_load_dynamic_manager_work, do_load_dynamic_manager);
|
||||||
|
INIT_WORK(&ksu_clear_dynamic_manager_work, do_clear_dynamic_manager);
|
||||||
|
|
||||||
|
// Initialize manager slots
|
||||||
|
for (i = 0; i < MAX_MANAGERS; i++) {
|
||||||
|
active_managers[i].is_active = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
ksu_load_dynamic_manager();
|
||||||
|
|
||||||
|
pr_info("Dynamic sign initialized with conditional multi-manager support\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
void ksu_dynamic_manager_exit(void)
|
||||||
|
{
|
||||||
|
clear_dynamic_manager();
|
||||||
|
|
||||||
|
// Save current config before exit
|
||||||
|
do_save_dynamic_manager(NULL);
|
||||||
|
pr_info("Dynamic sign exited with persistent storage\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get dynamic manager configuration for signature verification
|
||||||
|
bool ksu_get_dynamic_manager_config(unsigned int *size, const char **hash)
|
||||||
|
{
|
||||||
|
unsigned long flags;
|
||||||
|
bool valid = false;
|
||||||
|
|
||||||
|
spin_lock_irqsave(&dynamic_manager_lock, flags);
|
||||||
|
if (dynamic_manager.is_set) {
|
||||||
|
if (size) *size = dynamic_manager.size;
|
||||||
|
if (hash) *hash = dynamic_manager.hash;
|
||||||
|
valid = true;
|
||||||
|
}
|
||||||
|
spin_unlock_irqrestore(&dynamic_manager_lock, flags);
|
||||||
|
|
||||||
|
return valid;
|
||||||
|
}
|
||||||
43
kernel/dynamic_manager.h
Normal file
43
kernel/dynamic_manager.h
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
#ifndef __KSU_H_DYNAMIC_MANAGER
|
||||||
|
#define __KSU_H_DYNAMIC_MANAGER
|
||||||
|
|
||||||
|
#include <linux/types.h>
|
||||||
|
#include "ksu.h"
|
||||||
|
|
||||||
|
#define DYNAMIC_MANAGER_FILE_MAGIC 0x7f445347 // 'DSG', u32
|
||||||
|
#define DYNAMIC_MANAGER_FILE_VERSION 1 // u32
|
||||||
|
#define KERNEL_SU_DYNAMIC_MANAGER "/data/adb/ksu/.dynamic_manager"
|
||||||
|
|
||||||
|
struct dynamic_manager_config {
|
||||||
|
unsigned int size;
|
||||||
|
char hash[65];
|
||||||
|
int is_set;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct manager_info {
|
||||||
|
uid_t uid;
|
||||||
|
int signature_index;
|
||||||
|
bool is_active;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Dynamic sign operations
|
||||||
|
void ksu_dynamic_manager_init(void);
|
||||||
|
void ksu_dynamic_manager_exit(void);
|
||||||
|
int ksu_handle_dynamic_manager(struct dynamic_manager_user_config *config);
|
||||||
|
bool ksu_load_dynamic_manager(void);
|
||||||
|
bool ksu_is_dynamic_manager_enabled(void);
|
||||||
|
|
||||||
|
// Multi-manager operations
|
||||||
|
void ksu_add_manager(uid_t uid, int signature_index);
|
||||||
|
void ksu_remove_manager(uid_t uid);
|
||||||
|
bool ksu_is_any_manager(uid_t uid);
|
||||||
|
int ksu_get_manager_signature_index(uid_t uid);
|
||||||
|
int ksu_get_active_managers(struct manager_list_info *info);
|
||||||
|
|
||||||
|
// Multi-manager APK verification
|
||||||
|
bool ksu_is_dynamic_manager_apk(char *path, int *signature_index);
|
||||||
|
|
||||||
|
// Configuration access for signature verification
|
||||||
|
bool ksu_get_dynamic_manager_config(unsigned int *size, const char **hash);
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -60,6 +60,13 @@ uid_t sukisu_get_manager_uid() {
|
|||||||
return ksu_manager_uid;
|
return ksu_manager_uid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static
|
||||||
|
void sukisu_set_manager_uid(uid_t uid, int force) {
|
||||||
|
if(force || ksu_manager_uid == -1) {
|
||||||
|
ksu_manager_uid = uid;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ======================================================================
|
// ======================================================================
|
||||||
|
|
||||||
struct CompactAddressSymbol {
|
struct CompactAddressSymbol {
|
||||||
@@ -75,7 +82,8 @@ static struct CompactAddressSymbol address_symbol [] = {
|
|||||||
{ "get_ap_mod_exclude", &sukisu_get_ap_mod_exclude },
|
{ "get_ap_mod_exclude", &sukisu_get_ap_mod_exclude },
|
||||||
{ "is_uid_should_umount", &sukisu_is_uid_should_umount },
|
{ "is_uid_should_umount", &sukisu_is_uid_should_umount },
|
||||||
{ "is_current_uid_manager", &sukisu_is_current_uid_manager },
|
{ "is_current_uid_manager", &sukisu_is_current_uid_manager },
|
||||||
{ "get_manager_uid", &sukisu_get_manager_uid }
|
{ "get_manager_uid", &sukisu_get_manager_uid },
|
||||||
|
{ "sukisu_set_manager_uid", &sukisu_set_manager_uid }
|
||||||
};
|
};
|
||||||
|
|
||||||
unsigned long sukisu_compact_find_symbol(const char* name) {
|
unsigned long sukisu_compact_find_symbol(const char* name) {
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ void sukisu_kpm_load_module_path(const char* path, const char* args, void* ptr,
|
|||||||
int res = -1;
|
int res = -1;
|
||||||
printk("KPM: Stub function called (sukisu_kpm_load_module_path). path=%s args=%s ptr=%p\n", path, args, ptr);
|
printk("KPM: Stub function called (sukisu_kpm_load_module_path). path=%s args=%s ptr=%p\n", path, args, ptr);
|
||||||
__asm__ volatile("nop"); // 精确控制循环不被优化
|
__asm__ volatile("nop"); // 精确控制循环不被优化
|
||||||
if(copy_to_user(result, &res, sizeof(res)) < 1) printk("KPM: Copy to user faild.");
|
if(copy_to_user(result, &res, sizeof(res)) < 1) printk("KPM: Copy to user failed.");
|
||||||
}
|
}
|
||||||
|
|
||||||
noinline
|
noinline
|
||||||
@@ -73,7 +73,7 @@ void sukisu_kpm_unload_module(const char* name, void* ptr, void __user* result)
|
|||||||
int res = -1;
|
int res = -1;
|
||||||
printk("KPM: Stub function called (sukisu_kpm_unload_module). name=%s ptr=%p\n", name, ptr);
|
printk("KPM: Stub function called (sukisu_kpm_unload_module). name=%s ptr=%p\n", name, ptr);
|
||||||
__asm__ volatile("nop"); // 精确控制循环不被优化
|
__asm__ volatile("nop"); // 精确控制循环不被优化
|
||||||
if(copy_to_user(result, &res, sizeof(res)) < 1) printk("KPM: Copy to user faild.");
|
if(copy_to_user(result, &res, sizeof(res)) < 1) printk("KPM: Copy to user failed.");
|
||||||
}
|
}
|
||||||
|
|
||||||
noinline
|
noinline
|
||||||
@@ -83,7 +83,7 @@ void sukisu_kpm_num(void __user* result) {
|
|||||||
int res = 0;
|
int res = 0;
|
||||||
printk("KPM: Stub function called (sukisu_kpm_num).\n");
|
printk("KPM: Stub function called (sukisu_kpm_num).\n");
|
||||||
__asm__ volatile("nop"); // 精确控制循环不被优化
|
__asm__ volatile("nop"); // 精确控制循环不被优化
|
||||||
if(copy_to_user(result, &res, sizeof(res)) < 1) printk("KPM: Copy to user faild.");
|
if(copy_to_user(result, &res, sizeof(res)) < 1) printk("KPM: Copy to user failed.");
|
||||||
}
|
}
|
||||||
|
|
||||||
noinline
|
noinline
|
||||||
@@ -93,7 +93,7 @@ void sukisu_kpm_info(const char* name, void __user* out, void __user* result) {
|
|||||||
int res = -1;
|
int res = -1;
|
||||||
printk("KPM: Stub function called (sukisu_kpm_info). name=%s buffer=%p\n", name, out);
|
printk("KPM: Stub function called (sukisu_kpm_info). name=%s buffer=%p\n", name, out);
|
||||||
__asm__ volatile("nop"); // 精确控制循环不被优化
|
__asm__ volatile("nop"); // 精确控制循环不被优化
|
||||||
if(copy_to_user(result, &res, sizeof(res)) < 1) printk("KPM: Copy to user faild.");
|
if(copy_to_user(result, &res, sizeof(res)) < 1) printk("KPM: Copy to user failed.");
|
||||||
}
|
}
|
||||||
|
|
||||||
noinline
|
noinline
|
||||||
@@ -102,7 +102,7 @@ void sukisu_kpm_list(void __user* out, unsigned int bufferSize, void __user* res
|
|||||||
// This is a KPM module stub.
|
// This is a KPM module stub.
|
||||||
int res = -1;
|
int res = -1;
|
||||||
printk("KPM: Stub function called (sukisu_kpm_list). buffer=%p size=%d\n", out, bufferSize);
|
printk("KPM: Stub function called (sukisu_kpm_list). buffer=%p size=%d\n", out, bufferSize);
|
||||||
if(copy_to_user(result, &res, sizeof(res)) < 1) printk("KPM: Copy to user faild.");
|
if(copy_to_user(result, &res, sizeof(res)) < 1) printk("KPM: Copy to user failed.");
|
||||||
}
|
}
|
||||||
|
|
||||||
noinline
|
noinline
|
||||||
@@ -112,7 +112,7 @@ void sukisu_kpm_control(void __user* name, void __user* args, void __user* resul
|
|||||||
int res = -1;
|
int res = -1;
|
||||||
printk("KPM: Stub function called (sukisu_kpm_control). name=%p args=%p\n", name, args);
|
printk("KPM: Stub function called (sukisu_kpm_control). name=%p args=%p\n", name, args);
|
||||||
__asm__ volatile("nop"); // 精确控制循环不被优化
|
__asm__ volatile("nop"); // 精确控制循环不被优化
|
||||||
if(copy_to_user(result, &res, sizeof(res)) < 1) printk("KPM: Copy to user faild.");
|
if(copy_to_user(result, &res, sizeof(res)) < 1) printk("KPM: Copy to user failed.");
|
||||||
}
|
}
|
||||||
|
|
||||||
noinline
|
noinline
|
||||||
@@ -120,7 +120,7 @@ NO_OPTIMIZE
|
|||||||
void sukisu_kpm_version(void __user* out, unsigned int bufferSize, void __user* result) {
|
void sukisu_kpm_version(void __user* out, unsigned int bufferSize, void __user* result) {
|
||||||
int res = -1;
|
int res = -1;
|
||||||
printk("KPM: Stub function called (sukisu_kpm_version). buffer=%p size=%d\n", out, bufferSize);
|
printk("KPM: Stub function called (sukisu_kpm_version). buffer=%p size=%d\n", out, bufferSize);
|
||||||
if(copy_to_user(result, &res, sizeof(res)) < 1) printk("KPM: Copy to user faild.");
|
if(copy_to_user(result, &res, sizeof(res)) < 1) printk("KPM: Copy to user failed.");
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_SYMBOL(sukisu_kpm_load_module_path);
|
EXPORT_SYMBOL(sukisu_kpm_load_module_path);
|
||||||
|
|||||||
16
kernel/ksu.c
16
kernel/ksu.c
@@ -36,6 +36,10 @@ extern void ksu_sucompat_init();
|
|||||||
extern void ksu_sucompat_exit();
|
extern void ksu_sucompat_exit();
|
||||||
extern void ksu_ksud_init();
|
extern void ksu_ksud_init();
|
||||||
extern void ksu_ksud_exit();
|
extern void ksu_ksud_exit();
|
||||||
|
#ifdef CONFIG_KSU_TRACEPOINT_HOOK
|
||||||
|
extern void ksu_trace_register();
|
||||||
|
extern void ksu_trace_unregister();
|
||||||
|
#endif
|
||||||
|
|
||||||
int __init kernelsu_init(void)
|
int __init kernelsu_init(void)
|
||||||
{
|
{
|
||||||
@@ -56,13 +60,17 @@ int __init kernelsu_init(void)
|
|||||||
ksu_allowlist_init();
|
ksu_allowlist_init();
|
||||||
|
|
||||||
ksu_throne_tracker_init();
|
ksu_throne_tracker_init();
|
||||||
#ifdef CONFIG_KPROBES
|
#ifdef CONFIG_KSU_KPROBES_HOOK
|
||||||
ksu_sucompat_init();
|
ksu_sucompat_init();
|
||||||
ksu_ksud_init();
|
ksu_ksud_init();
|
||||||
#else
|
#else
|
||||||
pr_alert("KPROBES is disabled, KernelSU may not work, please check https://kernelsu.org/guide/how-to-integrate-for-non-gki.html");
|
pr_alert("KPROBES is disabled, KernelSU may not work, please check https://kernelsu.org/guide/how-to-integrate-for-non-gki.html");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_KSU_TRACEPOINT_HOOK
|
||||||
|
ksu_trace_register();
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef MODULE
|
#ifdef MODULE
|
||||||
#ifndef CONFIG_KSU_DEBUG
|
#ifndef CONFIG_KSU_DEBUG
|
||||||
kobject_del(&THIS_MODULE->mkobj.kobj);
|
kobject_del(&THIS_MODULE->mkobj.kobj);
|
||||||
@@ -79,11 +87,15 @@ void kernelsu_exit(void)
|
|||||||
|
|
||||||
destroy_workqueue(ksu_workqueue);
|
destroy_workqueue(ksu_workqueue);
|
||||||
|
|
||||||
#ifdef CONFIG_KPROBES
|
#ifdef CONFIG_KSU_KPROBES_HOOK
|
||||||
ksu_ksud_exit();
|
ksu_ksud_exit();
|
||||||
ksu_sucompat_exit();
|
ksu_sucompat_exit();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_KSU_TRACEPOINT_HOOK
|
||||||
|
ksu_trace_unregister();
|
||||||
|
#endif
|
||||||
|
|
||||||
ksu_core_exit();
|
ksu_core_exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
30
kernel/ksu.h
30
kernel/ksu.h
@@ -23,7 +23,13 @@
|
|||||||
#define CMD_UID_SHOULD_UMOUNT 13
|
#define CMD_UID_SHOULD_UMOUNT 13
|
||||||
#define CMD_IS_SU_ENABLED 14
|
#define CMD_IS_SU_ENABLED 14
|
||||||
#define CMD_ENABLE_SU 15
|
#define CMD_ENABLE_SU 15
|
||||||
|
|
||||||
|
#define CMD_GET_FULL_VERSION 0xC0FFEE1A
|
||||||
|
|
||||||
#define CMD_ENABLE_KPM 100
|
#define CMD_ENABLE_KPM 100
|
||||||
|
#define CMD_HOOK_TYPE 101
|
||||||
|
#define CMD_DYNAMIC_MANAGER 103
|
||||||
|
#define CMD_GET_MANAGERS 104
|
||||||
|
|
||||||
#define EVENT_POST_FS_DATA 1
|
#define EVENT_POST_FS_DATA 1
|
||||||
#define EVENT_BOOT_COMPLETED 2
|
#define EVENT_BOOT_COMPLETED 2
|
||||||
@@ -35,6 +41,30 @@
|
|||||||
#define KSU_MAX_GROUPS 32
|
#define KSU_MAX_GROUPS 32
|
||||||
#define KSU_SELINUX_DOMAIN 64
|
#define KSU_SELINUX_DOMAIN 64
|
||||||
|
|
||||||
|
// SukiSU Ultra kernel su version full strings
|
||||||
|
#ifndef KSU_VERSION_FULL
|
||||||
|
#define KSU_VERSION_FULL "v3.x-00000000@unknown"
|
||||||
|
#endif
|
||||||
|
#define KSU_FULL_VERSION_STRING 255
|
||||||
|
|
||||||
|
#define DYNAMIC_MANAGER_OP_SET 0
|
||||||
|
#define DYNAMIC_MANAGER_OP_GET 1
|
||||||
|
#define DYNAMIC_MANAGER_OP_CLEAR 2
|
||||||
|
|
||||||
|
struct dynamic_manager_user_config {
|
||||||
|
unsigned int operation;
|
||||||
|
unsigned int size;
|
||||||
|
char hash[65];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct manager_list_info {
|
||||||
|
int count;
|
||||||
|
struct {
|
||||||
|
uid_t uid;
|
||||||
|
int signature_index;
|
||||||
|
} managers[2];
|
||||||
|
};
|
||||||
|
|
||||||
struct root_profile {
|
struct root_profile {
|
||||||
int32_t uid;
|
int32_t uid;
|
||||||
int32_t gid;
|
int32_t gid;
|
||||||
|
|||||||
90
kernel/ksu_trace.c
Normal file
90
kernel/ksu_trace.c
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
#include "ksu_trace.h"
|
||||||
|
|
||||||
|
|
||||||
|
// extern kernelsu functions
|
||||||
|
extern bool ksu_execveat_hook __read_mostly;
|
||||||
|
extern bool ksu_vfs_read_hook __read_mostly;
|
||||||
|
extern bool ksu_input_hook __read_mostly;
|
||||||
|
extern int ksu_handle_execveat(int *fd, struct filename **filename_ptr, void *argv, void *envp, int *flags);
|
||||||
|
extern int ksu_handle_execveat_sucompat(int *fd, struct filename **filename_ptr, void *argv, void *envp, int *flags);
|
||||||
|
extern int ksu_handle_faccessat(int *dfd, const char __user **filename_user, int *mode, int *flags);
|
||||||
|
extern int ksu_handle_sys_read(unsigned int fd, char __user **buf_ptr, size_t *count_ptr);
|
||||||
|
extern int ksu_handle_stat(int *dfd, const char __user **filename_user, int *flags);
|
||||||
|
extern int ksu_handle_input_handle_event(unsigned int *type, unsigned int *code, int *value);
|
||||||
|
extern int ksu_handle_devpts(struct inode*);
|
||||||
|
// end kernelsu functions
|
||||||
|
|
||||||
|
|
||||||
|
// tracepoint callback functions
|
||||||
|
void ksu_trace_execveat_hook_callback(void *data, int *fd, struct filename **filename_ptr,
|
||||||
|
void *argv, void *envp, int *flags)
|
||||||
|
{
|
||||||
|
if (unlikely(ksu_execveat_hook))
|
||||||
|
ksu_handle_execveat(fd, filename_ptr, argv, envp, flags);
|
||||||
|
else
|
||||||
|
ksu_handle_execveat_sucompat(fd, filename_ptr, NULL, NULL, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ksu_trace_execveat_sucompat_hook_callback(void *data, int *fd, struct filename **filename_ptr,
|
||||||
|
void *argv, void *envp, int *flags)
|
||||||
|
{
|
||||||
|
if (!ksu_execveat_hook)
|
||||||
|
ksu_handle_execveat_sucompat(fd, filename_ptr, argv, envp, flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ksu_trace_faccessat_hook_callback(void *data, int *dfd, const char __user **filename_user,
|
||||||
|
int *mode, int *flags)
|
||||||
|
{
|
||||||
|
ksu_handle_faccessat(dfd, filename_user, mode, flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ksu_trace_sys_read_hook_callback(void *data, unsigned int fd, char __user **buf_ptr,
|
||||||
|
size_t *count_ptr)
|
||||||
|
{
|
||||||
|
if (unlikely(ksu_vfs_read_hook))
|
||||||
|
ksu_handle_sys_read(fd, buf_ptr, count_ptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ksu_trace_stat_hook_callback(void *data, int *dfd, const char __user **filename_user,
|
||||||
|
int *flags)
|
||||||
|
{
|
||||||
|
ksu_handle_stat(dfd, filename_user, flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ksu_trace_input_hook_callback(void *data, unsigned int *type, unsigned int *code,
|
||||||
|
int *value)
|
||||||
|
{
|
||||||
|
if (unlikely(ksu_input_hook))
|
||||||
|
ksu_handle_input_handle_event(type, code, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ksu_trace_devpts_hook_callback(void *data, struct inode *inode)
|
||||||
|
{
|
||||||
|
ksu_handle_devpts(inode);
|
||||||
|
}
|
||||||
|
// end tracepoint callback functions
|
||||||
|
|
||||||
|
|
||||||
|
// register tracepoint callback functions
|
||||||
|
void ksu_trace_register(void)
|
||||||
|
{
|
||||||
|
register_trace_ksu_trace_execveat_hook(ksu_trace_execveat_hook_callback, NULL);
|
||||||
|
register_trace_ksu_trace_execveat_sucompat_hook(ksu_trace_execveat_sucompat_hook_callback, NULL);
|
||||||
|
register_trace_ksu_trace_faccessat_hook(ksu_trace_faccessat_hook_callback, NULL);
|
||||||
|
register_trace_ksu_trace_sys_read_hook(ksu_trace_sys_read_hook_callback, NULL);
|
||||||
|
register_trace_ksu_trace_stat_hook(ksu_trace_stat_hook_callback, NULL);
|
||||||
|
register_trace_ksu_trace_input_hook(ksu_trace_input_hook_callback, NULL);
|
||||||
|
register_trace_ksu_trace_devpts_hook(ksu_trace_devpts_hook_callback, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
// unregister tracepoint callback functions
|
||||||
|
void ksu_trace_unregister(void)
|
||||||
|
{
|
||||||
|
unregister_trace_ksu_trace_execveat_hook(ksu_trace_execveat_hook_callback, NULL);
|
||||||
|
unregister_trace_ksu_trace_execveat_sucompat_hook(ksu_trace_execveat_sucompat_hook_callback, NULL);
|
||||||
|
unregister_trace_ksu_trace_faccessat_hook(ksu_trace_faccessat_hook_callback, NULL);
|
||||||
|
unregister_trace_ksu_trace_sys_read_hook(ksu_trace_sys_read_hook_callback, NULL);
|
||||||
|
unregister_trace_ksu_trace_stat_hook(ksu_trace_stat_hook_callback, NULL);
|
||||||
|
unregister_trace_ksu_trace_input_hook(ksu_trace_input_hook_callback, NULL);
|
||||||
|
unregister_trace_ksu_trace_devpts_hook(ksu_trace_devpts_hook_callback, NULL);
|
||||||
|
}
|
||||||
45
kernel/ksu_trace.h
Normal file
45
kernel/ksu_trace.h
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
#undef TRACE_SYSTEM
|
||||||
|
#define TRACE_SYSTEM ksu_trace
|
||||||
|
|
||||||
|
#if !defined(_KSU_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
|
||||||
|
#define _KSU_TRACE_H
|
||||||
|
|
||||||
|
#include <linux/fs.h>
|
||||||
|
#include <linux/tracepoint.h>
|
||||||
|
|
||||||
|
DECLARE_TRACE(ksu_trace_execveat_hook,
|
||||||
|
TP_PROTO(int *fd, struct filename **filename_ptr, void *argv, void *envp, int *flags),
|
||||||
|
TP_ARGS(fd, filename_ptr, argv, envp, flags));
|
||||||
|
|
||||||
|
DECLARE_TRACE(ksu_trace_execveat_sucompat_hook,
|
||||||
|
TP_PROTO(int *fd, struct filename **filename_ptr, void *argv, void *envp, int *flags),
|
||||||
|
TP_ARGS(fd, filename_ptr, argv, envp, flags));
|
||||||
|
|
||||||
|
DECLARE_TRACE(ksu_trace_faccessat_hook,
|
||||||
|
TP_PROTO(int *dfd, const char __user **filename_user, int *mode, int *flags),
|
||||||
|
TP_ARGS(dfd, filename_user, mode, flags));
|
||||||
|
|
||||||
|
DECLARE_TRACE(ksu_trace_sys_read_hook,
|
||||||
|
TP_PROTO(unsigned int fd, char __user **buf_ptr, size_t *count_ptr),
|
||||||
|
TP_ARGS(fd, buf_ptr, count_ptr));
|
||||||
|
|
||||||
|
DECLARE_TRACE(ksu_trace_stat_hook,
|
||||||
|
TP_PROTO(int *dfd, const char __user **filename_user, int *flags),
|
||||||
|
TP_ARGS(dfd, filename_user, flags));
|
||||||
|
|
||||||
|
DECLARE_TRACE(ksu_trace_input_hook,
|
||||||
|
TP_PROTO(unsigned int *type, unsigned int *code, int *value),
|
||||||
|
TP_ARGS(type, code, value));
|
||||||
|
|
||||||
|
DECLARE_TRACE(ksu_trace_devpts_hook,
|
||||||
|
TP_PROTO(struct inode *inode),
|
||||||
|
TP_ARGS(inode));
|
||||||
|
|
||||||
|
#endif /* _KSU_TRACE_H */
|
||||||
|
|
||||||
|
#undef TRACE_INCLUDE_PATH
|
||||||
|
#define TRACE_INCLUDE_PATH .
|
||||||
|
#undef TRACE_INCLUDE_FILE
|
||||||
|
#define TRACE_INCLUDE_FILE ksu_trace
|
||||||
|
|
||||||
|
#include <trace/define_trace.h>
|
||||||
10
kernel/ksu_trace_export.c
Normal file
10
kernel/ksu_trace_export.c
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
#define CREATE_TRACE_POINTS
|
||||||
|
#include "ksu_trace.h"
|
||||||
|
|
||||||
|
EXPORT_TRACEPOINT_SYMBOL_GPL(ksu_trace_execveat_hook);
|
||||||
|
EXPORT_TRACEPOINT_SYMBOL_GPL(ksu_trace_execveat_sucompat_hook);
|
||||||
|
EXPORT_TRACEPOINT_SYMBOL_GPL(ksu_trace_faccessat_hook);
|
||||||
|
EXPORT_TRACEPOINT_SYMBOL_GPL(ksu_trace_sys_read_hook);
|
||||||
|
EXPORT_TRACEPOINT_SYMBOL_GPL(ksu_trace_stat_hook);
|
||||||
|
EXPORT_TRACEPOINT_SYMBOL_GPL(ksu_trace_input_hook);
|
||||||
|
EXPORT_TRACEPOINT_SYMBOL_GPL(ksu_trace_devpts_hook);
|
||||||
@@ -48,7 +48,7 @@ static void stop_vfs_read_hook();
|
|||||||
static void stop_execve_hook();
|
static void stop_execve_hook();
|
||||||
static void stop_input_hook();
|
static void stop_input_hook();
|
||||||
|
|
||||||
#ifdef CONFIG_KPROBES
|
#ifdef CONFIG_KSU_KPROBES_HOOK
|
||||||
static struct work_struct stop_vfs_read_work;
|
static struct work_struct stop_vfs_read_work;
|
||||||
static struct work_struct stop_execve_hook_work;
|
static struct work_struct stop_execve_hook_work;
|
||||||
static struct work_struct stop_input_hook_work;
|
static struct work_struct stop_input_hook_work;
|
||||||
@@ -162,7 +162,7 @@ int ksu_handle_execveat_ksud(int *fd, struct filename **filename_ptr,
|
|||||||
struct user_arg_ptr *argv,
|
struct user_arg_ptr *argv,
|
||||||
struct user_arg_ptr *envp, int *flags)
|
struct user_arg_ptr *envp, int *flags)
|
||||||
{
|
{
|
||||||
#ifndef CONFIG_KPROBES
|
#ifndef CONFIG_KSU_KPROBES_HOOK
|
||||||
if (!ksu_execveat_hook) {
|
if (!ksu_execveat_hook) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -318,7 +318,7 @@ static ssize_t read_iter_proxy(struct kiocb *iocb, struct iov_iter *to)
|
|||||||
int ksu_handle_vfs_read(struct file **file_ptr, char __user **buf_ptr,
|
int ksu_handle_vfs_read(struct file **file_ptr, char __user **buf_ptr,
|
||||||
size_t *count_ptr, loff_t **pos)
|
size_t *count_ptr, loff_t **pos)
|
||||||
{
|
{
|
||||||
#ifndef CONFIG_KPROBES
|
#ifndef CONFIG_KSU_KPROBES_HOOK
|
||||||
if (!ksu_vfs_read_hook) {
|
if (!ksu_vfs_read_hook) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -431,7 +431,7 @@ static bool is_volumedown_enough(unsigned int count)
|
|||||||
int ksu_handle_input_handle_event(unsigned int *type, unsigned int *code,
|
int ksu_handle_input_handle_event(unsigned int *type, unsigned int *code,
|
||||||
int *value)
|
int *value)
|
||||||
{
|
{
|
||||||
#ifndef CONFIG_KPROBES
|
#ifndef CONFIG_KSU_KPROBES_HOOK
|
||||||
if (!ksu_input_hook) {
|
if (!ksu_input_hook) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -473,7 +473,7 @@ bool ksu_is_safe_mode()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_KPROBES
|
#ifdef CONFIG_KSU_KPROBES_HOOK
|
||||||
static int sys_execve_handler_pre(struct kprobe *p, struct pt_regs *regs)
|
static int sys_execve_handler_pre(struct kprobe *p, struct pt_regs *regs)
|
||||||
{
|
{
|
||||||
struct pt_regs *real_regs = PT_REAL_REGS(regs);
|
struct pt_regs *real_regs = PT_REAL_REGS(regs);
|
||||||
@@ -549,7 +549,7 @@ static void do_stop_input_hook(struct work_struct *work)
|
|||||||
|
|
||||||
static void stop_vfs_read_hook()
|
static void stop_vfs_read_hook()
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_KPROBES
|
#ifdef CONFIG_KSU_KPROBES_HOOK
|
||||||
bool ret = schedule_work(&stop_vfs_read_work);
|
bool ret = schedule_work(&stop_vfs_read_work);
|
||||||
pr_info("unregister vfs_read kprobe: %d!\n", ret);
|
pr_info("unregister vfs_read kprobe: %d!\n", ret);
|
||||||
#else
|
#else
|
||||||
@@ -560,7 +560,7 @@ static void stop_vfs_read_hook()
|
|||||||
|
|
||||||
static void stop_execve_hook()
|
static void stop_execve_hook()
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_KPROBES
|
#ifdef CONFIG_KSU_KPROBES_HOOK
|
||||||
bool ret = schedule_work(&stop_execve_hook_work);
|
bool ret = schedule_work(&stop_execve_hook_work);
|
||||||
pr_info("unregister execve kprobe: %d!\n", ret);
|
pr_info("unregister execve kprobe: %d!\n", ret);
|
||||||
#else
|
#else
|
||||||
@@ -576,7 +576,7 @@ static void stop_input_hook()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
input_hook_stopped = true;
|
input_hook_stopped = true;
|
||||||
#ifdef CONFIG_KPROBES
|
#ifdef CONFIG_KSU_KPROBES_HOOK
|
||||||
bool ret = schedule_work(&stop_input_hook_work);
|
bool ret = schedule_work(&stop_input_hook_work);
|
||||||
pr_info("unregister input kprobe: %d!\n", ret);
|
pr_info("unregister input kprobe: %d!\n", ret);
|
||||||
#else
|
#else
|
||||||
@@ -588,7 +588,7 @@ static void stop_input_hook()
|
|||||||
// ksud: module support
|
// ksud: module support
|
||||||
void ksu_ksud_init()
|
void ksu_ksud_init()
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_KPROBES
|
#ifdef CONFIG_KSU_KPROBES_HOOK
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = register_kprobe(&execve_kp);
|
ret = register_kprobe(&execve_kp);
|
||||||
@@ -608,12 +608,12 @@ void ksu_ksud_init()
|
|||||||
|
|
||||||
void ksu_ksud_exit()
|
void ksu_ksud_exit()
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_KPROBES
|
#ifdef CONFIG_KSU_KPROBES_HOOK
|
||||||
unregister_kprobe(&execve_kp);
|
unregister_kprobe(&execve_kp);
|
||||||
// this should be done before unregister vfs_read_kp
|
// this should be done before unregister vfs_read_kp
|
||||||
// unregister_kprobe(&vfs_read_kp);
|
// unregister_kprobe(&vfs_read_kp);
|
||||||
unregister_kprobe(&input_event_kp);
|
unregister_kprobe(&input_event_kp);
|
||||||
|
#endif
|
||||||
|
|
||||||
is_boot_phase = false;
|
is_boot_phase = false;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
@@ -8,6 +8,11 @@
|
|||||||
|
|
||||||
extern uid_t ksu_manager_uid; // DO NOT DIRECT USE
|
extern uid_t ksu_manager_uid; // DO NOT DIRECT USE
|
||||||
|
|
||||||
|
extern bool ksu_is_any_manager(uid_t uid);
|
||||||
|
extern void ksu_add_manager(uid_t uid, int signature_index);
|
||||||
|
extern void ksu_remove_manager(uid_t uid);
|
||||||
|
extern int ksu_get_manager_signature_index(uid_t uid);
|
||||||
|
|
||||||
static inline bool ksu_is_manager_uid_valid()
|
static inline bool ksu_is_manager_uid_valid()
|
||||||
{
|
{
|
||||||
return ksu_manager_uid != KSU_INVALID_UID;
|
return ksu_manager_uid != KSU_INVALID_UID;
|
||||||
@@ -15,7 +20,7 @@ static inline bool ksu_is_manager_uid_valid()
|
|||||||
|
|
||||||
static inline bool is_manager()
|
static inline bool is_manager()
|
||||||
{
|
{
|
||||||
return unlikely(ksu_manager_uid == current_uid().val);
|
return unlikely(ksu_is_any_manager(current_uid().val) || ksu_manager_uid == current_uid().val);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline uid_t ksu_get_manager_uid()
|
static inline uid_t ksu_get_manager_uid()
|
||||||
|
|||||||
13
kernel/manager_sign.h
Normal file
13
kernel/manager_sign.h
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
#ifndef MANAGER_SIGN_H
|
||||||
|
#define MANAGER_SIGN_H
|
||||||
|
|
||||||
|
// ShirkNeko/SukiSU
|
||||||
|
#define EXPECTED_SIZE_SHIRKNEKO 0x35c
|
||||||
|
#define EXPECTED_HASH_SHIRKNEKO "947ae944f3de4ed4c21a7e4f7953ecf351bfa2b36239da37a34111ad29993eef"
|
||||||
|
|
||||||
|
// Dynamic Sign
|
||||||
|
#define EXPECTED_SIZE_OTHER 0x300
|
||||||
|
#define EXPECTED_HASH_OTHER "0000000000000000000000000000000000000000000000000000000000000000"
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* MANAGER_SIGN_H */
|
||||||
@@ -19,19 +19,24 @@
|
|||||||
static struct policydb *get_policydb(void)
|
static struct policydb *get_policydb(void)
|
||||||
{
|
{
|
||||||
struct policydb *db;
|
struct policydb *db;
|
||||||
struct selinux_policy *policy = rcu_dereference(selinux_state.policy);
|
struct selinux_policy *policy = selinux_state.policy;
|
||||||
db = &policy->policydb;
|
db = &policy->policydb;
|
||||||
return db;
|
return db;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static DEFINE_MUTEX(ksu_rules);
|
||||||
|
|
||||||
void apply_kernelsu_rules()
|
void apply_kernelsu_rules()
|
||||||
{
|
{
|
||||||
|
struct policydb *db;
|
||||||
|
|
||||||
if (!getenforce()) {
|
if (!getenforce()) {
|
||||||
pr_info("SELinux permissive or disabled, apply rules!\n");
|
pr_info("SELinux permissive or disabled, apply rules!\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
rcu_read_lock();
|
mutex_lock(&ksu_rules);
|
||||||
struct policydb *db = get_policydb();
|
|
||||||
|
db = get_policydb();
|
||||||
|
|
||||||
ksu_permissive(db, KERNEL_SU_DOMAIN);
|
ksu_permissive(db, KERNEL_SU_DOMAIN);
|
||||||
ksu_typeattribute(db, KERNEL_SU_DOMAIN, "mlstrustedsubject");
|
ksu_typeattribute(db, KERNEL_SU_DOMAIN, "mlstrustedsubject");
|
||||||
@@ -122,7 +127,10 @@ void apply_kernelsu_rules()
|
|||||||
ksu_allow(db, "system_server", KERNEL_SU_DOMAIN, "process", "getpgid");
|
ksu_allow(db, "system_server", KERNEL_SU_DOMAIN, "process", "getpgid");
|
||||||
ksu_allow(db, "system_server", KERNEL_SU_DOMAIN, "process", "sigkill");
|
ksu_allow(db, "system_server", KERNEL_SU_DOMAIN, "process", "sigkill");
|
||||||
|
|
||||||
rcu_read_unlock();
|
// https://android-review.googlesource.com/c/platform/system/logging/+/3725346
|
||||||
|
ksu_dontaudit(db, "untrusted_app", KERNEL_SU_DOMAIN, "dir", "getattr");
|
||||||
|
|
||||||
|
mutex_unlock(&ksu_rules);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define MAX_SEPOL_LEN 128
|
#define MAX_SEPOL_LEN 128
|
||||||
@@ -212,6 +220,8 @@ static void reset_avc_cache()
|
|||||||
|
|
||||||
int handle_sepolicy(unsigned long arg3, void __user *arg4)
|
int handle_sepolicy(unsigned long arg3, void __user *arg4)
|
||||||
{
|
{
|
||||||
|
struct policydb *db;
|
||||||
|
|
||||||
if (!arg4) {
|
if (!arg4) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -273,9 +283,9 @@ int handle_sepolicy(unsigned long arg3, void __user *arg4)
|
|||||||
subcmd = data.subcmd;
|
subcmd = data.subcmd;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
rcu_read_lock();
|
mutex_lock(&ksu_rules);
|
||||||
|
|
||||||
struct policydb *db = get_policydb();
|
db = get_policydb();
|
||||||
|
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
if (cmd == CMD_NORMAL_PERM) {
|
if (cmd == CMD_NORMAL_PERM) {
|
||||||
@@ -525,7 +535,7 @@ int handle_sepolicy(unsigned long arg3, void __user *arg4)
|
|||||||
}
|
}
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
rcu_read_unlock();
|
mutex_unlock(&ksu_rules);
|
||||||
|
|
||||||
// only allow and xallow needs to reset avc cache, but we cannot do that because
|
// only allow and xallow needs to reset avc cache, but we cannot do that because
|
||||||
// we are in atomic context. so we just reset it every time.
|
// we are in atomic context. so we just reset it every time.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
GKI_ROOT=$(pwd)
|
KERNEL_ROOT=$(pwd)
|
||||||
|
|
||||||
display_usage() {
|
display_usage() {
|
||||||
echo "Usage: $0 [--cleanup | <commit-or-tag>]"
|
echo "Usage: $0 [--cleanup | <commit-or-tag>]"
|
||||||
@@ -12,10 +12,10 @@ display_usage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
initialize_variables() {
|
initialize_variables() {
|
||||||
if test -d "$GKI_ROOT/common/drivers"; then
|
if test -d "$KERNEL_ROOT/common/drivers"; then
|
||||||
DRIVER_DIR="$GKI_ROOT/common/drivers"
|
DRIVER_DIR="$KERNEL_ROOT/common/drivers"
|
||||||
elif test -d "$GKI_ROOT/drivers"; then
|
elif test -d "$KERNEL_ROOT/drivers"; then
|
||||||
DRIVER_DIR="$GKI_ROOT/drivers"
|
DRIVER_DIR="$KERNEL_ROOT/drivers"
|
||||||
else
|
else
|
||||||
echo '[ERROR] "drivers/" directory not found.'
|
echo '[ERROR] "drivers/" directory not found.'
|
||||||
exit 127
|
exit 127
|
||||||
@@ -30,22 +30,21 @@ perform_cleanup() {
|
|||||||
echo "[+] Cleaning up..."
|
echo "[+] Cleaning up..."
|
||||||
[ -L "$DRIVER_DIR/kernelsu" ] && rm "$DRIVER_DIR/kernelsu" && echo "[-] Symlink removed."
|
[ -L "$DRIVER_DIR/kernelsu" ] && rm "$DRIVER_DIR/kernelsu" && echo "[-] Symlink removed."
|
||||||
grep -q "kernelsu" "$DRIVER_MAKEFILE" && sed -i '/kernelsu/d' "$DRIVER_MAKEFILE" && echo "[-] Makefile reverted."
|
grep -q "kernelsu" "$DRIVER_MAKEFILE" && sed -i '/kernelsu/d' "$DRIVER_MAKEFILE" && echo "[-] Makefile reverted."
|
||||||
grep -q "drivers/kernelsu/Kconfig" "$DRIVER_KCONFIG" && sed -i '/drivers\/kernelsu\/Kconfig/d' "$DRIVER_KCONFIG" && echo "[-] Kconfig reverted."
|
grep -q "kernelsu" "$DRIVER_KCONFIG" && sed -i '/kernelsu/d' "$DRIVER_KCONFIG" && echo "[-] Kconfig reverted."
|
||||||
if [ -d "$GKI_ROOT/KernelSU" ]; then
|
if [ -d "$KERNEL_ROOT/KernelSU" ]; then
|
||||||
rm -rf "$GKI_ROOT/KernelSU" && echo "[-] KernelSU directory deleted."
|
rm -rf "$KERNEL_ROOT/KernelSU" && echo "[-] KernelSU directory deleted."
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Sets up or update KernelSU environment
|
# Sets up or update KernelSU environment
|
||||||
setup_kernelsu() {
|
setup_kernelsu() {
|
||||||
echo "[+] Setting up KernelSU..."
|
echo "[+] Setting up KernelSU..."
|
||||||
# Clone the repository and rename it to KernelSU
|
# Clone the repository
|
||||||
if [ ! -d "$GKI_ROOT/KernelSU" ]; then
|
if [ ! -d "$KERNEL_ROOT/KernelSU" ]; then
|
||||||
git clone https://github.com/SukiSU-Ultra/SukiSU-Ultra SukiSU-Ultra
|
git clone https://github.com/SukiSU-Ultra/SukiSU-Ultra KernelSU
|
||||||
mv SukiSU-Ultra KernelSU
|
echo "[+] Repository cloned."
|
||||||
echo "[+] Repository cloned and renamed to KernelSU."
|
|
||||||
fi
|
fi
|
||||||
cd "$GKI_ROOT/KernelSU"
|
cd "$KERNEL_ROOT/KernelSU"
|
||||||
git stash && echo "[-] Stashed current changes."
|
git stash && echo "[-] Stashed current changes."
|
||||||
if [ "$(git status | grep -Po 'v\d+(\.\d+)*' | head -n1)" ]; then
|
if [ "$(git status | grep -Po 'v\d+(\.\d+)*' | head -n1)" ]; then
|
||||||
git checkout main && echo "[-] Switched to main branch."
|
git checkout main && echo "[-] Switched to main branch."
|
||||||
@@ -57,11 +56,11 @@ setup_kernelsu() {
|
|||||||
git checkout "$1" && echo "[-] Checked out $1." || echo "[-] Checkout default branch"
|
git checkout "$1" && echo "[-] Checked out $1." || echo "[-] Checkout default branch"
|
||||||
fi
|
fi
|
||||||
cd "$DRIVER_DIR"
|
cd "$DRIVER_DIR"
|
||||||
ln -sf "$(realpath --relative-to="$DRIVER_DIR" "$GKI_ROOT/KernelSU/kernel")" "kernelsu" && echo "[+] Symlink created."
|
ln -sf "$(realpath --relative-to="$DRIVER_DIR" "$KERNEL_ROOT/KernelSU/kernel")" "kernelsu" && echo "[+] Symlink created."
|
||||||
|
|
||||||
# Add entries in Makefile and Kconfig if not already existing
|
# Add entries in Makefile and Kconfig if not already existing
|
||||||
grep -q "kernelsu" "$DRIVER_MAKEFILE" || printf "\nobj-\$(CONFIG_KSU) += kernelsu/\n" >> "$DRIVER_MAKEFILE" && echo "[+] Modified Makefile."
|
grep -q "kernelsu" "$DRIVER_MAKEFILE" || echo 'obj-$(CONFIG_KSU) += kernelsu/' >> "$DRIVER_MAKEFILE" && echo "[+] Modified Makefile."
|
||||||
grep -q "source \"drivers/kernelsu/Kconfig\"" "$DRIVER_KCONFIG" || sed -i "/endmenu/i\source \"drivers/kernelsu/Kconfig\"" "$DRIVER_KCONFIG" && echo "[+] Modified Kconfig."
|
grep -q 'source "drivers/kernelsu/Kconfig"' "$DRIVER_KCONFIG" || sed -i '/endmenu/i\source "drivers/kernelsu/Kconfig"' "$DRIVER_KCONFIG" && echo "[+] Modified Kconfig."
|
||||||
echo '[+] Done.'
|
echo '[+] Done.'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
extern void escape_to_root();
|
extern void escape_to_root();
|
||||||
|
|
||||||
#ifndef CONFIG_KPROBES
|
#ifndef CONFIG_KSU_KPROBES_HOOK
|
||||||
static bool ksu_sucompat_non_kp __read_mostly = true;
|
static bool ksu_sucompat_non_kp __read_mostly = true;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@ int ksu_handle_faccessat(int *dfd, const char __user **filename_user, int *mode,
|
|||||||
{
|
{
|
||||||
const char su[] = SU_PATH;
|
const char su[] = SU_PATH;
|
||||||
|
|
||||||
#ifndef CONFIG_KPROBES
|
#ifndef CONFIG_KSU_KPROBES_HOOK
|
||||||
if (!ksu_sucompat_non_kp) {
|
if (!ksu_sucompat_non_kp) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -81,7 +81,7 @@ int ksu_handle_stat(int *dfd, const char __user **filename_user, int *flags)
|
|||||||
// const char sh[] = SH_PATH;
|
// const char sh[] = SH_PATH;
|
||||||
const char su[] = SU_PATH;
|
const char su[] = SU_PATH;
|
||||||
|
|
||||||
#ifndef CONFIG_KPROBES
|
#ifndef CONFIG_KSU_KPROBES_HOOK
|
||||||
if (!ksu_sucompat_non_kp) {
|
if (!ksu_sucompat_non_kp) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -130,7 +130,7 @@ int ksu_handle_execveat_sucompat(int *fd, struct filename **filename_ptr,
|
|||||||
const char sh[] = KSUD_PATH;
|
const char sh[] = KSUD_PATH;
|
||||||
const char su[] = SU_PATH;
|
const char su[] = SU_PATH;
|
||||||
|
|
||||||
#ifndef CONFIG_KPROBES
|
#ifndef CONFIG_KSU_KPROBES_HOOK
|
||||||
if (!ksu_sucompat_non_kp) {
|
if (!ksu_sucompat_non_kp) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -164,7 +164,7 @@ int ksu_handle_execve_sucompat(int *fd, const char __user **filename_user,
|
|||||||
const char su[] = SU_PATH;
|
const char su[] = SU_PATH;
|
||||||
char path[sizeof(su) + 1];
|
char path[sizeof(su) + 1];
|
||||||
|
|
||||||
#ifndef CONFIG_KPROBES
|
#ifndef CONFIG_KSU_KPROBES_HOOK
|
||||||
if (!ksu_sucompat_non_kp){
|
if (!ksu_sucompat_non_kp){
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -189,7 +189,48 @@ int ksu_handle_execve_sucompat(int *fd, const char __user **filename_user,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_KPROBES
|
static int ksu_inline_handle_devpts(struct inode *inode)
|
||||||
|
{
|
||||||
|
if (!current->mm) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
uid_t uid = current_uid().val;
|
||||||
|
if (uid % 100000 < 10000) {
|
||||||
|
// not untrusted_app, ignore it
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!ksu_is_allow_uid(uid))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (ksu_devpts_sid) {
|
||||||
|
struct inode_security_struct *sec = selinux_inode(inode);
|
||||||
|
if (sec) {
|
||||||
|
sec->sid = ksu_devpts_sid;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int __ksu_handle_devpts(struct inode *inode)
|
||||||
|
{
|
||||||
|
#ifndef CONFIG_KSU_KPROBES_HOOK
|
||||||
|
if (!ksu_sucompat_non_kp) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return ksu_inline_handle_devpts(inode);
|
||||||
|
}
|
||||||
|
|
||||||
|
// dead code, we are phasing out ksu_handle_devpts for LSM hooks.
|
||||||
|
int __maybe_unused ksu_handle_devpts(struct inode *inode)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_KSU_KPROBES_HOOK
|
||||||
static int faccessat_handler_pre(struct kprobe *p, struct pt_regs *regs)
|
static int faccessat_handler_pre(struct kprobe *p, struct pt_regs *regs)
|
||||||
{
|
{
|
||||||
struct pt_regs *real_regs = PT_REAL_REGS(regs);
|
struct pt_regs *real_regs = PT_REAL_REGS(regs);
|
||||||
@@ -222,6 +263,24 @@ static int execve_handler_pre(struct kprobe *p, struct pt_regs *regs)
|
|||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef MODULE
|
||||||
|
static struct kprobe *su_kps[4];
|
||||||
|
static int pts_unix98_lookup_pre(struct kprobe *p, struct pt_regs *regs)
|
||||||
|
{
|
||||||
|
struct inode *inode;
|
||||||
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
|
||||||
|
struct file *file = (struct file *)PT_REGS_PARM2(regs);
|
||||||
|
inode = file->f_path.dentry->d_inode;
|
||||||
|
#else
|
||||||
|
inode = (struct inode *)PT_REGS_PARM2(regs);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return ksu_inline_handle_devpts(inode);
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
static struct kprobe *su_kps[3];
|
||||||
|
#endif
|
||||||
|
|
||||||
static struct kprobe *init_kprobe(const char *name,
|
static struct kprobe *init_kprobe(const char *name,
|
||||||
kprobe_pre_handler_t handler)
|
kprobe_pre_handler_t handler)
|
||||||
{
|
{
|
||||||
@@ -252,16 +311,18 @@ static void destroy_kprobe(struct kprobe **kp_ptr)
|
|||||||
*kp_ptr = NULL;
|
*kp_ptr = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct kprobe *su_kps[3];
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// sucompat: permited process can execute 'su' to gain root access.
|
// sucompat: permited process can execute 'su' to gain root access.
|
||||||
void ksu_sucompat_init()
|
void ksu_sucompat_init()
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_KPROBES
|
#ifdef CONFIG_KSU_KPROBES_HOOK
|
||||||
su_kps[0] = init_kprobe(SYS_EXECVE_SYMBOL, execve_handler_pre);
|
su_kps[0] = init_kprobe(SYS_EXECVE_SYMBOL, execve_handler_pre);
|
||||||
su_kps[1] = init_kprobe(SYS_FACCESSAT_SYMBOL, faccessat_handler_pre);
|
su_kps[1] = init_kprobe(SYS_FACCESSAT_SYMBOL, faccessat_handler_pre);
|
||||||
su_kps[2] = init_kprobe(SYS_NEWFSTATAT_SYMBOL, newfstatat_handler_pre);
|
su_kps[2] = init_kprobe(SYS_NEWFSTATAT_SYMBOL, newfstatat_handler_pre);
|
||||||
|
#ifdef MODULE
|
||||||
|
su_kps[3] = init_kprobe("pts_unix98_lookup", pts_unix98_lookup_pre);
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
ksu_sucompat_non_kp = true;
|
ksu_sucompat_non_kp = true;
|
||||||
pr_info("ksu_sucompat_init: hooks enabled: execve/execveat_su, faccessat, stat\n");
|
pr_info("ksu_sucompat_init: hooks enabled: execve/execveat_su, faccessat, stat\n");
|
||||||
@@ -270,7 +331,7 @@ void ksu_sucompat_init()
|
|||||||
|
|
||||||
void ksu_sucompat_exit()
|
void ksu_sucompat_exit()
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_KPROBES
|
#ifdef CONFIG_KSU_KPROBES_HOOK
|
||||||
for (int i = 0; i < ARRAY_SIZE(su_kps); i++) {
|
for (int i = 0; i < ARRAY_SIZE(su_kps); i++) {
|
||||||
destroy_kprobe(&su_kps[i]);
|
destroy_kprobe(&su_kps[i]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
#include <linux/string.h>
|
#include <linux/string.h>
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
#include <linux/version.h>
|
#include <linux/version.h>
|
||||||
#include <linux/namei.h>
|
|
||||||
|
|
||||||
#include "allowlist.h"
|
#include "allowlist.h"
|
||||||
#include "klog.h" // IWYU pragma: keep
|
#include "klog.h" // IWYU pragma: keep
|
||||||
@@ -13,6 +12,7 @@
|
|||||||
#include "manager.h"
|
#include "manager.h"
|
||||||
#include "throne_tracker.h"
|
#include "throne_tracker.h"
|
||||||
#include "kernel_compat.h"
|
#include "kernel_compat.h"
|
||||||
|
#include "dynamic_manager.h"
|
||||||
|
|
||||||
uid_t ksu_manager_uid = KSU_INVALID_UID;
|
uid_t ksu_manager_uid = KSU_INVALID_UID;
|
||||||
|
|
||||||
@@ -63,7 +63,7 @@ static int get_pkg_from_apk_path(char *pkg, const char *path)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void crown_manager(const char *apk, struct list_head *uid_data)
|
static void crown_manager(const char *apk, struct list_head *uid_data, int signature_index)
|
||||||
{
|
{
|
||||||
char pkg[KSU_MAX_PACKAGE_NAME];
|
char pkg[KSU_MAX_PACKAGE_NAME];
|
||||||
if (get_pkg_from_apk_path(pkg, apk) < 0) {
|
if (get_pkg_from_apk_path(pkg, apk) < 0) {
|
||||||
@@ -71,7 +71,7 @@ static void crown_manager(const char *apk, struct list_head *uid_data)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
pr_info("manager pkg: %s\n", pkg);
|
pr_info("manager pkg: %s, signature_index: %d\n", pkg, signature_index);
|
||||||
|
|
||||||
#ifdef KSU_MANAGER_PACKAGE
|
#ifdef KSU_MANAGER_PACKAGE
|
||||||
// pkg is `/<real package>`
|
// pkg is `/<real package>`
|
||||||
@@ -86,8 +86,17 @@ static void crown_manager(const char *apk, struct list_head *uid_data)
|
|||||||
|
|
||||||
list_for_each_entry (np, list, list) {
|
list_for_each_entry (np, list, list) {
|
||||||
if (strncmp(np->package, pkg, KSU_MAX_PACKAGE_NAME) == 0) {
|
if (strncmp(np->package, pkg, KSU_MAX_PACKAGE_NAME) == 0) {
|
||||||
pr_info("Crowning manager: %s(uid=%d)\n", pkg, np->uid);
|
pr_info("Crowning manager: %s(uid=%d, signature_index=%d)\n", pkg, np->uid, signature_index);
|
||||||
ksu_set_manager_uid(np->uid);
|
|
||||||
|
if (signature_index == 1 || signature_index == 2) {
|
||||||
|
ksu_add_manager(np->uid, signature_index);
|
||||||
|
|
||||||
|
if (!ksu_is_manager_uid_valid()) {
|
||||||
|
ksu_set_manager_uid(np->uid);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ksu_set_manager_uid(np->uid);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -116,7 +125,6 @@ struct my_dir_context {
|
|||||||
void *private_data;
|
void *private_data;
|
||||||
int depth;
|
int depth;
|
||||||
int *stop;
|
int *stop;
|
||||||
struct super_block* root_sb;
|
|
||||||
};
|
};
|
||||||
// https://docs.kernel.org/filesystems/porting.html
|
// https://docs.kernel.org/filesystems/porting.html
|
||||||
// filldir_t (readdir callbacks) calling conventions have changed. Instead of returning 0 or -E... it returns bool now. false means "no more" (as -E... used to) and true - "keep going" (as 0 in old calling conventions). Rationale: callers never looked at specific -E... values anyway. -> iterate_shared() instances require no changes at all, all filldir_t ones in the tree converted.
|
// filldir_t (readdir callbacks) calling conventions have changed. Instead of returning 0 or -E... it returns bool now. false means "no more" (as -E... used to) and true - "keep going" (as 0 in old calling conventions). Rationale: callers never looked at specific -E... values anyway. -> iterate_shared() instances require no changes at all, all filldir_t ones in the tree converted.
|
||||||
@@ -137,8 +145,6 @@ FILLDIR_RETURN_TYPE my_actor(struct dir_context *ctx, const char *name,
|
|||||||
struct my_dir_context *my_ctx =
|
struct my_dir_context *my_ctx =
|
||||||
container_of(ctx, struct my_dir_context, ctx);
|
container_of(ctx, struct my_dir_context, ctx);
|
||||||
char dirpath[DATA_PATH_LEN];
|
char dirpath[DATA_PATH_LEN];
|
||||||
int err;
|
|
||||||
struct path path;
|
|
||||||
|
|
||||||
if (!my_ctx) {
|
if (!my_ctx) {
|
||||||
pr_err("Invalid context\n");
|
pr_err("Invalid context\n");
|
||||||
@@ -166,18 +172,6 @@ FILLDIR_RETURN_TYPE my_actor(struct dir_context *ctx, const char *name,
|
|||||||
return FILLDIR_ACTOR_CONTINUE;
|
return FILLDIR_ACTOR_CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
err = kern_path(dirpath, 0, &path);
|
|
||||||
|
|
||||||
if (err) {
|
|
||||||
pr_err("get dirpath %s err: %d\n", dirpath, err);
|
|
||||||
return FILLDIR_ACTOR_CONTINUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (my_ctx->root_sb != path.dentry->d_inode->i_sb) {
|
|
||||||
pr_info("skip cross fs: %s", dirpath);
|
|
||||||
return FILLDIR_ACTOR_CONTINUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (d_type == DT_DIR && my_ctx->depth > 0 &&
|
if (d_type == DT_DIR && my_ctx->depth > 0 &&
|
||||||
(my_ctx->stop && !*my_ctx->stop)) {
|
(my_ctx->stop && !*my_ctx->stop)) {
|
||||||
struct data_path *data = kmalloc(sizeof(struct data_path), GFP_ATOMIC);
|
struct data_path *data = kmalloc(sizeof(struct data_path), GFP_ATOMIC);
|
||||||
@@ -201,11 +195,24 @@ FILLDIR_RETURN_TYPE my_actor(struct dir_context *ctx, const char *name,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool is_manager = is_manager_apk(dirpath);
|
int signature_index = -1;
|
||||||
pr_info("Found new base.apk at path: %s, is_manager: %d\n",
|
bool is_multi_manager = ksu_is_dynamic_manager_apk(dirpath, &signature_index);
|
||||||
dirpath, is_manager);
|
|
||||||
if (is_manager) {
|
pr_info("Found new base.apk at path: %s, is_multi_manager: %d, signature_index: %d\n",
|
||||||
crown_manager(dirpath, my_ctx->private_data);
|
dirpath, is_multi_manager, signature_index);
|
||||||
|
|
||||||
|
if (is_multi_manager && (signature_index == 1 || signature_index == 2)) {
|
||||||
|
crown_manager(dirpath, my_ctx->private_data, signature_index);
|
||||||
|
|
||||||
|
struct apk_path_hash *apk_data = kmalloc(sizeof(struct apk_path_hash), GFP_ATOMIC);
|
||||||
|
if (apk_data) {
|
||||||
|
apk_data->hash = hash;
|
||||||
|
apk_data->exists = true;
|
||||||
|
list_add_tail(&apk_data->list, &apk_path_hash_list);
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if (is_manager_apk(dirpath)) {
|
||||||
|
crown_manager(dirpath, my_ctx->private_data, 0);
|
||||||
*my_ctx->stop = 1;
|
*my_ctx->stop = 1;
|
||||||
|
|
||||||
// Manager found, clear APK cache list
|
// Manager found, clear APK cache list
|
||||||
@@ -215,9 +222,11 @@ FILLDIR_RETURN_TYPE my_actor(struct dir_context *ctx, const char *name,
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
struct apk_path_hash *apk_data = kmalloc(sizeof(struct apk_path_hash), GFP_ATOMIC);
|
struct apk_path_hash *apk_data = kmalloc(sizeof(struct apk_path_hash), GFP_ATOMIC);
|
||||||
apk_data->hash = hash;
|
if (apk_data) {
|
||||||
apk_data->exists = true;
|
apk_data->hash = hash;
|
||||||
list_add_tail(&apk_data->list, &apk_path_hash_list);
|
apk_data->exists = true;
|
||||||
|
list_add_tail(&apk_data->list, &apk_path_hash_list);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -227,18 +236,10 @@ FILLDIR_RETURN_TYPE my_actor(struct dir_context *ctx, const char *name,
|
|||||||
|
|
||||||
void search_manager(const char *path, int depth, struct list_head *uid_data)
|
void search_manager(const char *path, int depth, struct list_head *uid_data)
|
||||||
{
|
{
|
||||||
int i, stop = 0, err;
|
int i, stop = 0;
|
||||||
struct list_head data_path_list;
|
struct list_head data_path_list;
|
||||||
struct path kpath;
|
|
||||||
struct super_block* root_sb;
|
|
||||||
INIT_LIST_HEAD(&data_path_list);
|
INIT_LIST_HEAD(&data_path_list);
|
||||||
|
unsigned long data_app_magic = 0;
|
||||||
err = kern_path(path, 0, &kpath);
|
|
||||||
|
|
||||||
if (err) {
|
|
||||||
pr_err("get search root %s err: %d\n", path, err);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Initialize APK cache list
|
// Initialize APK cache list
|
||||||
struct apk_path_hash *pos, *n;
|
struct apk_path_hash *pos, *n;
|
||||||
@@ -252,8 +253,6 @@ void search_manager(const char *path, int depth, struct list_head *uid_data)
|
|||||||
data.depth = depth;
|
data.depth = depth;
|
||||||
list_add_tail(&data.list, &data_path_list);
|
list_add_tail(&data.list, &data_path_list);
|
||||||
|
|
||||||
root_sb = kpath.dentry->d_inode->i_sb;
|
|
||||||
|
|
||||||
for (i = depth; i >= 0; i--) {
|
for (i = depth; i >= 0; i--) {
|
||||||
struct data_path *pos, *n;
|
struct data_path *pos, *n;
|
||||||
|
|
||||||
@@ -263,8 +262,7 @@ void search_manager(const char *path, int depth, struct list_head *uid_data)
|
|||||||
.parent_dir = pos->dirpath,
|
.parent_dir = pos->dirpath,
|
||||||
.private_data = uid_data,
|
.private_data = uid_data,
|
||||||
.depth = pos->depth,
|
.depth = pos->depth,
|
||||||
.stop = &stop,
|
.stop = &stop };
|
||||||
.root_sb = root_sb };
|
|
||||||
struct file *file;
|
struct file *file;
|
||||||
|
|
||||||
if (!stop) {
|
if (!stop) {
|
||||||
@@ -274,6 +272,24 @@ void search_manager(const char *path, int depth, struct list_head *uid_data)
|
|||||||
goto skip_iterate;
|
goto skip_iterate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// grab magic on first folder, which is /data/app
|
||||||
|
if (!data_app_magic) {
|
||||||
|
if (file->f_inode->i_sb->s_magic) {
|
||||||
|
data_app_magic = file->f_inode->i_sb->s_magic;
|
||||||
|
pr_info("%s: dir: %s got magic! 0x%lx\n", __func__, pos->dirpath, data_app_magic);
|
||||||
|
} else {
|
||||||
|
filp_close(file, NULL);
|
||||||
|
goto skip_iterate;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (file->f_inode->i_sb->s_magic != data_app_magic) {
|
||||||
|
pr_info("%s: skip: %s magic: 0x%lx expected: 0x%lx\n", __func__, pos->dirpath,
|
||||||
|
file->f_inode->i_sb->s_magic, data_app_magic);
|
||||||
|
filp_close(file, NULL);
|
||||||
|
goto skip_iterate;
|
||||||
|
}
|
||||||
|
|
||||||
iterate_dir(file, &ctx.ctx);
|
iterate_dir(file, &ctx.ctx);
|
||||||
filp_close(file, NULL);
|
filp_close(file, NULL);
|
||||||
}
|
}
|
||||||
@@ -372,6 +388,8 @@ void track_throne()
|
|||||||
|
|
||||||
// first, check if manager_uid exist!
|
// first, check if manager_uid exist!
|
||||||
bool manager_exist = false;
|
bool manager_exist = false;
|
||||||
|
bool dynamic_manager_exist = false;
|
||||||
|
|
||||||
list_for_each_entry (np, &uid_list, list) {
|
list_for_each_entry (np, &uid_list, list) {
|
||||||
// if manager is installed in work profile, the uid in packages.list is still equals main profile
|
// if manager is installed in work profile, the uid in packages.list is still equals main profile
|
||||||
// don't delete it in this case!
|
// don't delete it in this case!
|
||||||
@@ -382,6 +400,16 @@ void track_throne()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check for dynamic managers
|
||||||
|
if (!dynamic_manager_exist && ksu_is_dynamic_manager_enabled()) {
|
||||||
|
list_for_each_entry (np, &uid_list, list) {
|
||||||
|
if (ksu_is_any_manager(np->uid)) {
|
||||||
|
dynamic_manager_exist = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!manager_exist) {
|
if (!manager_exist) {
|
||||||
if (ksu_is_manager_uid_valid()) {
|
if (ksu_is_manager_uid_valid()) {
|
||||||
pr_info("manager is uninstalled, invalidate it!\n");
|
pr_info("manager is uninstalled, invalidate it!\n");
|
||||||
@@ -391,6 +419,11 @@ void track_throne()
|
|||||||
pr_info("Searching manager...\n");
|
pr_info("Searching manager...\n");
|
||||||
search_manager("/data/app", 2, &uid_list);
|
search_manager("/data/app", 2, &uid_list);
|
||||||
pr_info("Search manager finished\n");
|
pr_info("Search manager finished\n");
|
||||||
|
} else if (!dynamic_manager_exist && ksu_is_dynamic_manager_enabled()) {
|
||||||
|
// Always perform search when called from dynamic manager rescan
|
||||||
|
pr_info("Dynamic sign enabled, Searching manager...\n");
|
||||||
|
search_manager("/data/app", 2, &uid_list);
|
||||||
|
pr_info("Search Dynamic sign manager finished\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
prune:
|
prune:
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
@file:Suppress("UnstableApiUsage")
|
@file:Suppress("UnstableApiUsage")
|
||||||
|
|
||||||
import com.android.build.api.dsl.ApkSigningConfig
|
|
||||||
import com.android.build.gradle.internal.api.BaseVariantOutputImpl
|
import com.android.build.gradle.internal.api.BaseVariantOutputImpl
|
||||||
import com.android.build.gradle.tasks.PackageAndroidArtifact
|
import com.android.build.gradle.tasks.PackageAndroidArtifact
|
||||||
|
|
||||||
@@ -107,6 +106,10 @@ android {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ksp {
|
||||||
|
arg("compose-destinations.defaultTransitions", "none")
|
||||||
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation(libs.gson)
|
implementation(libs.gson)
|
||||||
implementation(libs.androidx.activity.compose)
|
implementation(libs.androidx.activity.compose)
|
||||||
@@ -159,4 +162,6 @@ dependencies {
|
|||||||
implementation(libs.mmrl.webui)
|
implementation(libs.mmrl.webui)
|
||||||
implementation(libs.mmrl.ui)
|
implementation(libs.mmrl.ui)
|
||||||
|
|
||||||
|
implementation(libs.accompanist.drawablepainter)
|
||||||
|
|
||||||
}
|
}
|
||||||
BIN
manager/app/src/main/assets/ksu_susfs_1.5.7
Normal file
BIN
manager/app/src/main/assets/ksu_susfs_1.5.7
Normal file
Binary file not shown.
BIN
manager/app/src/main/assets/ksu_susfs_1.5.8
Normal file
BIN
manager/app/src/main/assets/ksu_susfs_1.5.8
Normal file
Binary file not shown.
BIN
manager/app/src/main/assets/ksu_susfs_1.5.9
Normal file
BIN
manager/app/src/main/assets/ksu_susfs_1.5.9
Normal file
Binary file not shown.
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
# For more information about using CMake with Android Studio, read the
|
# For more information about using CMake with Android Studio, read the
|
||||||
# documentation: https://d.android.com/studio/projects/add-native-code.html
|
# documentation: https://d.android.com/studio/projects/add-native-code.html
|
||||||
|
|
||||||
@@ -7,15 +6,22 @@ cmake_minimum_required(VERSION 3.18.1)
|
|||||||
|
|
||||||
project("kernelsu")
|
project("kernelsu")
|
||||||
|
|
||||||
find_package(cxx REQUIRED CONFIG)
|
|
||||||
link_libraries(cxx::cxx)
|
|
||||||
|
|
||||||
add_library(zako
|
add_library(zako
|
||||||
SHARED
|
SHARED
|
||||||
jni.cc
|
jni.c
|
||||||
ksu.cc
|
ksu.c
|
||||||
)
|
)
|
||||||
|
|
||||||
find_library(log-lib log)
|
find_library(log-lib log)
|
||||||
|
|
||||||
target_link_libraries(zako ${log-lib})
|
if(ANDROID_ABI STREQUAL "arm64-v8a")
|
||||||
|
set(zakosign-lib ${CMAKE_SOURCE_DIR}/../jniLibs/arm64-v8a/libzakosign.so)
|
||||||
|
elseif(ANDROID_ABI STREQUAL "armeabi-v7a")
|
||||||
|
set(zakosign-lib ${CMAKE_SOURCE_DIR}/../jniLibs/armeabi-v7a/libzakosign.so)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(ANDROID_ABI STREQUAL "arm64-v8a" OR ANDROID_ABI STREQUAL "armeabi-v7a")
|
||||||
|
target_link_libraries(zako ${log-lib} ${zakosign-lib})
|
||||||
|
else()
|
||||||
|
target_link_libraries(zako ${log-lib})
|
||||||
|
endif()
|
||||||
|
|||||||
434
manager/app/src/main/cpp/jni.c
Normal file
434
manager/app/src/main/cpp/jni.c
Normal file
@@ -0,0 +1,434 @@
|
|||||||
|
#include "prelude.h"
|
||||||
|
#include "ksu.h"
|
||||||
|
|
||||||
|
#include <jni.h>
|
||||||
|
#include <sys/prctl.h>
|
||||||
|
#include <android/log.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
|
||||||
|
NativeBridge(becomeManager, jboolean, jstring pkg) {
|
||||||
|
const char* cpkg = GetEnvironment()->GetStringUTFChars(env, pkg, JNI_FALSE);
|
||||||
|
bool result = become_manager(cpkg);
|
||||||
|
|
||||||
|
GetEnvironment()->ReleaseStringUTFChars(env, pkg, cpkg);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
NativeBridgeNP(getVersion, jint) {
|
||||||
|
return get_version();
|
||||||
|
}
|
||||||
|
|
||||||
|
// get VERSION FULL
|
||||||
|
NativeBridgeNP(getFullVersion, jstring) {
|
||||||
|
char buff[255] = { 0 };
|
||||||
|
get_full_version((char *) &buff);
|
||||||
|
return GetEnvironment()->NewStringUTF(env, buff);
|
||||||
|
}
|
||||||
|
|
||||||
|
NativeBridgeNP(getAllowList, jintArray) {
|
||||||
|
int uids[1024];
|
||||||
|
int size = 0;
|
||||||
|
bool result = get_allow_list(uids, &size);
|
||||||
|
|
||||||
|
LogDebug("getAllowList: %d, size: %d", result, size);
|
||||||
|
|
||||||
|
if (result) {
|
||||||
|
jintArray array = GetEnvironment()->NewIntArray(env, size);
|
||||||
|
GetEnvironment()->SetIntArrayRegion(env, array, 0, size, uids);
|
||||||
|
|
||||||
|
return array;
|
||||||
|
}
|
||||||
|
|
||||||
|
return GetEnvironment()->NewIntArray(env, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
NativeBridgeNP(isSafeMode, jboolean) {
|
||||||
|
return is_safe_mode();
|
||||||
|
}
|
||||||
|
|
||||||
|
NativeBridgeNP(isLkmMode, jboolean) {
|
||||||
|
return is_lkm_mode();
|
||||||
|
}
|
||||||
|
|
||||||
|
static void fillIntArray(JNIEnv *env, jobject list, int *data, int count) {
|
||||||
|
jclass cls = GetEnvironment()->GetObjectClass(env, list);
|
||||||
|
jmethodID add = GetEnvironment()->GetMethodID(env, cls, "add", "(Ljava/lang/Object;)Z");
|
||||||
|
jclass integerCls = GetEnvironment()->FindClass(env, "java/lang/Integer");
|
||||||
|
jmethodID constructor = GetEnvironment()->GetMethodID(env, integerCls, "<init>", "(I)V");
|
||||||
|
for (int i = 0; i < count; ++i) {
|
||||||
|
jobject integer = GetEnvironment()->NewObject(env, integerCls, constructor, data[i]);
|
||||||
|
GetEnvironment()->CallBooleanMethod(env, list, add, integer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void addIntToList(JNIEnv *env, jobject list, int ele) {
|
||||||
|
jclass cls = GetEnvironment()->GetObjectClass(env, list);
|
||||||
|
jmethodID add = GetEnvironment()->GetMethodID(env, cls, "add", "(Ljava/lang/Object;)Z");
|
||||||
|
jclass integerCls = GetEnvironment()->FindClass(env, "java/lang/Integer");
|
||||||
|
jmethodID constructor = GetEnvironment()->GetMethodID(env, integerCls, "<init>", "(I)V");
|
||||||
|
jobject integer = GetEnvironment()->NewObject(env, integerCls, constructor, ele);
|
||||||
|
GetEnvironment()->CallBooleanMethod(env, list, add, integer);
|
||||||
|
}
|
||||||
|
|
||||||
|
static uint64_t capListToBits(JNIEnv *env, jobject list) {
|
||||||
|
jclass cls = GetEnvironment()->GetObjectClass(env, list);
|
||||||
|
jmethodID get = GetEnvironment()->GetMethodID(env, cls, "get", "(I)Ljava/lang/Object;");
|
||||||
|
jmethodID size = GetEnvironment()->GetMethodID(env, cls, "size", "()I");
|
||||||
|
jint listSize = GetEnvironment()->CallIntMethod(env, list, size);
|
||||||
|
jclass integerCls = GetEnvironment()->FindClass(env, "java/lang/Integer");
|
||||||
|
jmethodID intValue = GetEnvironment()->GetMethodID(env, integerCls, "intValue", "()I");
|
||||||
|
uint64_t result = 0;
|
||||||
|
for (int i = 0; i < listSize; ++i) {
|
||||||
|
jobject integer = GetEnvironment()->CallObjectMethod(env, list, get, i);
|
||||||
|
int data = GetEnvironment()->CallIntMethod(env, integer, intValue);
|
||||||
|
|
||||||
|
if (cap_valid(data)) {
|
||||||
|
result |= (1ULL << data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int getListSize(JNIEnv *env, jobject list) {
|
||||||
|
jclass cls = GetEnvironment()->GetObjectClass(env, list);
|
||||||
|
jmethodID size = GetEnvironment()->GetMethodID(env, cls, "size", "()I");
|
||||||
|
return GetEnvironment()->CallIntMethod(env, list, size);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void fillArrayWithList(JNIEnv *env, jobject list, int *data, int count) {
|
||||||
|
jclass cls = GetEnvironment()->GetObjectClass(env, list);
|
||||||
|
jmethodID get = GetEnvironment()->GetMethodID(env, cls, "get", "(I)Ljava/lang/Object;");
|
||||||
|
jclass integerCls = GetEnvironment()->FindClass(env, "java/lang/Integer");
|
||||||
|
jmethodID intValue = GetEnvironment()->GetMethodID(env, integerCls, "intValue", "()I");
|
||||||
|
for (int i = 0; i < count; ++i) {
|
||||||
|
jobject integer = GetEnvironment()->CallObjectMethod(env, list, get, i);
|
||||||
|
data[i] = GetEnvironment()->CallIntMethod(env, integer, intValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
NativeBridge(getAppProfile, jobject, jstring pkg, jint uid) {
|
||||||
|
if (GetEnvironment()->GetStringLength(env, pkg) > KSU_MAX_PACKAGE_NAME) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
char key[KSU_MAX_PACKAGE_NAME] = { 0 };
|
||||||
|
const char* cpkg = GetEnvironment()->GetStringUTFChars(env, pkg, nullptr);
|
||||||
|
strcpy(key, cpkg);
|
||||||
|
GetEnvironment()->ReleaseStringUTFChars(env, pkg, cpkg);
|
||||||
|
|
||||||
|
struct app_profile profile = { 0 };
|
||||||
|
profile.version = KSU_APP_PROFILE_VER;
|
||||||
|
|
||||||
|
strcpy(profile.key, key);
|
||||||
|
profile.current_uid = uid;
|
||||||
|
|
||||||
|
bool useDefaultProfile = !get_app_profile(key, &profile);
|
||||||
|
|
||||||
|
jclass cls = GetEnvironment()->FindClass(env, "com/sukisu/ultra/Natives$Profile");
|
||||||
|
jmethodID constructor = GetEnvironment()->GetMethodID(env, cls, "<init>", "()V");
|
||||||
|
jobject obj = GetEnvironment()->NewObject(env, cls, constructor);
|
||||||
|
jfieldID keyField = GetEnvironment()->GetFieldID(env, cls, "name", "Ljava/lang/String;");
|
||||||
|
jfieldID currentUidField = GetEnvironment()->GetFieldID(env, cls, "currentUid", "I");
|
||||||
|
jfieldID allowSuField = GetEnvironment()->GetFieldID(env, cls, "allowSu", "Z");
|
||||||
|
|
||||||
|
jfieldID rootUseDefaultField = GetEnvironment()->GetFieldID(env, cls, "rootUseDefault", "Z");
|
||||||
|
jfieldID rootTemplateField = GetEnvironment()->GetFieldID(env, cls, "rootTemplate", "Ljava/lang/String;");
|
||||||
|
|
||||||
|
jfieldID uidField = GetEnvironment()->GetFieldID(env, cls, "uid", "I");
|
||||||
|
jfieldID gidField = GetEnvironment()->GetFieldID(env, cls, "gid", "I");
|
||||||
|
jfieldID groupsField = GetEnvironment()->GetFieldID(env, cls, "groups", "Ljava/util/List;");
|
||||||
|
jfieldID capabilitiesField = GetEnvironment()->GetFieldID(env, cls, "capabilities", "Ljava/util/List;");
|
||||||
|
jfieldID domainField = GetEnvironment()->GetFieldID(env, cls, "context", "Ljava/lang/String;");
|
||||||
|
jfieldID namespacesField = GetEnvironment()->GetFieldID(env, cls, "namespace", "I");
|
||||||
|
|
||||||
|
jfieldID nonRootUseDefaultField = GetEnvironment()->GetFieldID(env, cls, "nonRootUseDefault", "Z");
|
||||||
|
jfieldID umountModulesField = GetEnvironment()->GetFieldID(env, cls, "umountModules", "Z");
|
||||||
|
|
||||||
|
GetEnvironment()->SetObjectField(env, obj, keyField, GetEnvironment()->NewStringUTF(env, profile.key));
|
||||||
|
GetEnvironment()->SetIntField(env, obj, currentUidField, profile.current_uid);
|
||||||
|
|
||||||
|
if (useDefaultProfile) {
|
||||||
|
// no profile found, so just use default profile:
|
||||||
|
// don't allow root and use default profile!
|
||||||
|
LogDebug("use default profile for: %s, %d", key, uid);
|
||||||
|
|
||||||
|
// allow_su = false
|
||||||
|
// non root use default = true
|
||||||
|
GetEnvironment()->SetBooleanField(env, obj, allowSuField, false);
|
||||||
|
GetEnvironment()->SetBooleanField(env, obj, nonRootUseDefaultField, true);
|
||||||
|
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool allowSu = profile.allow_su;
|
||||||
|
|
||||||
|
if (allowSu) {
|
||||||
|
GetEnvironment()->SetBooleanField(env, obj, rootUseDefaultField, (jboolean) profile.rp_config.use_default);
|
||||||
|
if (strlen(profile.rp_config.template_name) > 0) {
|
||||||
|
GetEnvironment()->SetObjectField(env, obj, rootTemplateField,
|
||||||
|
GetEnvironment()->NewStringUTF(env, profile.rp_config.template_name));
|
||||||
|
}
|
||||||
|
|
||||||
|
GetEnvironment()->SetIntField(env, obj, uidField, profile.rp_config.profile.uid);
|
||||||
|
GetEnvironment()->SetIntField(env, obj, gidField, profile.rp_config.profile.gid);
|
||||||
|
|
||||||
|
jobject groupList = GetEnvironment()->GetObjectField(env, obj, groupsField);
|
||||||
|
int groupCount = profile.rp_config.profile.groups_count;
|
||||||
|
if (groupCount > KSU_MAX_GROUPS) {
|
||||||
|
LogDebug("kernel group count too large: %d???", groupCount);
|
||||||
|
groupCount = KSU_MAX_GROUPS;
|
||||||
|
}
|
||||||
|
fillIntArray(env, groupList, profile.rp_config.profile.groups, groupCount);
|
||||||
|
|
||||||
|
jobject capList = GetEnvironment()->GetObjectField(env, obj, capabilitiesField);
|
||||||
|
for (int i = 0; i <= CAP_LAST_CAP; i++) {
|
||||||
|
if (profile.rp_config.profile.capabilities.effective & (1ULL << i)) {
|
||||||
|
addIntToList(env, capList, i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
GetEnvironment()->SetObjectField(env, obj, domainField,
|
||||||
|
GetEnvironment()->NewStringUTF(env, profile.rp_config.profile.selinux_domain));
|
||||||
|
GetEnvironment()->SetIntField(env, obj, namespacesField, profile.rp_config.profile.namespaces);
|
||||||
|
GetEnvironment()->SetBooleanField(env, obj, allowSuField, profile.allow_su);
|
||||||
|
} else {
|
||||||
|
GetEnvironment()->SetBooleanField(env, obj, nonRootUseDefaultField, profile.nrp_config.use_default);
|
||||||
|
GetEnvironment()->SetBooleanField(env, obj, umountModulesField, profile.nrp_config.profile.umount_modules);
|
||||||
|
}
|
||||||
|
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
NativeBridge(setAppProfile, jboolean, jobject profile) {
|
||||||
|
jclass cls = GetEnvironment()->FindClass(env, "com/sukisu/ultra/Natives$Profile");
|
||||||
|
|
||||||
|
jfieldID keyField = GetEnvironment()->GetFieldID(env, cls, "name", "Ljava/lang/String;");
|
||||||
|
jfieldID currentUidField = GetEnvironment()->GetFieldID(env, cls, "currentUid", "I");
|
||||||
|
jfieldID allowSuField = GetEnvironment()->GetFieldID(env, cls, "allowSu", "Z");
|
||||||
|
|
||||||
|
jfieldID rootUseDefaultField = GetEnvironment()->GetFieldID(env, cls, "rootUseDefault", "Z");
|
||||||
|
jfieldID rootTemplateField = GetEnvironment()->GetFieldID(env, cls, "rootTemplate", "Ljava/lang/String;");
|
||||||
|
|
||||||
|
jfieldID uidField = GetEnvironment()->GetFieldID(env, cls, "uid", "I");
|
||||||
|
jfieldID gidField = GetEnvironment()->GetFieldID(env, cls, "gid", "I");
|
||||||
|
jfieldID groupsField = GetEnvironment()->GetFieldID(env, cls, "groups", "Ljava/util/List;");
|
||||||
|
jfieldID capabilitiesField = GetEnvironment()->GetFieldID(env, cls, "capabilities", "Ljava/util/List;");
|
||||||
|
jfieldID domainField = GetEnvironment()->GetFieldID(env, cls, "context", "Ljava/lang/String;");
|
||||||
|
jfieldID namespacesField = GetEnvironment()->GetFieldID(env, cls, "namespace", "I");
|
||||||
|
|
||||||
|
jfieldID nonRootUseDefaultField = GetEnvironment()->GetFieldID(env, cls, "nonRootUseDefault", "Z");
|
||||||
|
jfieldID umountModulesField = GetEnvironment()->GetFieldID(env, cls, "umountModules", "Z");
|
||||||
|
|
||||||
|
jobject key = GetEnvironment()->GetObjectField(env, profile, keyField);
|
||||||
|
if (!key) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (GetEnvironment()->GetStringLength(env, (jstring) key) > KSU_MAX_PACKAGE_NAME) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* cpkg = GetEnvironment()->GetStringUTFChars(env, (jstring) key, nullptr);
|
||||||
|
char p_key[KSU_MAX_PACKAGE_NAME] = { 0 };
|
||||||
|
strcpy(p_key, cpkg);
|
||||||
|
GetEnvironment()->ReleaseStringUTFChars(env, (jstring) key, cpkg);
|
||||||
|
|
||||||
|
jint currentUid = GetEnvironment()->GetIntField(env, profile, currentUidField);
|
||||||
|
|
||||||
|
jint uid = GetEnvironment()->GetIntField(env, profile, uidField);
|
||||||
|
jint gid = GetEnvironment()->GetIntField(env, profile, gidField);
|
||||||
|
jobject groups = GetEnvironment()->GetObjectField(env, profile, groupsField);
|
||||||
|
jobject capabilities = GetEnvironment()->GetObjectField(env, profile, capabilitiesField);
|
||||||
|
jobject domain = GetEnvironment()->GetObjectField(env, profile, domainField);
|
||||||
|
jboolean allowSu = GetEnvironment()->GetBooleanField(env, profile, allowSuField);
|
||||||
|
jboolean umountModules = GetEnvironment()->GetBooleanField(env, profile, umountModulesField);
|
||||||
|
|
||||||
|
struct app_profile p = { 0 };
|
||||||
|
p.version = KSU_APP_PROFILE_VER;
|
||||||
|
|
||||||
|
strcpy(p.key, p_key);
|
||||||
|
p.allow_su = allowSu;
|
||||||
|
p.current_uid = currentUid;
|
||||||
|
|
||||||
|
if (allowSu) {
|
||||||
|
p.rp_config.use_default = GetEnvironment()->GetBooleanField(env, profile, rootUseDefaultField);
|
||||||
|
jobject templateName = GetEnvironment()->GetObjectField(env, profile, rootTemplateField);
|
||||||
|
if (templateName) {
|
||||||
|
const char* ctemplateName = GetEnvironment()->GetStringUTFChars(env, (jstring) templateName, nullptr);
|
||||||
|
strcpy(p.rp_config.template_name, ctemplateName);
|
||||||
|
GetEnvironment()->ReleaseStringUTFChars(env, (jstring) templateName, ctemplateName);
|
||||||
|
}
|
||||||
|
|
||||||
|
p.rp_config.profile.uid = uid;
|
||||||
|
p.rp_config.profile.gid = gid;
|
||||||
|
|
||||||
|
int groups_count = getListSize(env, groups);
|
||||||
|
if (groups_count > KSU_MAX_GROUPS) {
|
||||||
|
LogDebug("groups count too large: %d", groups_count);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
p.rp_config.profile.groups_count = groups_count;
|
||||||
|
fillArrayWithList(env, groups, p.rp_config.profile.groups, groups_count);
|
||||||
|
|
||||||
|
p.rp_config.profile.capabilities.effective = capListToBits(env, capabilities);
|
||||||
|
|
||||||
|
const char* cdomain = GetEnvironment()->GetStringUTFChars(env, (jstring) domain, nullptr);
|
||||||
|
strcpy(p.rp_config.profile.selinux_domain, cdomain);
|
||||||
|
GetEnvironment()->ReleaseStringUTFChars(env, (jstring) domain, cdomain);
|
||||||
|
|
||||||
|
p.rp_config.profile.namespaces = GetEnvironment()->GetIntField(env, profile, namespacesField);
|
||||||
|
} else {
|
||||||
|
p.nrp_config.use_default = GetEnvironment()->GetBooleanField(env, profile, nonRootUseDefaultField);
|
||||||
|
p.nrp_config.profile.umount_modules = umountModules;
|
||||||
|
}
|
||||||
|
|
||||||
|
return set_app_profile(&p);
|
||||||
|
}
|
||||||
|
|
||||||
|
NativeBridge(uidShouldUmount, jboolean, jint uid) {
|
||||||
|
return uid_should_umount(uid);
|
||||||
|
}
|
||||||
|
|
||||||
|
NativeBridgeNP(isSuEnabled, jboolean) {
|
||||||
|
return is_su_enabled();
|
||||||
|
}
|
||||||
|
|
||||||
|
NativeBridge(setSuEnabled, jboolean, jboolean enabled) {
|
||||||
|
return set_su_enabled(enabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if KPM is enabled
|
||||||
|
NativeBridgeNP(isKPMEnabled, jboolean) {
|
||||||
|
return is_KPM_enable();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get HOOK type
|
||||||
|
NativeBridgeNP(getHookType, jstring) {
|
||||||
|
char hook_type[16];
|
||||||
|
get_hook_type(hook_type, sizeof(hook_type));
|
||||||
|
return GetEnvironment()->NewStringUTF(env, hook_type);
|
||||||
|
}
|
||||||
|
|
||||||
|
// SuSFS Related Function Status
|
||||||
|
NativeBridgeNP(getSusfsFeatureStatus, jobject) {
|
||||||
|
struct susfs_feature_status status;
|
||||||
|
bool result = get_susfs_feature_status(&status);
|
||||||
|
|
||||||
|
if (!result) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
jclass cls = GetEnvironment()->FindClass(env, "com/sukisu/ultra/Natives$SusfsFeatureStatus");
|
||||||
|
jmethodID constructor = GetEnvironment()->GetMethodID(env, cls, "<init>", "()V");
|
||||||
|
jobject obj = GetEnvironment()->NewObject(env, cls, constructor);
|
||||||
|
|
||||||
|
SET_BOOLEAN_FIELD(obj, cls, statusSusPath, status.status_sus_path);
|
||||||
|
SET_BOOLEAN_FIELD(obj, cls, statusSusMount, status.status_sus_mount);
|
||||||
|
SET_BOOLEAN_FIELD(obj, cls, statusAutoDefaultMount, status.status_auto_default_mount);
|
||||||
|
SET_BOOLEAN_FIELD(obj, cls, statusAutoBindMount, status.status_auto_bind_mount);
|
||||||
|
SET_BOOLEAN_FIELD(obj, cls, statusSusKstat, status.status_sus_kstat);
|
||||||
|
SET_BOOLEAN_FIELD(obj, cls, statusTryUmount, status.status_try_umount);
|
||||||
|
SET_BOOLEAN_FIELD(obj, cls, statusAutoTryUmountBind, status.status_auto_try_umount_bind);
|
||||||
|
SET_BOOLEAN_FIELD(obj, cls, statusSpoofUname, status.status_spoof_uname);
|
||||||
|
SET_BOOLEAN_FIELD(obj, cls, statusEnableLog, status.status_enable_log);
|
||||||
|
SET_BOOLEAN_FIELD(obj, cls, statusHideSymbols, status.status_hide_symbols);
|
||||||
|
SET_BOOLEAN_FIELD(obj, cls, statusSpoofCmdline, status.status_spoof_cmdline);
|
||||||
|
SET_BOOLEAN_FIELD(obj, cls, statusOpenRedirect, status.status_open_redirect);
|
||||||
|
SET_BOOLEAN_FIELD(obj, cls, statusMagicMount, status.status_magic_mount);
|
||||||
|
SET_BOOLEAN_FIELD(obj, cls, statusSusSu, status.status_sus_su);
|
||||||
|
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
// dynamic manager
|
||||||
|
NativeBridge(setDynamicManager, jboolean, jint size, jstring hash) {
|
||||||
|
if (!hash) {
|
||||||
|
LogDebug("setDynamicManager: hash is null");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* chash = GetEnvironment()->GetStringUTFChars(env, hash, nullptr);
|
||||||
|
bool result = set_dynamic_manager((unsigned int)size, chash);
|
||||||
|
GetEnvironment()->ReleaseStringUTFChars(env, hash, chash);
|
||||||
|
|
||||||
|
LogDebug("setDynamicManager: size=0x%x, result=%d", size, result);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
NativeBridgeNP(getDynamicManager, jobject) {
|
||||||
|
struct dynamic_manager_user_config config;
|
||||||
|
bool result = get_dynamic_manager(&config);
|
||||||
|
|
||||||
|
if (!result) {
|
||||||
|
LogDebug("getDynamicManager: failed to get dynamic manager config");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
jobject obj = CREATE_JAVA_OBJECT("com/sukisu/ultra/Natives$DynamicManagerConfig");
|
||||||
|
jclass cls = GetEnvironment()->FindClass(env, "com/sukisu/ultra/Natives$DynamicManagerConfig");
|
||||||
|
|
||||||
|
SET_INT_FIELD(obj, cls, size, (jint)config.size);
|
||||||
|
SET_STRING_FIELD(obj, cls, hash, config.hash);
|
||||||
|
|
||||||
|
LogDebug("getDynamicManager: size=0x%x, hash=%.16s...", config.size, config.hash);
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
NativeBridgeNP(clearDynamicManager, jboolean) {
|
||||||
|
bool result = clear_dynamic_manager();
|
||||||
|
LogDebug("clearDynamicManager: result=%d", result);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get a list of active managers
|
||||||
|
NativeBridgeNP(getManagersList, jobject) {
|
||||||
|
struct manager_list_info managerListInfo;
|
||||||
|
bool result = get_managers_list(&managerListInfo);
|
||||||
|
|
||||||
|
if (!result) {
|
||||||
|
LogDebug("getManagersList: failed to get active managers list");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
jobject obj = CREATE_JAVA_OBJECT("com/sukisu/ultra/Natives$ManagersList");
|
||||||
|
jclass managerListCls = GetEnvironment()->FindClass(env, "com/sukisu/ultra/Natives$ManagersList");
|
||||||
|
|
||||||
|
SET_INT_FIELD(obj, managerListCls, count, (jint)managerListInfo.count);
|
||||||
|
|
||||||
|
jobject managersList = CREATE_ARRAYLIST();
|
||||||
|
|
||||||
|
for (int i = 0; i < managerListInfo.count; i++) {
|
||||||
|
jobject managerInfo = CREATE_JAVA_OBJECT_WITH_PARAMS(
|
||||||
|
"com/sukisu/ultra/Natives$ManagerInfo",
|
||||||
|
"(II)V",
|
||||||
|
(jint)managerListInfo.managers[i].uid,
|
||||||
|
(jint)managerListInfo.managers[i].signature_index
|
||||||
|
);
|
||||||
|
ADD_TO_LIST(managersList, managerInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
SET_OBJECT_FIELD(obj, managerListCls, managers, managersList);
|
||||||
|
|
||||||
|
LogDebug("getManagersList: count=%d", managerListInfo.count);
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
NativeBridge(verifyModuleSignature, jboolean, jstring modulePath) {
|
||||||
|
#if defined(__aarch64__) || defined(_M_ARM64) || defined(__arm__) || defined(_M_ARM)
|
||||||
|
if (!modulePath) {
|
||||||
|
LogDebug("verifyModuleSignature: modulePath is null");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* cModulePath = GetEnvironment()->GetStringUTFChars(env, modulePath, nullptr);
|
||||||
|
bool result = verify_module_signature(cModulePath);
|
||||||
|
GetEnvironment()->ReleaseStringUTFChars(env, modulePath, cModulePath);
|
||||||
|
|
||||||
|
LogDebug("verifyModuleSignature: path=%s, result=%d", cModulePath, result);
|
||||||
|
return result;
|
||||||
|
#else
|
||||||
|
LogDebug("verifyModuleSignature: not supported on non-ARM architecture");
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
@@ -1,313 +0,0 @@
|
|||||||
#include <jni.h>
|
|
||||||
|
|
||||||
#include <sys/prctl.h>
|
|
||||||
|
|
||||||
#include <android/log.h>
|
|
||||||
#include <cstring>
|
|
||||||
|
|
||||||
#include "ksu.h"
|
|
||||||
|
|
||||||
#define LOG_TAG "KernelSU"
|
|
||||||
#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)
|
|
||||||
|
|
||||||
extern "C"
|
|
||||||
JNIEXPORT jboolean JNICALL
|
|
||||||
Java_com_sukisu_ultra_Natives_becomeManager(JNIEnv *env, jobject, jstring pkg) {
|
|
||||||
auto cpkg = env->GetStringUTFChars(pkg, nullptr);
|
|
||||||
auto result = become_manager(cpkg);
|
|
||||||
env->ReleaseStringUTFChars(pkg, cpkg);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
extern "C"
|
|
||||||
JNIEXPORT jint JNICALL
|
|
||||||
Java_com_sukisu_ultra_Natives_getVersion(JNIEnv *env, jobject) {
|
|
||||||
return get_version();
|
|
||||||
}
|
|
||||||
|
|
||||||
extern "C"
|
|
||||||
JNIEXPORT jintArray JNICALL
|
|
||||||
Java_com_sukisu_ultra_Natives_getAllowList(JNIEnv *env, jobject) {
|
|
||||||
int uids[1024];
|
|
||||||
int size = 0;
|
|
||||||
bool result = get_allow_list(uids, &size);
|
|
||||||
LOGD("getAllowList: %d, size: %d", result, size);
|
|
||||||
if (result) {
|
|
||||||
auto array = env->NewIntArray(size);
|
|
||||||
env->SetIntArrayRegion(array, 0, size, uids);
|
|
||||||
return array;
|
|
||||||
}
|
|
||||||
return env->NewIntArray(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
extern "C"
|
|
||||||
JNIEXPORT jboolean JNICALL
|
|
||||||
Java_com_sukisu_ultra_Natives_isSafeMode(JNIEnv *env, jclass clazz) {
|
|
||||||
return is_safe_mode();
|
|
||||||
}
|
|
||||||
|
|
||||||
extern "C"
|
|
||||||
JNIEXPORT jboolean JNICALL
|
|
||||||
Java_com_sukisu_ultra_Natives_isLkmMode(JNIEnv *env, jclass clazz) {
|
|
||||||
return is_lkm_mode();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void fillIntArray(JNIEnv *env, jobject list, int *data, int count) {
|
|
||||||
auto cls = env->GetObjectClass(list);
|
|
||||||
auto add = env->GetMethodID(cls, "add", "(Ljava/lang/Object;)Z");
|
|
||||||
auto integerCls = env->FindClass("java/lang/Integer");
|
|
||||||
auto constructor = env->GetMethodID(integerCls, "<init>", "(I)V");
|
|
||||||
for (int i = 0; i < count; ++i) {
|
|
||||||
auto integer = env->NewObject(integerCls, constructor, data[i]);
|
|
||||||
env->CallBooleanMethod(list, add, integer);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void addIntToList(JNIEnv *env, jobject list, int ele) {
|
|
||||||
auto cls = env->GetObjectClass(list);
|
|
||||||
auto add = env->GetMethodID(cls, "add", "(Ljava/lang/Object;)Z");
|
|
||||||
auto integerCls = env->FindClass("java/lang/Integer");
|
|
||||||
auto constructor = env->GetMethodID(integerCls, "<init>", "(I)V");
|
|
||||||
auto integer = env->NewObject(integerCls, constructor, ele);
|
|
||||||
env->CallBooleanMethod(list, add, integer);
|
|
||||||
}
|
|
||||||
|
|
||||||
static uint64_t capListToBits(JNIEnv *env, jobject list) {
|
|
||||||
auto cls = env->GetObjectClass(list);
|
|
||||||
auto get = env->GetMethodID(cls, "get", "(I)Ljava/lang/Object;");
|
|
||||||
auto size = env->GetMethodID(cls, "size", "()I");
|
|
||||||
auto listSize = env->CallIntMethod(list, size);
|
|
||||||
auto integerCls = env->FindClass("java/lang/Integer");
|
|
||||||
auto intValue = env->GetMethodID(integerCls, "intValue", "()I");
|
|
||||||
uint64_t result = 0;
|
|
||||||
for (int i = 0; i < listSize; ++i) {
|
|
||||||
auto integer = env->CallObjectMethod(list, get, i);
|
|
||||||
int data = env->CallIntMethod(integer, intValue);
|
|
||||||
|
|
||||||
if (cap_valid(data)) {
|
|
||||||
result |= (1ULL << data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int getListSize(JNIEnv *env, jobject list) {
|
|
||||||
auto cls = env->GetObjectClass(list);
|
|
||||||
auto size = env->GetMethodID(cls, "size", "()I");
|
|
||||||
return env->CallIntMethod(list, size);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void fillArrayWithList(JNIEnv *env, jobject list, int *data, int count) {
|
|
||||||
auto cls = env->GetObjectClass(list);
|
|
||||||
auto get = env->GetMethodID(cls, "get", "(I)Ljava/lang/Object;");
|
|
||||||
auto integerCls = env->FindClass("java/lang/Integer");
|
|
||||||
auto intValue = env->GetMethodID(integerCls, "intValue", "()I");
|
|
||||||
for (int i = 0; i < count; ++i) {
|
|
||||||
auto integer = env->CallObjectMethod(list, get, i);
|
|
||||||
data[i] = env->CallIntMethod(integer, intValue);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
extern "C"
|
|
||||||
JNIEXPORT jobject JNICALL
|
|
||||||
Java_com_sukisu_ultra_Natives_getAppProfile(JNIEnv *env, jobject, jstring pkg, jint uid) {
|
|
||||||
if (env->GetStringLength(pkg) > KSU_MAX_PACKAGE_NAME) {
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
p_key_t key = {};
|
|
||||||
auto cpkg = env->GetStringUTFChars(pkg, nullptr);
|
|
||||||
strcpy(key, cpkg);
|
|
||||||
env->ReleaseStringUTFChars(pkg, cpkg);
|
|
||||||
|
|
||||||
app_profile profile = {};
|
|
||||||
profile.version = KSU_APP_PROFILE_VER;
|
|
||||||
|
|
||||||
strcpy(profile.key, key);
|
|
||||||
profile.current_uid = uid;
|
|
||||||
|
|
||||||
bool useDefaultProfile = !get_app_profile(key, &profile);
|
|
||||||
|
|
||||||
auto cls = env->FindClass("com/sukisu/ultra/Natives$Profile");
|
|
||||||
auto constructor = env->GetMethodID(cls, "<init>", "()V");
|
|
||||||
auto obj = env->NewObject(cls, constructor);
|
|
||||||
auto keyField = env->GetFieldID(cls, "name", "Ljava/lang/String;");
|
|
||||||
auto currentUidField = env->GetFieldID(cls, "currentUid", "I");
|
|
||||||
auto allowSuField = env->GetFieldID(cls, "allowSu", "Z");
|
|
||||||
|
|
||||||
auto rootUseDefaultField = env->GetFieldID(cls, "rootUseDefault", "Z");
|
|
||||||
auto rootTemplateField = env->GetFieldID(cls, "rootTemplate", "Ljava/lang/String;");
|
|
||||||
|
|
||||||
auto uidField = env->GetFieldID(cls, "uid", "I");
|
|
||||||
auto gidField = env->GetFieldID(cls, "gid", "I");
|
|
||||||
auto groupsField = env->GetFieldID(cls, "groups", "Ljava/util/List;");
|
|
||||||
auto capabilitiesField = env->GetFieldID(cls, "capabilities", "Ljava/util/List;");
|
|
||||||
auto domainField = env->GetFieldID(cls, "context", "Ljava/lang/String;");
|
|
||||||
auto namespacesField = env->GetFieldID(cls, "namespace", "I");
|
|
||||||
|
|
||||||
auto nonRootUseDefaultField = env->GetFieldID(cls, "nonRootUseDefault", "Z");
|
|
||||||
auto umountModulesField = env->GetFieldID(cls, "umountModules", "Z");
|
|
||||||
|
|
||||||
env->SetObjectField(obj, keyField, env->NewStringUTF(profile.key));
|
|
||||||
env->SetIntField(obj, currentUidField, profile.current_uid);
|
|
||||||
|
|
||||||
if (useDefaultProfile) {
|
|
||||||
// no profile found, so just use default profile:
|
|
||||||
// don't allow root and use default profile!
|
|
||||||
LOGD("use default profile for: %s, %d", key, uid);
|
|
||||||
|
|
||||||
// allow_su = false
|
|
||||||
// non root use default = true
|
|
||||||
env->SetBooleanField(obj, allowSuField, false);
|
|
||||||
env->SetBooleanField(obj, nonRootUseDefaultField, true);
|
|
||||||
|
|
||||||
return obj;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto allowSu = profile.allow_su;
|
|
||||||
|
|
||||||
if (allowSu) {
|
|
||||||
env->SetBooleanField(obj, rootUseDefaultField, (jboolean) profile.rp_config.use_default);
|
|
||||||
if (strlen(profile.rp_config.template_name) > 0) {
|
|
||||||
env->SetObjectField(obj, rootTemplateField,
|
|
||||||
env->NewStringUTF(profile.rp_config.template_name));
|
|
||||||
}
|
|
||||||
|
|
||||||
env->SetIntField(obj, uidField, profile.rp_config.profile.uid);
|
|
||||||
env->SetIntField(obj, gidField, profile.rp_config.profile.gid);
|
|
||||||
|
|
||||||
jobject groupList = env->GetObjectField(obj, groupsField);
|
|
||||||
int groupCount = profile.rp_config.profile.groups_count;
|
|
||||||
if (groupCount > KSU_MAX_GROUPS) {
|
|
||||||
LOGD("kernel group count too large: %d???", groupCount);
|
|
||||||
groupCount = KSU_MAX_GROUPS;
|
|
||||||
}
|
|
||||||
fillIntArray(env, groupList, profile.rp_config.profile.groups, groupCount);
|
|
||||||
|
|
||||||
jobject capList = env->GetObjectField(obj, capabilitiesField);
|
|
||||||
for (int i = 0; i <= CAP_LAST_CAP; i++) {
|
|
||||||
if (profile.rp_config.profile.capabilities.effective & (1ULL << i)) {
|
|
||||||
addIntToList(env, capList, i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
env->SetObjectField(obj, domainField,
|
|
||||||
env->NewStringUTF(profile.rp_config.profile.selinux_domain));
|
|
||||||
env->SetIntField(obj, namespacesField, profile.rp_config.profile.namespaces);
|
|
||||||
env->SetBooleanField(obj, allowSuField, profile.allow_su);
|
|
||||||
} else {
|
|
||||||
env->SetBooleanField(obj, nonRootUseDefaultField,
|
|
||||||
(jboolean) profile.nrp_config.use_default);
|
|
||||||
env->SetBooleanField(obj, umountModulesField, profile.nrp_config.profile.umount_modules);
|
|
||||||
}
|
|
||||||
|
|
||||||
return obj;
|
|
||||||
}
|
|
||||||
|
|
||||||
extern "C"
|
|
||||||
JNIEXPORT jboolean JNICALL
|
|
||||||
Java_com_sukisu_ultra_Natives_setAppProfile(JNIEnv *env, jobject clazz, jobject profile) {
|
|
||||||
auto cls = env->FindClass("com/sukisu/ultra/Natives$Profile");
|
|
||||||
|
|
||||||
auto keyField = env->GetFieldID(cls, "name", "Ljava/lang/String;");
|
|
||||||
auto currentUidField = env->GetFieldID(cls, "currentUid", "I");
|
|
||||||
auto allowSuField = env->GetFieldID(cls, "allowSu", "Z");
|
|
||||||
|
|
||||||
auto rootUseDefaultField = env->GetFieldID(cls, "rootUseDefault", "Z");
|
|
||||||
auto rootTemplateField = env->GetFieldID(cls, "rootTemplate", "Ljava/lang/String;");
|
|
||||||
|
|
||||||
auto uidField = env->GetFieldID(cls, "uid", "I");
|
|
||||||
auto gidField = env->GetFieldID(cls, "gid", "I");
|
|
||||||
auto groupsField = env->GetFieldID(cls, "groups", "Ljava/util/List;");
|
|
||||||
auto capabilitiesField = env->GetFieldID(cls, "capabilities", "Ljava/util/List;");
|
|
||||||
auto domainField = env->GetFieldID(cls, "context", "Ljava/lang/String;");
|
|
||||||
auto namespacesField = env->GetFieldID(cls, "namespace", "I");
|
|
||||||
|
|
||||||
auto nonRootUseDefaultField = env->GetFieldID(cls, "nonRootUseDefault", "Z");
|
|
||||||
auto umountModulesField = env->GetFieldID(cls, "umountModules", "Z");
|
|
||||||
|
|
||||||
auto key = env->GetObjectField(profile, keyField);
|
|
||||||
if (!key) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (env->GetStringLength((jstring) key) > KSU_MAX_PACKAGE_NAME) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto cpkg = env->GetStringUTFChars((jstring) key, nullptr);
|
|
||||||
p_key_t p_key = {};
|
|
||||||
strcpy(p_key, cpkg);
|
|
||||||
env->ReleaseStringUTFChars((jstring) key, cpkg);
|
|
||||||
|
|
||||||
auto currentUid = env->GetIntField(profile, currentUidField);
|
|
||||||
|
|
||||||
auto uid = env->GetIntField(profile, uidField);
|
|
||||||
auto gid = env->GetIntField(profile, gidField);
|
|
||||||
auto groups = env->GetObjectField(profile, groupsField);
|
|
||||||
auto capabilities = env->GetObjectField(profile, capabilitiesField);
|
|
||||||
auto domain = env->GetObjectField(profile, domainField);
|
|
||||||
auto allowSu = env->GetBooleanField(profile, allowSuField);
|
|
||||||
auto umountModules = env->GetBooleanField(profile, umountModulesField);
|
|
||||||
|
|
||||||
app_profile p = {};
|
|
||||||
p.version = KSU_APP_PROFILE_VER;
|
|
||||||
|
|
||||||
strcpy(p.key, p_key);
|
|
||||||
p.allow_su = allowSu;
|
|
||||||
p.current_uid = currentUid;
|
|
||||||
|
|
||||||
if (allowSu) {
|
|
||||||
p.rp_config.use_default = env->GetBooleanField(profile, rootUseDefaultField);
|
|
||||||
auto templateName = env->GetObjectField(profile, rootTemplateField);
|
|
||||||
if (templateName) {
|
|
||||||
auto ctemplateName = env->GetStringUTFChars((jstring) templateName, nullptr);
|
|
||||||
strcpy(p.rp_config.template_name, ctemplateName);
|
|
||||||
env->ReleaseStringUTFChars((jstring) templateName, ctemplateName);
|
|
||||||
}
|
|
||||||
|
|
||||||
p.rp_config.profile.uid = uid;
|
|
||||||
p.rp_config.profile.gid = gid;
|
|
||||||
|
|
||||||
int groups_count = getListSize(env, groups);
|
|
||||||
if (groups_count > KSU_MAX_GROUPS) {
|
|
||||||
LOGD("groups count too large: %d", groups_count);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
p.rp_config.profile.groups_count = groups_count;
|
|
||||||
fillArrayWithList(env, groups, p.rp_config.profile.groups, groups_count);
|
|
||||||
|
|
||||||
p.rp_config.profile.capabilities.effective = capListToBits(env, capabilities);
|
|
||||||
|
|
||||||
auto cdomain = env->GetStringUTFChars((jstring) domain, nullptr);
|
|
||||||
strcpy(p.rp_config.profile.selinux_domain, cdomain);
|
|
||||||
env->ReleaseStringUTFChars((jstring) domain, cdomain);
|
|
||||||
|
|
||||||
p.rp_config.profile.namespaces = env->GetIntField(profile, namespacesField);
|
|
||||||
} else {
|
|
||||||
p.nrp_config.use_default = env->GetBooleanField(profile, nonRootUseDefaultField);
|
|
||||||
p.nrp_config.profile.umount_modules = umountModules;
|
|
||||||
}
|
|
||||||
|
|
||||||
return set_app_profile(&p);
|
|
||||||
}
|
|
||||||
extern "C"
|
|
||||||
JNIEXPORT jboolean JNICALL
|
|
||||||
Java_com_sukisu_ultra_Natives_uidShouldUmount(JNIEnv *env, jobject thiz, jint uid) {
|
|
||||||
return uid_should_umount(uid);
|
|
||||||
}
|
|
||||||
extern "C"
|
|
||||||
JNIEXPORT jboolean JNICALL
|
|
||||||
Java_com_sukisu_ultra_Natives_isSuEnabled(JNIEnv *env, jobject thiz) {
|
|
||||||
return is_su_enabled();
|
|
||||||
}
|
|
||||||
extern "C"
|
|
||||||
JNIEXPORT jboolean JNICALL
|
|
||||||
Java_com_sukisu_ultra_Natives_setSuEnabled(JNIEnv *env, jobject thiz, jboolean enabled) {
|
|
||||||
return set_su_enabled(enabled);
|
|
||||||
}
|
|
||||||
|
|
||||||
extern "C" JNIEXPORT jboolean JNICALL
|
|
||||||
Java_com_sukisu_ultra_Natives_isKPMEnabled(JNIEnv *env, jobject) {
|
|
||||||
return is_KPM_enable();
|
|
||||||
}
|
|
||||||
252
manager/app/src/main/cpp/ksu.c
Normal file
252
manager/app/src/main/cpp/ksu.c
Normal file
@@ -0,0 +1,252 @@
|
|||||||
|
//
|
||||||
|
// Created by weishu on 2022/12/9.
|
||||||
|
//
|
||||||
|
|
||||||
|
#include <sys/prctl.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#include "prelude.h"
|
||||||
|
#include "ksu.h"
|
||||||
|
|
||||||
|
#if defined(__aarch64__) || defined(_M_ARM64) || defined(__arm__) || defined(_M_ARM)
|
||||||
|
|
||||||
|
// Zako extern declarations
|
||||||
|
#define ZAKO_ESV_IMPORTANT_ERROR 1 << 31
|
||||||
|
extern int zako_sys_file_open(const char* path);
|
||||||
|
extern uint32_t zako_file_verify_esig(int fd, uint32_t flags);
|
||||||
|
extern const char* zako_file_verrcidx2str(uint8_t index);
|
||||||
|
|
||||||
|
#endif // __aarch64__ || _M_ARM64 || __arm__ || _M_ARM
|
||||||
|
|
||||||
|
#define KERNEL_SU_OPTION 0xDEADBEEF
|
||||||
|
|
||||||
|
#define CMD_GRANT_ROOT 0
|
||||||
|
|
||||||
|
#define CMD_BECOME_MANAGER 1
|
||||||
|
#define CMD_GET_VERSION 2
|
||||||
|
#define CMD_ALLOW_SU 3
|
||||||
|
#define CMD_DENY_SU 4
|
||||||
|
#define CMD_GET_SU_LIST 5
|
||||||
|
#define CMD_GET_DENY_LIST 6
|
||||||
|
#define CMD_CHECK_SAFEMODE 9
|
||||||
|
|
||||||
|
#define CMD_GET_APP_PROFILE 10
|
||||||
|
#define CMD_SET_APP_PROFILE 11
|
||||||
|
|
||||||
|
#define CMD_IS_UID_GRANTED_ROOT 12
|
||||||
|
#define CMD_IS_UID_SHOULD_UMOUNT 13
|
||||||
|
#define CMD_IS_SU_ENABLED 14
|
||||||
|
#define CMD_ENABLE_SU 15
|
||||||
|
|
||||||
|
#define CMD_GET_VERSION_FULL 0xC0FFEE1A
|
||||||
|
|
||||||
|
#define CMD_ENABLE_KPM 100
|
||||||
|
#define CMD_HOOK_TYPE 101
|
||||||
|
#define CMD_GET_SUSFS_FEATURE_STATUS 102
|
||||||
|
#define CMD_DYNAMIC_MANAGER 103
|
||||||
|
#define CMD_GET_MANAGERS 104
|
||||||
|
|
||||||
|
#define DYNAMIC_MANAGER_OP_SET 0
|
||||||
|
#define DYNAMIC_MANAGER_OP_GET 1
|
||||||
|
#define DYNAMIC_MANAGER_OP_CLEAR 2
|
||||||
|
|
||||||
|
static bool ksuctl(int cmd, void* arg1, void* arg2) {
|
||||||
|
int32_t result = 0;
|
||||||
|
int32_t rtn = prctl(KERNEL_SU_OPTION, cmd, arg1, arg2, &result);
|
||||||
|
|
||||||
|
return result == KERNEL_SU_OPTION && rtn == -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool become_manager(const char* pkg) {
|
||||||
|
char param[128];
|
||||||
|
uid_t uid = getuid();
|
||||||
|
uint32_t userId = uid / 100000;
|
||||||
|
if (userId == 0) {
|
||||||
|
sprintf(param, "/data/data/%s", pkg);
|
||||||
|
} else {
|
||||||
|
snprintf(param, sizeof(param), "/data/user/%d/%s", userId, pkg);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ksuctl(CMD_BECOME_MANAGER, param, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
// cache the result to avoid unnecessary syscall
|
||||||
|
static bool is_lkm;
|
||||||
|
int get_version() {
|
||||||
|
int32_t version = -1;
|
||||||
|
int32_t flags = 0;
|
||||||
|
ksuctl(CMD_GET_VERSION, &version, &flags);
|
||||||
|
if (!is_lkm && (flags & 0x1)) {
|
||||||
|
is_lkm = true;
|
||||||
|
}
|
||||||
|
return version;
|
||||||
|
}
|
||||||
|
|
||||||
|
void get_full_version(char* buff) {
|
||||||
|
ksuctl(CMD_GET_VERSION_FULL, buff, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool get_allow_list(int *uids, int *size) {
|
||||||
|
return ksuctl(CMD_GET_SU_LIST, uids, size);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool is_safe_mode() {
|
||||||
|
return ksuctl(CMD_CHECK_SAFEMODE, NULL, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool is_lkm_mode() {
|
||||||
|
// you should call get_version first!
|
||||||
|
return is_lkm;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool uid_should_umount(int uid) {
|
||||||
|
int should;
|
||||||
|
return ksuctl(CMD_IS_UID_SHOULD_UMOUNT, (void*) ((size_t) uid), &should) && should;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool set_app_profile(const struct app_profile* profile) {
|
||||||
|
return ksuctl(CMD_SET_APP_PROFILE, (void*) profile, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool get_app_profile(char* key, struct app_profile* profile) {
|
||||||
|
return ksuctl(CMD_GET_APP_PROFILE, profile, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool set_su_enabled(bool enabled) {
|
||||||
|
return ksuctl(CMD_ENABLE_SU, (void*) enabled, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool is_su_enabled() {
|
||||||
|
int enabled = true;
|
||||||
|
// if ksuctl failed, we assume su is enabled, and it cannot be disabled.
|
||||||
|
ksuctl(CMD_IS_SU_ENABLED, &enabled, NULL);
|
||||||
|
return enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool is_KPM_enable() {
|
||||||
|
int enabled = false;
|
||||||
|
ksuctl(CMD_ENABLE_KPM, &enabled, NULL);
|
||||||
|
return enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool get_hook_type(char* hook_type, size_t size) {
|
||||||
|
if (hook_type == NULL || size == 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
static char cached_hook_type[16] = {0};
|
||||||
|
if (cached_hook_type[0] == '\0') {
|
||||||
|
if (!ksuctl(CMD_HOOK_TYPE, cached_hook_type, NULL)) {
|
||||||
|
strcpy(cached_hook_type, "Unknown");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
strncpy(hook_type, cached_hook_type, size);
|
||||||
|
hook_type[size - 1] = '\0';
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool get_susfs_feature_status(struct susfs_feature_status* status) {
|
||||||
|
if (status == NULL) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ksuctl(CMD_GET_SUSFS_FEATURE_STATUS, status, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool set_dynamic_manager(unsigned int size, const char* hash) {
|
||||||
|
if (hash == NULL) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct dynamic_manager_user_config config;
|
||||||
|
config.operation = DYNAMIC_MANAGER_OP_SET;
|
||||||
|
config.size = size;
|
||||||
|
strncpy(config.hash, hash, sizeof(config.hash) - 1);
|
||||||
|
config.hash[sizeof(config.hash) - 1] = '\0';
|
||||||
|
|
||||||
|
return ksuctl(CMD_DYNAMIC_MANAGER, &config, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool get_dynamic_manager(struct dynamic_manager_user_config* config) {
|
||||||
|
if (config == NULL) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
config->operation = DYNAMIC_MANAGER_OP_GET;
|
||||||
|
return ksuctl(CMD_DYNAMIC_MANAGER, config, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool clear_dynamic_manager() {
|
||||||
|
struct dynamic_manager_user_config config;
|
||||||
|
config.operation = DYNAMIC_MANAGER_OP_CLEAR;
|
||||||
|
return ksuctl(CMD_DYNAMIC_MANAGER, &config, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool get_managers_list(struct manager_list_info* info) {
|
||||||
|
if (info == NULL) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ksuctl(CMD_GET_MANAGERS, info, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool verify_module_signature(const char* input) {
|
||||||
|
#if defined(__aarch64__) || defined(_M_ARM64) || defined(__arm__) || defined(_M_ARM)
|
||||||
|
if (input == NULL) {
|
||||||
|
LogDebug("verify_module_signature: input path is null");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
int fd = zako_sys_file_open(input);
|
||||||
|
if (fd < 0) {
|
||||||
|
LogDebug("verify_module_signature: failed to open file: %s", input);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t results = zako_file_verify_esig(fd, 0);
|
||||||
|
|
||||||
|
if (results != 0) {
|
||||||
|
/* If important error occured, verification process should
|
||||||
|
be considered as failed due to unexpected modification
|
||||||
|
potentially happened. */
|
||||||
|
if ((results & ZAKO_ESV_IMPORTANT_ERROR) != 0) {
|
||||||
|
LogDebug("verify_module_signature: Verification failed! (important error)");
|
||||||
|
} else {
|
||||||
|
/* This is for manager that doesn't want to do certificate checks */
|
||||||
|
LogDebug("verify_module_signature: Verification partially passed");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
LogDebug("verify_module_signature: Verification passed!");
|
||||||
|
goto exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Go through all bit fields */
|
||||||
|
for (size_t i = 0; i < sizeof(uint32_t) * 8; i++) {
|
||||||
|
if ((results & (1 << i)) == 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Convert error bit field index into human readable string */
|
||||||
|
const char* message = zako_file_verrcidx2str((uint8_t)i);
|
||||||
|
// Error message: message
|
||||||
|
if (message != NULL) {
|
||||||
|
LogDebug("verify_module_signature: Error bit %zu: %s", i, message);
|
||||||
|
} else {
|
||||||
|
LogDebug("verify_module_signature: Error bit %zu: Unknown error", i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
exit:
|
||||||
|
close(fd);
|
||||||
|
LogDebug("verify_module_signature: path=%s, results=0x%x, success=%s",
|
||||||
|
input, results, (results == 0) ? "true" : "false");
|
||||||
|
return results == 0;
|
||||||
|
#else
|
||||||
|
LogDebug("verify_module_signature: not supported on non-ARM architecture, path=%s", input ? input : "null");
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
@@ -1,105 +0,0 @@
|
|||||||
//
|
|
||||||
// Created by weishu on 2022/12/9.
|
|
||||||
//
|
|
||||||
|
|
||||||
#include <sys/prctl.h>
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
#include "ksu.h"
|
|
||||||
|
|
||||||
#define KERNEL_SU_OPTION 0xDEADBEEF
|
|
||||||
|
|
||||||
#define CMD_GRANT_ROOT 0
|
|
||||||
|
|
||||||
#define CMD_BECOME_MANAGER 1
|
|
||||||
#define CMD_GET_VERSION 2
|
|
||||||
#define CMD_ALLOW_SU 3
|
|
||||||
#define CMD_DENY_SU 4
|
|
||||||
#define CMD_GET_SU_LIST 5
|
|
||||||
#define CMD_GET_DENY_LIST 6
|
|
||||||
#define CMD_CHECK_SAFEMODE 9
|
|
||||||
|
|
||||||
#define CMD_GET_APP_PROFILE 10
|
|
||||||
#define CMD_SET_APP_PROFILE 11
|
|
||||||
|
|
||||||
#define CMD_IS_UID_GRANTED_ROOT 12
|
|
||||||
#define CMD_IS_UID_SHOULD_UMOUNT 13
|
|
||||||
#define CMD_IS_SU_ENABLED 14
|
|
||||||
#define CMD_ENABLE_SU 15
|
|
||||||
#define CMD_ENABLE_KPM 100
|
|
||||||
|
|
||||||
static bool ksuctl(int cmd, void* arg1, void* arg2) {
|
|
||||||
int32_t result = 0;
|
|
||||||
prctl(KERNEL_SU_OPTION, cmd, arg1, arg2, &result);
|
|
||||||
return result == KERNEL_SU_OPTION;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool become_manager(const char* pkg) {
|
|
||||||
char param[128];
|
|
||||||
uid_t uid = getuid();
|
|
||||||
uint32_t userId = uid / 100000;
|
|
||||||
if (userId == 0) {
|
|
||||||
sprintf(param, "/data/data/%s", pkg);
|
|
||||||
} else {
|
|
||||||
snprintf(param, sizeof(param), "/data/user/%d/%s", userId, pkg);
|
|
||||||
}
|
|
||||||
|
|
||||||
return ksuctl(CMD_BECOME_MANAGER, param, nullptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
// cache the result to avoid unnecessary syscall
|
|
||||||
static bool is_lkm;
|
|
||||||
int get_version() {
|
|
||||||
int32_t version = -1;
|
|
||||||
int32_t lkm = 0;
|
|
||||||
ksuctl(CMD_GET_VERSION, &version, &lkm);
|
|
||||||
if (!is_lkm && lkm != 0) {
|
|
||||||
is_lkm = true;
|
|
||||||
}
|
|
||||||
return version;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool get_allow_list(int *uids, int *size) {
|
|
||||||
return ksuctl(CMD_GET_SU_LIST, uids, size);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool is_safe_mode() {
|
|
||||||
return ksuctl(CMD_CHECK_SAFEMODE, nullptr, nullptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool is_lkm_mode() {
|
|
||||||
// you should call get_version first!
|
|
||||||
return is_lkm;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool uid_should_umount(int uid) {
|
|
||||||
bool should;
|
|
||||||
return ksuctl(CMD_IS_UID_SHOULD_UMOUNT, reinterpret_cast<void*>(uid), &should) && should;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool set_app_profile(const app_profile *profile) {
|
|
||||||
return ksuctl(CMD_SET_APP_PROFILE, (void*) profile, nullptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool get_app_profile(p_key_t key, app_profile *profile) {
|
|
||||||
return ksuctl(CMD_GET_APP_PROFILE, (void*) profile, nullptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool set_su_enabled(bool enabled) {
|
|
||||||
return ksuctl(CMD_ENABLE_SU, (void*) enabled, nullptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool is_su_enabled() {
|
|
||||||
bool enabled = true;
|
|
||||||
// if ksuctl failed, we assume su is enabled, and it cannot be disabled.
|
|
||||||
ksuctl(CMD_IS_SU_ENABLED, &enabled, nullptr);
|
|
||||||
return enabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool is_KPM_enable() {
|
|
||||||
bool enabled = false;
|
|
||||||
return ksuctl(CMD_ENABLE_KPM, &enabled, nullptr), enabled;
|
|
||||||
}
|
|
||||||
@@ -5,10 +5,14 @@
|
|||||||
#ifndef KERNELSU_KSU_H
|
#ifndef KERNELSU_KSU_H
|
||||||
#define KERNELSU_KSU_H
|
#define KERNELSU_KSU_H
|
||||||
|
|
||||||
|
#include "prelude.h"
|
||||||
#include <linux/capability.h>
|
#include <linux/capability.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
bool become_manager(const char *);
|
bool become_manager(const char *);
|
||||||
|
|
||||||
|
void get_full_version(char* buff);
|
||||||
|
|
||||||
int get_version();
|
int get_version();
|
||||||
|
|
||||||
bool get_allow_list(int *uids, int *size);
|
bool get_allow_list(int *uids, int *size);
|
||||||
@@ -25,7 +29,34 @@ bool is_lkm_mode();
|
|||||||
#define KSU_MAX_GROUPS 32
|
#define KSU_MAX_GROUPS 32
|
||||||
#define KSU_SELINUX_DOMAIN 64
|
#define KSU_SELINUX_DOMAIN 64
|
||||||
|
|
||||||
using p_key_t = char[KSU_MAX_PACKAGE_NAME];
|
#define DYNAMIC_MANAGER_OP_SET 0
|
||||||
|
#define DYNAMIC_MANAGER_OP_GET 1
|
||||||
|
#define DYNAMIC_MANAGER_OP_CLEAR 2
|
||||||
|
|
||||||
|
struct dynamic_manager_user_config {
|
||||||
|
unsigned int operation;
|
||||||
|
unsigned int size;
|
||||||
|
char hash[65];
|
||||||
|
};
|
||||||
|
|
||||||
|
// SUSFS Functional State Structures
|
||||||
|
struct susfs_feature_status {
|
||||||
|
bool status_sus_path;
|
||||||
|
bool status_sus_mount;
|
||||||
|
bool status_auto_default_mount;
|
||||||
|
bool status_auto_bind_mount;
|
||||||
|
bool status_sus_kstat;
|
||||||
|
bool status_try_umount;
|
||||||
|
bool status_auto_try_umount_bind;
|
||||||
|
bool status_spoof_uname;
|
||||||
|
bool status_enable_log;
|
||||||
|
bool status_hide_symbols;
|
||||||
|
bool status_spoof_cmdline;
|
||||||
|
bool status_open_redirect;
|
||||||
|
bool status_magic_mount;
|
||||||
|
bool status_overlayfs_auto_kstat;
|
||||||
|
bool status_sus_su;
|
||||||
|
};
|
||||||
|
|
||||||
struct root_profile {
|
struct root_profile {
|
||||||
int32_t uid;
|
int32_t uid;
|
||||||
@@ -75,9 +106,17 @@ struct app_profile {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
bool set_app_profile(const app_profile *profile);
|
struct manager_list_info {
|
||||||
|
int count;
|
||||||
|
struct {
|
||||||
|
uid_t uid;
|
||||||
|
int signature_index;
|
||||||
|
} managers[2];
|
||||||
|
};
|
||||||
|
|
||||||
bool get_app_profile(p_key_t key, app_profile *profile);
|
bool set_app_profile(const struct app_profile* profile);
|
||||||
|
|
||||||
|
bool get_app_profile(char* key, struct app_profile* profile);
|
||||||
|
|
||||||
bool set_su_enabled(bool enabled);
|
bool set_su_enabled(bool enabled);
|
||||||
|
|
||||||
@@ -85,4 +124,18 @@ bool is_su_enabled();
|
|||||||
|
|
||||||
bool is_KPM_enable();
|
bool is_KPM_enable();
|
||||||
|
|
||||||
|
bool get_hook_type(char* hook_type, size_t size);
|
||||||
|
|
||||||
|
bool get_susfs_feature_status(struct susfs_feature_status* status);
|
||||||
|
|
||||||
|
bool set_dynamic_manager(unsigned int size, const char* hash);
|
||||||
|
|
||||||
|
bool get_dynamic_manager(struct dynamic_manager_user_config* config);
|
||||||
|
|
||||||
|
bool clear_dynamic_manager();
|
||||||
|
|
||||||
|
bool get_managers_list(struct manager_list_info* info);
|
||||||
|
|
||||||
|
bool verify_module_signature(const char* input);
|
||||||
|
|
||||||
#endif //KERNELSU_KSU_H
|
#endif //KERNELSU_KSU_H
|
||||||
66
manager/app/src/main/cpp/prelude.h
Normal file
66
manager/app/src/main/cpp/prelude.h
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
|
||||||
|
#ifndef KERNELSU_PRELUDE_H
|
||||||
|
#define KERNELSU_PRELUDE_H
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <jni.h>
|
||||||
|
#include <android/log.h>
|
||||||
|
|
||||||
|
#define GetEnvironment() (*env)
|
||||||
|
#define NativeBridge(fn, rtn, ...) JNIEXPORT rtn JNICALL Java_com_sukisu_ultra_Natives_##fn(JNIEnv* env, jclass clazz, __VA_ARGS__)
|
||||||
|
#define NativeBridgeNP(fn, rtn) JNIEXPORT rtn JNICALL Java_com_sukisu_ultra_Natives_##fn(JNIEnv* env, jclass clazz)
|
||||||
|
|
||||||
|
// Macros to simplify field setup
|
||||||
|
#define SET_BOOLEAN_FIELD(obj, cls, fieldName, value) do { \
|
||||||
|
jfieldID field = GetEnvironment()->GetFieldID(env, cls, #fieldName, "Z"); \
|
||||||
|
GetEnvironment()->SetBooleanField(env, obj, field, value); \
|
||||||
|
} while(0)
|
||||||
|
|
||||||
|
#define SET_INT_FIELD(obj, cls, fieldName, value) do { \
|
||||||
|
jfieldID field = GetEnvironment()->GetFieldID(env, cls, #fieldName, "I"); \
|
||||||
|
GetEnvironment()->SetIntField(env, obj, field, value); \
|
||||||
|
} while(0)
|
||||||
|
|
||||||
|
#define SET_STRING_FIELD(obj, cls, fieldName, value) do { \
|
||||||
|
jfieldID field = GetEnvironment()->GetFieldID(env, cls, #fieldName, "Ljava/lang/String;"); \
|
||||||
|
GetEnvironment()->SetObjectField(env, obj, field, GetEnvironment()->NewStringUTF(env, value)); \
|
||||||
|
} while(0)
|
||||||
|
|
||||||
|
#define SET_OBJECT_FIELD(obj, cls, fieldName, value) do { \
|
||||||
|
jfieldID field = GetEnvironment()->GetFieldID(env, cls, #fieldName, "Ljava/util/List;"); \
|
||||||
|
GetEnvironment()->SetObjectField(env, obj, field, value); \
|
||||||
|
} while(0)
|
||||||
|
|
||||||
|
// Macros for creating Java objects
|
||||||
|
#define CREATE_JAVA_OBJECT(className) ({ \
|
||||||
|
jclass cls = GetEnvironment()->FindClass(env, className); \
|
||||||
|
jmethodID constructor = GetEnvironment()->GetMethodID(env, cls, "<init>", "()V"); \
|
||||||
|
GetEnvironment()->NewObject(env, cls, constructor); \
|
||||||
|
})
|
||||||
|
|
||||||
|
// Macros for creating ArrayList
|
||||||
|
#define CREATE_ARRAYLIST() ({ \
|
||||||
|
jclass arrayListCls = GetEnvironment()->FindClass(env, "java/util/ArrayList"); \
|
||||||
|
jmethodID constructor = GetEnvironment()->GetMethodID(env, arrayListCls, "<init>", "()V"); \
|
||||||
|
GetEnvironment()->NewObject(env, arrayListCls, constructor); \
|
||||||
|
})
|
||||||
|
|
||||||
|
// Macros for adding elements to an ArrayList
|
||||||
|
#define ADD_TO_LIST(list, item) do { \
|
||||||
|
jclass cls = GetEnvironment()->GetObjectClass(env, list); \
|
||||||
|
jmethodID addMethod = GetEnvironment()->GetMethodID(env, cls, "add", "(Ljava/lang/Object;)Z"); \
|
||||||
|
GetEnvironment()->CallBooleanMethod(env, list, addMethod, item); \
|
||||||
|
} while(0)
|
||||||
|
|
||||||
|
// Macros for creating Java objects with parameter constructors
|
||||||
|
#define CREATE_JAVA_OBJECT_WITH_PARAMS(className, signature, ...) ({ \
|
||||||
|
jclass cls = GetEnvironment()->FindClass(env, className); \
|
||||||
|
jmethodID constructor = GetEnvironment()->GetMethodID(env, cls, "<init>", signature); \
|
||||||
|
GetEnvironment()->NewObject(env, cls, constructor, __VA_ARGS__); \
|
||||||
|
})
|
||||||
|
|
||||||
|
#define LogDebug(...) __android_log_print(ANDROID_LOG_DEBUG, "KernelSU", __VA_ARGS__)
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -17,6 +17,7 @@ object Natives {
|
|||||||
// 10977: change groups_count and groups to avoid overflow write
|
// 10977: change groups_count and groups to avoid overflow write
|
||||||
// 11071: Fix the issue of failing to set a custom SELinux type.
|
// 11071: Fix the issue of failing to set a custom SELinux type.
|
||||||
const val MINIMAL_SUPPORTED_KERNEL = 11071
|
const val MINIMAL_SUPPORTED_KERNEL = 11071
|
||||||
|
const val MINIMAL_SUPPORTED_KERNEL_FULL = "v3.1.5"
|
||||||
|
|
||||||
// 11640: Support query working mode, LKM or GKI
|
// 11640: Support query working mode, LKM or GKI
|
||||||
// when MINIMAL_SUPPORTED_KERNEL > 11640, we can remove this constant.
|
// when MINIMAL_SUPPORTED_KERNEL > 11640, we can remove this constant.
|
||||||
@@ -28,10 +29,38 @@ object Natives {
|
|||||||
|
|
||||||
const val MINIMAL_SUPPORTED_KPM = 12800
|
const val MINIMAL_SUPPORTED_KPM = 12800
|
||||||
|
|
||||||
|
const val MINIMAL_SUPPORTED_DYNAMIC_MANAGER = 13215
|
||||||
|
|
||||||
const val ROOT_UID = 0
|
const val ROOT_UID = 0
|
||||||
const val ROOT_GID = 0
|
const val ROOT_GID = 0
|
||||||
|
|
||||||
|
// 获取完整版本号
|
||||||
|
external fun getFullVersion(): String
|
||||||
|
|
||||||
|
fun isVersionLessThan(v1Full: String, v2Full: String): Boolean {
|
||||||
|
fun extractVersionParts(version: String): List<Int> {
|
||||||
|
val match = Regex("""v\d+(\.\d+)*""").find(version)
|
||||||
|
val simpleVersion = match?.value ?: version
|
||||||
|
return simpleVersion.trimStart('v').split('.').map { it.toIntOrNull() ?: 0 }
|
||||||
|
}
|
||||||
|
|
||||||
|
val v1Parts = extractVersionParts(v1Full)
|
||||||
|
val v2Parts = extractVersionParts(v2Full)
|
||||||
|
val maxLength = maxOf(v1Parts.size, v2Parts.size)
|
||||||
|
for (i in 0 until maxLength) {
|
||||||
|
val num1 = v1Parts.getOrElse(i) { 0 }
|
||||||
|
val num2 = v2Parts.getOrElse(i) { 0 }
|
||||||
|
if (num1 != num2) return num1 < num2
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getSimpleVersionFull(): String = getFullVersion().let { version ->
|
||||||
|
Regex("""v\d+(\.\d+)*""").find(version)?.value ?: version
|
||||||
|
}
|
||||||
|
|
||||||
init {
|
init {
|
||||||
|
System.loadLibrary("zakosign")
|
||||||
System.loadLibrary("zako")
|
System.loadLibrary("zako")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,6 +98,43 @@ object Natives {
|
|||||||
external fun isSuEnabled(): Boolean
|
external fun isSuEnabled(): Boolean
|
||||||
external fun setSuEnabled(enabled: Boolean): Boolean
|
external fun setSuEnabled(enabled: Boolean): Boolean
|
||||||
external fun isKPMEnabled(): Boolean
|
external fun isKPMEnabled(): Boolean
|
||||||
|
external fun getHookType(): String
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get SUSFS feature status from kernel
|
||||||
|
* @return SusfsFeatureStatus object containing all feature states, or null if failed
|
||||||
|
*/
|
||||||
|
external fun getSusfsFeatureStatus(): SusfsFeatureStatus?
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set dynamic managerature configuration
|
||||||
|
* @param size APK signature size
|
||||||
|
* @param hash APK signature hash (64 character hex string)
|
||||||
|
* @return true if successful, false otherwise
|
||||||
|
*/
|
||||||
|
external fun setDynamicManager(size: Int, hash: String): Boolean
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get current dynamic managerature configuration
|
||||||
|
* @return DynamicManagerConfig object containing current configuration, or null if not set
|
||||||
|
*/
|
||||||
|
external fun getDynamicManager(): DynamicManagerConfig?
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clear dynamic managerature configuration
|
||||||
|
* @return true if successful, false otherwise
|
||||||
|
*/
|
||||||
|
external fun clearDynamicManager(): Boolean
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get active managers list when dynamic manager is enabled
|
||||||
|
* @return ManagersList object containing active managers, or null if failed or not enabled
|
||||||
|
*/
|
||||||
|
external fun getManagersList(): ManagersList?
|
||||||
|
|
||||||
|
// 模块签名验证
|
||||||
|
external fun verifyModuleSignature(modulePath: String): Boolean
|
||||||
|
|
||||||
private const val NON_ROOT_DEFAULT_PROFILE_KEY = "$"
|
private const val NON_ROOT_DEFAULT_PROFILE_KEY = "$"
|
||||||
private const val NOBODY_UID = 9999
|
private const val NOBODY_UID = 9999
|
||||||
@@ -91,9 +157,62 @@ object Natives {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun requireNewKernel(): Boolean {
|
fun requireNewKernel(): Boolean {
|
||||||
return version < MINIMAL_SUPPORTED_KERNEL
|
if (version < MINIMAL_SUPPORTED_KERNEL) return true
|
||||||
|
return isVersionLessThan(getFullVersion(), MINIMAL_SUPPORTED_KERNEL_FULL)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Immutable
|
||||||
|
@Parcelize
|
||||||
|
@Keep
|
||||||
|
data class SusfsFeatureStatus(
|
||||||
|
val statusSusPath: Boolean = false,
|
||||||
|
val statusSusMount: Boolean = false,
|
||||||
|
val statusAutoDefaultMount: Boolean = false,
|
||||||
|
val statusAutoBindMount: Boolean = false,
|
||||||
|
val statusSusKstat: Boolean = false,
|
||||||
|
val statusTryUmount: Boolean = false,
|
||||||
|
val statusAutoTryUmountBind: Boolean = false,
|
||||||
|
val statusSpoofUname: Boolean = false,
|
||||||
|
val statusEnableLog: Boolean = false,
|
||||||
|
val statusHideSymbols: Boolean = false,
|
||||||
|
val statusSpoofCmdline: Boolean = false,
|
||||||
|
val statusOpenRedirect: Boolean = false,
|
||||||
|
val statusMagicMount: Boolean = false,
|
||||||
|
val statusOverlayfsAutoKstat: Boolean = false,
|
||||||
|
val statusSusSu: Boolean = false
|
||||||
|
) : Parcelable
|
||||||
|
|
||||||
|
@Immutable
|
||||||
|
@Parcelize
|
||||||
|
@Keep
|
||||||
|
data class DynamicManagerConfig(
|
||||||
|
val size: Int = 0,
|
||||||
|
val hash: String = ""
|
||||||
|
) : Parcelable {
|
||||||
|
|
||||||
|
fun isValid(): Boolean {
|
||||||
|
return size > 0 && hash.length == 64 && hash.all {
|
||||||
|
it in '0'..'9' || it in 'a'..'f' || it in 'A'..'F'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Immutable
|
||||||
|
@Parcelize
|
||||||
|
@Keep
|
||||||
|
data class ManagersList(
|
||||||
|
val count: Int = 0,
|
||||||
|
val managers: List<ManagerInfo> = emptyList()
|
||||||
|
) : Parcelable
|
||||||
|
|
||||||
|
@Immutable
|
||||||
|
@Parcelize
|
||||||
|
@Keep
|
||||||
|
data class ManagerInfo(
|
||||||
|
val uid: Int = 0,
|
||||||
|
val signatureIndex: Int = 0
|
||||||
|
) : Parcelable
|
||||||
|
|
||||||
@Immutable
|
@Immutable
|
||||||
@Parcelize
|
@Parcelize
|
||||||
@Keep
|
@Keep
|
||||||
|
|||||||
141
manager/app/src/main/java/com/sukisu/ultra/ui/KsuService.kt
Normal file
141
manager/app/src/main/java/com/sukisu/ultra/ui/KsuService.kt
Normal file
@@ -0,0 +1,141 @@
|
|||||||
|
package com.sukisu.ultra.ui
|
||||||
|
|
||||||
|
import android.content.Intent
|
||||||
|
import android.content.pm.PackageInfo
|
||||||
|
import android.os.Binder
|
||||||
|
import android.os.IBinder
|
||||||
|
import android.os.IInterface
|
||||||
|
import android.os.Parcel
|
||||||
|
import android.os.UserManager
|
||||||
|
import android.util.Log
|
||||||
|
import com.topjohnwu.superuser.ipc.RootService
|
||||||
|
import rikka.parcelablelist.ParcelableListSlice
|
||||||
|
import java.lang.reflect.Method
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author ShirkNeko
|
||||||
|
* @date 2025/7/2.
|
||||||
|
*/
|
||||||
|
class KsuService : RootService() {
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
private const val TAG = "KsuService"
|
||||||
|
private const val DESCRIPTOR = "com.sukisu.ultra.IKsuInterface"
|
||||||
|
private const val TRANSACTION_GET_PACKAGES = IBinder.FIRST_CALL_TRANSACTION + 0
|
||||||
|
}
|
||||||
|
|
||||||
|
interface IKsuInterface : IInterface {
|
||||||
|
fun getPackages(flags: Int): ParcelableListSlice<PackageInfo>
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class Stub : Binder(), IKsuInterface {
|
||||||
|
init {
|
||||||
|
attachInterface(this, DESCRIPTOR)
|
||||||
|
}
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
fun asInterface(obj: IBinder?): IKsuInterface? {
|
||||||
|
if (obj == null) return null
|
||||||
|
val iin = obj.queryLocalInterface(DESCRIPTOR)
|
||||||
|
return if (iin != null && iin is IKsuInterface) {
|
||||||
|
iin
|
||||||
|
} else {
|
||||||
|
Proxy(obj)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun asBinder(): IBinder = this
|
||||||
|
|
||||||
|
override fun onTransact(code: Int, data: Parcel, reply: Parcel?, flags: Int): Boolean {
|
||||||
|
val descriptor = DESCRIPTOR
|
||||||
|
when (code) {
|
||||||
|
INTERFACE_TRANSACTION -> {
|
||||||
|
reply?.writeString(descriptor)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
TRANSACTION_GET_PACKAGES -> {
|
||||||
|
data.enforceInterface(descriptor)
|
||||||
|
val flagsArg = data.readInt()
|
||||||
|
val result = getPackages(flagsArg)
|
||||||
|
reply?.writeNoException()
|
||||||
|
reply?.writeInt(1)
|
||||||
|
result.writeToParcel(reply!!, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return super.onTransact(code, data, reply, flags)
|
||||||
|
}
|
||||||
|
|
||||||
|
private class Proxy(private val mRemote: IBinder) : IKsuInterface {
|
||||||
|
override fun getPackages(flags: Int): ParcelableListSlice<PackageInfo> {
|
||||||
|
val data = Parcel.obtain()
|
||||||
|
val reply = Parcel.obtain()
|
||||||
|
return try {
|
||||||
|
data.writeInterfaceToken(DESCRIPTOR)
|
||||||
|
data.writeInt(flags)
|
||||||
|
mRemote.transact(TRANSACTION_GET_PACKAGES, data, reply, 0)
|
||||||
|
reply.readException()
|
||||||
|
if (reply.readInt() != 0) {
|
||||||
|
@Suppress("UNCHECKED_CAST")
|
||||||
|
ParcelableListSlice.CREATOR.createFromParcel(reply) as ParcelableListSlice<PackageInfo>
|
||||||
|
} else {
|
||||||
|
ParcelableListSlice(emptyList<PackageInfo>())
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
reply.recycle()
|
||||||
|
data.recycle()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun asBinder(): IBinder = mRemote
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
inner class KsuInterfaceImpl : Stub() {
|
||||||
|
override fun getPackages(flags: Int): ParcelableListSlice<PackageInfo> {
|
||||||
|
val list = getInstalledPackagesAll(flags)
|
||||||
|
Log.i(TAG, "getPackages: ${list.size}")
|
||||||
|
return ParcelableListSlice(list)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onBind(intent: Intent): IBinder {
|
||||||
|
return KsuInterfaceImpl()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun getUserIds(): List<Int> {
|
||||||
|
val result = mutableListOf<Int>()
|
||||||
|
val um = getSystemService(USER_SERVICE) as UserManager
|
||||||
|
val userProfiles = um.userProfiles
|
||||||
|
for (userProfile in userProfiles) {
|
||||||
|
result.add(userProfile.hashCode())
|
||||||
|
}
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun getInstalledPackagesAll(flags: Int): ArrayList<PackageInfo> {
|
||||||
|
val packages = ArrayList<PackageInfo>()
|
||||||
|
for (userId in getUserIds()) {
|
||||||
|
Log.i(TAG, "getInstalledPackagesAll: $userId")
|
||||||
|
packages.addAll(getInstalledPackagesAsUser(flags, userId))
|
||||||
|
}
|
||||||
|
return packages
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun getInstalledPackagesAsUser(flags: Int, userId: Int): List<PackageInfo> {
|
||||||
|
return try {
|
||||||
|
val pm = packageManager
|
||||||
|
val getInstalledPackagesAsUser: Method = pm.javaClass.getDeclaredMethod(
|
||||||
|
"getInstalledPackagesAsUser",
|
||||||
|
Int::class.java,
|
||||||
|
Int::class.java
|
||||||
|
)
|
||||||
|
@Suppress("UNCHECKED_CAST")
|
||||||
|
getInstalledPackagesAsUser.invoke(pm, flags, userId) as List<PackageInfo>
|
||||||
|
} catch (e: Throwable) {
|
||||||
|
Log.e(TAG, "err", e)
|
||||||
|
ArrayList()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,20 +7,32 @@ import android.os.Bundle
|
|||||||
import androidx.activity.ComponentActivity
|
import androidx.activity.ComponentActivity
|
||||||
import androidx.activity.compose.setContent
|
import androidx.activity.compose.setContent
|
||||||
import androidx.activity.enableEdgeToEdge
|
import androidx.activity.enableEdgeToEdge
|
||||||
|
import androidx.compose.animation.AnimatedContentTransitionScope
|
||||||
|
import androidx.compose.animation.EnterTransition
|
||||||
|
import androidx.compose.animation.ExitTransition
|
||||||
|
import androidx.compose.animation.core.tween
|
||||||
|
import androidx.compose.animation.fadeIn
|
||||||
|
import androidx.compose.animation.fadeOut
|
||||||
|
import androidx.compose.animation.scaleOut
|
||||||
|
import androidx.compose.animation.slideInHorizontally
|
||||||
|
import androidx.compose.animation.slideOutHorizontally
|
||||||
import androidx.compose.foundation.layout.*
|
import androidx.compose.foundation.layout.*
|
||||||
import androidx.compose.material3.*
|
import androidx.compose.material3.*
|
||||||
import androidx.compose.runtime.*
|
import androidx.compose.runtime.*
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
|
import androidx.navigation.NavBackStackEntry
|
||||||
import androidx.navigation.compose.currentBackStackEntryAsState
|
import androidx.navigation.compose.currentBackStackEntryAsState
|
||||||
import androidx.navigation.compose.rememberNavController
|
import androidx.navigation.compose.rememberNavController
|
||||||
import com.ramcosta.composedestinations.DestinationsNavHost
|
import com.ramcosta.composedestinations.DestinationsNavHost
|
||||||
|
import com.ramcosta.composedestinations.animations.NavHostAnimatedDestinationStyle
|
||||||
import com.ramcosta.composedestinations.generated.NavGraphs
|
import com.ramcosta.composedestinations.generated.NavGraphs
|
||||||
import com.ramcosta.composedestinations.generated.destinations.ExecuteModuleActionScreenDestination
|
import com.ramcosta.composedestinations.generated.destinations.ExecuteModuleActionScreenDestination
|
||||||
import com.ramcosta.composedestinations.spec.NavHostGraphSpec
|
import com.ramcosta.composedestinations.spec.NavHostGraphSpec
|
||||||
import io.sukisu.ultra.UltraToolInstall
|
import io.sukisu.ultra.UltraToolInstall
|
||||||
import com.sukisu.ultra.ksuApp
|
import com.sukisu.ultra.ksuApp
|
||||||
import zako.zako.zako.zakoui.activity.util.AppData
|
import zako.zako.zako.zakoui.activity.util.AppData
|
||||||
|
import com.sukisu.ultra.ui.screen.BottomBarDestination
|
||||||
import com.sukisu.ultra.ui.theme.*
|
import com.sukisu.ultra.ui.theme.*
|
||||||
import zako.zako.zako.zakoui.activity.util.*
|
import zako.zako.zako.zakoui.activity.util.*
|
||||||
import zako.zako.zako.zakoui.activity.component.BottomBar
|
import zako.zako.zako.zakoui.activity.component.BottomBar
|
||||||
@@ -82,6 +94,10 @@ class MainActivity : ComponentActivity() {
|
|||||||
val snackBarHostState = remember { SnackbarHostState() }
|
val snackBarHostState = remember { SnackbarHostState() }
|
||||||
val currentDestination = navController.currentBackStackEntryAsState().value?.destination
|
val currentDestination = navController.currentBackStackEntryAsState().value?.destination
|
||||||
|
|
||||||
|
val bottomBarRoutes = remember {
|
||||||
|
BottomBarDestination.entries.map { it.direction.route }.toSet()
|
||||||
|
}
|
||||||
|
|
||||||
val showBottomBar = when (currentDestination?.route) {
|
val showBottomBar = when (currentDestination?.route) {
|
||||||
ExecuteModuleActionScreenDestination.route -> false
|
ExecuteModuleActionScreenDestination.route -> false
|
||||||
else -> true
|
else -> true
|
||||||
@@ -107,7 +123,47 @@ class MainActivity : ComponentActivity() {
|
|||||||
modifier = Modifier.padding(innerPadding),
|
modifier = Modifier.padding(innerPadding),
|
||||||
navGraph = NavGraphs.root as NavHostGraphSpec,
|
navGraph = NavGraphs.root as NavHostGraphSpec,
|
||||||
navController = navController,
|
navController = navController,
|
||||||
defaultTransitions = NavigationUtils.defaultTransitions()
|
defaultTransitions = object : NavHostAnimatedDestinationStyle() {
|
||||||
|
override val enterTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> EnterTransition = {
|
||||||
|
// If the target is a detail page (not a bottom navigation page), slide in from the right
|
||||||
|
if (targetState.destination.route !in bottomBarRoutes) {
|
||||||
|
slideInHorizontally(initialOffsetX = { it })
|
||||||
|
} else {
|
||||||
|
// Otherwise (switching between bottom navigation pages), use fade in
|
||||||
|
fadeIn(animationSpec = tween(340))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override val exitTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> ExitTransition = {
|
||||||
|
// If navigating from the home page (bottom navigation page) to a detail page, slide out to the left
|
||||||
|
if (initialState.destination.route in bottomBarRoutes && targetState.destination.route !in bottomBarRoutes) {
|
||||||
|
slideOutHorizontally(targetOffsetX = { -it / 4 }) + fadeOut()
|
||||||
|
} else {
|
||||||
|
// Otherwise (switching between bottom navigation pages), use fade out
|
||||||
|
fadeOut(animationSpec = tween(340))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override val popEnterTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> EnterTransition = {
|
||||||
|
// If returning to the home page (bottom navigation page), slide in from the left
|
||||||
|
if (targetState.destination.route in bottomBarRoutes) {
|
||||||
|
slideInHorizontally(initialOffsetX = { -it / 4 }) + fadeIn()
|
||||||
|
} else {
|
||||||
|
// Otherwise (e.g., returning between multiple detail pages), use default fade in
|
||||||
|
fadeIn(animationSpec = tween(340))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override val popExitTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> ExitTransition = {
|
||||||
|
// If returning from a detail page (not a bottom navigation page), scale down and fade out
|
||||||
|
if (initialState.destination.route !in bottomBarRoutes) {
|
||||||
|
scaleOut(targetScale = 0.9f) + fadeOut()
|
||||||
|
} else {
|
||||||
|
// Otherwise, use default fade out
|
||||||
|
fadeOut(animationSpec = tween(340))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,7 +99,10 @@ private fun AboutCardContent() {
|
|||||||
htmlString = stringResource(
|
htmlString = stringResource(
|
||||||
id = R.string.about_source_code,
|
id = R.string.about_source_code,
|
||||||
"<b><a href=\"https://github.com/ShirkNeko/SukiSU-Ultra\">GitHub</a></b>",
|
"<b><a href=\"https://github.com/ShirkNeko/SukiSU-Ultra\">GitHub</a></b>",
|
||||||
"<b><a href=\"https://t.me/SukiKSU\">Telegram</a></b>"
|
"<b><a href=\"https://t.me/SukiKSU\">Telegram</a></b>",
|
||||||
|
"<b>怡子曰曰</b>",
|
||||||
|
"<b>明风 OuO</b>",
|
||||||
|
"<b><a href=\"https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode.txt\">CC BY-NC-SA 4.0</a></b>"
|
||||||
),
|
),
|
||||||
linkStyles = TextLinkStyles(
|
linkStyles = TextLinkStyles(
|
||||||
style = SpanStyle(
|
style = SpanStyle(
|
||||||
|
|||||||
@@ -0,0 +1,73 @@
|
|||||||
|
package com.sukisu.ultra.ui.component
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint
|
||||||
|
import androidx.compose.animation.core.*
|
||||||
|
import androidx.compose.animation.*
|
||||||
|
import androidx.compose.runtime.*
|
||||||
|
import androidx.compose.foundation.layout.Box
|
||||||
|
import androidx.compose.foundation.lazy.LazyListState
|
||||||
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||||
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.draw.alpha
|
||||||
|
import androidx.compose.ui.draw.clip
|
||||||
|
import androidx.compose.ui.draw.scale
|
||||||
|
import androidx.compose.ui.unit.dp
|
||||||
|
|
||||||
|
@SuppressLint("AutoboxingStateCreation")
|
||||||
|
@Composable
|
||||||
|
fun rememberFabVisibilityState(listState: LazyListState): State<Boolean> {
|
||||||
|
var previousScrollOffset by remember { mutableStateOf(0) }
|
||||||
|
var previousIndex by remember { mutableStateOf(0) }
|
||||||
|
val fabVisible = remember { mutableStateOf(true) }
|
||||||
|
|
||||||
|
LaunchedEffect(listState) {
|
||||||
|
snapshotFlow { listState.firstVisibleItemIndex to listState.firstVisibleItemScrollOffset }
|
||||||
|
.collect { (index, offset) ->
|
||||||
|
if (previousIndex == 0 && previousScrollOffset == 0) {
|
||||||
|
fabVisible.value = true
|
||||||
|
} else {
|
||||||
|
val isScrollingDown = when {
|
||||||
|
index > previousIndex -> false
|
||||||
|
index < previousIndex -> true
|
||||||
|
else -> offset < previousScrollOffset
|
||||||
|
}
|
||||||
|
|
||||||
|
fabVisible.value = isScrollingDown
|
||||||
|
}
|
||||||
|
|
||||||
|
previousIndex = index
|
||||||
|
previousScrollOffset = offset
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return fabVisible
|
||||||
|
}
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun AnimatedFab(
|
||||||
|
visible: Boolean,
|
||||||
|
content: @Composable () -> Unit
|
||||||
|
) {
|
||||||
|
val scale by animateFloatAsState(
|
||||||
|
targetValue = if (visible) 1f else 0f,
|
||||||
|
animationSpec = spring(
|
||||||
|
dampingRatio = Spring.DampingRatioMediumBouncy,
|
||||||
|
stiffness = Spring.StiffnessLow
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
AnimatedVisibility(
|
||||||
|
visible = visible,
|
||||||
|
enter = fadeIn() + scaleIn(),
|
||||||
|
exit = fadeOut() + scaleOut(targetScale = 0.8f)
|
||||||
|
) {
|
||||||
|
Box(
|
||||||
|
modifier = Modifier
|
||||||
|
.clip(RoundedCornerShape(16.dp))
|
||||||
|
.scale(scale)
|
||||||
|
.alpha(scale)
|
||||||
|
) {
|
||||||
|
content()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,861 @@
|
|||||||
|
package com.sukisu.ultra.ui.component
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint
|
||||||
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
|
import androidx.compose.foundation.layout.Box
|
||||||
|
import androidx.compose.foundation.layout.Column
|
||||||
|
import androidx.compose.foundation.layout.Row
|
||||||
|
import androidx.compose.foundation.layout.Spacer
|
||||||
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
|
import androidx.compose.foundation.layout.height
|
||||||
|
import androidx.compose.foundation.layout.padding
|
||||||
|
import androidx.compose.foundation.layout.size
|
||||||
|
import androidx.compose.foundation.layout.width
|
||||||
|
import androidx.compose.foundation.lazy.LazyColumn
|
||||||
|
import androidx.compose.foundation.lazy.items
|
||||||
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||||
|
import androidx.compose.material.icons.Icons
|
||||||
|
import androidx.compose.material.icons.filled.Add
|
||||||
|
import androidx.compose.material.icons.filled.Apps
|
||||||
|
import androidx.compose.material.icons.filled.Folder
|
||||||
|
import androidx.compose.material.icons.filled.Loop
|
||||||
|
import androidx.compose.material.icons.filled.PlayArrow
|
||||||
|
import androidx.compose.material.icons.filled.Security
|
||||||
|
import androidx.compose.material.icons.filled.Settings
|
||||||
|
import androidx.compose.material.icons.filled.Storage
|
||||||
|
import androidx.compose.material3.Button
|
||||||
|
import androidx.compose.material3.Card
|
||||||
|
import androidx.compose.material3.CardDefaults
|
||||||
|
import androidx.compose.material3.Icon
|
||||||
|
import androidx.compose.material3.MaterialTheme
|
||||||
|
import androidx.compose.material3.OutlinedTextField
|
||||||
|
import androidx.compose.material3.Switch
|
||||||
|
import androidx.compose.material3.Text
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.runtime.LaunchedEffect
|
||||||
|
import androidx.compose.runtime.remember
|
||||||
|
import androidx.compose.ui.Alignment
|
||||||
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.res.stringResource
|
||||||
|
import androidx.compose.ui.text.font.FontWeight
|
||||||
|
import androidx.compose.ui.unit.dp
|
||||||
|
import androidx.compose.ui.unit.sp
|
||||||
|
import com.sukisu.ultra.R
|
||||||
|
import com.sukisu.ultra.ui.util.SuSFSManager
|
||||||
|
import com.sukisu.ultra.ui.util.SuSFSManager.isSusVersion158
|
||||||
|
import com.sukisu.ultra.ui.viewmodel.SuperUserViewModel
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SUS路径内容组件
|
||||||
|
*/
|
||||||
|
@Composable
|
||||||
|
fun SusPathsContent(
|
||||||
|
susPaths: Set<String>,
|
||||||
|
isLoading: Boolean,
|
||||||
|
onAddPath: () -> Unit,
|
||||||
|
onAddAppPath: () -> Unit,
|
||||||
|
onRemovePath: (String) -> Unit,
|
||||||
|
onEditPath: ((String) -> Unit)? = null,
|
||||||
|
forceRefreshApps: Boolean = false
|
||||||
|
) {
|
||||||
|
val superUserApps = SuperUserViewModel.apps
|
||||||
|
val superUserIsRefreshing = remember { SuperUserViewModel().isRefreshing }
|
||||||
|
|
||||||
|
LaunchedEffect(superUserIsRefreshing, superUserApps.size) {
|
||||||
|
if (!superUserIsRefreshing && superUserApps.isNotEmpty()) {
|
||||||
|
AppInfoCache.clearCache()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LaunchedEffect(forceRefreshApps) {
|
||||||
|
if (forceRefreshApps) {
|
||||||
|
AppInfoCache.clearCache()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
val (appPathGroups, otherPaths) = remember(susPaths) {
|
||||||
|
val appPathRegex = Regex(".*/Android/data/([^/]+)/?.*")
|
||||||
|
val uidPathRegex = Regex("/sys/fs/cgroup/uid_([0-9]+)")
|
||||||
|
val appPathMap = mutableMapOf<String, MutableList<String>>()
|
||||||
|
val uidToPackageMap = mutableMapOf<String, String>()
|
||||||
|
val others = mutableListOf<String>()
|
||||||
|
|
||||||
|
// 构建UID到包名的映射
|
||||||
|
SuperUserViewModel.apps.forEach { app ->
|
||||||
|
try {
|
||||||
|
val uid = app.packageInfo.applicationInfo?.uid
|
||||||
|
uidToPackageMap[uid.toString()] = app.packageName
|
||||||
|
} catch (_: Exception) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
susPaths.forEach { path ->
|
||||||
|
val appDataMatch = appPathRegex.find(path)
|
||||||
|
val uidMatch = uidPathRegex.find(path)
|
||||||
|
|
||||||
|
when {
|
||||||
|
appDataMatch != null -> {
|
||||||
|
val packageName = appDataMatch.groupValues[1]
|
||||||
|
appPathMap.getOrPut(packageName) { mutableListOf() }.add(path)
|
||||||
|
}
|
||||||
|
uidMatch != null -> {
|
||||||
|
val uid = uidMatch.groupValues[1]
|
||||||
|
val packageName = uidToPackageMap[uid]
|
||||||
|
if (packageName != null) {
|
||||||
|
appPathMap.getOrPut(packageName) { mutableListOf() }.add(path)
|
||||||
|
} else {
|
||||||
|
others.add(path)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else -> {
|
||||||
|
others.add(path)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
val sortedAppGroups = appPathMap.toList()
|
||||||
|
.sortedBy { it.first }
|
||||||
|
.map { (packageName, paths) -> packageName to paths.sorted() }
|
||||||
|
|
||||||
|
Pair(sortedAppGroups, others.sorted())
|
||||||
|
}
|
||||||
|
|
||||||
|
Box(modifier = Modifier.fillMaxSize()) {
|
||||||
|
LazyColumn(
|
||||||
|
modifier = Modifier.fillMaxSize(),
|
||||||
|
verticalArrangement = Arrangement.spacedBy(12.dp)
|
||||||
|
) {
|
||||||
|
// 应用路径分组
|
||||||
|
if (appPathGroups.isNotEmpty()) {
|
||||||
|
item {
|
||||||
|
SectionHeader(
|
||||||
|
title = stringResource(R.string.app_paths_section),
|
||||||
|
subtitle = null,
|
||||||
|
icon = Icons.Default.Apps,
|
||||||
|
count = appPathGroups.size
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
items(appPathGroups) { (packageName, paths) ->
|
||||||
|
AppPathGroupCard(
|
||||||
|
packageName = packageName,
|
||||||
|
paths = paths,
|
||||||
|
onDeleteGroup = {
|
||||||
|
paths.forEach { path -> onRemovePath(path) }
|
||||||
|
},
|
||||||
|
onEditGroup = if (onEditPath != null) {
|
||||||
|
{
|
||||||
|
onEditPath(paths.first())
|
||||||
|
}
|
||||||
|
} else null,
|
||||||
|
isLoading = isLoading
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 其他路径
|
||||||
|
if (otherPaths.isNotEmpty()) {
|
||||||
|
item {
|
||||||
|
SectionHeader(
|
||||||
|
title = stringResource(R.string.other_paths_section),
|
||||||
|
subtitle = null,
|
||||||
|
icon = Icons.Default.Folder,
|
||||||
|
count = otherPaths.size
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
items(otherPaths) { path ->
|
||||||
|
PathItemCard(
|
||||||
|
path = path,
|
||||||
|
icon = Icons.Default.Folder,
|
||||||
|
onDelete = { onRemovePath(path) },
|
||||||
|
onEdit = if (onEditPath != null) { { onEditPath(path) } } else null,
|
||||||
|
isLoading = isLoading
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (susPaths.isEmpty()) {
|
||||||
|
item {
|
||||||
|
EmptyStateCard(
|
||||||
|
message = stringResource(R.string.susfs_no_paths_configured)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
item {
|
||||||
|
Row(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.padding(vertical = 16.dp),
|
||||||
|
horizontalArrangement = Arrangement.spacedBy(8.dp),
|
||||||
|
verticalAlignment = Alignment.CenterVertically
|
||||||
|
) {
|
||||||
|
Button(
|
||||||
|
onClick = onAddPath,
|
||||||
|
modifier = Modifier
|
||||||
|
.weight(1f)
|
||||||
|
.height(48.dp),
|
||||||
|
shape = RoundedCornerShape(8.dp)
|
||||||
|
) {
|
||||||
|
Icon(
|
||||||
|
imageVector = Icons.Default.Add,
|
||||||
|
contentDescription = null,
|
||||||
|
modifier = Modifier.size(24.dp)
|
||||||
|
)
|
||||||
|
Spacer(modifier = Modifier.width(8.dp))
|
||||||
|
Text(text = stringResource(R.string.add_custom_path))
|
||||||
|
}
|
||||||
|
|
||||||
|
Button(
|
||||||
|
onClick = onAddAppPath,
|
||||||
|
modifier = Modifier
|
||||||
|
.weight(1f)
|
||||||
|
.height(48.dp),
|
||||||
|
shape = RoundedCornerShape(8.dp)
|
||||||
|
) {
|
||||||
|
Icon(
|
||||||
|
imageVector = Icons.Default.Apps,
|
||||||
|
contentDescription = null,
|
||||||
|
modifier = Modifier.size(24.dp)
|
||||||
|
)
|
||||||
|
Spacer(modifier = Modifier.width(8.dp))
|
||||||
|
Text(text = stringResource(R.string.add_app_path))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SUS循环路径内容组件
|
||||||
|
*/
|
||||||
|
@Composable
|
||||||
|
fun SusLoopPathsContent(
|
||||||
|
susLoopPaths: Set<String>,
|
||||||
|
isLoading: Boolean,
|
||||||
|
onAddLoopPath: () -> Unit,
|
||||||
|
onRemoveLoopPath: (String) -> Unit,
|
||||||
|
onEditLoopPath: ((String) -> Unit)? = null
|
||||||
|
) {
|
||||||
|
Box(modifier = Modifier.fillMaxSize()) {
|
||||||
|
LazyColumn(
|
||||||
|
modifier = Modifier.fillMaxSize(),
|
||||||
|
verticalArrangement = Arrangement.spacedBy(12.dp)
|
||||||
|
) {
|
||||||
|
// 说明卡片
|
||||||
|
item {
|
||||||
|
Card(
|
||||||
|
modifier = Modifier.fillMaxWidth(),
|
||||||
|
colors = CardDefaults.cardColors(
|
||||||
|
containerColor = MaterialTheme.colorScheme.surfaceVariant.copy(alpha = 0.4f)
|
||||||
|
),
|
||||||
|
shape = RoundedCornerShape(12.dp)
|
||||||
|
) {
|
||||||
|
Column(
|
||||||
|
modifier = Modifier.padding(12.dp),
|
||||||
|
verticalArrangement = Arrangement.spacedBy(8.dp)
|
||||||
|
) {
|
||||||
|
Text(
|
||||||
|
text = stringResource(R.string.sus_loop_paths_description_title),
|
||||||
|
style = MaterialTheme.typography.titleMedium,
|
||||||
|
fontWeight = FontWeight.Medium,
|
||||||
|
color = MaterialTheme.colorScheme.primary
|
||||||
|
)
|
||||||
|
Text(
|
||||||
|
text = stringResource(R.string.sus_loop_paths_description_text),
|
||||||
|
style = MaterialTheme.typography.bodyMedium,
|
||||||
|
color = MaterialTheme.colorScheme.onSurfaceVariant
|
||||||
|
)
|
||||||
|
Text(
|
||||||
|
text = stringResource(R.string.susfs_loop_path_restriction_warning),
|
||||||
|
style = MaterialTheme.typography.bodySmall,
|
||||||
|
color = MaterialTheme.colorScheme.secondary
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (susLoopPaths.isEmpty()) {
|
||||||
|
item {
|
||||||
|
EmptyStateCard(
|
||||||
|
message = stringResource(R.string.susfs_no_loop_paths_configured)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
item {
|
||||||
|
SectionHeader(
|
||||||
|
title = stringResource(R.string.loop_paths_section),
|
||||||
|
subtitle = null,
|
||||||
|
icon = Icons.Default.Loop,
|
||||||
|
count = susLoopPaths.size
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
items(susLoopPaths.toList()) { path ->
|
||||||
|
PathItemCard(
|
||||||
|
path = path,
|
||||||
|
icon = Icons.Default.Loop,
|
||||||
|
onDelete = { onRemoveLoopPath(path) },
|
||||||
|
onEdit = if (onEditLoopPath != null) { { onEditLoopPath(path) } } else null,
|
||||||
|
isLoading = isLoading
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
item {
|
||||||
|
Row(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.padding(vertical = 16.dp),
|
||||||
|
horizontalArrangement = Arrangement.spacedBy(8.dp),
|
||||||
|
verticalAlignment = Alignment.CenterVertically
|
||||||
|
) {
|
||||||
|
Button(
|
||||||
|
onClick = onAddLoopPath,
|
||||||
|
modifier = Modifier
|
||||||
|
.weight(1f)
|
||||||
|
.height(48.dp),
|
||||||
|
shape = RoundedCornerShape(8.dp)
|
||||||
|
) {
|
||||||
|
Icon(
|
||||||
|
imageVector = Icons.Default.Add,
|
||||||
|
contentDescription = null,
|
||||||
|
modifier = Modifier.size(24.dp)
|
||||||
|
)
|
||||||
|
Spacer(modifier = Modifier.width(8.dp))
|
||||||
|
Text(text = stringResource(R.string.add_loop_path))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SUS挂载内容组件
|
||||||
|
*/
|
||||||
|
@Composable
|
||||||
|
fun SusMountsContent(
|
||||||
|
susMounts: Set<String>,
|
||||||
|
hideSusMountsForAllProcs: Boolean,
|
||||||
|
isSusVersion158: Boolean,
|
||||||
|
isLoading: Boolean,
|
||||||
|
onAddMount: () -> Unit,
|
||||||
|
onRemoveMount: (String) -> Unit,
|
||||||
|
onEditMount: ((String) -> Unit)? = null,
|
||||||
|
onToggleHideSusMountsForAllProcs: (Boolean) -> Unit
|
||||||
|
) {
|
||||||
|
Box(modifier = Modifier.fillMaxSize()) {
|
||||||
|
LazyColumn(
|
||||||
|
modifier = Modifier.fillMaxSize(),
|
||||||
|
verticalArrangement = Arrangement.spacedBy(12.dp)
|
||||||
|
) {
|
||||||
|
if (isSusVersion158) {
|
||||||
|
item {
|
||||||
|
SusMountHidingControlCard(
|
||||||
|
hideSusMountsForAllProcs = hideSusMountsForAllProcs,
|
||||||
|
isLoading = isLoading,
|
||||||
|
onToggleHiding = onToggleHideSusMountsForAllProcs
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (susMounts.isEmpty()) {
|
||||||
|
item {
|
||||||
|
EmptyStateCard(
|
||||||
|
message = stringResource(R.string.susfs_no_mounts_configured)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
items(susMounts.toList()) { mount ->
|
||||||
|
PathItemCard(
|
||||||
|
path = mount,
|
||||||
|
icon = Icons.Default.Storage,
|
||||||
|
onDelete = { onRemoveMount(mount) },
|
||||||
|
onEdit = if (onEditMount != null) { { onEditMount(mount) } } else null,
|
||||||
|
isLoading = isLoading
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
item {
|
||||||
|
Row(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.padding(vertical = 16.dp),
|
||||||
|
horizontalArrangement = Arrangement.spacedBy(8.dp),
|
||||||
|
verticalAlignment = Alignment.CenterVertically
|
||||||
|
) {
|
||||||
|
Button(
|
||||||
|
onClick = onAddMount,
|
||||||
|
modifier = Modifier
|
||||||
|
.weight(1f)
|
||||||
|
.height(48.dp),
|
||||||
|
shape = RoundedCornerShape(8.dp)
|
||||||
|
) {
|
||||||
|
Icon(
|
||||||
|
imageVector = Icons.Default.Add,
|
||||||
|
contentDescription = null,
|
||||||
|
modifier = Modifier.size(24.dp)
|
||||||
|
)
|
||||||
|
Spacer(modifier = Modifier.width(8.dp))
|
||||||
|
Text(text = stringResource(R.string.add))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 尝试卸载内容组件
|
||||||
|
*/
|
||||||
|
@Composable
|
||||||
|
fun TryUmountContent(
|
||||||
|
tryUmounts: Set<String>,
|
||||||
|
umountForZygoteIsoService: Boolean,
|
||||||
|
isLoading: Boolean,
|
||||||
|
onAddUmount: () -> Unit,
|
||||||
|
onRunUmount: () -> Unit,
|
||||||
|
onRemoveUmount: (String) -> Unit,
|
||||||
|
onEditUmount: ((String) -> Unit)? = null,
|
||||||
|
onToggleUmountForZygoteIsoService: (Boolean) -> Unit
|
||||||
|
) {
|
||||||
|
Box(modifier = Modifier.fillMaxSize()) {
|
||||||
|
LazyColumn(
|
||||||
|
modifier = Modifier.fillMaxSize(),
|
||||||
|
verticalArrangement = Arrangement.spacedBy(12.dp)
|
||||||
|
) {
|
||||||
|
if (isSusVersion158()) {
|
||||||
|
item {
|
||||||
|
Card(
|
||||||
|
modifier = Modifier.fillMaxWidth(),
|
||||||
|
colors = CardDefaults.cardColors(
|
||||||
|
containerColor = MaterialTheme.colorScheme.surface
|
||||||
|
),
|
||||||
|
shape = RoundedCornerShape(12.dp)
|
||||||
|
) {
|
||||||
|
Row(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.padding(12.dp),
|
||||||
|
horizontalArrangement = Arrangement.SpaceBetween,
|
||||||
|
verticalAlignment = Alignment.CenterVertically
|
||||||
|
) {
|
||||||
|
Column(
|
||||||
|
modifier = Modifier.weight(1f)
|
||||||
|
) {
|
||||||
|
Row(
|
||||||
|
verticalAlignment = Alignment.CenterVertically
|
||||||
|
) {
|
||||||
|
Icon(
|
||||||
|
imageVector = Icons.Default.Security,
|
||||||
|
contentDescription = null,
|
||||||
|
tint = MaterialTheme.colorScheme.primary,
|
||||||
|
modifier = Modifier.size(18.dp)
|
||||||
|
)
|
||||||
|
Spacer(modifier = Modifier.width(8.dp))
|
||||||
|
Text(
|
||||||
|
text = stringResource(R.string.umount_zygote_iso_service),
|
||||||
|
style = MaterialTheme.typography.titleMedium,
|
||||||
|
fontWeight = FontWeight.Medium,
|
||||||
|
color = MaterialTheme.colorScheme.onSurface
|
||||||
|
)
|
||||||
|
}
|
||||||
|
Spacer(modifier = Modifier.height(6.dp))
|
||||||
|
Text(
|
||||||
|
text = stringResource(R.string.umount_zygote_iso_service_description),
|
||||||
|
style = MaterialTheme.typography.bodyMedium,
|
||||||
|
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||||
|
lineHeight = 14.sp
|
||||||
|
)
|
||||||
|
}
|
||||||
|
Switch(
|
||||||
|
checked = umountForZygoteIsoService,
|
||||||
|
onCheckedChange = onToggleUmountForZygoteIsoService,
|
||||||
|
enabled = !isLoading
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tryUmounts.isEmpty()) {
|
||||||
|
item {
|
||||||
|
EmptyStateCard(
|
||||||
|
message = stringResource(R.string.susfs_no_umounts_configured)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
items(tryUmounts.toList()) { umountEntry ->
|
||||||
|
val parts = umountEntry.split("|")
|
||||||
|
val path = if (parts.isNotEmpty()) parts[0] else umountEntry
|
||||||
|
val mode = if (parts.size > 1) parts[1] else "0"
|
||||||
|
val modeText = if (mode == "0")
|
||||||
|
stringResource(R.string.susfs_umount_mode_normal_short)
|
||||||
|
else
|
||||||
|
stringResource(R.string.susfs_umount_mode_detach_short)
|
||||||
|
|
||||||
|
PathItemCard(
|
||||||
|
path = path,
|
||||||
|
icon = Icons.Default.Storage,
|
||||||
|
additionalInfo = stringResource(R.string.susfs_umount_mode_display, modeText, mode),
|
||||||
|
onDelete = { onRemoveUmount(umountEntry) },
|
||||||
|
onEdit = if (onEditUmount != null) { { onEditUmount(umountEntry) } } else null,
|
||||||
|
isLoading = isLoading
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
item {
|
||||||
|
Row(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.padding(vertical = 16.dp),
|
||||||
|
horizontalArrangement = Arrangement.spacedBy(8.dp),
|
||||||
|
verticalAlignment = Alignment.CenterVertically
|
||||||
|
) {
|
||||||
|
Button(
|
||||||
|
onClick = onAddUmount,
|
||||||
|
modifier = Modifier
|
||||||
|
.weight(1f)
|
||||||
|
.height(48.dp),
|
||||||
|
shape = RoundedCornerShape(8.dp)
|
||||||
|
) {
|
||||||
|
Icon(
|
||||||
|
imageVector = Icons.Default.Add,
|
||||||
|
contentDescription = null,
|
||||||
|
modifier = Modifier.size(24.dp)
|
||||||
|
)
|
||||||
|
Spacer(modifier = Modifier.width(8.dp))
|
||||||
|
Text(text = stringResource(R.string.add))
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tryUmounts.isNotEmpty()) {
|
||||||
|
Button(
|
||||||
|
onClick = onRunUmount,
|
||||||
|
modifier = Modifier
|
||||||
|
.weight(1f)
|
||||||
|
.height(48.dp),
|
||||||
|
shape = RoundedCornerShape(8.dp)
|
||||||
|
) {
|
||||||
|
Icon(
|
||||||
|
imageVector = Icons.Default.PlayArrow,
|
||||||
|
contentDescription = null,
|
||||||
|
modifier = Modifier.size(24.dp)
|
||||||
|
)
|
||||||
|
Spacer(modifier = Modifier.width(8.dp))
|
||||||
|
Text(text = stringResource(R.string.susfs_run))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Kstat配置内容组件
|
||||||
|
*/
|
||||||
|
@Composable
|
||||||
|
fun KstatConfigContent(
|
||||||
|
kstatConfigs: Set<String>,
|
||||||
|
addKstatPaths: Set<String>,
|
||||||
|
isLoading: Boolean,
|
||||||
|
onAddKstatStatically: () -> Unit,
|
||||||
|
onAddKstat: () -> Unit,
|
||||||
|
onRemoveKstatConfig: (String) -> Unit,
|
||||||
|
onEditKstatConfig: ((String) -> Unit)? = null,
|
||||||
|
onRemoveAddKstat: (String) -> Unit,
|
||||||
|
onEditAddKstat: ((String) -> Unit)? = null,
|
||||||
|
onUpdateKstat: (String) -> Unit,
|
||||||
|
onUpdateKstatFullClone: (String) -> Unit
|
||||||
|
) {
|
||||||
|
Box(modifier = Modifier.fillMaxSize()) {
|
||||||
|
LazyColumn(
|
||||||
|
modifier = Modifier.fillMaxSize(),
|
||||||
|
verticalArrangement = Arrangement.spacedBy(12.dp)
|
||||||
|
) {
|
||||||
|
item {
|
||||||
|
Card(
|
||||||
|
modifier = Modifier.fillMaxWidth(),
|
||||||
|
colors = CardDefaults.cardColors(
|
||||||
|
containerColor = MaterialTheme.colorScheme.surfaceVariant.copy(alpha = 0.4f)
|
||||||
|
),
|
||||||
|
shape = RoundedCornerShape(12.dp)
|
||||||
|
) {
|
||||||
|
Column(
|
||||||
|
modifier = Modifier.padding(12.dp),
|
||||||
|
verticalArrangement = Arrangement.spacedBy(8.dp)
|
||||||
|
) {
|
||||||
|
Text(
|
||||||
|
text = stringResource(R.string.kstat_config_description_title),
|
||||||
|
style = MaterialTheme.typography.titleMedium,
|
||||||
|
fontWeight = FontWeight.Medium,
|
||||||
|
color = MaterialTheme.colorScheme.primary
|
||||||
|
)
|
||||||
|
Text(
|
||||||
|
text = stringResource(R.string.kstat_config_description_add_statically),
|
||||||
|
style = MaterialTheme.typography.bodyMedium,
|
||||||
|
color = MaterialTheme.colorScheme.onSurfaceVariant
|
||||||
|
)
|
||||||
|
Text(
|
||||||
|
text = stringResource(R.string.kstat_config_description_add),
|
||||||
|
style = MaterialTheme.typography.bodyMedium,
|
||||||
|
color = MaterialTheme.colorScheme.onSurfaceVariant
|
||||||
|
)
|
||||||
|
Text(
|
||||||
|
text = stringResource(R.string.kstat_config_description_update),
|
||||||
|
style = MaterialTheme.typography.bodyMedium,
|
||||||
|
color = MaterialTheme.colorScheme.onSurfaceVariant
|
||||||
|
)
|
||||||
|
Text(
|
||||||
|
text = stringResource(R.string.kstat_config_description_update_full_clone),
|
||||||
|
style = MaterialTheme.typography.bodyMedium,
|
||||||
|
color = MaterialTheme.colorScheme.onSurfaceVariant
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (kstatConfigs.isNotEmpty()) {
|
||||||
|
item {
|
||||||
|
Text(
|
||||||
|
text = stringResource(R.string.static_kstat_config),
|
||||||
|
style = MaterialTheme.typography.titleMedium,
|
||||||
|
fontWeight = FontWeight.Bold
|
||||||
|
)
|
||||||
|
}
|
||||||
|
items(kstatConfigs.toList()) { config ->
|
||||||
|
KstatConfigItemCard(
|
||||||
|
config = config,
|
||||||
|
onDelete = { onRemoveKstatConfig(config) },
|
||||||
|
onEdit = if (onEditKstatConfig != null) { { onEditKstatConfig(config) } } else null,
|
||||||
|
isLoading = isLoading
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (addKstatPaths.isNotEmpty()) {
|
||||||
|
item {
|
||||||
|
Text(
|
||||||
|
text = stringResource(R.string.kstat_path_management),
|
||||||
|
style = MaterialTheme.typography.titleMedium,
|
||||||
|
fontWeight = FontWeight.Bold
|
||||||
|
)
|
||||||
|
}
|
||||||
|
items(addKstatPaths.toList()) { path ->
|
||||||
|
AddKstatPathItemCard(
|
||||||
|
path = path,
|
||||||
|
onDelete = { onRemoveAddKstat(path) },
|
||||||
|
onEdit = if (onEditAddKstat != null) { { onEditAddKstat(path) } } else null,
|
||||||
|
onUpdate = { onUpdateKstat(path) },
|
||||||
|
onUpdateFullClone = { onUpdateKstatFullClone(path) },
|
||||||
|
isLoading = isLoading
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (kstatConfigs.isEmpty() && addKstatPaths.isEmpty()) {
|
||||||
|
item {
|
||||||
|
EmptyStateCard(
|
||||||
|
message = stringResource(R.string.no_kstat_config_message)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
item {
|
||||||
|
Row(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.padding(vertical = 16.dp),
|
||||||
|
horizontalArrangement = Arrangement.spacedBy(8.dp),
|
||||||
|
verticalAlignment = Alignment.CenterVertically
|
||||||
|
) {
|
||||||
|
Button(
|
||||||
|
onClick = onAddKstat,
|
||||||
|
modifier = Modifier
|
||||||
|
.weight(1f)
|
||||||
|
.height(48.dp),
|
||||||
|
shape = RoundedCornerShape(8.dp)
|
||||||
|
) {
|
||||||
|
Icon(
|
||||||
|
imageVector = Icons.Default.Add,
|
||||||
|
contentDescription = null,
|
||||||
|
modifier = Modifier.size(24.dp)
|
||||||
|
)
|
||||||
|
Spacer(modifier = Modifier.width(8.dp))
|
||||||
|
Text(text = stringResource(R.string.add))
|
||||||
|
}
|
||||||
|
|
||||||
|
Button(
|
||||||
|
onClick = onAddKstatStatically,
|
||||||
|
modifier = Modifier
|
||||||
|
.weight(1f)
|
||||||
|
.height(48.dp),
|
||||||
|
shape = RoundedCornerShape(8.dp)
|
||||||
|
) {
|
||||||
|
Icon(
|
||||||
|
imageVector = Icons.Default.Settings,
|
||||||
|
contentDescription = null,
|
||||||
|
modifier = Modifier.size(24.dp)
|
||||||
|
)
|
||||||
|
Spacer(modifier = Modifier.width(8.dp))
|
||||||
|
Text(text = stringResource(R.string.add))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 路径设置内容组件
|
||||||
|
*/
|
||||||
|
@SuppressLint("SdCardPath")
|
||||||
|
@Composable
|
||||||
|
fun PathSettingsContent(
|
||||||
|
androidDataPath: String,
|
||||||
|
onAndroidDataPathChange: (String) -> Unit,
|
||||||
|
sdcardPath: String,
|
||||||
|
onSdcardPathChange: (String) -> Unit,
|
||||||
|
isLoading: Boolean,
|
||||||
|
onSetAndroidDataPath: () -> Unit,
|
||||||
|
onSetSdcardPath: () -> Unit
|
||||||
|
) {
|
||||||
|
LazyColumn(
|
||||||
|
modifier = Modifier.fillMaxSize(),
|
||||||
|
verticalArrangement = Arrangement.spacedBy(16.dp)
|
||||||
|
) {
|
||||||
|
item {
|
||||||
|
Card(
|
||||||
|
modifier = Modifier.fillMaxWidth(),
|
||||||
|
shape = RoundedCornerShape(12.dp)
|
||||||
|
) {
|
||||||
|
Column(
|
||||||
|
modifier = Modifier.padding(12.dp),
|
||||||
|
verticalArrangement = Arrangement.spacedBy(12.dp)
|
||||||
|
) {
|
||||||
|
OutlinedTextField(
|
||||||
|
value = androidDataPath,
|
||||||
|
onValueChange = onAndroidDataPathChange,
|
||||||
|
label = { Text(stringResource(R.string.susfs_android_data_path_label)) },
|
||||||
|
placeholder = { Text("/sdcard/Android/data") },
|
||||||
|
modifier = Modifier.fillMaxWidth(),
|
||||||
|
enabled = !isLoading,
|
||||||
|
singleLine = true,
|
||||||
|
shape = RoundedCornerShape(8.dp)
|
||||||
|
)
|
||||||
|
|
||||||
|
Button(
|
||||||
|
onClick = onSetAndroidDataPath,
|
||||||
|
enabled = !isLoading && androidDataPath.isNotBlank(),
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.height(40.dp),
|
||||||
|
shape = RoundedCornerShape(8.dp)
|
||||||
|
) {
|
||||||
|
Text(stringResource(R.string.susfs_set_android_data_path))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
item {
|
||||||
|
Card(
|
||||||
|
modifier = Modifier.fillMaxWidth(),
|
||||||
|
shape = RoundedCornerShape(12.dp)
|
||||||
|
) {
|
||||||
|
Column(
|
||||||
|
modifier = Modifier.padding(12.dp),
|
||||||
|
verticalArrangement = Arrangement.spacedBy(12.dp)
|
||||||
|
) {
|
||||||
|
OutlinedTextField(
|
||||||
|
value = sdcardPath,
|
||||||
|
onValueChange = onSdcardPathChange,
|
||||||
|
label = { Text(stringResource(R.string.susfs_sdcard_path_label)) },
|
||||||
|
placeholder = { Text("/sdcard") },
|
||||||
|
modifier = Modifier.fillMaxWidth(),
|
||||||
|
enabled = !isLoading,
|
||||||
|
singleLine = true,
|
||||||
|
shape = RoundedCornerShape(8.dp)
|
||||||
|
)
|
||||||
|
|
||||||
|
Button(
|
||||||
|
onClick = onSetSdcardPath,
|
||||||
|
enabled = !isLoading && sdcardPath.isNotBlank(),
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.height(40.dp),
|
||||||
|
shape = RoundedCornerShape(8.dp)
|
||||||
|
) {
|
||||||
|
Text(stringResource(R.string.susfs_set_sdcard_path))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 启用功能状态内容组件
|
||||||
|
*/
|
||||||
|
@Composable
|
||||||
|
fun EnabledFeaturesContent(
|
||||||
|
enabledFeatures: List<SuSFSManager.EnabledFeature>,
|
||||||
|
onRefresh: () -> Unit
|
||||||
|
) {
|
||||||
|
LazyColumn(
|
||||||
|
modifier = Modifier.fillMaxSize(),
|
||||||
|
verticalArrangement = Arrangement.spacedBy(12.dp)
|
||||||
|
) {
|
||||||
|
item {
|
||||||
|
Card(
|
||||||
|
modifier = Modifier.fillMaxWidth(),
|
||||||
|
colors = CardDefaults.cardColors(
|
||||||
|
containerColor = MaterialTheme.colorScheme.surfaceVariant.copy(alpha = 0.4f)
|
||||||
|
),
|
||||||
|
shape = RoundedCornerShape(12.dp)
|
||||||
|
) {
|
||||||
|
Column(
|
||||||
|
modifier = Modifier.padding(12.dp)
|
||||||
|
) {
|
||||||
|
Row(
|
||||||
|
verticalAlignment = Alignment.CenterVertically
|
||||||
|
) {
|
||||||
|
Icon(
|
||||||
|
imageVector = Icons.Default.Settings,
|
||||||
|
contentDescription = null,
|
||||||
|
tint = MaterialTheme.colorScheme.primary,
|
||||||
|
modifier = Modifier.size(18.dp)
|
||||||
|
)
|
||||||
|
Spacer(modifier = Modifier.width(8.dp))
|
||||||
|
Text(
|
||||||
|
text = stringResource(R.string.susfs_enabled_features_description),
|
||||||
|
style = MaterialTheme.typography.bodyMedium,
|
||||||
|
color = MaterialTheme.colorScheme.onSurfaceVariant
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (enabledFeatures.isEmpty()) {
|
||||||
|
item {
|
||||||
|
EmptyStateCard(
|
||||||
|
message = stringResource(R.string.susfs_no_features_found)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
items(enabledFeatures) { feature ->
|
||||||
|
FeatureStatusCard(
|
||||||
|
feature = feature,
|
||||||
|
onRefresh = onRefresh
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,277 @@
|
|||||||
|
package com.sukisu.ultra.ui.component
|
||||||
|
|
||||||
|
import androidx.compose.animation.*
|
||||||
|
import androidx.compose.animation.core.*
|
||||||
|
import androidx.compose.foundation.layout.*
|
||||||
|
import androidx.compose.material.icons.Icons
|
||||||
|
import androidx.compose.material.icons.filled.*
|
||||||
|
import androidx.compose.material3.*
|
||||||
|
import androidx.compose.runtime.*
|
||||||
|
import androidx.compose.ui.Alignment
|
||||||
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.draw.alpha
|
||||||
|
import androidx.compose.ui.draw.rotate
|
||||||
|
import androidx.compose.ui.draw.scale
|
||||||
|
import androidx.compose.ui.graphics.Color
|
||||||
|
import androidx.compose.ui.graphics.vector.ImageVector
|
||||||
|
import androidx.compose.ui.res.stringResource
|
||||||
|
import androidx.compose.ui.unit.dp
|
||||||
|
import androidx.compose.ui.unit.Dp
|
||||||
|
import com.sukisu.ultra.R
|
||||||
|
|
||||||
|
// 菜单项数据类
|
||||||
|
data class FabMenuItem(
|
||||||
|
val icon: ImageVector,
|
||||||
|
val labelRes: Int,
|
||||||
|
val color: Color = Color.Unspecified,
|
||||||
|
val onClick: () -> Unit
|
||||||
|
)
|
||||||
|
|
||||||
|
// 动画配置
|
||||||
|
object FabAnimationConfig {
|
||||||
|
const val ANIMATION_DURATION = 300
|
||||||
|
const val STAGGER_DELAY = 50
|
||||||
|
val BUTTON_SPACING = 72.dp
|
||||||
|
val BUTTON_SIZE = 56.dp
|
||||||
|
val SMALL_BUTTON_SIZE = 48.dp
|
||||||
|
}
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun VerticalExpandableFab(
|
||||||
|
menuItems: List<FabMenuItem>,
|
||||||
|
modifier: Modifier = Modifier,
|
||||||
|
buttonSize: Dp = FabAnimationConfig.BUTTON_SIZE,
|
||||||
|
smallButtonSize: Dp = FabAnimationConfig.SMALL_BUTTON_SIZE,
|
||||||
|
buttonSpacing: Dp = FabAnimationConfig.BUTTON_SPACING,
|
||||||
|
animationDurationMs: Int = FabAnimationConfig.ANIMATION_DURATION,
|
||||||
|
staggerDelayMs: Int = FabAnimationConfig.STAGGER_DELAY,
|
||||||
|
mainButtonIcon: ImageVector = Icons.Filled.Add,
|
||||||
|
mainButtonExpandedIcon: ImageVector = Icons.Filled.Close,
|
||||||
|
onMainButtonClick: (() -> Unit)? = null,
|
||||||
|
) {
|
||||||
|
var isExpanded by remember { mutableStateOf(false) }
|
||||||
|
|
||||||
|
// 主按钮旋转动画
|
||||||
|
val rotationAngle by animateFloatAsState(
|
||||||
|
targetValue = if (isExpanded) 45f else 0f,
|
||||||
|
animationSpec = tween(
|
||||||
|
durationMillis = animationDurationMs,
|
||||||
|
easing = FastOutSlowInEasing
|
||||||
|
),
|
||||||
|
label = "mainButtonRotation"
|
||||||
|
)
|
||||||
|
|
||||||
|
// 主按钮缩放动画
|
||||||
|
val mainButtonScale by animateFloatAsState(
|
||||||
|
targetValue = if (isExpanded) 1.1f else 1f,
|
||||||
|
animationSpec = tween(
|
||||||
|
durationMillis = animationDurationMs,
|
||||||
|
easing = FastOutSlowInEasing
|
||||||
|
),
|
||||||
|
label = "mainButtonScale"
|
||||||
|
)
|
||||||
|
|
||||||
|
Box(
|
||||||
|
modifier = modifier.wrapContentSize(),
|
||||||
|
contentAlignment = Alignment.BottomEnd
|
||||||
|
) {
|
||||||
|
// 子菜单按钮
|
||||||
|
menuItems.forEachIndexed { index, menuItem ->
|
||||||
|
val animatedOffsetY by animateFloatAsState(
|
||||||
|
targetValue = if (isExpanded) {
|
||||||
|
-(buttonSpacing.value * (index + 1))
|
||||||
|
} else {
|
||||||
|
0f
|
||||||
|
},
|
||||||
|
animationSpec = tween(
|
||||||
|
durationMillis = animationDurationMs,
|
||||||
|
delayMillis = if (isExpanded) {
|
||||||
|
index * staggerDelayMs
|
||||||
|
} else {
|
||||||
|
(menuItems.size - index - 1) * staggerDelayMs
|
||||||
|
},
|
||||||
|
easing = FastOutSlowInEasing
|
||||||
|
),
|
||||||
|
label = "fabOffset$index"
|
||||||
|
)
|
||||||
|
|
||||||
|
val animatedScale by animateFloatAsState(
|
||||||
|
targetValue = if (isExpanded) 1f else 0f,
|
||||||
|
animationSpec = tween(
|
||||||
|
durationMillis = animationDurationMs,
|
||||||
|
delayMillis = if (isExpanded) {
|
||||||
|
index * staggerDelayMs + 100
|
||||||
|
} else {
|
||||||
|
(menuItems.size - index - 1) * staggerDelayMs
|
||||||
|
},
|
||||||
|
easing = FastOutSlowInEasing
|
||||||
|
),
|
||||||
|
label = "fabScale$index"
|
||||||
|
)
|
||||||
|
|
||||||
|
val animatedAlpha by animateFloatAsState(
|
||||||
|
targetValue = if (isExpanded) 1f else 0f,
|
||||||
|
animationSpec = tween(
|
||||||
|
durationMillis = animationDurationMs,
|
||||||
|
delayMillis = if (isExpanded) {
|
||||||
|
index * staggerDelayMs + 150
|
||||||
|
} else {
|
||||||
|
(menuItems.size - index - 1) * staggerDelayMs
|
||||||
|
},
|
||||||
|
easing = FastOutSlowInEasing
|
||||||
|
),
|
||||||
|
label = "fabAlpha$index"
|
||||||
|
)
|
||||||
|
|
||||||
|
// 子按钮容器(包含标签)
|
||||||
|
Row(
|
||||||
|
modifier = Modifier
|
||||||
|
.offset(y = animatedOffsetY.dp)
|
||||||
|
.scale(animatedScale)
|
||||||
|
.alpha(animatedAlpha),
|
||||||
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
|
horizontalArrangement = Arrangement.End
|
||||||
|
) {
|
||||||
|
// 标签
|
||||||
|
AnimatedVisibility(
|
||||||
|
visible = isExpanded && animatedScale > 0.5f,
|
||||||
|
enter = slideInHorizontally(
|
||||||
|
initialOffsetX = { it / 2 },
|
||||||
|
animationSpec = tween(200)
|
||||||
|
) + fadeIn(animationSpec = tween(200)),
|
||||||
|
exit = slideOutHorizontally(
|
||||||
|
targetOffsetX = { it / 2 },
|
||||||
|
animationSpec = tween(150)
|
||||||
|
) + fadeOut(animationSpec = tween(150))
|
||||||
|
) {
|
||||||
|
Surface(
|
||||||
|
modifier = Modifier.padding(end = 16.dp),
|
||||||
|
shape = MaterialTheme.shapes.small,
|
||||||
|
color = MaterialTheme.colorScheme.inverseSurface,
|
||||||
|
tonalElevation = 6.dp
|
||||||
|
) {
|
||||||
|
Text(
|
||||||
|
text = stringResource(menuItem.labelRes),
|
||||||
|
modifier = Modifier.padding(horizontal = 12.dp, vertical = 6.dp),
|
||||||
|
style = MaterialTheme.typography.labelMedium,
|
||||||
|
color = MaterialTheme.colorScheme.inverseOnSurface
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 子按钮
|
||||||
|
SmallFloatingActionButton(
|
||||||
|
onClick = {
|
||||||
|
menuItem.onClick()
|
||||||
|
isExpanded = false
|
||||||
|
},
|
||||||
|
modifier = Modifier.size(smallButtonSize),
|
||||||
|
containerColor = if (menuItem.color != Color.Unspecified) {
|
||||||
|
menuItem.color
|
||||||
|
} else {
|
||||||
|
MaterialTheme.colorScheme.secondary
|
||||||
|
},
|
||||||
|
contentColor = if (menuItem.color != Color.Unspecified) {
|
||||||
|
if (menuItem.color == Color.Gray) Color.White
|
||||||
|
else MaterialTheme.colorScheme.onSecondary
|
||||||
|
} else {
|
||||||
|
MaterialTheme.colorScheme.onSecondary
|
||||||
|
},
|
||||||
|
elevation = FloatingActionButtonDefaults.elevation(
|
||||||
|
defaultElevation = 4.dp,
|
||||||
|
pressedElevation = 6.dp
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
Icon(
|
||||||
|
imageVector = menuItem.icon,
|
||||||
|
contentDescription = stringResource(menuItem.labelRes),
|
||||||
|
modifier = Modifier.size(20.dp)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 主按钮
|
||||||
|
FloatingActionButton(
|
||||||
|
onClick = {
|
||||||
|
onMainButtonClick?.invoke()
|
||||||
|
isExpanded = !isExpanded
|
||||||
|
},
|
||||||
|
modifier = Modifier
|
||||||
|
.size(buttonSize)
|
||||||
|
.scale(mainButtonScale),
|
||||||
|
elevation = FloatingActionButtonDefaults.elevation(
|
||||||
|
defaultElevation = 6.dp,
|
||||||
|
pressedElevation = 8.dp,
|
||||||
|
hoveredElevation = 8.dp
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
Icon(
|
||||||
|
imageVector = if (isExpanded) mainButtonExpandedIcon else mainButtonIcon,
|
||||||
|
contentDescription = stringResource(
|
||||||
|
if (isExpanded) R.string.collapse_menu else R.string.expand_menu
|
||||||
|
),
|
||||||
|
modifier = Modifier
|
||||||
|
.size(24.dp)
|
||||||
|
.rotate(if (mainButtonIcon == Icons.Filled.Add) rotationAngle else 0f)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 预设菜单项
|
||||||
|
object FabMenuPresets {
|
||||||
|
fun getScrollMenuItems(
|
||||||
|
onScrollToTop: () -> Unit,
|
||||||
|
onScrollToBottom: () -> Unit
|
||||||
|
) = listOf(
|
||||||
|
FabMenuItem(
|
||||||
|
icon = Icons.Filled.KeyboardArrowDown,
|
||||||
|
labelRes = R.string.scroll_to_bottom,
|
||||||
|
onClick = onScrollToBottom
|
||||||
|
),
|
||||||
|
FabMenuItem(
|
||||||
|
icon = Icons.Filled.KeyboardArrowUp,
|
||||||
|
labelRes = R.string.scroll_to_top,
|
||||||
|
onClick = onScrollToTop
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun getBatchActionMenuItems(
|
||||||
|
onCancel: () -> Unit,
|
||||||
|
onDeny: () -> Unit,
|
||||||
|
onAllow: () -> Unit,
|
||||||
|
onUnmountModules: () -> Unit,
|
||||||
|
onDisableUnmount: () -> Unit
|
||||||
|
) = listOf(
|
||||||
|
FabMenuItem(
|
||||||
|
icon = Icons.Filled.Close,
|
||||||
|
labelRes = R.string.cancel,
|
||||||
|
color = Color.Gray,
|
||||||
|
onClick = onCancel
|
||||||
|
),
|
||||||
|
FabMenuItem(
|
||||||
|
icon = Icons.Filled.Block,
|
||||||
|
labelRes = R.string.deny_authorization,
|
||||||
|
color = MaterialTheme.colorScheme.error,
|
||||||
|
onClick = onDeny
|
||||||
|
),
|
||||||
|
FabMenuItem(
|
||||||
|
icon = Icons.Filled.Check,
|
||||||
|
labelRes = R.string.grant_authorization,
|
||||||
|
color = MaterialTheme.colorScheme.primary,
|
||||||
|
onClick = onAllow
|
||||||
|
),
|
||||||
|
FabMenuItem(
|
||||||
|
icon = Icons.Filled.FolderOff,
|
||||||
|
labelRes = R.string.unmount_modules,
|
||||||
|
onClick = onUnmountModules
|
||||||
|
),
|
||||||
|
FabMenuItem(
|
||||||
|
icon = Icons.Filled.Folder,
|
||||||
|
labelRes = R.string.disable_unmount,
|
||||||
|
onClick = onDisableUnmount
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -209,11 +209,10 @@ fun GroupsPanel(selected: List<Groups>, closeSelection: (selection: Set<Groups>)
|
|||||||
}
|
}
|
||||||
|
|
||||||
val selection = HashSet(selected)
|
val selection = HashSet(selected)
|
||||||
val backgroundColor = if (CardConfig.isCustomBackgroundEnabled) Color.Transparent else MaterialTheme.colorScheme.surfaceContainerHigh
|
|
||||||
|
|
||||||
MaterialTheme(
|
MaterialTheme(
|
||||||
colorScheme = MaterialTheme.colorScheme.copy(
|
colorScheme = MaterialTheme.colorScheme.copy(
|
||||||
surface = backgroundColor
|
surface = MaterialTheme.colorScheme.surfaceContainerHigh
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
ListDialog(
|
ListDialog(
|
||||||
@@ -289,11 +288,10 @@ fun CapsPanel(
|
|||||||
}
|
}
|
||||||
|
|
||||||
val selection = HashSet(selected)
|
val selection = HashSet(selected)
|
||||||
val backgroundColor = if (CardConfig.isCustomBackgroundEnabled) Color.Transparent else MaterialTheme.colorScheme.surfaceContainerHigh
|
|
||||||
|
|
||||||
MaterialTheme(
|
MaterialTheme(
|
||||||
colorScheme = MaterialTheme.colorScheme.copy(
|
colorScheme = MaterialTheme.colorScheme.copy(
|
||||||
surface = backgroundColor
|
surface = MaterialTheme.colorScheme.surfaceContainerHigh
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
ListDialog(
|
ListDialog(
|
||||||
@@ -444,11 +442,10 @@ private fun SELinuxPanel(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
val backgroundColor = if (CardConfig.isCustomBackgroundEnabled) Color.Transparent else MaterialTheme.colorScheme.surfaceContainerHigh
|
|
||||||
|
|
||||||
MaterialTheme(
|
MaterialTheme(
|
||||||
colorScheme = MaterialTheme.colorScheme.copy(
|
colorScheme = MaterialTheme.colorScheme.copy(
|
||||||
surface = backgroundColor
|
surface = MaterialTheme.colorScheme.surfaceContainerHigh
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
InputDialog(
|
InputDialog(
|
||||||
|
|||||||
@@ -70,11 +70,15 @@ data class ModuleInstallStatus(
|
|||||||
val totalModules: Int = 0,
|
val totalModules: Int = 0,
|
||||||
val currentModule: Int = 0,
|
val currentModule: Int = 0,
|
||||||
val currentModuleName: String = "",
|
val currentModuleName: String = "",
|
||||||
val failedModules: MutableList<String> = mutableListOf()
|
val failedModules: MutableList<String> = mutableListOf(),
|
||||||
|
val verifiedModules: MutableList<String> = mutableListOf() // 添加已验证模块列表
|
||||||
)
|
)
|
||||||
|
|
||||||
private var moduleInstallStatus = mutableStateOf(ModuleInstallStatus())
|
private var moduleInstallStatus = mutableStateOf(ModuleInstallStatus())
|
||||||
|
|
||||||
|
// 存储模块URI和验证状态的映射
|
||||||
|
private var moduleVerificationMap = mutableMapOf<Uri, Boolean>()
|
||||||
|
|
||||||
fun setFlashingStatus(status: FlashingStatus) {
|
fun setFlashingStatus(status: FlashingStatus) {
|
||||||
currentFlashingStatus.value = status
|
currentFlashingStatus.value = status
|
||||||
}
|
}
|
||||||
@@ -83,7 +87,8 @@ fun updateModuleInstallStatus(
|
|||||||
totalModules: Int? = null,
|
totalModules: Int? = null,
|
||||||
currentModule: Int? = null,
|
currentModule: Int? = null,
|
||||||
currentModuleName: String? = null,
|
currentModuleName: String? = null,
|
||||||
failedModule: String? = null
|
failedModule: String? = null,
|
||||||
|
verifiedModule: String? = null
|
||||||
) {
|
) {
|
||||||
val current = moduleInstallStatus.value
|
val current = moduleInstallStatus.value
|
||||||
moduleInstallStatus.value = current.copy(
|
moduleInstallStatus.value = current.copy(
|
||||||
@@ -99,6 +104,18 @@ fun updateModuleInstallStatus(
|
|||||||
failedModules = updatedFailedModules
|
failedModules = updatedFailedModules
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (verifiedModule != null) {
|
||||||
|
val updatedVerifiedModules = current.verifiedModules.toMutableList()
|
||||||
|
updatedVerifiedModules.add(verifiedModule)
|
||||||
|
moduleInstallStatus.value = moduleInstallStatus.value.copy(
|
||||||
|
verifiedModules = updatedVerifiedModules
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun setModuleVerificationStatus(uri: Uri, isVerified: Boolean) {
|
||||||
|
moduleVerificationMap[uri] = isVerified
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalMaterial3Api::class)
|
@OptIn(ExperimentalMaterial3Api::class)
|
||||||
@@ -110,6 +127,12 @@ fun FlashScreen(navigator: DestinationsNavigator, flashIt: FlashIt) {
|
|||||||
var tempText: String
|
var tempText: String
|
||||||
val logContent = rememberSaveable { StringBuilder() }
|
val logContent = rememberSaveable { StringBuilder() }
|
||||||
var showFloatAction by rememberSaveable { mutableStateOf(false) }
|
var showFloatAction by rememberSaveable { mutableStateOf(false) }
|
||||||
|
// 添加状态跟踪是否已经完成刷写
|
||||||
|
var hasFlashCompleted by rememberSaveable { mutableStateOf(false) }
|
||||||
|
var hasExecuted by rememberSaveable { mutableStateOf(false) }
|
||||||
|
// 更新模块状态管理
|
||||||
|
var hasUpdateExecuted by rememberSaveable { mutableStateOf(false) }
|
||||||
|
var hasUpdateCompleted by rememberSaveable { mutableStateOf(false) }
|
||||||
|
|
||||||
val snackBarHost = LocalSnackbarHost.current
|
val snackBarHost = LocalSnackbarHost.current
|
||||||
val scope = rememberCoroutineScope()
|
val scope = rememberCoroutineScope()
|
||||||
@@ -127,18 +150,88 @@ fun FlashScreen(navigator: DestinationsNavigator, flashIt: FlashIt) {
|
|||||||
|
|
||||||
// 重置状态
|
// 重置状态
|
||||||
LaunchedEffect(flashIt) {
|
LaunchedEffect(flashIt) {
|
||||||
if (flashIt is FlashIt.FlashModules && flashIt.currentIndex == 0) {
|
when (flashIt) {
|
||||||
moduleInstallStatus.value = ModuleInstallStatus(
|
is FlashIt.FlashModules -> {
|
||||||
totalModules = flashIt.uris.size,
|
if (flashIt.currentIndex == 0) {
|
||||||
currentModule = 1
|
moduleInstallStatus.value = ModuleInstallStatus(
|
||||||
)
|
totalModules = flashIt.uris.size,
|
||||||
|
currentModule = 1
|
||||||
|
)
|
||||||
|
hasFlashCompleted = false
|
||||||
|
hasExecuted = false
|
||||||
|
moduleVerificationMap.clear()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
is FlashIt.FlashModuleUpdate -> {
|
||||||
|
hasUpdateCompleted = false
|
||||||
|
hasUpdateExecuted = false
|
||||||
|
}
|
||||||
|
else -> {
|
||||||
|
hasFlashCompleted = false
|
||||||
|
hasExecuted = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LaunchedEffect(Unit) {
|
// 处理更新模块安装
|
||||||
if (text.isNotEmpty()) {
|
LaunchedEffect(flashIt) {
|
||||||
|
if (flashIt !is FlashIt.FlashModuleUpdate) return@LaunchedEffect
|
||||||
|
if (hasUpdateExecuted || hasUpdateCompleted || text.isNotEmpty()) {
|
||||||
return@LaunchedEffect
|
return@LaunchedEffect
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hasUpdateExecuted = true
|
||||||
|
|
||||||
|
withContext(Dispatchers.IO) {
|
||||||
|
setFlashingStatus(FlashingStatus.FLASHING)
|
||||||
|
|
||||||
|
try {
|
||||||
|
logContent.append(text).append("\n")
|
||||||
|
} catch (_: Exception) {
|
||||||
|
logContent.append(text).append("\n")
|
||||||
|
}
|
||||||
|
|
||||||
|
flashModuleUpdate(flashIt.uri, onFinish = { showReboot, code ->
|
||||||
|
if (code != 0) {
|
||||||
|
text += "$errorCodeString $code.\n$checkLogString\n"
|
||||||
|
setFlashingStatus(FlashingStatus.FAILED)
|
||||||
|
} else {
|
||||||
|
setFlashingStatus(FlashingStatus.SUCCESS)
|
||||||
|
|
||||||
|
// 处理模块更新成功后的验证标志
|
||||||
|
val isVerified = moduleVerificationMap[flashIt.uri] ?: false
|
||||||
|
ModuleOperationUtils.handleModuleUpdate(context, flashIt.uri, isVerified)
|
||||||
|
|
||||||
|
viewModel.markNeedRefresh()
|
||||||
|
}
|
||||||
|
if (showReboot) {
|
||||||
|
text += "\n\n\n"
|
||||||
|
showFloatAction = true
|
||||||
|
}
|
||||||
|
hasUpdateCompleted = true
|
||||||
|
}, onStdout = {
|
||||||
|
tempText = "$it\n"
|
||||||
|
if (tempText.startsWith("[H[J")) { // clear command
|
||||||
|
text = tempText.substring(6)
|
||||||
|
} else {
|
||||||
|
text += tempText
|
||||||
|
}
|
||||||
|
logContent.append(it).append("\n")
|
||||||
|
}, onStderr = {
|
||||||
|
logContent.append(it).append("\n")
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 安装但排除更新模块
|
||||||
|
LaunchedEffect(flashIt) {
|
||||||
|
if (flashIt is FlashIt.FlashModuleUpdate) return@LaunchedEffect
|
||||||
|
if (hasExecuted || hasFlashCompleted || text.isNotEmpty()) {
|
||||||
|
return@LaunchedEffect
|
||||||
|
}
|
||||||
|
|
||||||
|
hasExecuted = true
|
||||||
|
|
||||||
withContext(Dispatchers.IO) {
|
withContext(Dispatchers.IO) {
|
||||||
setFlashingStatus(FlashingStatus.FLASHING)
|
setFlashingStatus(FlashingStatus.FLASHING)
|
||||||
|
|
||||||
@@ -157,7 +250,7 @@ fun FlashScreen(navigator: DestinationsNavigator, flashIt: FlashIt) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
flashIt(context, flashIt, onFinish = { showReboot, code ->
|
flashIt(flashIt, onFinish = { showReboot, code ->
|
||||||
if (code != 0) {
|
if (code != 0) {
|
||||||
text += "$errorCodeString $code.\n$checkLogString\n"
|
text += "$errorCodeString $code.\n$checkLogString\n"
|
||||||
setFlashingStatus(FlashingStatus.FAILED)
|
setFlashingStatus(FlashingStatus.FAILED)
|
||||||
@@ -169,6 +262,28 @@ fun FlashScreen(navigator: DestinationsNavigator, flashIt: FlashIt) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
setFlashingStatus(FlashingStatus.SUCCESS)
|
setFlashingStatus(FlashingStatus.SUCCESS)
|
||||||
|
|
||||||
|
// 处理模块安装成功后的验证标志
|
||||||
|
when (flashIt) {
|
||||||
|
is FlashIt.FlashModule -> {
|
||||||
|
val isVerified = moduleVerificationMap[flashIt.uri] ?: false
|
||||||
|
ModuleOperationUtils.handleModuleInstallSuccess(context, flashIt.uri, isVerified)
|
||||||
|
if (isVerified) {
|
||||||
|
updateModuleInstallStatus(verifiedModule = moduleInstallStatus.value.currentModuleName)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
is FlashIt.FlashModules -> {
|
||||||
|
val currentUri = flashIt.uris[flashIt.currentIndex]
|
||||||
|
val isVerified = moduleVerificationMap[currentUri] ?: false
|
||||||
|
ModuleOperationUtils.handleModuleInstallSuccess(context, currentUri, isVerified)
|
||||||
|
if (isVerified) {
|
||||||
|
updateModuleInstallStatus(verifiedModule = moduleInstallStatus.value.currentModuleName)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
else -> {}
|
||||||
|
}
|
||||||
|
|
||||||
viewModel.markNeedRefresh()
|
viewModel.markNeedRefresh()
|
||||||
}
|
}
|
||||||
if (showReboot) {
|
if (showReboot) {
|
||||||
@@ -176,6 +291,8 @@ fun FlashScreen(navigator: DestinationsNavigator, flashIt: FlashIt) {
|
|||||||
showFloatAction = true
|
showFloatAction = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hasFlashCompleted = true
|
||||||
|
|
||||||
if (flashIt is FlashIt.FlashModules && flashIt.currentIndex < flashIt.uris.size - 1) {
|
if (flashIt is FlashIt.FlashModules && flashIt.currentIndex < flashIt.uris.size - 1) {
|
||||||
val nextFlashIt = flashIt.copy(
|
val nextFlashIt = flashIt.copy(
|
||||||
currentIndex = flashIt.currentIndex + 1
|
currentIndex = flashIt.currentIndex + 1
|
||||||
@@ -187,7 +304,7 @@ fun FlashScreen(navigator: DestinationsNavigator, flashIt: FlashIt) {
|
|||||||
}
|
}
|
||||||
}, onStdout = {
|
}, onStdout = {
|
||||||
tempText = "$it\n"
|
tempText = "$it\n"
|
||||||
if (tempText.startsWith("[H[J")) { // clear command
|
if (tempText.startsWith("[H[J")) { // clear command
|
||||||
text = tempText.substring(6)
|
text = tempText.substring(6)
|
||||||
} else {
|
} else {
|
||||||
text += tempText
|
text += tempText
|
||||||
@@ -200,8 +317,13 @@ fun FlashScreen(navigator: DestinationsNavigator, flashIt: FlashIt) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
val onBack: () -> Unit = {
|
val onBack: () -> Unit = {
|
||||||
if (currentFlashingStatus.value != FlashingStatus.FLASHING) {
|
val canGoBack = when (flashIt) {
|
||||||
if (flashIt is FlashIt.FlashModules) {
|
is FlashIt.FlashModuleUpdate -> currentFlashingStatus.value != FlashingStatus.FLASHING
|
||||||
|
else -> currentFlashingStatus.value != FlashingStatus.FLASHING
|
||||||
|
}
|
||||||
|
|
||||||
|
if (canGoBack) {
|
||||||
|
if (flashIt is FlashIt.FlashModules || flashIt is FlashIt.FlashModuleUpdate) {
|
||||||
viewModel.markNeedRefresh()
|
viewModel.markNeedRefresh()
|
||||||
viewModel.fetchModuleList()
|
viewModel.fetchModuleList()
|
||||||
navigator.navigate(ModuleScreenDestination)
|
navigator.navigate(ModuleScreenDestination)
|
||||||
@@ -222,8 +344,6 @@ fun FlashScreen(navigator: DestinationsNavigator, flashIt: FlashIt) {
|
|||||||
TopBar(
|
TopBar(
|
||||||
currentFlashingStatus.value,
|
currentFlashingStatus.value,
|
||||||
currentStatus,
|
currentStatus,
|
||||||
navigator = navigator,
|
|
||||||
flashIt = flashIt,
|
|
||||||
onBack = onBack,
|
onBack = onBack,
|
||||||
onSave = {
|
onSave = {
|
||||||
scope.launch {
|
scope.launch {
|
||||||
@@ -352,7 +472,7 @@ fun ModuleInstallProgressBar(
|
|||||||
horizontalArrangement = Arrangement.SpaceBetween
|
horizontalArrangement = Arrangement.SpaceBetween
|
||||||
) {
|
) {
|
||||||
Text(
|
Text(
|
||||||
text = if (currentModuleName.isNotEmpty()) currentModuleName else stringResource(R.string.module),
|
text = currentModuleName.ifEmpty { stringResource(R.string.module) },
|
||||||
style = MaterialTheme.typography.titleMedium,
|
style = MaterialTheme.typography.titleMedium,
|
||||||
fontWeight = FontWeight.Bold
|
fontWeight = FontWeight.Bold
|
||||||
)
|
)
|
||||||
@@ -434,8 +554,6 @@ fun ModuleInstallProgressBar(
|
|||||||
private fun TopBar(
|
private fun TopBar(
|
||||||
status: FlashingStatus,
|
status: FlashingStatus,
|
||||||
moduleStatus: ModuleInstallStatus = ModuleInstallStatus(),
|
moduleStatus: ModuleInstallStatus = ModuleInstallStatus(),
|
||||||
navigator: DestinationsNavigator,
|
|
||||||
flashIt: FlashIt,
|
|
||||||
onBack: () -> Unit,
|
onBack: () -> Unit,
|
||||||
onSave: () -> Unit = {},
|
onSave: () -> Unit = {},
|
||||||
scrollBehavior: TopAppBarScrollBehavior? = null
|
scrollBehavior: TopAppBarScrollBehavior? = null
|
||||||
@@ -526,12 +644,22 @@ sealed class FlashIt : Parcelable {
|
|||||||
data class FlashBoot(val boot: Uri? = null, val lkm: LkmSelection, val ota: Boolean) : FlashIt()
|
data class FlashBoot(val boot: Uri? = null, val lkm: LkmSelection, val ota: Boolean) : FlashIt()
|
||||||
data class FlashModule(val uri: Uri) : FlashIt()
|
data class FlashModule(val uri: Uri) : FlashIt()
|
||||||
data class FlashModules(val uris: List<Uri>, val currentIndex: Int = 0) : FlashIt()
|
data class FlashModules(val uris: List<Uri>, val currentIndex: Int = 0) : FlashIt()
|
||||||
|
data class FlashModuleUpdate(val uri: Uri) : FlashIt() // 模块更新
|
||||||
data object FlashRestore : FlashIt()
|
data object FlashRestore : FlashIt()
|
||||||
data object FlashUninstall : FlashIt()
|
data object FlashUninstall : FlashIt()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 模块更新刷写
|
||||||
|
fun flashModuleUpdate(
|
||||||
|
uri: Uri,
|
||||||
|
onFinish: (Boolean, Int) -> Unit,
|
||||||
|
onStdout: (String) -> Unit,
|
||||||
|
onStderr: (String) -> Unit
|
||||||
|
) {
|
||||||
|
flashModule(uri, onFinish, onStdout, onStderr)
|
||||||
|
}
|
||||||
|
|
||||||
fun flashIt(
|
fun flashIt(
|
||||||
context: android.content.Context,
|
|
||||||
flashIt: FlashIt,
|
flashIt: FlashIt,
|
||||||
onFinish: (Boolean, Int) -> Unit,
|
onFinish: (Boolean, Int) -> Unit,
|
||||||
onStdout: (String) -> Unit,
|
onStdout: (String) -> Unit,
|
||||||
@@ -558,6 +686,9 @@ fun flashIt(
|
|||||||
|
|
||||||
flashModule(currentUri, onFinish, onStdout, onStderr)
|
flashModule(currentUri, onFinish, onStdout, onStderr)
|
||||||
}
|
}
|
||||||
|
is FlashIt.FlashModuleUpdate -> {
|
||||||
|
onFinish(false, 0)
|
||||||
|
}
|
||||||
FlashIt.FlashRestore -> restoreBoot(onFinish, onStdout, onStderr)
|
FlashIt.FlashRestore -> restoreBoot(onFinish, onStdout, onStderr)
|
||||||
FlashIt.FlashUninstall -> uninstallPermanently(onFinish, onStdout, onStderr)
|
FlashIt.FlashUninstall -> uninstallPermanently(onFinish, onStdout, onStderr)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.sukisu.ultra.ui.screen
|
package com.sukisu.ultra.ui.screen
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import android.os.PowerManager
|
import android.os.PowerManager
|
||||||
@@ -76,6 +77,7 @@ import androidx.lifecycle.viewmodel.compose.viewModel
|
|||||||
import com.ramcosta.composedestinations.annotation.Destination
|
import com.ramcosta.composedestinations.annotation.Destination
|
||||||
import com.ramcosta.composedestinations.annotation.RootGraph
|
import com.ramcosta.composedestinations.annotation.RootGraph
|
||||||
import com.ramcosta.composedestinations.generated.destinations.InstallScreenDestination
|
import com.ramcosta.composedestinations.generated.destinations.InstallScreenDestination
|
||||||
|
import com.ramcosta.composedestinations.generated.destinations.SuSFSConfigScreenDestination
|
||||||
import com.ramcosta.composedestinations.navigation.DestinationsNavigator
|
import com.ramcosta.composedestinations.navigation.DestinationsNavigator
|
||||||
import com.sukisu.ultra.KernelVersion
|
import com.sukisu.ultra.KernelVersion
|
||||||
import com.sukisu.ultra.Natives
|
import com.sukisu.ultra.Natives
|
||||||
@@ -90,6 +92,8 @@ import com.sukisu.ultra.ui.theme.getCardElevation
|
|||||||
import com.sukisu.ultra.ui.util.checkNewVersion
|
import com.sukisu.ultra.ui.util.checkNewVersion
|
||||||
import com.sukisu.ultra.ui.util.module.LatestVersionInfo
|
import com.sukisu.ultra.ui.util.module.LatestVersionInfo
|
||||||
import com.sukisu.ultra.ui.util.reboot
|
import com.sukisu.ultra.ui.util.reboot
|
||||||
|
import com.sukisu.ultra.ui.util.getSuSFS
|
||||||
|
import com.sukisu.ultra.ui.util.SuSFSManager
|
||||||
import com.sukisu.ultra.ui.viewmodel.HomeViewModel
|
import com.sukisu.ultra.ui.viewmodel.HomeViewModel
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
@@ -126,7 +130,8 @@ fun HomeScreen(navigator: DestinationsNavigator) {
|
|||||||
Scaffold(
|
Scaffold(
|
||||||
topBar = {
|
topBar = {
|
||||||
TopBar(
|
TopBar(
|
||||||
scrollBehavior = scrollBehavior
|
scrollBehavior = scrollBehavior,
|
||||||
|
navigator = navigator
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
contentWindowInsets = WindowInsets.safeDrawing.only(
|
contentWindowInsets = WindowInsets.safeDrawing.only(
|
||||||
@@ -165,8 +170,8 @@ fun HomeScreen(navigator: DestinationsNavigator) {
|
|||||||
if (viewModel.systemStatus.requireNewKernel) {
|
if (viewModel.systemStatus.requireNewKernel) {
|
||||||
WarningCard(
|
WarningCard(
|
||||||
stringResource(id = R.string.require_kernel_version).format(
|
stringResource(id = R.string.require_kernel_version).format(
|
||||||
viewModel.systemStatus.ksuVersion,
|
Natives.getSimpleVersionFull(),
|
||||||
Natives.MINIMAL_SUPPORTED_KERNEL
|
Natives.MINIMAL_SUPPORTED_KERNEL_FULL
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -187,6 +192,7 @@ fun HomeScreen(navigator: DestinationsNavigator) {
|
|||||||
systemInfo = viewModel.systemInfo,
|
systemInfo = viewModel.systemInfo,
|
||||||
isSimpleMode = viewModel.isSimpleMode,
|
isSimpleMode = viewModel.isSimpleMode,
|
||||||
isHideSusfsStatus = viewModel.isHideSusfsStatus,
|
isHideSusfsStatus = viewModel.isHideSusfsStatus,
|
||||||
|
isHideZygiskImplement = viewModel.isHideZygiskImplement,
|
||||||
showKpmInfo = viewModel.showKpmInfo,
|
showKpmInfo = viewModel.showKpmInfo,
|
||||||
lkmMode = viewModel.systemStatus.lkmMode,
|
lkmMode = viewModel.systemStatus.lkmMode,
|
||||||
)
|
)
|
||||||
@@ -256,15 +262,17 @@ fun UpdateCard() {
|
|||||||
@Composable
|
@Composable
|
||||||
fun RebootDropdownItem(@StringRes id: Int, reason: String = "") {
|
fun RebootDropdownItem(@StringRes id: Int, reason: String = "") {
|
||||||
DropdownMenuItem(
|
DropdownMenuItem(
|
||||||
text = {Text(stringResource(id))},
|
text = { Text(stringResource(id)) },
|
||||||
onClick = {reboot(reason)})
|
onClick = { reboot(reason) })
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalMaterial3Api::class)
|
@OptIn(ExperimentalMaterial3Api::class)
|
||||||
@Composable
|
@Composable
|
||||||
private fun TopBar(
|
private fun TopBar(
|
||||||
scrollBehavior: TopAppBarScrollBehavior? = null
|
scrollBehavior: TopAppBarScrollBehavior? = null,
|
||||||
|
navigator: DestinationsNavigator
|
||||||
) {
|
) {
|
||||||
|
val context = LocalContext.current
|
||||||
val colorScheme = MaterialTheme.colorScheme
|
val colorScheme = MaterialTheme.colorScheme
|
||||||
val cardColor = if (CardConfig.isCustomBackgroundEnabled) {
|
val cardColor = if (CardConfig.isCustomBackgroundEnabled) {
|
||||||
colorScheme.surfaceContainerLow
|
colorScheme.surfaceContainerLow
|
||||||
@@ -284,6 +292,19 @@ private fun TopBar(
|
|||||||
scrolledContainerColor = cardColor.copy(alpha = cardAlpha)
|
scrolledContainerColor = cardColor.copy(alpha = cardAlpha)
|
||||||
),
|
),
|
||||||
actions = {
|
actions = {
|
||||||
|
// SuSFS 配置按钮
|
||||||
|
if (getSuSFS() == "Supported" && SuSFSManager.isBinaryAvailable(context)) {
|
||||||
|
IconButton(onClick = {
|
||||||
|
navigator.navigate(SuSFSConfigScreenDestination)
|
||||||
|
}) {
|
||||||
|
Icon(
|
||||||
|
imageVector = Icons.Filled.Tune,
|
||||||
|
contentDescription = stringResource(R.string.susfs_config_setting_title)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 重启按钮
|
||||||
var showDropdown by remember { mutableStateOf(false) }
|
var showDropdown by remember { mutableStateOf(false) }
|
||||||
KsuIsValid {
|
KsuIsValid {
|
||||||
IconButton(onClick = {
|
IconButton(onClick = {
|
||||||
@@ -299,7 +320,8 @@ private fun TopBar(
|
|||||||
}) {
|
}) {
|
||||||
RebootDropdownItem(id = R.string.reboot)
|
RebootDropdownItem(id = R.string.reboot)
|
||||||
|
|
||||||
val pm = LocalContext.current.getSystemService(Context.POWER_SERVICE) as PowerManager?
|
val pm =
|
||||||
|
LocalContext.current.getSystemService(Context.POWER_SERVICE) as PowerManager?
|
||||||
@Suppress("DEPRECATION")
|
@Suppress("DEPRECATION")
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R && pm?.isRebootingUserspaceSupported == true) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R && pm?.isRebootingUserspaceSupported == true) {
|
||||||
RebootDropdownItem(id = R.string.reboot_userspace, reason = "userspace")
|
RebootDropdownItem(id = R.string.reboot_userspace, reason = "userspace")
|
||||||
@@ -323,8 +345,10 @@ private fun StatusCard(
|
|||||||
onClickInstall: () -> Unit = {}
|
onClickInstall: () -> Unit = {}
|
||||||
) {
|
) {
|
||||||
ElevatedCard(
|
ElevatedCard(
|
||||||
colors = getCardColors( if (systemStatus.ksuVersion != null)MaterialTheme.colorScheme.secondaryContainer
|
colors = getCardColors(
|
||||||
else MaterialTheme.colorScheme.errorContainer),
|
if (systemStatus.ksuVersion != null) MaterialTheme.colorScheme.secondaryContainer
|
||||||
|
else MaterialTheme.colorScheme.errorContainer
|
||||||
|
),
|
||||||
elevation = getCardElevation(),
|
elevation = getCardElevation(),
|
||||||
) {
|
) {
|
||||||
Row(
|
Row(
|
||||||
@@ -413,16 +437,21 @@ private fun StatusCard(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val isHideVersion = LocalContext.current.getSharedPreferences("settings", Context.MODE_PRIVATE)
|
val isHideVersion = LocalContext.current.getSharedPreferences(
|
||||||
|
"settings",
|
||||||
|
Context.MODE_PRIVATE
|
||||||
|
)
|
||||||
.getBoolean("is_hide_version", false)
|
.getBoolean("is_hide_version", false)
|
||||||
|
|
||||||
if (!isHideVersion) {
|
if (!isHideVersion) {
|
||||||
Spacer(Modifier.height(4.dp))
|
Spacer(Modifier.height(4.dp))
|
||||||
Text(
|
systemStatus.ksuFullVersion?.let {
|
||||||
text = stringResource(R.string.home_working_version, systemStatus.ksuVersion),
|
Text(
|
||||||
style = MaterialTheme.typography.bodyMedium,
|
text = stringResource(R.string.home_working_version, it),
|
||||||
color = MaterialTheme.colorScheme.secondary,
|
style = MaterialTheme.typography.bodyMedium,
|
||||||
)
|
color = MaterialTheme.colorScheme.secondary,
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -619,6 +648,7 @@ private fun InfoCard(
|
|||||||
systemInfo: HomeViewModel.SystemInfo,
|
systemInfo: HomeViewModel.SystemInfo,
|
||||||
isSimpleMode: Boolean,
|
isSimpleMode: Boolean,
|
||||||
isHideSusfsStatus: Boolean,
|
isHideSusfsStatus: Boolean,
|
||||||
|
isHideZygiskImplement: Boolean,
|
||||||
showKpmInfo: Boolean,
|
showKpmInfo: Boolean,
|
||||||
lkmMode: Boolean?
|
lkmMode: Boolean?
|
||||||
) {
|
) {
|
||||||
@@ -657,7 +687,7 @@ private fun InfoCard(
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.weight(1f)
|
.weight(1f)
|
||||||
){
|
) {
|
||||||
Text(
|
Text(
|
||||||
text = label,
|
text = label,
|
||||||
style = MaterialTheme.typography.labelLarge,
|
style = MaterialTheme.typography.labelLarge,
|
||||||
@@ -697,25 +727,74 @@ private fun InfoCard(
|
|||||||
icon = Icons.Default.SettingsSuggest,
|
icon = Icons.Default.SettingsSuggest,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if (!isSimpleMode &&
|
||||||
|
(systemInfo.suSFSStatus != "Supported")) {
|
||||||
|
InfoCardItem(
|
||||||
|
stringResource(R.string.home_hook_type),
|
||||||
|
Natives.getHookType(),
|
||||||
|
icon = Icons.Default.Link
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 活跃管理器
|
||||||
|
if (!isSimpleMode && systemInfo.isDynamicSignEnabled && systemInfo.managersList != null) {
|
||||||
|
val signatureMap = systemInfo.managersList.managers.groupBy { it.signatureIndex }
|
||||||
|
|
||||||
|
val managersText = buildString {
|
||||||
|
signatureMap.toSortedMap().forEach { (signatureIndex, managers) ->
|
||||||
|
append(managers.joinToString(", ") { "UID: ${it.uid}" })
|
||||||
|
append(" ")
|
||||||
|
append(
|
||||||
|
when (signatureIndex) {
|
||||||
|
0 -> "(${stringResource(R.string.default_signature)})"
|
||||||
|
1 -> "(${stringResource(R.string.dynamic_managerature)})"
|
||||||
|
else -> if (signatureIndex >= 2) "(${
|
||||||
|
stringResource(
|
||||||
|
R.string.signature_index,
|
||||||
|
signatureIndex
|
||||||
|
)
|
||||||
|
})" else "(${stringResource(R.string.unknown_signature)})"
|
||||||
|
}
|
||||||
|
)
|
||||||
|
append(" | ")
|
||||||
|
}
|
||||||
|
}.trimEnd(' ', '|')
|
||||||
|
|
||||||
|
InfoCardItem(
|
||||||
|
stringResource(R.string.multi_manager_list),
|
||||||
|
managersText.ifEmpty { stringResource(R.string.no_active_manager) },
|
||||||
|
icon = Icons.Default.Group,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
InfoCardItem(
|
InfoCardItem(
|
||||||
stringResource(R.string.home_selinux_status),
|
stringResource(R.string.home_selinux_status),
|
||||||
systemInfo.seLinuxStatus,
|
systemInfo.seLinuxStatus,
|
||||||
icon = Icons.Default.Security,
|
icon = Icons.Default.Security,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if (!isHideZygiskImplement && !isSimpleMode && systemInfo.zygiskImplement != "None") {
|
||||||
|
InfoCardItem(
|
||||||
|
stringResource(R.string.home_zygisk_implement),
|
||||||
|
systemInfo.zygiskImplement,
|
||||||
|
icon = Icons.Default.Adb,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
if (!isSimpleMode) {
|
if (!isSimpleMode) {
|
||||||
// 根据showKpmInfo决定是否显示KPM信息
|
// 根据showKpmInfo决定是否显示KPM信息
|
||||||
if (lkmMode != true && !showKpmInfo && Natives.version >= Natives.MINIMAL_SUPPORTED_KPM) {
|
if (lkmMode != true && !showKpmInfo) {
|
||||||
val displayVersion = if (systemInfo.kpmVersion.isEmpty() || systemInfo.kpmVersion.startsWith("Error")) {
|
val displayVersion =
|
||||||
val statusText = if (Natives.isKPMEnabled()) {
|
if (systemInfo.kpmVersion.isEmpty() || systemInfo.kpmVersion.startsWith("Error")) {
|
||||||
stringResource(R.string.kernel_patched)
|
val statusText = if (Natives.isKPMEnabled()) {
|
||||||
|
stringResource(R.string.kernel_patched)
|
||||||
|
} else {
|
||||||
|
stringResource(R.string.kernel_not_enabled)
|
||||||
|
}
|
||||||
|
"${stringResource(R.string.not_supported)} ($statusText)"
|
||||||
} else {
|
} else {
|
||||||
stringResource(R.string.kernel_not_enabled)
|
"${stringResource(R.string.supported)} (${systemInfo.kpmVersion})"
|
||||||
}
|
}
|
||||||
"${stringResource(R.string.not_supported)} ($statusText)"
|
|
||||||
} else {
|
|
||||||
"${stringResource(R.string.supported)} (${systemInfo.kpmVersion})"
|
|
||||||
}
|
|
||||||
|
|
||||||
InfoCardItem(
|
InfoCardItem(
|
||||||
stringResource(R.string.home_kpm_version),
|
stringResource(R.string.home_kpm_version),
|
||||||
@@ -725,32 +804,49 @@ private fun InfoCard(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((!isSimpleMode) && (!isHideSusfsStatus)) {
|
if (!isSimpleMode && !isHideSusfsStatus &&
|
||||||
if (systemInfo.suSFSStatus == "Supported") {
|
systemInfo.suSFSStatus == "Supported" &&
|
||||||
if (systemInfo.suSFSVersion.isNotEmpty()) {
|
systemInfo.suSFSVersion.isNotEmpty()
|
||||||
val isSUS_SU = systemInfo.suSFSFeatures == "CONFIG_KSU_SUSFS_SUS_SU"
|
) {
|
||||||
val infoText = buildString {
|
|
||||||
append(systemInfo.suSFSVersion)
|
|
||||||
append(if (isSUS_SU) " (${systemInfo.suSFSVariant})" else " (${stringResource(R.string.manual_hook)})")
|
|
||||||
if (isSUS_SU) {
|
|
||||||
if (systemInfo.susSUMode.isNotEmpty()) {
|
|
||||||
append(" ${stringResource(R.string.sus_su_mode)} ${systemInfo.susSUMode}")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
InfoCardItem(
|
val infoText = SuSFSInfoText(systemInfo)
|
||||||
stringResource(R.string.home_susfs_version),
|
|
||||||
infoText,
|
InfoCardItem(
|
||||||
icon = Icons.Default.Storage
|
stringResource(R.string.home_susfs_version),
|
||||||
)
|
infoText,
|
||||||
}
|
icon = Icons.Default.Storage
|
||||||
}
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressLint("ComposableNaming")
|
||||||
|
@Composable
|
||||||
|
private fun SuSFSInfoText(systemInfo: HomeViewModel.SystemInfo): String = buildString {
|
||||||
|
append(systemInfo.suSFSVersion)
|
||||||
|
|
||||||
|
val isSUS_SU = systemInfo.suSFSFeatures == "CONFIG_KSU_SUSFS_SUS_SU"
|
||||||
|
val isKprobesHook = Natives.getHookType() == "Kprobes"
|
||||||
|
|
||||||
|
when {
|
||||||
|
isSUS_SU && isKprobesHook -> {
|
||||||
|
append(" (${systemInfo.suSFSVariant})")
|
||||||
|
if (systemInfo.susSUMode.isNotEmpty()) {
|
||||||
|
append(" ${stringResource(R.string.sus_su_mode)} ${systemInfo.susSUMode}")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Natives.getHookType() == "Manual" -> {
|
||||||
|
append(" (${stringResource(R.string.manual_hook)})")
|
||||||
|
}
|
||||||
|
|
||||||
|
else -> {
|
||||||
|
append(" (${Natives.getHookType()})")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fun getManagerVersion(context: Context): Pair<String, Long> {
|
fun getManagerVersion(context: Context): Pair<String, Long> {
|
||||||
val packageInfo = context.packageManager.getPackageInfo(context.packageName, 0)!!
|
val packageInfo = context.packageManager.getPackageInfo(context.packageName, 0)!!
|
||||||
val versionCode = PackageInfoCompat.getLongVersionCode(packageInfo)
|
val versionCode = PackageInfoCompat.getLongVersionCode(packageInfo)
|
||||||
|
|||||||
@@ -186,7 +186,7 @@ fun InstallScreen(navigator: DestinationsNavigator) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
val onClickNext = {
|
val onClickNext = {
|
||||||
if (isGKI && lkmSelection == LkmSelection.KmiNone && currentKmi.isBlank()) {
|
if (isGKI && lkmSelection == LkmSelection.KmiNone && currentKmi.isBlank() && installMethod !is InstallMethod.HorizonKernel) {
|
||||||
selectKmiDialog.show()
|
selectKmiDialog.show()
|
||||||
} else {
|
} else {
|
||||||
onInstall()
|
onInstall()
|
||||||
@@ -373,7 +373,11 @@ private fun SelectInstallMethod(
|
|||||||
val horizonKernelSummary = stringResource(R.string.horizon_kernel_summary)
|
val horizonKernelSummary = stringResource(R.string.horizon_kernel_summary)
|
||||||
val selectFileTip = stringResource(
|
val selectFileTip = stringResource(
|
||||||
id = R.string.select_file_tip,
|
id = R.string.select_file_tip,
|
||||||
if (isInitBoot()) "init_boot" else "boot"
|
if (isInitBoot()) {
|
||||||
|
"init_boot / vendor_boot ${stringResource(R.string.select_file_tip_vendor)}"
|
||||||
|
} else {
|
||||||
|
"boot"
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
val radioOptions = mutableListOf<InstallMethod>(
|
val radioOptions = mutableListOf<InstallMethod>(
|
||||||
@@ -688,11 +692,10 @@ fun rememberSelectKmiDialog(onSelected: (String?) -> Unit): DialogHandle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var selection by remember { mutableStateOf<String?>(null) }
|
var selection by remember { mutableStateOf<String?>(null) }
|
||||||
val backgroundColor = MaterialTheme.colorScheme.surfaceContainerHigh
|
|
||||||
|
|
||||||
MaterialTheme(
|
MaterialTheme(
|
||||||
colorScheme = MaterialTheme.colorScheme.copy(
|
colorScheme = MaterialTheme.colorScheme.copy(
|
||||||
surface = backgroundColor
|
surface = MaterialTheme.colorScheme.surfaceContainerHigh
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
ListDialog(state = rememberUseCaseState(visible = true, onFinishedRequest = {
|
ListDialog(state = rememberUseCaseState(visible = true, onFinishedRequest = {
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import androidx.activity.result.contract.ActivityResultContracts
|
|||||||
import androidx.compose.foundation.layout.*
|
import androidx.compose.foundation.layout.*
|
||||||
import androidx.compose.foundation.lazy.LazyColumn
|
import androidx.compose.foundation.lazy.LazyColumn
|
||||||
import androidx.compose.foundation.lazy.items
|
import androidx.compose.foundation.lazy.items
|
||||||
|
import androidx.compose.foundation.lazy.rememberLazyListState
|
||||||
import androidx.compose.material.icons.Icons
|
import androidx.compose.material.icons.Icons
|
||||||
import androidx.compose.material.icons.filled.*
|
import androidx.compose.material.icons.filled.*
|
||||||
import androidx.compose.material3.*
|
import androidx.compose.material3.*
|
||||||
@@ -15,7 +16,6 @@ import androidx.compose.runtime.*
|
|||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.draw.clip
|
import androidx.compose.ui.draw.clip
|
||||||
import androidx.compose.ui.draw.shadow
|
|
||||||
import androidx.compose.ui.platform.LocalContext
|
import androidx.compose.ui.platform.LocalContext
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.text.style.TextAlign
|
import androidx.compose.ui.text.style.TextAlign
|
||||||
@@ -23,7 +23,6 @@ import androidx.compose.ui.unit.dp
|
|||||||
import androidx.lifecycle.viewmodel.compose.viewModel
|
import androidx.lifecycle.viewmodel.compose.viewModel
|
||||||
import com.ramcosta.composedestinations.annotation.Destination
|
import com.ramcosta.composedestinations.annotation.Destination
|
||||||
import com.ramcosta.composedestinations.annotation.RootGraph
|
import com.ramcosta.composedestinations.annotation.RootGraph
|
||||||
import com.ramcosta.composedestinations.navigation.DestinationsNavigator
|
|
||||||
import kotlinx.coroutines.delay
|
import kotlinx.coroutines.delay
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import com.sukisu.ultra.ui.component.*
|
import com.sukisu.ultra.ui.component.*
|
||||||
@@ -33,12 +32,10 @@ import com.sukisu.ultra.ui.util.*
|
|||||||
import java.io.File
|
import java.io.File
|
||||||
import androidx.core.content.edit
|
import androidx.core.content.edit
|
||||||
import com.sukisu.ultra.R
|
import com.sukisu.ultra.R
|
||||||
import java.io.BufferedReader
|
|
||||||
import java.io.FileInputStream
|
import java.io.FileInputStream
|
||||||
import java.io.InputStreamReader
|
|
||||||
import java.net.*
|
import java.net.*
|
||||||
import android.app.Activity
|
import android.app.Activity
|
||||||
import com.sukisu.ultra.ui.theme.CardConfig.cardElevation
|
import androidx.compose.ui.res.painterResource
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* KPM 管理界面
|
* KPM 管理界面
|
||||||
@@ -49,7 +46,6 @@ import com.sukisu.ultra.ui.theme.CardConfig.cardElevation
|
|||||||
@Destination<RootGraph>
|
@Destination<RootGraph>
|
||||||
@Composable
|
@Composable
|
||||||
fun KpmScreen(
|
fun KpmScreen(
|
||||||
navigator: DestinationsNavigator,
|
|
||||||
viewModel: KpmViewModel = viewModel()
|
viewModel: KpmViewModel = viewModel()
|
||||||
) {
|
) {
|
||||||
val context = LocalContext.current
|
val context = LocalContext.current
|
||||||
@@ -57,6 +53,9 @@ fun KpmScreen(
|
|||||||
val snackBarHost = remember { SnackbarHostState() }
|
val snackBarHost = remember { SnackbarHostState() }
|
||||||
val confirmDialog = rememberConfirmDialog()
|
val confirmDialog = rememberConfirmDialog()
|
||||||
|
|
||||||
|
val listState = rememberLazyListState()
|
||||||
|
val fabVisible by rememberFabVisibilityState(listState)
|
||||||
|
|
||||||
val moduleConfirmContentMap = viewModel.moduleList.associate { module ->
|
val moduleConfirmContentMap = viewModel.moduleList.associate { module ->
|
||||||
val moduleFileName = module.id
|
val moduleFileName = module.id
|
||||||
module.id to stringResource(R.string.confirm_uninstall_content, moduleFileName)
|
module.id to stringResource(R.string.confirm_uninstall_content, moduleFileName)
|
||||||
@@ -84,18 +83,17 @@ fun KpmScreen(
|
|||||||
LaunchedEffect(tempFileForInstall) {
|
LaunchedEffect(tempFileForInstall) {
|
||||||
tempFileForInstall?.let { tempFile ->
|
tempFileForInstall?.let { tempFile ->
|
||||||
try {
|
try {
|
||||||
val command = arrayOf("su", "-c", "strings ${tempFile.absolutePath} | grep 'name='")
|
val shell = getRootShell()
|
||||||
val process = Runtime.getRuntime().exec(command)
|
val command = "strings ${tempFile.absolutePath} | grep 'name='"
|
||||||
val inputStream = process.inputStream
|
val result = shell.newJob().add(command).to(ArrayList(), null).exec()
|
||||||
val reader = BufferedReader(InputStreamReader(inputStream))
|
if (result.isSuccess) {
|
||||||
var line: String?
|
for (line in result.out) {
|
||||||
while (reader.readLine().also { line = it } != null) {
|
if (line.startsWith("name=")) {
|
||||||
if (line!!.startsWith("name=")) {
|
moduleName = line.substringAfter("name=").trim()
|
||||||
moduleName = line.substringAfter("name=").trim()
|
break
|
||||||
break
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
process.waitFor()
|
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
Log.e("KsuCli", "Failed to get module name: ${e.message}", e)
|
Log.e("KsuCli", "Failed to get module name: ${e.message}", e)
|
||||||
}
|
}
|
||||||
@@ -283,28 +281,29 @@ fun KpmScreen(
|
|||||||
)
|
)
|
||||||
},
|
},
|
||||||
floatingActionButton = {
|
floatingActionButton = {
|
||||||
ExtendedFloatingActionButton(
|
AnimatedFab(visible = fabVisible) {
|
||||||
onClick = {
|
FloatingActionButton(
|
||||||
selectPatchLauncher.launch(
|
contentColor = MaterialTheme.colorScheme.onPrimary,
|
||||||
Intent(Intent.ACTION_GET_CONTENT).apply {
|
containerColor = MaterialTheme.colorScheme.primary,
|
||||||
type = "application/octet-stream"
|
onClick = {
|
||||||
}
|
selectPatchLauncher.launch(
|
||||||
)
|
Intent(Intent.ACTION_GET_CONTENT).apply {
|
||||||
},
|
type = "application/octet-stream"
|
||||||
icon = {
|
}
|
||||||
Icon(
|
)
|
||||||
imageVector = Icons.Filled.Add,
|
},
|
||||||
contentDescription = stringResource(R.string.kpm_install),
|
content = {
|
||||||
)
|
Icon(
|
||||||
},
|
painter = painterResource(id = R.drawable.package_import),
|
||||||
text = {
|
contentDescription = null
|
||||||
Text(
|
)
|
||||||
text = stringResource(R.string.kpm_install),
|
}
|
||||||
)
|
)
|
||||||
},
|
}
|
||||||
expanded = true,
|
|
||||||
)
|
|
||||||
},
|
},
|
||||||
|
contentWindowInsets = WindowInsets.safeDrawing.only(
|
||||||
|
WindowInsetsSides.Top + WindowInsetsSides.Horizontal
|
||||||
|
),
|
||||||
snackbarHost = { SnackbarHost(snackBarHost) }
|
snackbarHost = { SnackbarHost(snackBarHost) }
|
||||||
) { padding ->
|
) { padding ->
|
||||||
Column(modifier = Modifier.padding(padding)) {
|
Column(modifier = Modifier.padding(padding)) {
|
||||||
@@ -378,6 +377,7 @@ fun KpmScreen(
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
LazyColumn(
|
LazyColumn(
|
||||||
|
state = listState,
|
||||||
modifier = Modifier.fillMaxSize(),
|
modifier = Modifier.fillMaxSize(),
|
||||||
contentPadding = PaddingValues(horizontal = 16.dp, vertical = 16.dp),
|
contentPadding = PaddingValues(horizontal = 16.dp, vertical = 16.dp),
|
||||||
verticalArrangement = Arrangement.spacedBy(16.dp)
|
verticalArrangement = Arrangement.spacedBy(16.dp)
|
||||||
@@ -424,18 +424,17 @@ private suspend fun handleModuleInstall(
|
|||||||
) {
|
) {
|
||||||
var moduleId: String? = null
|
var moduleId: String? = null
|
||||||
try {
|
try {
|
||||||
val command = arrayOf("su", "-c", "strings ${tempFile.absolutePath} | grep 'name='")
|
val shell = getRootShell()
|
||||||
val process = Runtime.getRuntime().exec(command)
|
val command = "strings ${tempFile.absolutePath} | grep 'name='"
|
||||||
val inputStream = process.inputStream
|
val result = shell.newJob().add(command).to(ArrayList(), null).exec()
|
||||||
val reader = BufferedReader(InputStreamReader(inputStream))
|
if (result.isSuccess) {
|
||||||
var line: String?
|
for (line in result.out) {
|
||||||
while (reader.readLine().also { line = it } != null) {
|
if (line.startsWith("name=")) {
|
||||||
if (line!!.startsWith("name=")) {
|
moduleId = line.substringAfter("name=").trim()
|
||||||
moduleId = line.substringAfter("name=").trim()
|
break
|
||||||
break
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
process.waitFor()
|
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
Log.e("KsuCli", "Failed to get module ID from strings command: ${e.message}", e)
|
Log.e("KsuCli", "Failed to get module ID from strings command: ${e.message}", e)
|
||||||
}
|
}
|
||||||
@@ -454,8 +453,9 @@ private suspend fun handleModuleInstall(
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
if (isEmbed) {
|
if (isEmbed) {
|
||||||
Runtime.getRuntime().exec(arrayOf("su", "-c", "mkdir -p /data/adb/kpm")).waitFor()
|
val shell = getRootShell()
|
||||||
Runtime.getRuntime().exec(arrayOf("su", "-c", "cp ${tempFile.absolutePath} $targetPath")).waitFor()
|
shell.newJob().add("mkdir -p /data/adb/kpm").exec()
|
||||||
|
shell.newJob().add("cp ${tempFile.absolutePath} $targetPath").exec()
|
||||||
}
|
}
|
||||||
|
|
||||||
val loadResult = loadKpmModule(tempFile.absolutePath)
|
val loadResult = loadKpmModule(tempFile.absolutePath)
|
||||||
@@ -499,8 +499,9 @@ private suspend fun handleModuleUninstall(
|
|||||||
val moduleFilePath = "/data/adb/kpm/$moduleFileName"
|
val moduleFilePath = "/data/adb/kpm/$moduleFileName"
|
||||||
|
|
||||||
val fileExists = try {
|
val fileExists = try {
|
||||||
val result = Runtime.getRuntime().exec(arrayOf("su", "-c", "ls /data/adb/kpm/$moduleFileName")).waitFor() == 0
|
val shell = getRootShell()
|
||||||
result
|
val result = shell.newJob().add("ls /data/adb/kpm/$moduleFileName").exec()
|
||||||
|
result.isSuccess
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
Log.e("KsuCli", "Failed to check module file existence: ${e.message}", e)
|
Log.e("KsuCli", "Failed to check module file existence: ${e.message}", e)
|
||||||
snackBarHost.showSnackbar(
|
snackBarHost.showSnackbar(
|
||||||
@@ -509,6 +510,7 @@ private suspend fun handleModuleUninstall(
|
|||||||
)
|
)
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|
||||||
val confirmResult = confirmDialog.awaitConfirm(
|
val confirmResult = confirmDialog.awaitConfirm(
|
||||||
title = confirmTitle,
|
title = confirmTitle,
|
||||||
content = confirmContent,
|
content = confirmContent,
|
||||||
@@ -529,7 +531,8 @@ private suspend fun handleModuleUninstall(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (fileExists) {
|
if (fileExists) {
|
||||||
Runtime.getRuntime().exec(arrayOf("su", "-c", "rm $moduleFilePath")).waitFor()
|
val shell = getRootShell()
|
||||||
|
shell.newJob().add("rm $moduleFilePath").exec()
|
||||||
}
|
}
|
||||||
|
|
||||||
viewModel.fetchModuleList()
|
viewModel.fetchModuleList()
|
||||||
@@ -700,29 +703,31 @@ private fun KpmModuleItem(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun checkStringsCommand(tempFile: File): Int {
|
private fun checkStringsCommand(tempFile: File): Int {
|
||||||
val command = arrayOf("su", "-c", "strings ${tempFile.absolutePath} | grep -E 'name=|version=|license=|author='")
|
val shell = getRootShell()
|
||||||
val process = Runtime.getRuntime().exec(command)
|
val command = "strings ${tempFile.absolutePath} | grep -E 'name=|version=|license=|author='"
|
||||||
val inputStream = process.inputStream
|
val result = shell.newJob().add(command).to(ArrayList(), null).exec()
|
||||||
val reader = BufferedReader(InputStreamReader(inputStream))
|
|
||||||
var line: String?
|
if (!result.isSuccess) {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
var matchCount = 0
|
var matchCount = 0
|
||||||
val keywords = listOf("name=", "version=", "license=", "author=")
|
val keywords = listOf("name=", "version=", "license=", "author=")
|
||||||
var nameExists = false
|
var nameExists = false
|
||||||
|
|
||||||
while (reader.readLine().also { line = it } != null) {
|
for (line in result.out) {
|
||||||
if (!nameExists && line!!.startsWith("name=")) {
|
if (!nameExists && line.startsWith("name=")) {
|
||||||
nameExists = true
|
nameExists = true
|
||||||
matchCount++
|
matchCount++
|
||||||
} else if (nameExists) {
|
} else if (nameExists) {
|
||||||
for (keyword in keywords) {
|
for (keyword in keywords) {
|
||||||
if (line!!.startsWith(keyword)) {
|
if (line.startsWith(keyword)) {
|
||||||
matchCount++
|
matchCount++
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
process.waitFor()
|
|
||||||
|
|
||||||
return if (nameExists) matchCount else 0
|
return if (nameExists) matchCount else 0
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
package com.sukisu.ultra.ui.screen
|
package com.sukisu.ultra.ui.screen
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint
|
||||||
import android.app.Activity.*
|
import android.app.Activity.*
|
||||||
|
import android.content.ClipData
|
||||||
|
import android.content.ClipboardManager
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
@@ -8,12 +11,22 @@ import android.util.Log
|
|||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import androidx.activity.compose.rememberLauncherForActivityResult
|
import androidx.activity.compose.rememberLauncherForActivityResult
|
||||||
import androidx.activity.result.contract.ActivityResultContracts
|
import androidx.activity.result.contract.ActivityResultContracts
|
||||||
|
import androidx.compose.animation.*
|
||||||
|
import androidx.compose.animation.core.*
|
||||||
import androidx.compose.foundation.*
|
import androidx.compose.foundation.*
|
||||||
import androidx.compose.foundation.interaction.MutableInteractionSource
|
import androidx.compose.foundation.interaction.MutableInteractionSource
|
||||||
|
import androidx.compose.foundation.interaction.collectIsPressedAsState
|
||||||
import androidx.compose.foundation.layout.*
|
import androidx.compose.foundation.layout.*
|
||||||
import androidx.compose.foundation.lazy.LazyColumn
|
import androidx.compose.foundation.lazy.LazyColumn
|
||||||
|
import androidx.compose.foundation.lazy.LazyListState
|
||||||
|
import androidx.compose.foundation.lazy.grid.GridCells
|
||||||
|
import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
|
||||||
|
import androidx.compose.foundation.lazy.grid.items
|
||||||
import androidx.compose.foundation.lazy.items
|
import androidx.compose.foundation.lazy.items
|
||||||
|
import androidx.compose.foundation.lazy.rememberLazyListState
|
||||||
import androidx.compose.foundation.selection.toggleable
|
import androidx.compose.foundation.selection.toggleable
|
||||||
|
import androidx.compose.foundation.shape.CircleShape
|
||||||
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||||
import androidx.compose.material.icons.Icons
|
import androidx.compose.material.icons.Icons
|
||||||
import androidx.compose.material.icons.automirrored.outlined.*
|
import androidx.compose.material.icons.automirrored.outlined.*
|
||||||
import androidx.compose.material.icons.filled.*
|
import androidx.compose.material.icons.filled.*
|
||||||
@@ -24,8 +37,12 @@ import androidx.compose.runtime.*
|
|||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.draw.rotate
|
import androidx.compose.ui.draw.rotate
|
||||||
|
import androidx.compose.ui.draw.scale
|
||||||
|
import androidx.compose.ui.graphics.vector.ImageVector
|
||||||
|
import androidx.compose.ui.hapticfeedback.HapticFeedbackType
|
||||||
import androidx.compose.ui.input.nestedscroll.nestedScroll
|
import androidx.compose.ui.input.nestedscroll.nestedScroll
|
||||||
import androidx.compose.ui.platform.*
|
import androidx.compose.ui.platform.*
|
||||||
|
import androidx.compose.ui.res.painterResource
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.semantics.Role
|
import androidx.compose.ui.semantics.Role
|
||||||
import androidx.compose.ui.text.font.FontWeight
|
import androidx.compose.ui.text.font.FontWeight
|
||||||
@@ -66,29 +83,58 @@ import com.sukisu.ultra.ui.viewmodel.ModuleViewModel
|
|||||||
import java.util.concurrent.TimeUnit
|
import java.util.concurrent.TimeUnit
|
||||||
import androidx.core.content.edit
|
import androidx.core.content.edit
|
||||||
import com.sukisu.ultra.R
|
import com.sukisu.ultra.R
|
||||||
import com.sukisu.ultra.ui.theme.CardConfig.cardElevation
|
|
||||||
import com.sukisu.ultra.ui.webui.WebUIXActivity
|
import com.sukisu.ultra.ui.webui.WebUIXActivity
|
||||||
import com.dergoogler.mmrl.platform.Platform
|
import com.dergoogler.mmrl.platform.Platform
|
||||||
import androidx.core.net.toUri
|
import androidx.core.net.toUri
|
||||||
import com.dergoogler.mmrl.platform.model.ModuleConfig
|
import com.dergoogler.mmrl.platform.model.ModuleConfig
|
||||||
import com.dergoogler.mmrl.platform.model.ModuleConfig.Companion.asModuleConfig
|
import com.dergoogler.mmrl.platform.model.ModuleConfig.Companion.asModuleConfig
|
||||||
|
import com.sukisu.ultra.ui.component.AnimatedFab
|
||||||
|
import com.sukisu.ultra.ui.component.rememberFabVisibilityState
|
||||||
import com.sukisu.ultra.ui.theme.getCardElevation
|
import com.sukisu.ultra.ui.theme.getCardElevation
|
||||||
|
|
||||||
|
// 菜单项数据类
|
||||||
|
data class ModuleBottomSheetMenuItem(
|
||||||
|
val icon: ImageVector,
|
||||||
|
val titleRes: Int,
|
||||||
|
val onClick: () -> Unit
|
||||||
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author ShirkNeko
|
* @author ShirkNeko
|
||||||
* @date 2025/5/31.
|
* @date 2025/5/31.
|
||||||
*/
|
*/
|
||||||
|
@SuppressLint("ResourceType", "AutoboxingStateCreation")
|
||||||
@OptIn(ExperimentalMaterial3Api::class)
|
@OptIn(ExperimentalMaterial3Api::class)
|
||||||
@Destination<RootGraph>
|
@Destination<RootGraph>
|
||||||
@Composable
|
@Composable
|
||||||
fun ModuleScreen(navigator: DestinationsNavigator) {
|
fun ModuleScreen(navigator: DestinationsNavigator) {
|
||||||
val viewModel = viewModel<ModuleViewModel>()
|
val viewModel = viewModel<ModuleViewModel>()
|
||||||
val context = LocalContext.current
|
val context = LocalContext.current
|
||||||
|
val prefs = context.getSharedPreferences("settings",MODE_PRIVATE)
|
||||||
val snackBarHost = LocalSnackbarHost.current
|
val snackBarHost = LocalSnackbarHost.current
|
||||||
val scope = rememberCoroutineScope()
|
val scope = rememberCoroutineScope()
|
||||||
val confirmDialog = rememberConfirmDialog()
|
val confirmDialog = rememberConfirmDialog()
|
||||||
var lastClickTime by remember { mutableStateOf(0L) }
|
var lastClickTime by remember { mutableStateOf(0L) }
|
||||||
|
|
||||||
|
// 签名验证弹窗状态
|
||||||
|
var showSignatureDialog by remember { mutableStateOf(false) }
|
||||||
|
var signatureDialogMessage by remember { mutableStateOf("") }
|
||||||
|
var isForceVerificationFailed by remember { mutableStateOf(false) }
|
||||||
|
var pendingInstallAction by remember { mutableStateOf<(() -> Unit)?>(null) }
|
||||||
|
|
||||||
|
// 初始化缓存系统
|
||||||
|
LaunchedEffect(Unit) {
|
||||||
|
viewModel.initializeCache(context)
|
||||||
|
}
|
||||||
|
|
||||||
|
// BottomSheet状态
|
||||||
|
val bottomSheetState = rememberModalBottomSheetState(
|
||||||
|
skipPartiallyExpanded = true
|
||||||
|
)
|
||||||
|
var showBottomSheet by remember { mutableStateOf(false) }
|
||||||
|
val listState = rememberLazyListState()
|
||||||
|
val fabVisible by rememberFabVisibilityState(listState)
|
||||||
|
|
||||||
val selectZipLauncher = rememberLauncherForActivityResult(
|
val selectZipLauncher = rememberLauncherForActivityResult(
|
||||||
contract = ActivityResultContracts.StartActivityForResult()
|
contract = ActivityResultContracts.StartActivityForResult()
|
||||||
) {
|
) {
|
||||||
@@ -136,13 +182,53 @@ fun ModuleScreen(navigator: DestinationsNavigator) {
|
|||||||
)
|
)
|
||||||
|
|
||||||
if (confirmResult == ConfirmResult.Confirmed) {
|
if (confirmResult == ConfirmResult.Confirmed) {
|
||||||
try {
|
// 验证模块签名
|
||||||
// 批量安装模块
|
val forceVerification = prefs.getBoolean("force_signature_verification", false)
|
||||||
navigator.navigate(FlashScreenDestination(FlashIt.FlashModules(selectedModules)))
|
val verificationResults = mutableMapOf<Uri, Boolean>()
|
||||||
viewModel.markNeedRefresh()
|
|
||||||
} catch (e: Exception) {
|
for (uri in selectedModules) {
|
||||||
Log.e("ModuleScreen", "Error navigating to FlashScreen: ${e.message}")
|
val isVerified = verifyModuleSignature(context, uri)
|
||||||
snackBarHost.showSnackbar("Error while installing module: ${e.message}")
|
verificationResults[uri] = isVerified
|
||||||
|
// 存储验证状态
|
||||||
|
setModuleVerificationStatus(uri, isVerified)
|
||||||
|
|
||||||
|
if (forceVerification && !isVerified) {
|
||||||
|
withContext(Dispatchers.Main) {
|
||||||
|
signatureDialogMessage = context.getString(R.string.module_signature_invalid_message)
|
||||||
|
isForceVerificationFailed = true
|
||||||
|
showSignatureDialog = true
|
||||||
|
}
|
||||||
|
return@launch
|
||||||
|
} else if (!isVerified) {
|
||||||
|
withContext(Dispatchers.Main) {
|
||||||
|
signatureDialogMessage = context.getString(R.string.module_signature_verification_failed)
|
||||||
|
isForceVerificationFailed = false
|
||||||
|
pendingInstallAction = {
|
||||||
|
try {
|
||||||
|
navigator.navigate(FlashScreenDestination(FlashIt.FlashModules(selectedModules)))
|
||||||
|
viewModel.markNeedRefresh()
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.e("ModuleScreen", "Error navigating to FlashScreen: ${e.message}")
|
||||||
|
scope.launch {
|
||||||
|
snackBarHost.showSnackbar("Error while installing module: ${e.message}")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
showSignatureDialog = true
|
||||||
|
}
|
||||||
|
return@launch
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 所有模块签名验证通过,直接安装
|
||||||
|
if (verificationResults.all { it.value }) {
|
||||||
|
try {
|
||||||
|
navigator.navigate(FlashScreenDestination(FlashIt.FlashModules(selectedModules)))
|
||||||
|
viewModel.markNeedRefresh()
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.e("ModuleScreen", "Error navigating to FlashScreen: ${e.message}")
|
||||||
|
snackBarHost.showSnackbar("Error while installing module: ${e.message}")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -166,6 +252,28 @@ fun ModuleScreen(navigator: DestinationsNavigator) {
|
|||||||
)
|
)
|
||||||
|
|
||||||
if (confirmResult == ConfirmResult.Confirmed) {
|
if (confirmResult == ConfirmResult.Confirmed) {
|
||||||
|
// 验证模块签名
|
||||||
|
val forceVerification = prefs.getBoolean("force_signature_verification", false)
|
||||||
|
val isVerified = verifyModuleSignature(context, uri)
|
||||||
|
// 存储验证状态
|
||||||
|
setModuleVerificationStatus(uri, isVerified)
|
||||||
|
|
||||||
|
if (forceVerification && !isVerified) {
|
||||||
|
signatureDialogMessage = context.getString(R.string.module_signature_invalid_message)
|
||||||
|
isForceVerificationFailed = true
|
||||||
|
showSignatureDialog = true
|
||||||
|
return@launch
|
||||||
|
} else if (!isVerified) {
|
||||||
|
signatureDialogMessage = context.getString(R.string.module_signature_verification_failed)
|
||||||
|
isForceVerificationFailed = false
|
||||||
|
pendingInstallAction = {
|
||||||
|
navigator.navigate(FlashScreenDestination(FlashIt.FlashModule(uri)))
|
||||||
|
viewModel.markNeedRefresh()
|
||||||
|
}
|
||||||
|
showSignatureDialog = true
|
||||||
|
return@launch
|
||||||
|
}
|
||||||
|
|
||||||
navigator.navigate(FlashScreenDestination(FlashIt.FlashModule(uri)))
|
navigator.navigate(FlashScreenDestination(FlashIt.FlashModule(uri)))
|
||||||
viewModel.markNeedRefresh()
|
viewModel.markNeedRefresh()
|
||||||
}
|
}
|
||||||
@@ -180,7 +288,6 @@ fun ModuleScreen(navigator: DestinationsNavigator) {
|
|||||||
val backupLauncher = ModuleModify.rememberModuleBackupLauncher(context, snackBarHost)
|
val backupLauncher = ModuleModify.rememberModuleBackupLauncher(context, snackBarHost)
|
||||||
val restoreLauncher = ModuleModify.rememberModuleRestoreLauncher(context, snackBarHost)
|
val restoreLauncher = ModuleModify.rememberModuleRestoreLauncher(context, snackBarHost)
|
||||||
|
|
||||||
val prefs = context.getSharedPreferences("settings", MODE_PRIVATE)
|
|
||||||
|
|
||||||
LaunchedEffect(Unit) {
|
LaunchedEffect(Unit) {
|
||||||
if (viewModel.moduleList.isEmpty() || viewModel.isNeedRefresh) {
|
if (viewModel.moduleList.isEmpty() || viewModel.isNeedRefresh) {
|
||||||
@@ -201,6 +308,34 @@ fun ModuleScreen(navigator: DestinationsNavigator) {
|
|||||||
contract = ActivityResultContracts.StartActivityForResult()
|
contract = ActivityResultContracts.StartActivityForResult()
|
||||||
) { viewModel.fetchModuleList() }
|
) { viewModel.fetchModuleList() }
|
||||||
|
|
||||||
|
// BottomSheet菜单项
|
||||||
|
val bottomSheetMenuItems = remember {
|
||||||
|
listOf(
|
||||||
|
ModuleBottomSheetMenuItem(
|
||||||
|
icon = Icons.Outlined.Save,
|
||||||
|
titleRes = R.string.backup_modules,
|
||||||
|
onClick = {
|
||||||
|
backupLauncher.launch(ModuleModify.createBackupIntent())
|
||||||
|
scope.launch {
|
||||||
|
bottomSheetState.hide()
|
||||||
|
showBottomSheet = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
),
|
||||||
|
ModuleBottomSheetMenuItem(
|
||||||
|
icon = Icons.Outlined.RestoreFromTrash,
|
||||||
|
titleRes = R.string.restore_modules,
|
||||||
|
onClick = {
|
||||||
|
restoreLauncher.launch(ModuleModify.createRestoreIntent())
|
||||||
|
scope.launch {
|
||||||
|
bottomSheetState.hide()
|
||||||
|
showBottomSheet = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
Scaffold(
|
Scaffold(
|
||||||
topBar = {
|
topBar = {
|
||||||
SearchAppBar(
|
SearchAppBar(
|
||||||
@@ -209,96 +344,23 @@ fun ModuleScreen(navigator: DestinationsNavigator) {
|
|||||||
onSearchTextChange = { viewModel.search = it },
|
onSearchTextChange = { viewModel.search = it },
|
||||||
onClearClick = { viewModel.search = "" },
|
onClearClick = { viewModel.search = "" },
|
||||||
dropdownContent = {
|
dropdownContent = {
|
||||||
var showDropdown by remember { mutableStateOf(false) }
|
|
||||||
|
|
||||||
IconButton(
|
IconButton(
|
||||||
onClick = { showDropdown = true },
|
onClick = { showBottomSheet = true },
|
||||||
) {
|
) {
|
||||||
Icon(
|
Icon(
|
||||||
imageVector = Icons.Filled.MoreVert,
|
imageVector = Icons.Filled.MoreVert,
|
||||||
contentDescription = stringResource(id = R.string.settings),
|
contentDescription = stringResource(id = R.string.settings),
|
||||||
)
|
)
|
||||||
|
|
||||||
DropdownMenu(
|
|
||||||
expanded = showDropdown,
|
|
||||||
onDismissRequest = { showDropdown = false }
|
|
||||||
) {
|
|
||||||
DropdownMenuItem(
|
|
||||||
text = { Text(stringResource(R.string.module_sort_action_first)) },
|
|
||||||
trailingIcon = {
|
|
||||||
Checkbox(
|
|
||||||
checked = viewModel.sortActionFirst,
|
|
||||||
onCheckedChange = null,
|
|
||||||
)
|
|
||||||
},
|
|
||||||
onClick = {
|
|
||||||
viewModel.sortActionFirst = !viewModel.sortActionFirst
|
|
||||||
prefs.edit {
|
|
||||||
putBoolean(
|
|
||||||
"module_sort_action_first",
|
|
||||||
viewModel.sortActionFirst
|
|
||||||
)
|
|
||||||
}
|
|
||||||
scope.launch {
|
|
||||||
viewModel.fetchModuleList()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
DropdownMenuItem(
|
|
||||||
text = { Text(stringResource(R.string.module_sort_enabled_first)) },
|
|
||||||
trailingIcon = {
|
|
||||||
Checkbox(
|
|
||||||
checked = viewModel.sortEnabledFirst,
|
|
||||||
onCheckedChange = null,
|
|
||||||
)
|
|
||||||
},
|
|
||||||
onClick = {
|
|
||||||
viewModel.sortEnabledFirst = !viewModel.sortEnabledFirst
|
|
||||||
prefs.edit {
|
|
||||||
putBoolean("module_sort_enabled_first", viewModel.sortEnabledFirst)
|
|
||||||
}
|
|
||||||
scope.launch {
|
|
||||||
viewModel.fetchModuleList()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
HorizontalDivider(thickness = Dp.Hairline, modifier = Modifier.padding(vertical = 4.dp))
|
|
||||||
DropdownMenuItem(
|
|
||||||
text = { Text(stringResource(R.string.backup_modules)) },
|
|
||||||
leadingIcon = {
|
|
||||||
Icon(
|
|
||||||
imageVector = Icons.Outlined.Save,
|
|
||||||
contentDescription = stringResource(R.string.backup),
|
|
||||||
)
|
|
||||||
},
|
|
||||||
onClick = {
|
|
||||||
showDropdown = false
|
|
||||||
backupLauncher.launch(ModuleModify.createBackupIntent())
|
|
||||||
}
|
|
||||||
)
|
|
||||||
DropdownMenuItem(
|
|
||||||
text = { Text(stringResource(R.string.restore_modules)) },
|
|
||||||
leadingIcon = {
|
|
||||||
Icon(
|
|
||||||
imageVector = Icons.Outlined.RestoreFromTrash,
|
|
||||||
contentDescription = stringResource(R.string.restore),
|
|
||||||
)
|
|
||||||
},
|
|
||||||
onClick = {
|
|
||||||
showDropdown = false
|
|
||||||
restoreLauncher.launch(ModuleModify.createRestoreIntent())
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
scrollBehavior = scrollBehavior,
|
scrollBehavior = scrollBehavior,
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
floatingActionButton = {
|
floatingActionButton = {
|
||||||
if (!hideInstallButton) {
|
AnimatedFab(visible = !hideInstallButton && fabVisible) {
|
||||||
val moduleInstall = stringResource(id = R.string.module_install)
|
FloatingActionButton(
|
||||||
ExtendedFloatingActionButton(
|
contentColor = MaterialTheme.colorScheme.onPrimary,
|
||||||
|
containerColor = MaterialTheme.colorScheme.primary,
|
||||||
onClick = {
|
onClick = {
|
||||||
selectZipLauncher.launch(
|
selectZipLauncher.launch(
|
||||||
Intent(Intent.ACTION_GET_CONTENT).apply {
|
Intent(Intent.ACTION_GET_CONTENT).apply {
|
||||||
@@ -307,18 +369,12 @@ fun ModuleScreen(navigator: DestinationsNavigator) {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
icon = {
|
content = {
|
||||||
Icon(
|
Icon(
|
||||||
imageVector = Icons.Filled.Add,
|
painter = painterResource(id = R.drawable.package_import),
|
||||||
contentDescription = moduleInstall,
|
contentDescription = null
|
||||||
)
|
)
|
||||||
},
|
}
|
||||||
text = {
|
|
||||||
Text(
|
|
||||||
text = moduleInstall,
|
|
||||||
)
|
|
||||||
},
|
|
||||||
expanded = true,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -358,11 +414,15 @@ fun ModuleScreen(navigator: DestinationsNavigator) {
|
|||||||
ModuleList(
|
ModuleList(
|
||||||
navigator = navigator,
|
navigator = navigator,
|
||||||
viewModel = viewModel,
|
viewModel = viewModel,
|
||||||
|
listState = listState,
|
||||||
modifier = Modifier.nestedScroll(scrollBehavior.nestedScrollConnection),
|
modifier = Modifier.nestedScroll(scrollBehavior.nestedScrollConnection),
|
||||||
boxModifier = Modifier.padding(innerPadding),
|
boxModifier = Modifier.padding(innerPadding),
|
||||||
onInstallModule = {
|
onInstallModule = {
|
||||||
navigator.navigate(FlashScreenDestination(FlashIt.FlashModule(it)))
|
navigator.navigate(FlashScreenDestination(FlashIt.FlashModule(it)))
|
||||||
},
|
},
|
||||||
|
onUpdateModule = {
|
||||||
|
navigator.navigate(FlashScreenDestination(FlashIt.FlashModuleUpdate(it)))
|
||||||
|
},
|
||||||
onClickModule = { id, name, hasWebUi ->
|
onClickModule = { id, name, hasWebUi ->
|
||||||
val currentTime = System.currentTimeMillis()
|
val currentTime = System.currentTimeMillis()
|
||||||
if (currentTime - lastClickTime < 600) {
|
if (currentTime - lastClickTime < 600) {
|
||||||
@@ -425,6 +485,260 @@ fun ModuleScreen(navigator: DestinationsNavigator) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// BottomSheet
|
||||||
|
if (showBottomSheet) {
|
||||||
|
ModalBottomSheet(
|
||||||
|
onDismissRequest = {
|
||||||
|
showBottomSheet = false
|
||||||
|
},
|
||||||
|
sheetState = bottomSheetState,
|
||||||
|
dragHandle = {
|
||||||
|
Surface(
|
||||||
|
modifier = Modifier.padding(vertical = 11.dp),
|
||||||
|
color = MaterialTheme.colorScheme.onSurfaceVariant.copy(alpha = 0.4f),
|
||||||
|
shape = RoundedCornerShape(16.dp)
|
||||||
|
) {
|
||||||
|
Box(
|
||||||
|
Modifier.size(
|
||||||
|
width = 32.dp,
|
||||||
|
height = 4.dp
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
) {
|
||||||
|
ModuleBottomSheetContent(
|
||||||
|
menuItems = bottomSheetMenuItems,
|
||||||
|
viewModel = viewModel,
|
||||||
|
prefs = prefs,
|
||||||
|
scope = scope,
|
||||||
|
bottomSheetState = bottomSheetState,
|
||||||
|
onDismiss = { showBottomSheet = false }
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 签名验证弹窗
|
||||||
|
if (showSignatureDialog) {
|
||||||
|
AlertDialog(
|
||||||
|
onDismissRequest = { showSignatureDialog = false },
|
||||||
|
icon = {
|
||||||
|
Icon(
|
||||||
|
imageVector = Icons.Outlined.Warning,
|
||||||
|
contentDescription = null,
|
||||||
|
tint = MaterialTheme.colorScheme.error
|
||||||
|
)
|
||||||
|
},
|
||||||
|
title = {
|
||||||
|
Text(
|
||||||
|
text = stringResource(R.string.module_signature_invalid),
|
||||||
|
color = MaterialTheme.colorScheme.error
|
||||||
|
)
|
||||||
|
},
|
||||||
|
text = {
|
||||||
|
Text(text = signatureDialogMessage)
|
||||||
|
},
|
||||||
|
confirmButton = {
|
||||||
|
if (isForceVerificationFailed) {
|
||||||
|
// 强制验证失败,只显示确定按钮
|
||||||
|
TextButton(
|
||||||
|
onClick = { showSignatureDialog = false }
|
||||||
|
) {
|
||||||
|
Text(stringResource(R.string.confirm))
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 非强制验证失败,显示继续安装按钮
|
||||||
|
TextButton(
|
||||||
|
onClick = {
|
||||||
|
showSignatureDialog = false
|
||||||
|
pendingInstallAction?.invoke()
|
||||||
|
pendingInstallAction = null
|
||||||
|
}
|
||||||
|
) {
|
||||||
|
Text(stringResource(R.string.install))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
dismissButton = if (!isForceVerificationFailed) {
|
||||||
|
{
|
||||||
|
TextButton(
|
||||||
|
onClick = {
|
||||||
|
showSignatureDialog = false
|
||||||
|
pendingInstallAction = null
|
||||||
|
}
|
||||||
|
) {
|
||||||
|
Text(stringResource(R.string.cancel))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
null
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@OptIn(ExperimentalMaterial3Api::class)
|
||||||
|
@Composable
|
||||||
|
private fun ModuleBottomSheetContent(
|
||||||
|
menuItems: List<ModuleBottomSheetMenuItem>,
|
||||||
|
viewModel: ModuleViewModel,
|
||||||
|
prefs: android.content.SharedPreferences,
|
||||||
|
scope: kotlinx.coroutines.CoroutineScope,
|
||||||
|
bottomSheetState: SheetState,
|
||||||
|
onDismiss: () -> Unit
|
||||||
|
) {
|
||||||
|
Column(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.padding(bottom = 24.dp)
|
||||||
|
) {
|
||||||
|
// 标题
|
||||||
|
Text(
|
||||||
|
text = stringResource(R.string.menu_options),
|
||||||
|
style = MaterialTheme.typography.headlineSmall,
|
||||||
|
fontWeight = FontWeight.Bold,
|
||||||
|
modifier = Modifier.padding(horizontal = 24.dp, vertical = 16.dp)
|
||||||
|
)
|
||||||
|
|
||||||
|
// 菜单选项网格
|
||||||
|
LazyVerticalGrid(
|
||||||
|
columns = GridCells.Fixed(4),
|
||||||
|
modifier = Modifier.fillMaxWidth(),
|
||||||
|
contentPadding = PaddingValues(horizontal = 16.dp),
|
||||||
|
horizontalArrangement = Arrangement.spacedBy(8.dp),
|
||||||
|
verticalArrangement = Arrangement.spacedBy(16.dp)
|
||||||
|
) {
|
||||||
|
items(menuItems) { menuItem ->
|
||||||
|
ModuleBottomSheetMenuItemView(
|
||||||
|
menuItem = menuItem
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 排序选项
|
||||||
|
Spacer(modifier = Modifier.height(24.dp))
|
||||||
|
HorizontalDivider(modifier = Modifier.padding(horizontal = 24.dp))
|
||||||
|
|
||||||
|
Text(
|
||||||
|
text = stringResource(R.string.sort_options),
|
||||||
|
style = MaterialTheme.typography.titleMedium,
|
||||||
|
fontWeight = FontWeight.Bold,
|
||||||
|
modifier = Modifier.padding(horizontal = 24.dp, vertical = 16.dp)
|
||||||
|
)
|
||||||
|
|
||||||
|
// 排序选项
|
||||||
|
Column(
|
||||||
|
modifier = Modifier.padding(horizontal = 24.dp),
|
||||||
|
verticalArrangement = Arrangement.spacedBy(8.dp)
|
||||||
|
) {
|
||||||
|
// 优先显示有操作的模块
|
||||||
|
Row(
|
||||||
|
modifier = Modifier.fillMaxWidth(),
|
||||||
|
horizontalArrangement = Arrangement.SpaceBetween,
|
||||||
|
verticalAlignment = Alignment.CenterVertically
|
||||||
|
) {
|
||||||
|
Text(
|
||||||
|
text = stringResource(R.string.module_sort_action_first),
|
||||||
|
style = MaterialTheme.typography.bodyMedium
|
||||||
|
)
|
||||||
|
Switch(
|
||||||
|
checked = viewModel.sortActionFirst,
|
||||||
|
onCheckedChange = { checked ->
|
||||||
|
viewModel.sortActionFirst = checked
|
||||||
|
prefs.edit {
|
||||||
|
putBoolean("module_sort_action_first", checked)
|
||||||
|
}
|
||||||
|
scope.launch {
|
||||||
|
viewModel.fetchModuleList()
|
||||||
|
bottomSheetState.hide()
|
||||||
|
onDismiss()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 优先显示已启用的模块
|
||||||
|
Row(
|
||||||
|
modifier = Modifier.fillMaxWidth(),
|
||||||
|
horizontalArrangement = Arrangement.SpaceBetween,
|
||||||
|
verticalAlignment = Alignment.CenterVertically
|
||||||
|
) {
|
||||||
|
Text(
|
||||||
|
text = stringResource(R.string.module_sort_enabled_first),
|
||||||
|
style = MaterialTheme.typography.bodyMedium
|
||||||
|
)
|
||||||
|
Switch(
|
||||||
|
checked = viewModel.sortEnabledFirst,
|
||||||
|
onCheckedChange = { checked ->
|
||||||
|
viewModel.sortEnabledFirst = checked
|
||||||
|
prefs.edit {
|
||||||
|
putBoolean("module_sort_enabled_first", checked)
|
||||||
|
}
|
||||||
|
scope.launch {
|
||||||
|
viewModel.fetchModuleList()
|
||||||
|
bottomSheetState.hide()
|
||||||
|
onDismiss()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
private fun ModuleBottomSheetMenuItemView(menuItem: ModuleBottomSheetMenuItem) {
|
||||||
|
// 添加交互状态
|
||||||
|
val interactionSource = remember { MutableInteractionSource() }
|
||||||
|
val isPressed by interactionSource.collectIsPressedAsState()
|
||||||
|
|
||||||
|
val scale by animateFloatAsState(
|
||||||
|
targetValue = if (isPressed) 0.95f else 1.0f,
|
||||||
|
animationSpec = spring(
|
||||||
|
dampingRatio = Spring.DampingRatioMediumBouncy,
|
||||||
|
stiffness = Spring.StiffnessHigh
|
||||||
|
),
|
||||||
|
label = "menuItemScale"
|
||||||
|
)
|
||||||
|
|
||||||
|
Column(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.scale(scale)
|
||||||
|
.clickable(
|
||||||
|
interactionSource = interactionSource,
|
||||||
|
indication = null
|
||||||
|
) { menuItem.onClick() }
|
||||||
|
.padding(8.dp),
|
||||||
|
horizontalAlignment = Alignment.CenterHorizontally
|
||||||
|
) {
|
||||||
|
Surface(
|
||||||
|
modifier = Modifier.size(48.dp),
|
||||||
|
shape = CircleShape,
|
||||||
|
color = MaterialTheme.colorScheme.primaryContainer,
|
||||||
|
contentColor = MaterialTheme.colorScheme.onPrimaryContainer
|
||||||
|
) {
|
||||||
|
Box(
|
||||||
|
contentAlignment = Alignment.Center
|
||||||
|
) {
|
||||||
|
Icon(
|
||||||
|
imageVector = menuItem.icon,
|
||||||
|
contentDescription = stringResource(menuItem.titleRes),
|
||||||
|
modifier = Modifier.size(24.dp)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Spacer(modifier = Modifier.height(8.dp))
|
||||||
|
|
||||||
|
Text(
|
||||||
|
text = stringResource(menuItem.titleRes),
|
||||||
|
style = MaterialTheme.typography.labelSmall,
|
||||||
|
textAlign = TextAlign.Center,
|
||||||
|
maxLines = 2
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -433,9 +747,11 @@ fun ModuleScreen(navigator: DestinationsNavigator) {
|
|||||||
private fun ModuleList(
|
private fun ModuleList(
|
||||||
navigator: DestinationsNavigator,
|
navigator: DestinationsNavigator,
|
||||||
viewModel: ModuleViewModel,
|
viewModel: ModuleViewModel,
|
||||||
|
listState: LazyListState,
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
boxModifier: Modifier = Modifier,
|
boxModifier: Modifier = Modifier,
|
||||||
onInstallModule: (Uri) -> Unit,
|
onInstallModule: (Uri) -> Unit,
|
||||||
|
onUpdateModule: (Uri) -> Unit,
|
||||||
onClickModule: (id: String, name: String, hasWebUi: Boolean) -> Unit,
|
onClickModule: (id: String, name: String, hasWebUi: Boolean) -> Unit,
|
||||||
context: Context,
|
context: Context,
|
||||||
snackBarHost: SnackbarHostState
|
snackBarHost: SnackbarHostState
|
||||||
@@ -523,7 +839,12 @@ private fun ModuleList(
|
|||||||
downloadUrl,
|
downloadUrl,
|
||||||
fileName,
|
fileName,
|
||||||
downloading,
|
downloading,
|
||||||
onDownloaded = onInstallModule,
|
onDownloaded = { uri ->
|
||||||
|
// 验证更新模块的签名
|
||||||
|
val isVerified = verifyModuleSignature(context, uri)
|
||||||
|
setModuleVerificationStatus(uri, isVerified)
|
||||||
|
onUpdateModule(uri)
|
||||||
|
},
|
||||||
onDownloading = {
|
onDownloading = {
|
||||||
launch(Dispatchers.Main) {
|
launch(Dispatchers.Main) {
|
||||||
Toast.makeText(context, downloading, Toast.LENGTH_SHORT).show()
|
Toast.makeText(context, downloading, Toast.LENGTH_SHORT).show()
|
||||||
@@ -555,6 +876,8 @@ private fun ModuleList(
|
|||||||
val success = loadingDialog.withLoading {
|
val success = loadingDialog.withLoading {
|
||||||
withContext(Dispatchers.IO) {
|
withContext(Dispatchers.IO) {
|
||||||
if (isUninstall) {
|
if (isUninstall) {
|
||||||
|
// 卸载时移除验证标志
|
||||||
|
ModuleOperationUtils.handleModuleUninstall(module.dirId)
|
||||||
uninstallModule(module.dirId)
|
uninstallModule(module.dirId)
|
||||||
} else {
|
} else {
|
||||||
restoreModule(module.dirId)
|
restoreModule(module.dirId)
|
||||||
@@ -564,6 +887,7 @@ private fun ModuleList(
|
|||||||
|
|
||||||
if (success) {
|
if (success) {
|
||||||
viewModel.fetchModuleList()
|
viewModel.fetchModuleList()
|
||||||
|
viewModel.markNeedRefresh()
|
||||||
}
|
}
|
||||||
if (!isUninstall) return
|
if (!isUninstall) return
|
||||||
val message = if (success) {
|
val message = if (success) {
|
||||||
@@ -593,6 +917,7 @@ private fun ModuleList(
|
|||||||
isRefreshing = viewModel.isRefreshing
|
isRefreshing = viewModel.isRefreshing
|
||||||
) {
|
) {
|
||||||
LazyColumn(
|
LazyColumn(
|
||||||
|
state = listState,
|
||||||
modifier = modifier,
|
modifier = modifier,
|
||||||
verticalArrangement = Arrangement.spacedBy(16.dp),
|
verticalArrangement = Arrangement.spacedBy(16.dp),
|
||||||
contentPadding = remember {
|
contentPadding = remember {
|
||||||
@@ -651,10 +976,8 @@ private fun ModuleList(
|
|||||||
},
|
},
|
||||||
onCheckChanged = {
|
onCheckChanged = {
|
||||||
scope.launch {
|
scope.launch {
|
||||||
val success = loadingDialog.withLoading {
|
val success = withContext(Dispatchers.IO) {
|
||||||
withContext(Dispatchers.IO) {
|
toggleModule(module.dirId, !module.enabled)
|
||||||
toggleModule(module.dirId, !module.enabled)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (success) {
|
if (success) {
|
||||||
viewModel.fetchModuleList()
|
viewModel.fetchModuleList()
|
||||||
@@ -710,6 +1033,16 @@ fun ModuleItem(
|
|||||||
onUpdate: (ModuleViewModel.ModuleInfo) -> Unit,
|
onUpdate: (ModuleViewModel.ModuleInfo) -> Unit,
|
||||||
onClick: (ModuleViewModel.ModuleInfo) -> Unit
|
onClick: (ModuleViewModel.ModuleInfo) -> Unit
|
||||||
) {
|
) {
|
||||||
|
val context = LocalContext.current
|
||||||
|
val prefs = context.getSharedPreferences("settings", MODE_PRIVATE)
|
||||||
|
val isHideTagRow = prefs.getBoolean("is_hide_tag_row", false)
|
||||||
|
// 获取显示更多模块信息的设置
|
||||||
|
val showMoreModuleInfo = prefs.getBoolean("show_more_module_info", false)
|
||||||
|
|
||||||
|
// 剪贴板管理器和触觉反馈
|
||||||
|
val clipboardManager = context.getSystemService(CLIPBOARD_SERVICE) as ClipboardManager
|
||||||
|
val hapticFeedback = LocalHapticFeedback.current
|
||||||
|
|
||||||
ElevatedCard(
|
ElevatedCard(
|
||||||
colors = getCardColors(MaterialTheme.colorScheme.surfaceContainerHigh),
|
colors = getCardColors(MaterialTheme.colorScheme.surfaceContainerHigh),
|
||||||
elevation = getCardElevation(),
|
elevation = getCardElevation(),
|
||||||
@@ -719,6 +1052,11 @@ fun ModuleItem(
|
|||||||
val indication = LocalIndication.current
|
val indication = LocalIndication.current
|
||||||
val viewModel = viewModel<ModuleViewModel>()
|
val viewModel = viewModel<ModuleViewModel>()
|
||||||
|
|
||||||
|
// 使用缓存系统获取模块大小
|
||||||
|
val sizeStr = remember(module.dirId) {
|
||||||
|
viewModel.getModuleSize(module.dirId)
|
||||||
|
}
|
||||||
|
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.run {
|
.run {
|
||||||
@@ -748,14 +1086,48 @@ fun ModuleItem(
|
|||||||
Column(
|
Column(
|
||||||
modifier = Modifier.fillMaxWidth(0.8f)
|
modifier = Modifier.fillMaxWidth(0.8f)
|
||||||
) {
|
) {
|
||||||
Text(
|
Row(
|
||||||
text = module.name,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
fontSize = MaterialTheme.typography.titleMedium.fontSize,
|
horizontalArrangement = Arrangement.spacedBy(8.dp)
|
||||||
fontWeight = FontWeight.SemiBold,
|
) {
|
||||||
lineHeight = MaterialTheme.typography.bodySmall.lineHeight,
|
Text(
|
||||||
fontFamily = MaterialTheme.typography.titleMedium.fontFamily,
|
text = module.name,
|
||||||
textDecoration = textDecoration,
|
fontSize = MaterialTheme.typography.titleMedium.fontSize,
|
||||||
)
|
fontWeight = FontWeight.SemiBold,
|
||||||
|
lineHeight = MaterialTheme.typography.bodySmall.lineHeight,
|
||||||
|
fontFamily = MaterialTheme.typography.titleMedium.fontFamily,
|
||||||
|
textDecoration = textDecoration,
|
||||||
|
modifier = Modifier.weight(1f, false)
|
||||||
|
)
|
||||||
|
|
||||||
|
// 显示验证标签
|
||||||
|
if (module.isVerified) {
|
||||||
|
Surface(
|
||||||
|
shape = RoundedCornerShape(12.dp),
|
||||||
|
color = MaterialTheme.colorScheme.primary,
|
||||||
|
modifier = Modifier
|
||||||
|
) {
|
||||||
|
Row(
|
||||||
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
|
modifier = Modifier.padding(horizontal = 6.dp, vertical = 2.dp)
|
||||||
|
) {
|
||||||
|
Icon(
|
||||||
|
imageVector = Icons.Default.Verified,
|
||||||
|
contentDescription = stringResource(R.string.module_signature_verified),
|
||||||
|
tint = MaterialTheme.colorScheme.onPrimary,
|
||||||
|
modifier = Modifier.size(12.dp)
|
||||||
|
)
|
||||||
|
Spacer(modifier = Modifier.width(2.dp))
|
||||||
|
Text(
|
||||||
|
text = stringResource(R.string.module_verified),
|
||||||
|
style = MaterialTheme.typography.labelSmall,
|
||||||
|
color = MaterialTheme.colorScheme.onPrimary,
|
||||||
|
fontWeight = FontWeight.Medium
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Text(
|
Text(
|
||||||
text = "$moduleVersion: ${module.version}",
|
text = "$moduleVersion: ${module.version}",
|
||||||
@@ -772,6 +1144,43 @@ fun ModuleItem(
|
|||||||
fontFamily = MaterialTheme.typography.bodySmall.fontFamily,
|
fontFamily = MaterialTheme.typography.bodySmall.fontFamily,
|
||||||
textDecoration = textDecoration,
|
textDecoration = textDecoration,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// 显示更多模块信息时添加updateJson
|
||||||
|
if (showMoreModuleInfo && module.updateJson.isNotEmpty()) {
|
||||||
|
val updateJsonLabel = stringResource(R.string.module_update_json)
|
||||||
|
Text(
|
||||||
|
text = "$updateJsonLabel: ${module.updateJson}",
|
||||||
|
fontSize = MaterialTheme.typography.bodySmall.fontSize,
|
||||||
|
lineHeight = MaterialTheme.typography.bodySmall.lineHeight,
|
||||||
|
fontFamily = MaterialTheme.typography.bodySmall.fontFamily,
|
||||||
|
textDecoration = textDecoration,
|
||||||
|
color = MaterialTheme.colorScheme.primary,
|
||||||
|
maxLines = 5,
|
||||||
|
overflow = TextOverflow.Ellipsis,
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.combinedClickable(
|
||||||
|
onClick = {
|
||||||
|
},
|
||||||
|
onLongClick = {
|
||||||
|
// 长按复制updateJson地址
|
||||||
|
val clipData = ClipData.newPlainText(
|
||||||
|
"Update JSON URL",
|
||||||
|
module.updateJson
|
||||||
|
)
|
||||||
|
clipboardManager.setPrimaryClip(clipData)
|
||||||
|
hapticFeedback.performHapticFeedback(HapticFeedbackType.LongPress)
|
||||||
|
|
||||||
|
// 显示复制成功的提示
|
||||||
|
Toast.makeText(
|
||||||
|
context,
|
||||||
|
context.getString(R.string.module_update_json_copied),
|
||||||
|
Toast.LENGTH_SHORT
|
||||||
|
).show()
|
||||||
|
}
|
||||||
|
),
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Spacer(modifier = Modifier.weight(1f))
|
Spacer(modifier = Modifier.weight(1f))
|
||||||
@@ -801,6 +1210,44 @@ fun ModuleItem(
|
|||||||
maxLines = 4,
|
maxLines = 4,
|
||||||
textDecoration = textDecoration,
|
textDecoration = textDecoration,
|
||||||
)
|
)
|
||||||
|
if (!isHideTagRow) {
|
||||||
|
|
||||||
|
Spacer(modifier = Modifier.height(12.dp))
|
||||||
|
// 文件夹名称和大小标签
|
||||||
|
Row(
|
||||||
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
|
horizontalArrangement = Arrangement.spacedBy(8.dp),
|
||||||
|
modifier = Modifier.fillMaxWidth()
|
||||||
|
) {
|
||||||
|
Surface(
|
||||||
|
shape = RoundedCornerShape(4.dp),
|
||||||
|
color = MaterialTheme.colorScheme.primary,
|
||||||
|
modifier = Modifier
|
||||||
|
) {
|
||||||
|
Text(
|
||||||
|
text = module.dirId,
|
||||||
|
style = MaterialTheme.typography.labelSmall,
|
||||||
|
modifier = Modifier.padding(horizontal = 4.dp, vertical = 1.dp),
|
||||||
|
color = MaterialTheme.colorScheme.onPrimary,
|
||||||
|
maxLines = 1,
|
||||||
|
overflow = TextOverflow.Ellipsis
|
||||||
|
)
|
||||||
|
}
|
||||||
|
Surface(
|
||||||
|
shape = RoundedCornerShape(4.dp),
|
||||||
|
color = MaterialTheme.colorScheme.secondaryContainer,
|
||||||
|
modifier = Modifier
|
||||||
|
) {
|
||||||
|
Text(
|
||||||
|
text = sizeStr,
|
||||||
|
style = MaterialTheme.typography.labelSmall,
|
||||||
|
modifier = Modifier.padding(horizontal = 4.dp, vertical = 1.dp),
|
||||||
|
color = MaterialTheme.colorScheme.onSecondaryContainer,
|
||||||
|
maxLines = 1
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Spacer(modifier = Modifier.height(16.dp))
|
Spacer(modifier = Modifier.height(16.dp))
|
||||||
|
|
||||||
@@ -838,7 +1285,7 @@ fun ModuleItem(
|
|||||||
interactionSource = interactionSource,
|
interactionSource = interactionSource,
|
||||||
contentPadding = ButtonDefaults.TextButtonContentPadding,
|
contentPadding = ButtonDefaults.TextButtonContentPadding,
|
||||||
|
|
||||||
) {
|
) {
|
||||||
Icon(
|
Icon(
|
||||||
modifier = Modifier.size(20.dp),
|
modifier = Modifier.size(20.dp),
|
||||||
imageVector = Icons.AutoMirrored.Outlined.Wysiwyg,
|
imageVector = Icons.AutoMirrored.Outlined.Wysiwyg,
|
||||||
@@ -907,6 +1354,8 @@ fun ModuleItemPreview() {
|
|||||||
hasActionScript = false,
|
hasActionScript = false,
|
||||||
dirId = "dirId",
|
dirId = "dirId",
|
||||||
config = ModuleConfig(),
|
config = ModuleConfig(),
|
||||||
|
isVerified = true,
|
||||||
|
verificationTimestamp = System.currentTimeMillis()
|
||||||
)
|
)
|
||||||
ModuleItem(EmptyDestinationsNavigator, module, "", {}, {}, {}, {})
|
ModuleItem(EmptyDestinationsNavigator, module, "", {}, {}, {}, {})
|
||||||
}
|
}
|
||||||
@@ -122,11 +122,11 @@ fun SettingScreen(navigator: DestinationsNavigator) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 配置卡片
|
// 配置卡片
|
||||||
SettingsGroupCard(
|
KsuIsValid {
|
||||||
title = stringResource(R.string.configuration),
|
SettingsGroupCard(
|
||||||
content = {
|
title = stringResource(R.string.configuration),
|
||||||
// 配置文件模板入口
|
content = {
|
||||||
KsuIsValid {
|
// 配置文件模板入口
|
||||||
SettingItem(
|
SettingItem(
|
||||||
icon = Icons.Filled.Fence,
|
icon = Icons.Filled.Fence,
|
||||||
title = stringResource(R.string.settings_profile_template),
|
title = stringResource(R.string.settings_profile_template),
|
||||||
@@ -135,14 +135,12 @@ fun SettingScreen(navigator: DestinationsNavigator) {
|
|||||||
navigator.navigate(AppProfileTemplateScreenDestination)
|
navigator.navigate(AppProfileTemplateScreenDestination)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
|
||||||
|
|
||||||
// 卸载模块开关
|
// 卸载模块开关
|
||||||
var umountChecked by rememberSaveable {
|
var umountChecked by rememberSaveable {
|
||||||
mutableStateOf(Natives.isDefaultUmountModules())
|
mutableStateOf(Natives.isDefaultUmountModules())
|
||||||
}
|
}
|
||||||
|
|
||||||
KsuIsValid {
|
|
||||||
SwitchItem(
|
SwitchItem(
|
||||||
icon = Icons.Filled.FolderDelete,
|
icon = Icons.Filled.FolderDelete,
|
||||||
title = stringResource(R.string.settings_umount_modules_default),
|
title = stringResource(R.string.settings_umount_modules_default),
|
||||||
@@ -154,10 +152,8 @@ fun SettingScreen(navigator: DestinationsNavigator) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
|
||||||
|
|
||||||
// SU 禁用开关
|
// SU 禁用开关
|
||||||
KsuIsValid {
|
|
||||||
if (Natives.version >= Natives.MINIMAL_SUPPORTED_SU_COMPAT) {
|
if (Natives.version >= Natives.MINIMAL_SUPPORTED_SU_COMPAT) {
|
||||||
var isSuDisabled by rememberSaveable {
|
var isSuDisabled by rememberSaveable {
|
||||||
mutableStateOf(!Natives.isSuEnabled())
|
mutableStateOf(!Natives.isSuEnabled())
|
||||||
@@ -175,9 +171,23 @@ fun SettingScreen(navigator: DestinationsNavigator) {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
// 强制签名验证开关
|
||||||
|
var forceSignatureVerification by rememberSaveable {
|
||||||
|
mutableStateOf(prefs.getBoolean("force_signature_verification", false))
|
||||||
|
}
|
||||||
|
SwitchItem(
|
||||||
|
icon = Icons.Filled.Security,
|
||||||
|
title = stringResource(R.string.module_signature_verification),
|
||||||
|
summary = stringResource(R.string.module_signature_verification_summary),
|
||||||
|
checked = forceSignatureVerification,
|
||||||
|
onCheckedChange = { enabled ->
|
||||||
|
prefs.edit { putBoolean("force_signature_verification", enabled) }
|
||||||
|
forceSignatureVerification = enabled
|
||||||
|
}
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
)
|
||||||
)
|
}
|
||||||
|
|
||||||
// 应用设置卡片
|
// 应用设置卡片
|
||||||
SettingsGroupCard(
|
SettingsGroupCard(
|
||||||
@@ -662,115 +672,121 @@ fun rememberUninstallDialog(onSelected: (UninstallType) -> Unit): DialogHandle {
|
|||||||
|
|
||||||
var selectedOption by remember { mutableStateOf<UninstallType?>(null) }
|
var selectedOption by remember { mutableStateOf<UninstallType?>(null) }
|
||||||
|
|
||||||
AlertDialog(
|
MaterialTheme(
|
||||||
onDismissRequest = {
|
colorScheme = MaterialTheme.colorScheme.copy(
|
||||||
dismiss()
|
surface = MaterialTheme.colorScheme.surfaceContainerHigh
|
||||||
},
|
)
|
||||||
title = {
|
) {
|
||||||
Text(
|
AlertDialog(
|
||||||
text = stringResource(R.string.settings_uninstall),
|
onDismissRequest = {
|
||||||
style = MaterialTheme.typography.headlineSmall,
|
dismiss()
|
||||||
)
|
},
|
||||||
},
|
title = {
|
||||||
text = {
|
Text(
|
||||||
Column(
|
text = stringResource(R.string.settings_uninstall),
|
||||||
modifier = Modifier.padding(vertical = 8.dp),
|
style = MaterialTheme.typography.headlineSmall,
|
||||||
verticalArrangement = Arrangement.spacedBy(16.dp)
|
)
|
||||||
) {
|
},
|
||||||
options.forEachIndexed { index, option ->
|
text = {
|
||||||
val isSelected = selectedOption == option
|
Column(
|
||||||
val backgroundColor = if (isSelected)
|
modifier = Modifier.padding(vertical = 8.dp),
|
||||||
MaterialTheme.colorScheme.primaryContainer
|
verticalArrangement = Arrangement.spacedBy(16.dp)
|
||||||
else
|
) {
|
||||||
Color.Transparent
|
options.forEachIndexed { index, option ->
|
||||||
val contentColor = if (isSelected)
|
val isSelected = selectedOption == option
|
||||||
MaterialTheme.colorScheme.onPrimaryContainer
|
val backgroundColor = if (isSelected)
|
||||||
else
|
MaterialTheme.colorScheme.primaryContainer
|
||||||
MaterialTheme.colorScheme.onSurface
|
else
|
||||||
|
Color.Transparent
|
||||||
|
val contentColor = if (isSelected)
|
||||||
|
MaterialTheme.colorScheme.onPrimaryContainer
|
||||||
|
else
|
||||||
|
MaterialTheme.colorScheme.onSurface
|
||||||
|
|
||||||
Row(
|
Row(
|
||||||
modifier = Modifier
|
|
||||||
.fillMaxWidth()
|
|
||||||
.clip(MaterialTheme.shapes.medium)
|
|
||||||
.background(backgroundColor)
|
|
||||||
.clickable {
|
|
||||||
selectedOption = option
|
|
||||||
}
|
|
||||||
.padding(vertical = 12.dp, horizontal = 8.dp),
|
|
||||||
verticalAlignment = Alignment.CenterVertically
|
|
||||||
) {
|
|
||||||
Icon(
|
|
||||||
imageVector = option.icon,
|
|
||||||
contentDescription = null,
|
|
||||||
tint = MaterialTheme.colorScheme.primary,
|
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.padding(end = 16.dp)
|
.fillMaxWidth()
|
||||||
.size(24.dp)
|
.clip(MaterialTheme.shapes.medium)
|
||||||
)
|
.background(backgroundColor)
|
||||||
Column(
|
.clickable {
|
||||||
modifier = Modifier.weight(1f)
|
selectedOption = option
|
||||||
|
}
|
||||||
|
.padding(vertical = 12.dp, horizontal = 8.dp),
|
||||||
|
verticalAlignment = Alignment.CenterVertically
|
||||||
) {
|
) {
|
||||||
Text(
|
Icon(
|
||||||
text = listOptions[index].titleText,
|
imageVector = option.icon,
|
||||||
style = MaterialTheme.typography.titleMedium,
|
contentDescription = null,
|
||||||
|
tint = MaterialTheme.colorScheme.primary,
|
||||||
|
modifier = Modifier
|
||||||
|
.padding(end = 16.dp)
|
||||||
|
.size(24.dp)
|
||||||
)
|
)
|
||||||
listOptions[index].subtitleText?.let {
|
Column(
|
||||||
|
modifier = Modifier.weight(1f)
|
||||||
|
) {
|
||||||
Text(
|
Text(
|
||||||
text = it,
|
text = listOptions[index].titleText,
|
||||||
style = MaterialTheme.typography.bodyMedium,
|
style = MaterialTheme.typography.titleMedium,
|
||||||
color = if (isSelected)
|
)
|
||||||
contentColor.copy(alpha = 0.8f)
|
listOptions[index].subtitleText?.let {
|
||||||
else
|
Text(
|
||||||
MaterialTheme.colorScheme.onSurfaceVariant
|
text = it,
|
||||||
|
style = MaterialTheme.typography.bodyMedium,
|
||||||
|
color = if (isSelected)
|
||||||
|
contentColor.copy(alpha = 0.8f)
|
||||||
|
else
|
||||||
|
MaterialTheme.colorScheme.onSurfaceVariant
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (isSelected) {
|
||||||
|
Icon(
|
||||||
|
imageVector = Icons.Default.RadioButtonChecked,
|
||||||
|
contentDescription = null,
|
||||||
|
tint = MaterialTheme.colorScheme.primary,
|
||||||
|
modifier = Modifier.size(24.dp)
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
Icon(
|
||||||
|
imageVector = Icons.Default.RadioButtonUnchecked,
|
||||||
|
contentDescription = null,
|
||||||
|
tint = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||||
|
modifier = Modifier.size(24.dp)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isSelected) {
|
|
||||||
Icon(
|
|
||||||
imageVector = Icons.Default.RadioButtonChecked,
|
|
||||||
contentDescription = null,
|
|
||||||
tint = MaterialTheme.colorScheme.primary,
|
|
||||||
modifier = Modifier.size(24.dp)
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
Icon(
|
|
||||||
imageVector = Icons.Default.RadioButtonUnchecked,
|
|
||||||
contentDescription = null,
|
|
||||||
tint = MaterialTheme.colorScheme.onSurfaceVariant,
|
|
||||||
modifier = Modifier.size(24.dp)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
},
|
confirmButton = {
|
||||||
confirmButton = {
|
Button(
|
||||||
Button(
|
onClick = {
|
||||||
onClick = {
|
selectedOption?.let { onSelected(it) }
|
||||||
selectedOption?.let { onSelected(it) }
|
dismiss()
|
||||||
dismiss()
|
},
|
||||||
},
|
enabled = selectedOption != null,
|
||||||
enabled = selectedOption != null,
|
) {
|
||||||
) {
|
Text(
|
||||||
Text(
|
text = stringResource(android.R.string.ok)
|
||||||
text = stringResource(android.R.string.ok)
|
)
|
||||||
)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
dismissButton = {
|
|
||||||
TextButton(
|
|
||||||
onClick = {
|
|
||||||
dismiss()
|
|
||||||
}
|
}
|
||||||
) {
|
},
|
||||||
Text(
|
dismissButton = {
|
||||||
text = stringResource(android.R.string.cancel),
|
TextButton(
|
||||||
)
|
onClick = {
|
||||||
}
|
dismiss()
|
||||||
},
|
}
|
||||||
shape = MaterialTheme.shapes.extraLarge,
|
) {
|
||||||
tonalElevation = 4.dp
|
Text(
|
||||||
)
|
text = stringResource(android.R.string.cancel),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
shape = MaterialTheme.shapes.extraLarge,
|
||||||
|
tonalElevation = 4.dp
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
2110
manager/app/src/main/java/com/sukisu/ultra/ui/screen/SuSFSConfig.kt
Normal file
2110
manager/app/src/main/java/com/sukisu/ultra/ui/screen/SuSFSConfig.kt
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -223,7 +223,11 @@ fun restoreBoot(
|
|||||||
onFinish: (Boolean, Int) -> Unit, onStdout: (String) -> Unit, onStderr: (String) -> Unit
|
onFinish: (Boolean, Int) -> Unit, onStdout: (String) -> Unit, onStderr: (String) -> Unit
|
||||||
): Boolean {
|
): Boolean {
|
||||||
val magiskboot = File(ksuApp.applicationInfo.nativeLibraryDir, "libzakoboot.so")
|
val magiskboot = File(ksuApp.applicationInfo.nativeLibraryDir, "libzakoboot.so")
|
||||||
val result = flashWithIO("${getKsuDaemonPath()} boot-restore -f --magiskboot $magiskboot", onStdout, onStderr)
|
val result = flashWithIO(
|
||||||
|
"${getKsuDaemonPath()} boot-restore -f --magiskboot $magiskboot",
|
||||||
|
onStdout,
|
||||||
|
onStderr
|
||||||
|
)
|
||||||
onFinish(result.isSuccess, result.code)
|
onFinish(result.isSuccess, result.code)
|
||||||
return result.isSuccess
|
return result.isSuccess
|
||||||
}
|
}
|
||||||
@@ -232,7 +236,8 @@ fun uninstallPermanently(
|
|||||||
onFinish: (Boolean, Int) -> Unit, onStdout: (String) -> Unit, onStderr: (String) -> Unit
|
onFinish: (Boolean, Int) -> Unit, onStdout: (String) -> Unit, onStderr: (String) -> Unit
|
||||||
): Boolean {
|
): Boolean {
|
||||||
val magiskboot = File(ksuApp.applicationInfo.nativeLibraryDir, "libzakoboot.so")
|
val magiskboot = File(ksuApp.applicationInfo.nativeLibraryDir, "libzakoboot.so")
|
||||||
val result = flashWithIO("${getKsuDaemonPath()} uninstall --magiskboot $magiskboot", onStdout, onStderr)
|
val result =
|
||||||
|
flashWithIO("${getKsuDaemonPath()} uninstall --magiskboot $magiskboot", onStdout, onStderr)
|
||||||
onFinish(result.isSuccess, result.code)
|
onFinish(result.isSuccess, result.code)
|
||||||
return result.isSuccess
|
return result.isSuccess
|
||||||
}
|
}
|
||||||
@@ -457,6 +462,7 @@ fun getSuSFSVariant(): String {
|
|||||||
val result = ShellUtils.fastCmd(shell, "${getSuSFSDaemonPath()} variant")
|
val result = ShellUtils.fastCmd(shell, "${getSuSFSDaemonPath()} variant")
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getSuSFSFeatures(): String {
|
fun getSuSFSFeatures(): String {
|
||||||
val shell = getRootShell()
|
val shell = getRootShell()
|
||||||
val result = ShellUtils.fastCmd(shell, "${getSuSFSDaemonPath()} features")
|
val result = ShellUtils.fastCmd(shell, "${getSuSFSDaemonPath()} features")
|
||||||
@@ -505,7 +511,7 @@ fun getKpmModuleCount(): Int {
|
|||||||
return result.trim().toIntOrNull() ?: 0
|
return result.trim().toIntOrNull() ?: 0
|
||||||
}
|
}
|
||||||
|
|
||||||
fun runCmd(shell : Shell, cmd : String) : String {
|
fun runCmd(shell: Shell, cmd: String): String {
|
||||||
return shell.newJob()
|
return shell.newJob()
|
||||||
.add(cmd)
|
.add(cmd)
|
||||||
.to(mutableListOf<String>(), null)
|
.to(mutableListOf<String>(), null)
|
||||||
@@ -548,3 +554,18 @@ fun getKpmVersion(): String {
|
|||||||
val result = ShellUtils.fastCmd(shell, cmd)
|
val result = ShellUtils.fastCmd(shell, cmd)
|
||||||
return result.trim()
|
return result.trim()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun getZygiskImplement(): String {
|
||||||
|
val shell = getRootShell()
|
||||||
|
val zygiskPath = "/data/adb/modules/zygisksu"
|
||||||
|
val rezygiskPath = "/data/adb/modules/rezygisk"
|
||||||
|
val result = if (ShellUtils.fastCmdResult(shell, "test -f $zygiskPath/module.prop && test ! -f $zygiskPath/disable")) {
|
||||||
|
ShellUtils.fastCmd(shell, "grep '^name=' $zygiskPath/module.prop | cut -d'=' -f2")
|
||||||
|
} else if (ShellUtils.fastCmdResult(shell, "test -f $rezygiskPath/module.prop && test ! -f $rezygiskPath/disable")) {
|
||||||
|
ShellUtils.fastCmd(shell, "grep '^name=' $rezygiskPath/module.prop | cut -d'=' -f2")
|
||||||
|
} else {
|
||||||
|
"None"
|
||||||
|
}
|
||||||
|
Log.i(TAG, "Zygisk implement: $result")
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,17 +1,14 @@
|
|||||||
package com.sukisu.ultra.ui.util
|
package com.sukisu.ultra.ui.util
|
||||||
|
|
||||||
import android.app.AlertDialog
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import androidx.activity.compose.rememberLauncherForActivityResult
|
import androidx.activity.compose.rememberLauncherForActivityResult
|
||||||
import androidx.activity.result.contract.ActivityResultContracts
|
import androidx.activity.result.contract.ActivityResultContracts
|
||||||
import androidx.compose.material3.SnackbarDuration
|
import androidx.compose.material3.*
|
||||||
import androidx.compose.material3.SnackbarHostState
|
import androidx.compose.runtime.*
|
||||||
import androidx.compose.material3.SnackbarResult
|
import androidx.compose.ui.platform.LocalContext
|
||||||
import androidx.compose.runtime.Composable
|
|
||||||
import androidx.compose.runtime.rememberCoroutineScope
|
|
||||||
import kotlinx.coroutines.CompletableDeferred
|
import kotlinx.coroutines.CompletableDeferred
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
@@ -25,18 +22,78 @@ import java.util.Date
|
|||||||
import java.util.Locale
|
import java.util.Locale
|
||||||
|
|
||||||
object ModuleModify {
|
object ModuleModify {
|
||||||
suspend fun showRestoreConfirmation(context: Context): Boolean {
|
@Composable
|
||||||
val result = CompletableDeferred<Boolean>()
|
fun RestoreConfirmationDialog(
|
||||||
withContext(Dispatchers.Main) {
|
showDialog: Boolean,
|
||||||
AlertDialog.Builder(context)
|
onConfirm: () -> Unit,
|
||||||
.setTitle(context.getString(R.string.restore_confirm_title))
|
onDismiss: () -> Unit
|
||||||
.setMessage(context.getString(R.string.restore_confirm_message))
|
) {
|
||||||
.setPositiveButton(context.getString(R.string.confirm)) { _, _ -> result.complete(true) }
|
val context = LocalContext.current
|
||||||
.setNegativeButton(context.getString(R.string.cancel)) { _, _ -> result.complete(false) }
|
|
||||||
.setOnCancelListener { result.complete(false) }
|
if (showDialog) {
|
||||||
.show()
|
AlertDialog(
|
||||||
|
onDismissRequest = onDismiss,
|
||||||
|
title = {
|
||||||
|
Text(
|
||||||
|
text = context.getString(R.string.restore_confirm_title),
|
||||||
|
style = MaterialTheme.typography.headlineSmall
|
||||||
|
)
|
||||||
|
},
|
||||||
|
text = {
|
||||||
|
Text(
|
||||||
|
text = context.getString(R.string.restore_confirm_message),
|
||||||
|
style = MaterialTheme.typography.bodyMedium
|
||||||
|
)
|
||||||
|
},
|
||||||
|
confirmButton = {
|
||||||
|
TextButton(onClick = onConfirm) {
|
||||||
|
Text(context.getString(R.string.confirm))
|
||||||
|
}
|
||||||
|
},
|
||||||
|
dismissButton = {
|
||||||
|
TextButton(onClick = onDismiss) {
|
||||||
|
Text(context.getString(R.string.cancel))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun AllowlistRestoreConfirmationDialog(
|
||||||
|
showDialog: Boolean,
|
||||||
|
onConfirm: () -> Unit,
|
||||||
|
onDismiss: () -> Unit
|
||||||
|
) {
|
||||||
|
val context = LocalContext.current
|
||||||
|
|
||||||
|
if (showDialog) {
|
||||||
|
AlertDialog(
|
||||||
|
onDismissRequest = onDismiss,
|
||||||
|
title = {
|
||||||
|
Text(
|
||||||
|
text = context.getString(R.string.allowlist_restore_confirm_title),
|
||||||
|
style = MaterialTheme.typography.headlineSmall
|
||||||
|
)
|
||||||
|
},
|
||||||
|
text = {
|
||||||
|
Text(
|
||||||
|
text = context.getString(R.string.allowlist_restore_confirm_message),
|
||||||
|
style = MaterialTheme.typography.bodyMedium
|
||||||
|
)
|
||||||
|
},
|
||||||
|
confirmButton = {
|
||||||
|
TextButton(onClick = onConfirm) {
|
||||||
|
Text(context.getString(R.string.confirm))
|
||||||
|
}
|
||||||
|
},
|
||||||
|
dismissButton = {
|
||||||
|
TextButton(onClick = onDismiss) {
|
||||||
|
Text(context.getString(R.string.cancel))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
}
|
}
|
||||||
return result.await()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun backupModules(context: Context, snackBarHost: SnackbarHostState, uri: Uri) {
|
suspend fun backupModules(context: Context, snackBarHost: SnackbarHostState, uri: Uri) {
|
||||||
@@ -82,8 +139,19 @@ object ModuleModify {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun restoreModules(context: Context, snackBarHost: SnackbarHostState, uri: Uri) {
|
suspend fun restoreModules(
|
||||||
val userConfirmed = showRestoreConfirmation(context)
|
context: Context,
|
||||||
|
snackBarHost: SnackbarHostState,
|
||||||
|
uri: Uri,
|
||||||
|
showConfirmDialog: (Boolean) -> Unit,
|
||||||
|
confirmResult: CompletableDeferred<Boolean>
|
||||||
|
) {
|
||||||
|
// 显示确认对话框
|
||||||
|
withContext(Dispatchers.Main) {
|
||||||
|
showConfirmDialog(true)
|
||||||
|
}
|
||||||
|
|
||||||
|
val userConfirmed = confirmResult.await()
|
||||||
if (!userConfirmed) return
|
if (!userConfirmed) return
|
||||||
|
|
||||||
withContext(Dispatchers.IO) {
|
withContext(Dispatchers.IO) {
|
||||||
@@ -132,20 +200,6 @@ object ModuleModify {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun showAllowlistRestoreConfirmation(context: Context): Boolean {
|
|
||||||
val result = CompletableDeferred<Boolean>()
|
|
||||||
withContext(Dispatchers.Main) {
|
|
||||||
AlertDialog.Builder(context)
|
|
||||||
.setTitle(context.getString(R.string.allowlist_restore_confirm_title))
|
|
||||||
.setMessage(context.getString(R.string.allowlist_restore_confirm_message))
|
|
||||||
.setPositiveButton(context.getString(R.string.confirm)) { _, _ -> result.complete(true) }
|
|
||||||
.setNegativeButton(context.getString(R.string.cancel)) { _, _ -> result.complete(false) }
|
|
||||||
.setOnCancelListener { result.complete(false) }
|
|
||||||
.show()
|
|
||||||
}
|
|
||||||
return result.await()
|
|
||||||
}
|
|
||||||
|
|
||||||
suspend fun backupAllowlist(context: Context, snackBarHost: SnackbarHostState, uri: Uri) {
|
suspend fun backupAllowlist(context: Context, snackBarHost: SnackbarHostState, uri: Uri) {
|
||||||
withContext(Dispatchers.IO) {
|
withContext(Dispatchers.IO) {
|
||||||
try {
|
try {
|
||||||
@@ -182,8 +236,19 @@ object ModuleModify {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun restoreAllowlist(context: Context, snackBarHost: SnackbarHostState, uri: Uri) {
|
suspend fun restoreAllowlist(
|
||||||
val userConfirmed = showAllowlistRestoreConfirmation(context)
|
context: Context,
|
||||||
|
snackBarHost: SnackbarHostState,
|
||||||
|
uri: Uri,
|
||||||
|
showConfirmDialog: (Boolean) -> Unit,
|
||||||
|
confirmResult: CompletableDeferred<Boolean>
|
||||||
|
) {
|
||||||
|
// 显示确认对话框
|
||||||
|
withContext(Dispatchers.Main) {
|
||||||
|
showConfirmDialog(true)
|
||||||
|
}
|
||||||
|
|
||||||
|
val userConfirmed = confirmResult.await()
|
||||||
if (!userConfirmed) return
|
if (!userConfirmed) return
|
||||||
|
|
||||||
withContext(Dispatchers.IO) {
|
withContext(Dispatchers.IO) {
|
||||||
@@ -246,13 +311,42 @@ object ModuleModify {
|
|||||||
context: Context,
|
context: Context,
|
||||||
snackBarHost: SnackbarHostState,
|
snackBarHost: SnackbarHostState,
|
||||||
scope: kotlinx.coroutines.CoroutineScope = rememberCoroutineScope()
|
scope: kotlinx.coroutines.CoroutineScope = rememberCoroutineScope()
|
||||||
) = rememberLauncherForActivityResult(
|
): androidx.activity.result.ActivityResultLauncher<Intent> {
|
||||||
contract = ActivityResultContracts.StartActivityForResult()
|
var showRestoreDialog by remember { mutableStateOf(false) }
|
||||||
) { result ->
|
var restoreConfirmResult by remember { mutableStateOf<CompletableDeferred<Boolean>?>(null) }
|
||||||
if (result.resultCode == android.app.Activity.RESULT_OK) {
|
var pendingUri by remember { mutableStateOf<Uri?>(null) }
|
||||||
result.data?.data?.let { uri ->
|
|
||||||
scope.launch {
|
// 显示恢复确认对话框
|
||||||
restoreModules(context, snackBarHost, uri)
|
RestoreConfirmationDialog(
|
||||||
|
showDialog = showRestoreDialog,
|
||||||
|
onConfirm = {
|
||||||
|
showRestoreDialog = false
|
||||||
|
restoreConfirmResult?.complete(true)
|
||||||
|
},
|
||||||
|
onDismiss = {
|
||||||
|
showRestoreDialog = false
|
||||||
|
restoreConfirmResult?.complete(false)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
return rememberLauncherForActivityResult(
|
||||||
|
contract = ActivityResultContracts.StartActivityForResult()
|
||||||
|
) { result ->
|
||||||
|
if (result.resultCode == android.app.Activity.RESULT_OK) {
|
||||||
|
result.data?.data?.let { uri ->
|
||||||
|
pendingUri = uri
|
||||||
|
scope.launch {
|
||||||
|
val confirmResult = CompletableDeferred<Boolean>()
|
||||||
|
restoreConfirmResult = confirmResult
|
||||||
|
|
||||||
|
restoreModules(
|
||||||
|
context = context,
|
||||||
|
snackBarHost = snackBarHost,
|
||||||
|
uri = uri,
|
||||||
|
showConfirmDialog = { show -> showRestoreDialog = show },
|
||||||
|
confirmResult = confirmResult
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -280,13 +374,42 @@ object ModuleModify {
|
|||||||
context: Context,
|
context: Context,
|
||||||
snackBarHost: SnackbarHostState,
|
snackBarHost: SnackbarHostState,
|
||||||
scope: kotlinx.coroutines.CoroutineScope = rememberCoroutineScope()
|
scope: kotlinx.coroutines.CoroutineScope = rememberCoroutineScope()
|
||||||
) = rememberLauncherForActivityResult(
|
): androidx.activity.result.ActivityResultLauncher<Intent> {
|
||||||
contract = ActivityResultContracts.StartActivityForResult()
|
var showAllowlistRestoreDialog by remember { mutableStateOf(false) }
|
||||||
) { result ->
|
var allowlistRestoreConfirmResult by remember { mutableStateOf<CompletableDeferred<Boolean>?>(null) }
|
||||||
if (result.resultCode == android.app.Activity.RESULT_OK) {
|
var pendingUri by remember { mutableStateOf<Uri?>(null) }
|
||||||
result.data?.data?.let { uri ->
|
|
||||||
scope.launch {
|
// 显示允许列表恢复确认对话框
|
||||||
restoreAllowlist(context, snackBarHost, uri)
|
AllowlistRestoreConfirmationDialog(
|
||||||
|
showDialog = showAllowlistRestoreDialog,
|
||||||
|
onConfirm = {
|
||||||
|
showAllowlistRestoreDialog = false
|
||||||
|
allowlistRestoreConfirmResult?.complete(true)
|
||||||
|
},
|
||||||
|
onDismiss = {
|
||||||
|
showAllowlistRestoreDialog = false
|
||||||
|
allowlistRestoreConfirmResult?.complete(false)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
return rememberLauncherForActivityResult(
|
||||||
|
contract = ActivityResultContracts.StartActivityForResult()
|
||||||
|
) { result ->
|
||||||
|
if (result.resultCode == android.app.Activity.RESULT_OK) {
|
||||||
|
result.data?.data?.let { uri ->
|
||||||
|
pendingUri = uri
|
||||||
|
scope.launch {
|
||||||
|
val confirmResult = CompletableDeferred<Boolean>()
|
||||||
|
allowlistRestoreConfirmResult = confirmResult
|
||||||
|
|
||||||
|
restoreAllowlist(
|
||||||
|
context = context,
|
||||||
|
snackBarHost = snackBarHost,
|
||||||
|
uri = uri,
|
||||||
|
showConfirmDialog = { show -> showAllowlistRestoreDialog = show },
|
||||||
|
confirmResult = confirmResult
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ object ModuleUtils {
|
|||||||
}
|
}
|
||||||
}?.removeSuffix(".zip") ?: context.getString(R.string.unknown_module)
|
}?.removeSuffix(".zip") ?: context.getString(R.string.unknown_module)
|
||||||
|
|
||||||
var formattedFileName = fileName.replace(Regex("[^a-zA-Z0-9\\s\\-_.@()\\u4e00-\\u9fa5]"), "").trim()
|
val formattedFileName = fileName.replace(Regex("[^a-zA-Z0-9\\s\\-_.@()\\u4e00-\\u9fa5]"), "").trim()
|
||||||
var moduleName = formattedFileName
|
var moduleName = formattedFileName
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -52,12 +52,10 @@ object ModuleUtils {
|
|||||||
if (entry.name == "module.prop") {
|
if (entry.name == "module.prop") {
|
||||||
val reader = BufferedReader(InputStreamReader(zipInputStream, StandardCharsets.UTF_8))
|
val reader = BufferedReader(InputStreamReader(zipInputStream, StandardCharsets.UTF_8))
|
||||||
var line: String?
|
var line: String?
|
||||||
var nameFound = false
|
|
||||||
while (reader.readLine().also { line = it } != null) {
|
while (reader.readLine().also { line = it } != null) {
|
||||||
if (line?.startsWith("name=") == true) {
|
if (line?.startsWith("name=") == true) {
|
||||||
moduleName = line.substringAfter("=")
|
moduleName = line.substringAfter("=")
|
||||||
moduleName = moduleName.replace(Regex("[^a-zA-Z0-9\\s\\-_.@()\\u4e00-\\u9fa5]"), "").trim()
|
moduleName = moduleName.replace(Regex("[^a-zA-Z0-9\\s\\-_.@()\\u4e00-\\u9fa5]"), "").trim()
|
||||||
nameFound = true
|
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -102,4 +100,43 @@ object ModuleUtils {
|
|||||||
Log.e(TAG, "Unable to get persistent permissions on URIs: $uri, Error: ${e.message}")
|
Log.e(TAG, "Unable to get persistent permissions on URIs: $uri, Error: ${e.message}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun extractModuleId(context: Context, uri: Uri): String? {
|
||||||
|
if (uri == Uri.EMPTY) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
return try {
|
||||||
|
|
||||||
|
val inputStream = context.contentResolver.openInputStream(uri)
|
||||||
|
if (inputStream == null) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
val zipInputStream = ZipInputStream(inputStream)
|
||||||
|
var entry = zipInputStream.nextEntry
|
||||||
|
var moduleId: String? = null
|
||||||
|
|
||||||
|
// 遍历ZIP文件中的条目,查找module.prop文件
|
||||||
|
while (entry != null) {
|
||||||
|
if (entry.name == "module.prop") {
|
||||||
|
val reader = BufferedReader(InputStreamReader(zipInputStream, StandardCharsets.UTF_8))
|
||||||
|
var line: String?
|
||||||
|
while (reader.readLine().also { line = it } != null) {
|
||||||
|
if (line?.startsWith("id=") == true) {
|
||||||
|
moduleId = line.substringAfter("=").trim()
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break
|
||||||
|
}
|
||||||
|
entry = zipInputStream.nextEntry
|
||||||
|
}
|
||||||
|
zipInputStream.close()
|
||||||
|
moduleId
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.e(TAG, "提取模块ID时发生异常: ${e.message}", e)
|
||||||
|
null
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,232 @@
|
|||||||
|
package com.sukisu.ultra.ui.util
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.net.Uri
|
||||||
|
import android.util.Log
|
||||||
|
import com.sukisu.ultra.Natives
|
||||||
|
import java.io.File
|
||||||
|
import java.io.FileOutputStream
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author ShirkNeko
|
||||||
|
* @date 2025/8/3
|
||||||
|
*/
|
||||||
|
|
||||||
|
// 模块签名验证工具类
|
||||||
|
object ModuleSignatureUtils {
|
||||||
|
private const val TAG = "ModuleSignatureUtils"
|
||||||
|
|
||||||
|
fun verifyModuleSignature(context: Context, moduleUri: Uri): Boolean {
|
||||||
|
return try {
|
||||||
|
// 创建临时文件
|
||||||
|
val tempFile = File(context.cacheDir, "temp_module_${System.currentTimeMillis()}.zip")
|
||||||
|
|
||||||
|
// 复制URI内容到临时文件
|
||||||
|
context.contentResolver.openInputStream(moduleUri)?.use { inputStream ->
|
||||||
|
FileOutputStream(tempFile).use { outputStream ->
|
||||||
|
inputStream.copyTo(outputStream)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 调用native方法验证签名
|
||||||
|
val isVerified = Natives.verifyModuleSignature(tempFile.absolutePath)
|
||||||
|
|
||||||
|
// 清理临时文件
|
||||||
|
tempFile.delete()
|
||||||
|
|
||||||
|
Log.d(TAG, "Module signature verification result: $isVerified")
|
||||||
|
isVerified
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.e(TAG, "Error verifying module signature", e)
|
||||||
|
false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 验证模块签名
|
||||||
|
fun verifyModuleSignature(context: Context, moduleUri: Uri): Boolean {
|
||||||
|
return ModuleSignatureUtils.verifyModuleSignature(context, moduleUri)
|
||||||
|
}
|
||||||
|
|
||||||
|
object ModuleOperationUtils {
|
||||||
|
private const val TAG = "ModuleOperationUtils"
|
||||||
|
|
||||||
|
fun handleModuleInstallSuccess(context: Context, moduleUri: Uri, isSignatureVerified: Boolean) {
|
||||||
|
if (!isSignatureVerified) {
|
||||||
|
Log.d(TAG, "模块签名未验证,跳过创建验证标志")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
// 从ZIP文件提取模块ID
|
||||||
|
val moduleId = ModuleUtils.extractModuleId(context, moduleUri)
|
||||||
|
if (moduleId == null) {
|
||||||
|
Log.e(TAG, "无法提取模块ID,无法创建验证标志")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 创建验证标志文件
|
||||||
|
val success = ModuleVerificationManager.createVerificationFlag(moduleId)
|
||||||
|
if (success) {
|
||||||
|
Log.d(TAG, "模块 $moduleId 验证标志创建成功")
|
||||||
|
} else {
|
||||||
|
Log.e(TAG, "模块 $moduleId 验证标志创建失败")
|
||||||
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.e(TAG, "处理模块安装成功时发生异常", e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun handleModuleUninstall(moduleId: String) {
|
||||||
|
try {
|
||||||
|
val success = ModuleVerificationManager.removeVerificationFlag(moduleId)
|
||||||
|
if (success) {
|
||||||
|
Log.d(TAG, "模块 $moduleId 验证标志移除成功")
|
||||||
|
} else {
|
||||||
|
Log.d(TAG, "模块 $moduleId 验证标志移除失败或不存在")
|
||||||
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.e(TAG, "处理模块卸载时发生异常: $moduleId", e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fun handleModuleUpdate(context: Context, moduleUri: Uri, isSignatureVerified: Boolean) {
|
||||||
|
try {
|
||||||
|
val moduleId = ModuleUtils.extractModuleId(context, moduleUri)
|
||||||
|
if (moduleId == null) {
|
||||||
|
Log.e(TAG, "无法提取模块ID,无法处理验证标志")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isSignatureVerified) {
|
||||||
|
// 签名验证通过,创建或更新验证标志
|
||||||
|
val success = ModuleVerificationManager.createVerificationFlag(moduleId)
|
||||||
|
if (success) {
|
||||||
|
Log.d(TAG, "模块 $moduleId 更新后验证标志已更新")
|
||||||
|
} else {
|
||||||
|
Log.e(TAG, "模块 $moduleId 更新后验证标志更新失败")
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 签名验证失败,移除验证标志
|
||||||
|
ModuleVerificationManager.removeVerificationFlag(moduleId)
|
||||||
|
Log.d(TAG, "模块 $moduleId 更新后签名未验证,验证标志已移除")
|
||||||
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.e(TAG, "处理模块更新时发生异常", e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
object ModuleVerificationManager {
|
||||||
|
private const val TAG = "ModuleVerificationManager"
|
||||||
|
private const val VERIFICATION_FLAGS_DIR = "/data/adb/ksu/verified_modules"
|
||||||
|
|
||||||
|
// 为指定模块创建验证标志文件
|
||||||
|
fun createVerificationFlag(moduleId: String): Boolean {
|
||||||
|
return try {
|
||||||
|
val shell = getRootShell()
|
||||||
|
val flagFilePath = "$VERIFICATION_FLAGS_DIR/$moduleId"
|
||||||
|
|
||||||
|
// 确保目录存在
|
||||||
|
val createDirCommand = "mkdir -p '$VERIFICATION_FLAGS_DIR'"
|
||||||
|
shell.newJob().add(createDirCommand).exec()
|
||||||
|
|
||||||
|
// 创建验证标志文件,写入验证时间戳
|
||||||
|
val timestamp = System.currentTimeMillis()
|
||||||
|
val command = "echo '$timestamp' > '$flagFilePath'"
|
||||||
|
|
||||||
|
val result = shell.newJob().add(command).exec()
|
||||||
|
|
||||||
|
if (result.isSuccess) {
|
||||||
|
Log.d(TAG, "验证标志文件创建成功: $flagFilePath")
|
||||||
|
true
|
||||||
|
} else {
|
||||||
|
Log.e(TAG, "验证标志文件创建失败: $moduleId")
|
||||||
|
false
|
||||||
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.e(TAG, "创建验证标志文件时发生异常: $moduleId", e)
|
||||||
|
false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun removeVerificationFlag(moduleId: String): Boolean {
|
||||||
|
return try {
|
||||||
|
val shell = getRootShell()
|
||||||
|
val flagFilePath = "$VERIFICATION_FLAGS_DIR/$moduleId"
|
||||||
|
|
||||||
|
val command = "rm -f '$flagFilePath'"
|
||||||
|
val result = shell.newJob().add(command).exec()
|
||||||
|
|
||||||
|
if (result.isSuccess) {
|
||||||
|
Log.d(TAG, "验证标志文件移除成功: $flagFilePath")
|
||||||
|
true
|
||||||
|
} else {
|
||||||
|
Log.e(TAG, "验证标志文件移除失败: $moduleId")
|
||||||
|
false
|
||||||
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.e(TAG, "移除验证标志文件时发生异常: $moduleId", e)
|
||||||
|
false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getVerificationTimestamp(moduleId: String): Long {
|
||||||
|
return try {
|
||||||
|
val shell = getRootShell()
|
||||||
|
val flagFilePath = "$VERIFICATION_FLAGS_DIR/$moduleId"
|
||||||
|
|
||||||
|
val command = "cat '$flagFilePath' 2>/dev/null || echo '0'"
|
||||||
|
val result = shell.newJob().add(command).to(ArrayList(), null).exec()
|
||||||
|
|
||||||
|
if (result.isSuccess && result.out.isNotEmpty()) {
|
||||||
|
val timestampStr = result.out.firstOrNull()?.trim() ?: "0"
|
||||||
|
timestampStr.toLongOrNull() ?: 0L
|
||||||
|
} else {
|
||||||
|
0L
|
||||||
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.e(TAG, "获取验证时间戳时发生异常: $moduleId", e)
|
||||||
|
0L
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun batchCheckVerificationStatus(moduleIds: List<String>): Map<String, Boolean> {
|
||||||
|
if (moduleIds.isEmpty()) return emptyMap()
|
||||||
|
|
||||||
|
return try {
|
||||||
|
val shell = getRootShell()
|
||||||
|
val result = mutableMapOf<String, Boolean>()
|
||||||
|
|
||||||
|
// 确保目录存在
|
||||||
|
val createDirCommand = "mkdir -p '$VERIFICATION_FLAGS_DIR'"
|
||||||
|
shell.newJob().add(createDirCommand).exec()
|
||||||
|
|
||||||
|
// 批量检查所有模块的验证标志文件
|
||||||
|
val commands = moduleIds.map { moduleId ->
|
||||||
|
"test -f '$VERIFICATION_FLAGS_DIR/$moduleId' && echo '$moduleId:true' || echo '$moduleId:false'"
|
||||||
|
}
|
||||||
|
|
||||||
|
val command = commands.joinToString(" && ")
|
||||||
|
val shellResult = shell.newJob().add(command).to(ArrayList(), null).exec()
|
||||||
|
|
||||||
|
if (shellResult.isSuccess) {
|
||||||
|
shellResult.out.forEach { line ->
|
||||||
|
val parts = line.split(":")
|
||||||
|
if (parts.size == 2) {
|
||||||
|
val moduleId = parts[0]
|
||||||
|
val isVerified = parts[1] == "true"
|
||||||
|
result[moduleId] = isVerified
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Log.d(TAG, "批量验证检查完成,共检查 ${moduleIds.size} 个模块")
|
||||||
|
result
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.e(TAG, "批量检查验证状态时发生异常", e)
|
||||||
|
// 返回默认值,所有模块都标记为未验证
|
||||||
|
moduleIds.associateWith { false }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
1447
manager/app/src/main/java/com/sukisu/ultra/ui/util/SuSFSManager.kt
Normal file
1447
manager/app/src/main/java/com/sukisu/ultra/ui/util/SuSFSManager.kt
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,540 @@
|
|||||||
|
package com.sukisu.ultra.ui.util
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Magisk模块脚本生成器
|
||||||
|
* 用于生成各种启动脚本的内容
|
||||||
|
*/
|
||||||
|
object ScriptGenerator {
|
||||||
|
|
||||||
|
// 常量定义
|
||||||
|
private const val DEFAULT_UNAME = "default"
|
||||||
|
private const val DEFAULT_BUILD_TIME = "default"
|
||||||
|
private const val LOG_DIR = "/data/adb/ksu/log"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成所有脚本文件
|
||||||
|
*/
|
||||||
|
fun generateAllScripts(config: SuSFSManager.ModuleConfig): Map<String, String> {
|
||||||
|
return mapOf(
|
||||||
|
"service.sh" to generateServiceScript(config),
|
||||||
|
"post-fs-data.sh" to generatePostFsDataScript(config),
|
||||||
|
"post-mount.sh" to generatePostMountScript(config),
|
||||||
|
"boot-completed.sh" to generateBootCompletedScript(config)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 日志相关的通用脚本片段
|
||||||
|
private fun generateLogSetup(logFileName: String): String = """
|
||||||
|
# 日志目录
|
||||||
|
LOG_DIR="$LOG_DIR"
|
||||||
|
LOG_FILE="${'$'}LOG_DIR/$logFileName"
|
||||||
|
|
||||||
|
# 创建日志目录
|
||||||
|
mkdir -p "${'$'}LOG_DIR"
|
||||||
|
|
||||||
|
# 获取当前时间
|
||||||
|
get_current_time() {
|
||||||
|
date '+%Y-%m-%d %H:%M:%S'
|
||||||
|
}
|
||||||
|
""".trimIndent()
|
||||||
|
|
||||||
|
// 二进制文件检查的通用脚本片段
|
||||||
|
private fun generateBinaryCheck(targetPath: String): String = """
|
||||||
|
# 检查SuSFS二进制文件
|
||||||
|
SUSFS_BIN="$targetPath"
|
||||||
|
if [ ! -f "${'$'}SUSFS_BIN" ]; then
|
||||||
|
echo "$(get_current_time): SuSFS二进制文件未找到: ${'$'}SUSFS_BIN" >> "${'$'}LOG_FILE"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
""".trimIndent()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成service.sh脚本内容
|
||||||
|
*/
|
||||||
|
@SuppressLint("SdCardPath")
|
||||||
|
private fun generateServiceScript(config: SuSFSManager.ModuleConfig): String {
|
||||||
|
return buildString {
|
||||||
|
appendLine("#!/system/bin/sh")
|
||||||
|
appendLine("# SuSFS Service Script")
|
||||||
|
appendLine("# 在系统服务启动后执行")
|
||||||
|
appendLine()
|
||||||
|
appendLine(generateLogSetup("susfs_service.log"))
|
||||||
|
appendLine()
|
||||||
|
appendLine(generateBinaryCheck(config.targetPath))
|
||||||
|
appendLine()
|
||||||
|
|
||||||
|
if (shouldConfigureInService(config)) {
|
||||||
|
// 添加SUS路径 (仅在不支持隐藏挂载时)
|
||||||
|
if (!config.support158 && config.susPaths.isNotEmpty()) {
|
||||||
|
appendLine()
|
||||||
|
appendLine("until [ -d \"/sdcard/Android\" ]; do sleep 1; done")
|
||||||
|
appendLine("sleep 45")
|
||||||
|
generateSusPathsSection(config.susPaths)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 设置uname和构建时间
|
||||||
|
generateUnameSection(config)
|
||||||
|
|
||||||
|
// 添加Kstat配置
|
||||||
|
generateKstatSection(config.kstatConfigs, config.addKstatPaths)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加日志设置
|
||||||
|
generateLogSettingSection(config.enableLog)
|
||||||
|
|
||||||
|
// 隐藏BL相关配置
|
||||||
|
if (config.enableHideBl) {
|
||||||
|
generateHideBlSection()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 清理工具残留
|
||||||
|
if (config.enableCleanupResidue) {
|
||||||
|
generateCleanupResidueSection()
|
||||||
|
}
|
||||||
|
|
||||||
|
appendLine("echo \"$(get_current_time): Service脚本执行完成\" >> \"${'$'}LOG_FILE\"")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断是否需要在service中配置
|
||||||
|
*/
|
||||||
|
private fun shouldConfigureInService(config: SuSFSManager.ModuleConfig): Boolean {
|
||||||
|
return config.susPaths.isNotEmpty() ||
|
||||||
|
config.susLoopPaths.isNotEmpty() ||
|
||||||
|
config.kstatConfigs.isNotEmpty() ||
|
||||||
|
config.addKstatPaths.isNotEmpty() ||
|
||||||
|
(!config.executeInPostFsData && (config.unameValue != DEFAULT_UNAME || config.buildTimeValue != DEFAULT_BUILD_TIME))
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun StringBuilder.generateLogSettingSection(enableLog: Boolean) {
|
||||||
|
appendLine("# 设置日志启用状态")
|
||||||
|
val logValue = if (enableLog) 1 else 0
|
||||||
|
appendLine("\"${'$'}SUSFS_BIN\" enable_log $logValue")
|
||||||
|
appendLine("echo \"$(get_current_time): 日志功能设置为: ${if (enableLog) "启用" else "禁用"}\" >> \"${'$'}LOG_FILE\"")
|
||||||
|
appendLine()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun StringBuilder.generateAvcLogSpoofingSection(enableAvcLogSpoofing: Boolean) {
|
||||||
|
appendLine("# 设置AVC日志欺骗状态")
|
||||||
|
val avcLogValue = if (enableAvcLogSpoofing) 1 else 0
|
||||||
|
appendLine("\"${'$'}SUSFS_BIN\" enable_avc_log_spoofing $avcLogValue")
|
||||||
|
appendLine("echo \"$(get_current_time): AVC日志欺骗功能设置为: ${if (enableAvcLogSpoofing) "启用" else "禁用"}\" >> \"${'$'}LOG_FILE\"")
|
||||||
|
appendLine()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun StringBuilder.generateSusPathsSection(susPaths: Set<String>) {
|
||||||
|
if (susPaths.isNotEmpty()) {
|
||||||
|
appendLine("# 添加SUS路径")
|
||||||
|
susPaths.forEach { path ->
|
||||||
|
appendLine("\"${'$'}SUSFS_BIN\" add_sus_path '$path'")
|
||||||
|
appendLine("echo \"$(get_current_time): 添加SUS路径: $path\" >> \"${'$'}LOG_FILE\"")
|
||||||
|
}
|
||||||
|
appendLine()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun StringBuilder.generateSusLoopPathsSection(susLoopPaths: Set<String>) {
|
||||||
|
if (susLoopPaths.isNotEmpty()) {
|
||||||
|
appendLine("# 添加SUS循环路径")
|
||||||
|
susLoopPaths.forEach { path ->
|
||||||
|
appendLine("\"${'$'}SUSFS_BIN\" add_sus_path_loop '$path'")
|
||||||
|
appendLine("echo \"$(get_current_time): 添加SUS循环路径: $path\" >> \"${'$'}LOG_FILE\"")
|
||||||
|
}
|
||||||
|
appendLine()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("SdCardPath")
|
||||||
|
private fun StringBuilder.generateKstatSection(
|
||||||
|
kstatConfigs: Set<String>,
|
||||||
|
addKstatPaths: Set<String>
|
||||||
|
) {
|
||||||
|
// 添加Kstat路径
|
||||||
|
if (addKstatPaths.isNotEmpty()) {
|
||||||
|
appendLine("# 添加Kstat路径")
|
||||||
|
addKstatPaths.forEach { path ->
|
||||||
|
appendLine("\"${'$'}SUSFS_BIN\" add_sus_kstat '$path'")
|
||||||
|
appendLine("echo \"$(get_current_time): 添加Kstat路径: $path\" >> \"${'$'}LOG_FILE\"")
|
||||||
|
}
|
||||||
|
appendLine()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加Kstat静态配置
|
||||||
|
if (kstatConfigs.isNotEmpty()) {
|
||||||
|
appendLine("# 添加Kstat静态配置")
|
||||||
|
kstatConfigs.forEach { config ->
|
||||||
|
val parts = config.split("|")
|
||||||
|
if (parts.size >= 13) {
|
||||||
|
val path = parts[0]
|
||||||
|
val params = parts.drop(1).joinToString("' '", "'", "'")
|
||||||
|
appendLine()
|
||||||
|
appendLine("\"${'$'}SUSFS_BIN\" add_sus_kstat_statically '$path' $params")
|
||||||
|
appendLine("echo \"$(get_current_time): 添加Kstat静态配置: $path\" >> \"${'$'}LOG_FILE\"")
|
||||||
|
appendLine()
|
||||||
|
appendLine("\"${'$'}SUSFS_BIN\" update_sus_kstat '$path'")
|
||||||
|
appendLine("echo \"$(get_current_time): 更新Kstat配置: $path\" >> \"${'$'}LOG_FILE\"")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
appendLine()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun StringBuilder.generateUnameSection(config: SuSFSManager.ModuleConfig) {
|
||||||
|
if (!config.executeInPostFsData && (config.unameValue != DEFAULT_UNAME || config.buildTimeValue != DEFAULT_BUILD_TIME)) {
|
||||||
|
appendLine("# 设置uname和构建时间")
|
||||||
|
appendLine("\"${'$'}SUSFS_BIN\" set_uname '${config.unameValue}' '${config.buildTimeValue}'")
|
||||||
|
appendLine("echo \"$(get_current_time): 设置uname为: ${config.unameValue}, 构建时间为: ${config.buildTimeValue}\" >> \"${'$'}LOG_FILE\"")
|
||||||
|
appendLine()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun StringBuilder.generateHideBlSection() {
|
||||||
|
appendLine("# 隐藏BL 来自 Shamiko 脚本")
|
||||||
|
appendLine(
|
||||||
|
"""
|
||||||
|
RESETPROP_BIN="/data/adb/ksu/bin/resetprop"
|
||||||
|
|
||||||
|
check_reset_prop() {
|
||||||
|
local NAME=$1
|
||||||
|
local EXPECTED=$2
|
||||||
|
local VALUE=$("${'$'}RESETPROP_BIN" ${'$'}NAME)
|
||||||
|
[ -z ${'$'}VALUE ] || [ ${'$'}VALUE = ${'$'}EXPECTED ] || "${'$'}RESETPROP_BIN" ${'$'}NAME ${'$'}EXPECTED
|
||||||
|
}
|
||||||
|
|
||||||
|
check_missing_prop() {
|
||||||
|
local NAME=$1
|
||||||
|
local EXPECTED=$2
|
||||||
|
local VALUE=$("${'$'}RESETPROP_BIN" ${'$'}NAME)
|
||||||
|
[ -z ${'$'}VALUE ] && "${'$'}RESETPROP_BIN" ${'$'}NAME ${'$'}EXPECTED
|
||||||
|
}
|
||||||
|
|
||||||
|
check_missing_match_prop() {
|
||||||
|
local NAME=$1
|
||||||
|
local EXPECTED=$2
|
||||||
|
local VALUE=$("${'$'}RESETPROP_BIN" ${'$'}NAME)
|
||||||
|
[ -z ${'$'}VALUE ] || [ ${'$'}VALUE = ${'$'}EXPECTED ] || "${'$'}RESETPROP_BIN" ${'$'}NAME ${'$'}EXPECTED
|
||||||
|
[ -z ${'$'}VALUE ] && "${'$'}RESETPROP_BIN" ${'$'}NAME ${'$'}EXPECTED
|
||||||
|
}
|
||||||
|
|
||||||
|
contains_reset_prop() {
|
||||||
|
local NAME=$1
|
||||||
|
local CONTAINS=$2
|
||||||
|
local NEWVAL=$3
|
||||||
|
case "$("${'$'}RESETPROP_BIN" ${'$'}NAME)" in
|
||||||
|
*"${'$'}CONTAINS"*) "${'$'}RESETPROP_BIN" ${'$'}NAME ${'$'}NEWVAL ;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
""".trimIndent())
|
||||||
|
appendLine()
|
||||||
|
appendLine("sleep 30")
|
||||||
|
appendLine()
|
||||||
|
appendLine("\"${'$'}RESETPROP_BIN\" -w sys.boot_completed 0")
|
||||||
|
|
||||||
|
// 添加所有系统属性重置
|
||||||
|
val systemProps = listOf(
|
||||||
|
"ro.boot.vbmeta.invalidate_on_error" to "yes",
|
||||||
|
"ro.boot.vbmeta.avb_version" to "1.2",
|
||||||
|
"ro.boot.vbmeta.hash_alg" to "sha256",
|
||||||
|
"ro.boot.vbmeta.size" to "19968",
|
||||||
|
"ro.boot.vbmeta.device_state" to "locked",
|
||||||
|
"ro.boot.verifiedbootstate" to "green",
|
||||||
|
"ro.boot.flash.locked" to "1",
|
||||||
|
"ro.boot.veritymode" to "enforcing",
|
||||||
|
"ro.boot.warranty_bit" to "0",
|
||||||
|
"ro.warranty_bit" to "0",
|
||||||
|
"ro.debuggable" to "0",
|
||||||
|
"ro.force.debuggable" to "0",
|
||||||
|
"ro.secure" to "1",
|
||||||
|
"ro.adb.secure" to "1",
|
||||||
|
"ro.build.type" to "user",
|
||||||
|
"ro.build.tags" to "release-keys",
|
||||||
|
"ro.vendor.boot.warranty_bit" to "0",
|
||||||
|
"ro.vendor.warranty_bit" to "0",
|
||||||
|
"vendor.boot.vbmeta.device_state" to "locked",
|
||||||
|
"vendor.boot.verifiedbootstate" to "green",
|
||||||
|
"sys.oem_unlock_allowed" to "0",
|
||||||
|
"ro.secureboot.lockstate" to "locked",
|
||||||
|
"ro.boot.realmebootstate" to "green",
|
||||||
|
"ro.boot.realme.lockstate" to "1",
|
||||||
|
"ro.crypto.state" to "encrypted"
|
||||||
|
)
|
||||||
|
|
||||||
|
systemProps.forEach { (prop, value) ->
|
||||||
|
when {
|
||||||
|
prop.startsWith("ro.boot.vbmeta") && prop.endsWith("_on_error") ->
|
||||||
|
appendLine("check_missing_prop \"$prop\" \"$value\"")
|
||||||
|
prop.contains("device_state") || prop.contains("verifiedbootstate") ->
|
||||||
|
appendLine("check_missing_match_prop \"$prop\" \"$value\"")
|
||||||
|
else ->
|
||||||
|
appendLine("check_reset_prop \"$prop\" \"$value\"")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
appendLine()
|
||||||
|
appendLine("# Hide adb debugging traces")
|
||||||
|
appendLine("resetprop \"sys.usb.adb.disabled\" \" \"")
|
||||||
|
appendLine()
|
||||||
|
|
||||||
|
appendLine("# Hide recovery boot mode")
|
||||||
|
appendLine("contains_reset_prop \"ro.bootmode\" \"recovery\" \"unknown\"")
|
||||||
|
appendLine("contains_reset_prop \"ro.boot.bootmode\" \"recovery\" \"unknown\"")
|
||||||
|
appendLine("contains_reset_prop \"vendor.boot.bootmode\" \"recovery\" \"unknown\"")
|
||||||
|
appendLine()
|
||||||
|
|
||||||
|
appendLine("# Hide cloudphone detection")
|
||||||
|
appendLine("[ -n \"$(resetprop ro.kernel.qemu)\" ] && resetprop ro.kernel.qemu \"\"")
|
||||||
|
appendLine()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 清理残留脚本生成
|
||||||
|
private fun StringBuilder.generateCleanupResidueSection() {
|
||||||
|
appendLine("# 清理工具残留文件")
|
||||||
|
appendLine("echo \"$(get_current_time): 开始清理工具残留\" >> \"${'$'}LOG_FILE\"")
|
||||||
|
appendLine()
|
||||||
|
|
||||||
|
// 定义清理函数
|
||||||
|
appendLine("""
|
||||||
|
cleanup_path() {
|
||||||
|
local path="$1"
|
||||||
|
local desc="$2"
|
||||||
|
local current="$3"
|
||||||
|
local total="$4"
|
||||||
|
|
||||||
|
if [ -n "${'$'}desc" ]; then
|
||||||
|
echo "$(get_current_time): [${'$'}current/${'$'}total] 清理: ${'$'}path (${'$'}desc)" >> "${'$'}LOG_FILE"
|
||||||
|
else
|
||||||
|
echo "$(get_current_time): [${'$'}current/${'$'}total] 清理: ${'$'}path" >> "${'$'}LOG_FILE"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if rm -rf "${'$'}path" 2>/dev/null; then
|
||||||
|
echo "$(get_current_time): ✓ 成功清理: ${'$'}path" >> "${'$'}LOG_FILE"
|
||||||
|
else
|
||||||
|
echo "$(get_current_time): ✗ 清理失败或不存在: ${'$'}path" >> "${'$'}LOG_FILE"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
""".trimIndent())
|
||||||
|
|
||||||
|
appendLine()
|
||||||
|
appendLine("# 开始清理各种工具残留")
|
||||||
|
appendLine("TOTAL=33")
|
||||||
|
appendLine()
|
||||||
|
|
||||||
|
val cleanupPaths = listOf(
|
||||||
|
"/data/local/stryker/" to "Stryker残留",
|
||||||
|
"/data/system/AppRetention" to "AppRetention残留",
|
||||||
|
"/data/local/tmp/luckys" to "Luck Tool残留",
|
||||||
|
"/data/local/tmp/HyperCeiler" to "西米露残留",
|
||||||
|
"/data/local/tmp/simpleHook" to "simple Hook残留",
|
||||||
|
"/data/local/tmp/DisabledAllGoogleServices" to "谷歌省电模块残留",
|
||||||
|
"/data/local/MIO" to "解包软件",
|
||||||
|
"/data/DNA" to "解包软件",
|
||||||
|
"/data/local/tmp/cleaner_starter" to "质感清理残留",
|
||||||
|
"/data/local/tmp/byyang" to "",
|
||||||
|
"/data/local/tmp/mount_mask" to "",
|
||||||
|
"/data/local/tmp/mount_mark" to "",
|
||||||
|
"/data/local/tmp/scriptTMP" to "",
|
||||||
|
"/data/local/luckys" to "",
|
||||||
|
"/data/local/tmp/horae_control.log" to "",
|
||||||
|
"/data/gpu_freq_table.conf" to "",
|
||||||
|
"/storage/emulated/0/Download/advanced/" to "",
|
||||||
|
"/storage/emulated/0/Documents/advanced/" to "爱玩机",
|
||||||
|
"/storage/emulated/0/Android/naki/" to "旧版asoulopt",
|
||||||
|
"/data/swap_config.conf" to "scene附加模块2",
|
||||||
|
"/data/local/tmp/resetprop" to "",
|
||||||
|
"/dev/cpuset/AppOpt/" to "AppOpt模块",
|
||||||
|
"/storage/emulated/0/Android/Clash/" to "Clash for Magisk模块",
|
||||||
|
"/storage/emulated/0/Android/Yume-Yunyun/" to "网易云后台优化模块",
|
||||||
|
"/data/local/tmp/Surfing_update" to "Surfing模块缓存",
|
||||||
|
"/data/encore/custom_default_cpu_gov" to "encore模块",
|
||||||
|
"/data/encore/default_cpu_gov" to "encore模块",
|
||||||
|
"/data/local/tmp/yshell" to "",
|
||||||
|
"/data/local/tmp/encore_logo.png" to "",
|
||||||
|
"/storage/emulated/legacy/" to "",
|
||||||
|
"/storage/emulated/elgg/" to "",
|
||||||
|
"/data/system/junge/" to "",
|
||||||
|
"/data/local/tmp/mount_namespace" to "挂载命名空间残留"
|
||||||
|
)
|
||||||
|
|
||||||
|
cleanupPaths.forEachIndexed { index, (path, desc) ->
|
||||||
|
val current = index + 1
|
||||||
|
appendLine("cleanup_path '$path' '$desc' $current \$TOTAL")
|
||||||
|
}
|
||||||
|
|
||||||
|
appendLine()
|
||||||
|
appendLine("echo \"$(get_current_time): 工具残留清理完成\" >> \"${'$'}LOG_FILE\"")
|
||||||
|
appendLine()
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成post-fs-data.sh脚本内容
|
||||||
|
*/
|
||||||
|
private fun generatePostFsDataScript(config: SuSFSManager.ModuleConfig): String {
|
||||||
|
return buildString {
|
||||||
|
appendLine("#!/system/bin/sh")
|
||||||
|
appendLine("# SuSFS Post-FS-Data Script")
|
||||||
|
appendLine("# 在文件系统挂载后但在系统完全启动前执行")
|
||||||
|
appendLine()
|
||||||
|
appendLine(generateLogSetup("susfs_post_fs_data.log"))
|
||||||
|
appendLine()
|
||||||
|
appendLine(generateBinaryCheck(config.targetPath))
|
||||||
|
appendLine()
|
||||||
|
appendLine("echo \"$(get_current_time): Post-FS-Data脚本开始执行\" >> \"${'$'}LOG_FILE\"")
|
||||||
|
appendLine()
|
||||||
|
|
||||||
|
// 设置uname和构建时间 - 只有在选择在post-fs-data中执行时才执行
|
||||||
|
if (config.executeInPostFsData && (config.unameValue != DEFAULT_UNAME || config.buildTimeValue != DEFAULT_BUILD_TIME)) {
|
||||||
|
appendLine("# 设置uname和构建时间")
|
||||||
|
appendLine("\"${'$'}SUSFS_BIN\" set_uname '${config.unameValue}' '${config.buildTimeValue}'")
|
||||||
|
appendLine("echo \"$(get_current_time): 设置uname为: ${config.unameValue}, 构建时间为: ${config.buildTimeValue}\" >> \"${'$'}LOG_FILE\"")
|
||||||
|
appendLine()
|
||||||
|
}
|
||||||
|
|
||||||
|
generateUmountZygoteIsoServiceSection(config.umountForZygoteIsoService, config.support158)
|
||||||
|
|
||||||
|
// 添加AVC日志欺骗设置
|
||||||
|
generateAvcLogSpoofingSection(config.enableAvcLogSpoofing)
|
||||||
|
|
||||||
|
appendLine("echo \"$(get_current_time): Post-FS-Data脚本执行完成\" >> \"${'$'}LOG_FILE\"")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加新的生成方法
|
||||||
|
private fun StringBuilder.generateUmountZygoteIsoServiceSection(umountForZygoteIsoService: Boolean, support158: Boolean) {
|
||||||
|
if (support158) {
|
||||||
|
appendLine("# 设置Zygote隔离服务卸载状态")
|
||||||
|
val umountValue = if (umountForZygoteIsoService) 1 else 0
|
||||||
|
appendLine("\"${'$'}SUSFS_BIN\" umount_for_zygote_iso_service $umountValue")
|
||||||
|
appendLine("echo \"$(get_current_time): Zygote隔离服务卸载设置为: ${if (umountForZygoteIsoService) "启用" else "禁用"}\" >> \"${'$'}LOG_FILE\"")
|
||||||
|
appendLine()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成post-mount.sh脚本内容
|
||||||
|
*/
|
||||||
|
private fun generatePostMountScript(config: SuSFSManager.ModuleConfig): String {
|
||||||
|
return buildString {
|
||||||
|
appendLine("#!/system/bin/sh")
|
||||||
|
appendLine("# SuSFS Post-Mount Script")
|
||||||
|
appendLine("# 在所有分区挂载完成后执行")
|
||||||
|
appendLine()
|
||||||
|
appendLine(generateLogSetup("susfs_post_mount.log"))
|
||||||
|
appendLine()
|
||||||
|
appendLine("echo \"$(get_current_time): Post-Mount脚本开始执行\" >> \"${'$'}LOG_FILE\"")
|
||||||
|
appendLine()
|
||||||
|
appendLine(generateBinaryCheck(config.targetPath))
|
||||||
|
appendLine()
|
||||||
|
|
||||||
|
// 添加SUS挂载
|
||||||
|
if (config.susMounts.isNotEmpty()) {
|
||||||
|
appendLine("# 添加SUS挂载")
|
||||||
|
config.susMounts.forEach { mount ->
|
||||||
|
appendLine("\"${'$'}SUSFS_BIN\" add_sus_mount '$mount'")
|
||||||
|
appendLine("echo \"$(get_current_time): 添加SUS挂载: $mount\" >> \"${'$'}LOG_FILE\"")
|
||||||
|
}
|
||||||
|
appendLine()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加尝试卸载
|
||||||
|
if (config.tryUmounts.isNotEmpty()) {
|
||||||
|
appendLine("# 添加尝试卸载")
|
||||||
|
config.tryUmounts.forEach { umount ->
|
||||||
|
val parts = umount.split("|")
|
||||||
|
if (parts.size == 2) {
|
||||||
|
val path = parts[0]
|
||||||
|
val mode = parts[1]
|
||||||
|
appendLine("\"${'$'}SUSFS_BIN\" add_try_umount '$path' $mode")
|
||||||
|
appendLine("echo \"$(get_current_time): 添加尝试卸载: $path (模式: $mode)\" >> \"${'$'}LOG_FILE\"")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
appendLine()
|
||||||
|
}
|
||||||
|
|
||||||
|
appendLine("echo \"$(get_current_time): Post-Mount脚本执行完成\" >> \"${'$'}LOG_FILE\"")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成boot-completed.sh脚本内容
|
||||||
|
*/
|
||||||
|
@SuppressLint("SdCardPath")
|
||||||
|
private fun generateBootCompletedScript(config: SuSFSManager.ModuleConfig): String {
|
||||||
|
return buildString {
|
||||||
|
appendLine("#!/system/bin/sh")
|
||||||
|
appendLine("# SuSFS Boot-Completed Script")
|
||||||
|
appendLine("# 在系统完全启动后执行")
|
||||||
|
appendLine()
|
||||||
|
appendLine(generateLogSetup("susfs_boot_completed.log"))
|
||||||
|
appendLine()
|
||||||
|
appendLine("echo \"$(get_current_time): Boot-Completed脚本开始执行\" >> \"${'$'}LOG_FILE\"")
|
||||||
|
appendLine()
|
||||||
|
appendLine(generateBinaryCheck(config.targetPath))
|
||||||
|
appendLine()
|
||||||
|
|
||||||
|
// 仅在支持隐藏挂载功能时执行相关配置
|
||||||
|
if (config.support158) {
|
||||||
|
// SUS挂载隐藏控制
|
||||||
|
val hideValue = if (config.hideSusMountsForAllProcs) 1 else 0
|
||||||
|
appendLine("# 设置SUS挂载隐藏控制")
|
||||||
|
appendLine("\"${'$'}SUSFS_BIN\" hide_sus_mnts_for_all_procs $hideValue")
|
||||||
|
appendLine("echo \"$(get_current_time): SUS挂载隐藏控制设置为: ${if (config.hideSusMountsForAllProcs) "对所有进程隐藏" else "仅对非KSU进程隐藏"}\" >> \"${'$'}LOG_FILE\"")
|
||||||
|
appendLine()
|
||||||
|
|
||||||
|
// 路径设置和SUS路径设置
|
||||||
|
if (config.susPaths.isNotEmpty() || config.susLoopPaths.isNotEmpty()) {
|
||||||
|
generatePathSettingSection(config.androidDataPath, config.sdcardPath)
|
||||||
|
appendLine()
|
||||||
|
|
||||||
|
// 添加普通SUS路径
|
||||||
|
if (config.susPaths.isNotEmpty()) {
|
||||||
|
generateSusPathsSection(config.susPaths)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加循环SUS路径
|
||||||
|
if (config.susLoopPaths.isNotEmpty()) {
|
||||||
|
generateSusLoopPathsSection(config.susLoopPaths)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
appendLine("echo \"$(get_current_time): Boot-Completed脚本执行完成\" >> \"${'$'}LOG_FILE\"")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("SdCardPath")
|
||||||
|
private fun StringBuilder.generatePathSettingSection(androidDataPath: String, sdcardPath: String) {
|
||||||
|
appendLine("# 路径配置")
|
||||||
|
appendLine("# 设置Android Data路径")
|
||||||
|
appendLine("until [ -d \"/sdcard/Android\" ]; do sleep 1; done")
|
||||||
|
appendLine("sleep 60")
|
||||||
|
appendLine()
|
||||||
|
appendLine("\"${'$'}SUSFS_BIN\" set_android_data_root_path '$androidDataPath'")
|
||||||
|
appendLine("echo \"$(get_current_time): Android Data路径设置为: $androidDataPath\" >> \"${'$'}LOG_FILE\"")
|
||||||
|
appendLine()
|
||||||
|
appendLine("# 设置SD卡路径")
|
||||||
|
appendLine("\"${'$'}SUSFS_BIN\" set_sdcard_root_path '$sdcardPath'")
|
||||||
|
appendLine("echo \"$(get_current_time): SD卡路径设置为: $sdcardPath\" >> \"${'$'}LOG_FILE\"")
|
||||||
|
appendLine()
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成module.prop文件内容
|
||||||
|
*/
|
||||||
|
fun generateModuleProp(moduleId: String): String {
|
||||||
|
val moduleVersion = "v1.0.2"
|
||||||
|
val moduleVersionCode = "1002"
|
||||||
|
|
||||||
|
return """
|
||||||
|
id=$moduleId
|
||||||
|
name=SuSFS Manager
|
||||||
|
version=$moduleVersion
|
||||||
|
versionCode=$moduleVersionCode
|
||||||
|
author=ShirkNeko
|
||||||
|
description=SuSFS Manager Auto Configuration Module (自动生成请不要手动卸载或删除该模块! / Automatically generated Please do not manually uninstall or delete the module!)
|
||||||
|
updateJson=
|
||||||
|
""".trimIndent()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -12,6 +12,7 @@ import androidx.lifecycle.ViewModel
|
|||||||
import androidx.lifecycle.viewModelScope
|
import androidx.lifecycle.viewModelScope
|
||||||
import com.dergoogler.mmrl.platform.Platform.Companion.context
|
import com.dergoogler.mmrl.platform.Platform.Companion.context
|
||||||
import com.google.gson.Gson
|
import com.google.gson.Gson
|
||||||
|
import com.google.gson.JsonSyntaxException
|
||||||
import com.sukisu.ultra.KernelVersion
|
import com.sukisu.ultra.KernelVersion
|
||||||
import com.sukisu.ultra.Natives
|
import com.sukisu.ultra.Natives
|
||||||
import com.sukisu.ultra.getKernelVersion
|
import com.sukisu.ultra.getKernelVersion
|
||||||
@@ -31,12 +32,15 @@ class HomeViewModel : ViewModel() {
|
|||||||
private const val KEY_SYSTEM_INFO = "system_info"
|
private const val KEY_SYSTEM_INFO = "system_info"
|
||||||
private const val KEY_VERSION_INFO = "version_info"
|
private const val KEY_VERSION_INFO = "version_info"
|
||||||
private const val KEY_LAST_UPDATE = "last_update_time"
|
private const val KEY_LAST_UPDATE = "last_update_time"
|
||||||
|
private const val KEY_ERROR_COUNT = "error_count"
|
||||||
|
private const val MAX_ERROR_COUNT = 2
|
||||||
}
|
}
|
||||||
|
|
||||||
// 系统状态
|
// 系统状态
|
||||||
data class SystemStatus(
|
data class SystemStatus(
|
||||||
val isManager: Boolean = false,
|
val isManager: Boolean = false,
|
||||||
val ksuVersion: Int? = null,
|
val ksuVersion: Int? = null,
|
||||||
|
val ksuFullVersion : String? = null,
|
||||||
val lkmMode: Boolean? = null,
|
val lkmMode: Boolean? = null,
|
||||||
val kernelVersion: KernelVersion = getKernelVersion(),
|
val kernelVersion: KernelVersion = getKernelVersion(),
|
||||||
val isRootAvailable: Boolean = false,
|
val isRootAvailable: Boolean = false,
|
||||||
@@ -59,7 +63,10 @@ class HomeViewModel : ViewModel() {
|
|||||||
val susSUMode: String = "",
|
val susSUMode: String = "",
|
||||||
val superuserCount: Int = 0,
|
val superuserCount: Int = 0,
|
||||||
val moduleCount: Int = 0,
|
val moduleCount: Int = 0,
|
||||||
val kpmModuleCount: Int = 0
|
val kpmModuleCount: Int = 0,
|
||||||
|
val managersList: Natives.ManagersList? = null,
|
||||||
|
val isDynamicSignEnabled: Boolean = false,
|
||||||
|
val zygiskImplement: String = ""
|
||||||
)
|
)
|
||||||
|
|
||||||
private val gson = Gson()
|
private val gson = Gson()
|
||||||
@@ -76,65 +83,164 @@ class HomeViewModel : ViewModel() {
|
|||||||
|
|
||||||
var isSimpleMode by mutableStateOf(false)
|
var isSimpleMode by mutableStateOf(false)
|
||||||
private set
|
private set
|
||||||
|
var isKernelSimpleMode by mutableStateOf(false)
|
||||||
|
private set
|
||||||
var isHideVersion by mutableStateOf(false)
|
var isHideVersion by mutableStateOf(false)
|
||||||
private set
|
private set
|
||||||
var isHideOtherInfo by mutableStateOf(false)
|
var isHideOtherInfo by mutableStateOf(false)
|
||||||
private set
|
private set
|
||||||
var isHideSusfsStatus by mutableStateOf(false)
|
var isHideSusfsStatus by mutableStateOf(false)
|
||||||
private set
|
private set
|
||||||
|
var isHideZygiskImplement by mutableStateOf(false)
|
||||||
|
private set
|
||||||
var isHideLinkCard by mutableStateOf(false)
|
var isHideLinkCard by mutableStateOf(false)
|
||||||
private set
|
private set
|
||||||
var showKpmInfo by mutableStateOf(false)
|
var showKpmInfo by mutableStateOf(false)
|
||||||
private set
|
private set
|
||||||
|
|
||||||
|
private fun clearAllCache() {
|
||||||
|
try {
|
||||||
|
prefs.edit { clear() }
|
||||||
|
Log.i(TAG, "All cache cleared successfully")
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.e(TAG, "Error clearing cache", e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun resetToDefaults() {
|
||||||
|
systemStatus = SystemStatus()
|
||||||
|
systemInfo = SystemInfo()
|
||||||
|
latestVersionInfo = LatestVersionInfo()
|
||||||
|
isSimpleMode = false
|
||||||
|
isKernelSimpleMode = false
|
||||||
|
isHideVersion = false
|
||||||
|
isHideOtherInfo = false
|
||||||
|
isHideSusfsStatus = false
|
||||||
|
isHideZygiskImplement = false
|
||||||
|
isHideLinkCard = false
|
||||||
|
showKpmInfo = false
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun handleError(error: Exception, operation: String) {
|
||||||
|
Log.e(TAG, "Error in $operation", error)
|
||||||
|
|
||||||
|
val errorCount = prefs.getInt(KEY_ERROR_COUNT, 0)
|
||||||
|
val newErrorCount = errorCount + 1
|
||||||
|
|
||||||
|
if (newErrorCount >= MAX_ERROR_COUNT) {
|
||||||
|
Log.w(TAG, "Too many errors ($newErrorCount), clearing cache and resetting")
|
||||||
|
clearAllCache()
|
||||||
|
resetToDefaults()
|
||||||
|
} else {
|
||||||
|
prefs.edit {
|
||||||
|
putInt(KEY_ERROR_COUNT, newErrorCount)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun String?.orSafe(default: String = ""): String {
|
||||||
|
return if (this.isNullOrBlank()) default else this
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun <T, R> Pair<T?, R?>?.orSafe(default: Pair<T, R>): Pair<T, R> {
|
||||||
|
return if (this?.first == null || this.second == null) default else Pair(this.first!!, this.second!!)
|
||||||
|
}
|
||||||
|
|
||||||
fun loadUserSettings(context: Context) {
|
fun loadUserSettings(context: Context) {
|
||||||
viewModelScope.launch(Dispatchers.IO) {
|
viewModelScope.launch(Dispatchers.IO) {
|
||||||
val prefs = context.getSharedPreferences("settings", Context.MODE_PRIVATE)
|
try {
|
||||||
isSimpleMode = prefs.getBoolean("is_simple_mode", false)
|
val settingsPrefs = context.getSharedPreferences("settings", Context.MODE_PRIVATE)
|
||||||
isHideVersion = prefs.getBoolean("is_hide_version", false)
|
isSimpleMode = settingsPrefs.getBoolean("is_simple_mode", false)
|
||||||
isHideOtherInfo = prefs.getBoolean("is_hide_other_info", false)
|
isKernelSimpleMode = settingsPrefs.getBoolean("is_kernel_simple_mode", false)
|
||||||
isHideSusfsStatus = prefs.getBoolean("is_hide_susfs_status", false)
|
isHideVersion = settingsPrefs.getBoolean("is_hide_version", false)
|
||||||
isHideLinkCard = prefs.getBoolean("is_hide_link_card", false)
|
isHideOtherInfo = settingsPrefs.getBoolean("is_hide_other_info", false)
|
||||||
showKpmInfo = prefs.getBoolean("show_kpm_info", false)
|
isHideSusfsStatus = settingsPrefs.getBoolean("is_hide_susfs_status", false)
|
||||||
|
isHideLinkCard = settingsPrefs.getBoolean("is_hide_link_card", false)
|
||||||
|
isHideZygiskImplement = settingsPrefs.getBoolean("is_hide_zygisk_Implement", false)
|
||||||
|
showKpmInfo = settingsPrefs.getBoolean("show_kpm_info", false)
|
||||||
|
} catch (e: Exception) {
|
||||||
|
handleError(e, "loadUserSettings")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun initializeData() {
|
fun initializeData() {
|
||||||
viewModelScope.launch {
|
viewModelScope.launch {
|
||||||
loadCachedData()
|
try {
|
||||||
|
loadCachedData()
|
||||||
|
// 成功加载后重置错误计数
|
||||||
|
prefs.edit {
|
||||||
|
putInt(KEY_ERROR_COUNT, 0)
|
||||||
|
}
|
||||||
|
} catch(e: Exception) {
|
||||||
|
handleError(e, "initializeData")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun loadCachedData() {
|
private fun loadCachedData() {
|
||||||
prefs.getString(KEY_SYSTEM_STATUS, null)?.let {
|
try {
|
||||||
systemStatus = gson.fromJson(it, SystemStatus::class.java)
|
prefs.getString(KEY_SYSTEM_STATUS, null)?.let { statusJson ->
|
||||||
}
|
try {
|
||||||
prefs.getString(KEY_SYSTEM_INFO, null)?.let {
|
val cachedStatus = gson.fromJson(statusJson, SystemStatus::class.java)
|
||||||
systemInfo = gson.fromJson(it, SystemInfo::class.java)
|
if (cachedStatus != null) {
|
||||||
}
|
systemStatus = cachedStatus
|
||||||
prefs.getString(KEY_VERSION_INFO, null)?.let {
|
}
|
||||||
latestVersionInfo = gson.fromJson(it, LatestVersionInfo::class.java)
|
} catch (e: JsonSyntaxException) {
|
||||||
|
Log.w(TAG, "Invalid system status JSON, using defaults", e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
prefs.getString(KEY_SYSTEM_INFO, null)?.let { infoJson ->
|
||||||
|
try {
|
||||||
|
val cachedInfo = gson.fromJson(infoJson, SystemInfo::class.java)
|
||||||
|
if (cachedInfo != null) {
|
||||||
|
systemInfo = cachedInfo
|
||||||
|
}
|
||||||
|
} catch (e: JsonSyntaxException) {
|
||||||
|
Log.w(TAG, "Invalid system info JSON, using defaults", e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
prefs.getString(KEY_VERSION_INFO, null)?.let { versionJson ->
|
||||||
|
try {
|
||||||
|
val cachedVersion = gson.fromJson(versionJson, LatestVersionInfo::class.java)
|
||||||
|
if (cachedVersion != null) {
|
||||||
|
latestVersionInfo = cachedVersion
|
||||||
|
}
|
||||||
|
} catch (e: JsonSyntaxException) {
|
||||||
|
Log.w(TAG, "Invalid version info JSON, using defaults", e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.e(TAG, "Error loading cached data", e)
|
||||||
|
throw e
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private suspend fun fetchAndSaveData() {
|
private suspend fun fetchAndSaveData() {
|
||||||
fetchSystemStatus()
|
try {
|
||||||
fetchSystemInfo()
|
fetchSystemStatus()
|
||||||
withContext(Dispatchers.IO) {
|
fetchSystemInfo()
|
||||||
prefs.edit {
|
withContext(Dispatchers.IO) {
|
||||||
putString(KEY_SYSTEM_STATUS, gson.toJson(systemStatus))
|
prefs.edit {
|
||||||
putString(KEY_SYSTEM_INFO, gson.toJson(systemInfo))
|
putString(KEY_SYSTEM_STATUS, gson.toJson(systemStatus))
|
||||||
putString(KEY_VERSION_INFO, gson.toJson(latestVersionInfo))
|
putString(KEY_SYSTEM_INFO, gson.toJson(systemInfo))
|
||||||
putLong(KEY_LAST_UPDATE, System.currentTimeMillis())
|
putString(KEY_VERSION_INFO, gson.toJson(latestVersionInfo))
|
||||||
|
putLong(KEY_LAST_UPDATE, System.currentTimeMillis())
|
||||||
|
putInt(KEY_ERROR_COUNT, 0)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
handleError(e, "fetchAndSaveData")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun checkForUpdates(context: Context) {
|
fun checkForUpdates(context: Context) {
|
||||||
viewModelScope.launch(Dispatchers.IO) {
|
viewModelScope.launch(Dispatchers.IO) {
|
||||||
try {
|
try {
|
||||||
val checkUpdate = context.getSharedPreferences("settings", Context.MODE_PRIVATE)
|
val settingsPrefs = context.getSharedPreferences("settings", Context.MODE_PRIVATE)
|
||||||
.getBoolean("check_update", true)
|
val checkUpdate = settingsPrefs.getBoolean("check_update", true)
|
||||||
|
|
||||||
if (checkUpdate) {
|
if (checkUpdate) {
|
||||||
val newVersionInfo = checkNewVersion()
|
val newVersionInfo = checkNewVersion()
|
||||||
@@ -145,7 +251,7 @@ class HomeViewModel : ViewModel() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
Log.e(TAG, "Error checking for updates", e)
|
handleError(e, "checkForUpdates")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -156,7 +262,7 @@ class HomeViewModel : ViewModel() {
|
|||||||
fetchAndSaveData()
|
fetchAndSaveData()
|
||||||
checkForUpdates(context)
|
checkForUpdates(context)
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
Log.e(TAG, "Error refreshing data", e)
|
handleError(e, "refreshAllData")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -165,23 +271,97 @@ class HomeViewModel : ViewModel() {
|
|||||||
withContext(Dispatchers.IO) {
|
withContext(Dispatchers.IO) {
|
||||||
try {
|
try {
|
||||||
val kernelVersion = getKernelVersion()
|
val kernelVersion = getKernelVersion()
|
||||||
val isManager = Natives.becomeManager(ksuApp.packageName)
|
val isManager = try {
|
||||||
val ksuVersion = if (isManager) Natives.version else null
|
Natives.becomeManager(ksuApp.packageName.orSafe("com.sukisu.ultra"))
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.w(TAG, "Failed to become manager", e)
|
||||||
|
false
|
||||||
|
}
|
||||||
|
|
||||||
|
val ksuVersion = if (isManager) {
|
||||||
|
try {
|
||||||
|
Natives.version
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.w(TAG, "Failed to get KSU version", e)
|
||||||
|
null
|
||||||
|
}
|
||||||
|
} else null
|
||||||
|
|
||||||
|
val fullVersion = try {
|
||||||
|
Natives.getFullVersion().orSafe("Unknown")
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.w(TAG, "Failed to get full version", e)
|
||||||
|
"Unknown"
|
||||||
|
}
|
||||||
|
|
||||||
|
val ksuFullVersion = if (isKernelSimpleMode) {
|
||||||
|
try {
|
||||||
|
val startIndex = fullVersion.indexOf('v')
|
||||||
|
if (startIndex >= 0) {
|
||||||
|
val endIndex = fullVersion.indexOf('-', startIndex)
|
||||||
|
val versionStr = if (endIndex > startIndex) {
|
||||||
|
fullVersion.substring(startIndex, endIndex)
|
||||||
|
} else {
|
||||||
|
fullVersion.substring(startIndex)
|
||||||
|
}
|
||||||
|
val numericVersion = "v" + (Regex("""\d+(\.\d+)*""").find(versionStr)?.value ?: versionStr)
|
||||||
|
numericVersion
|
||||||
|
} else {
|
||||||
|
fullVersion
|
||||||
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.w(TAG, "Failed to process full version", e)
|
||||||
|
fullVersion
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
fullVersion
|
||||||
|
}
|
||||||
|
|
||||||
val lkmMode = ksuVersion?.let {
|
val lkmMode = ksuVersion?.let {
|
||||||
if (it >= Natives.MINIMAL_SUPPORTED_KERNEL_LKM && kernelVersion.isGKI()) Natives.isLkmMode else null
|
try {
|
||||||
|
if (it >= Natives.MINIMAL_SUPPORTED_KERNEL_LKM && kernelVersion.isGKI()) {
|
||||||
|
Natives.isLkmMode
|
||||||
|
} else null
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.w(TAG, "Failed to get LKM mode", e)
|
||||||
|
null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
val isRootAvailable = try {
|
||||||
|
rootAvailable()
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.w(TAG, "Failed to check root availability", e)
|
||||||
|
false
|
||||||
|
}
|
||||||
|
|
||||||
|
val isKpmConfigured = try {
|
||||||
|
Natives.isKPMEnabled()
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.w(TAG, "Failed to check KPM status", e)
|
||||||
|
false
|
||||||
|
}
|
||||||
|
|
||||||
|
val requireNewKernel = try {
|
||||||
|
isManager && Natives.requireNewKernel()
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.w(TAG, "Failed to check kernel requirement", e)
|
||||||
|
false
|
||||||
}
|
}
|
||||||
|
|
||||||
systemStatus = SystemStatus(
|
systemStatus = SystemStatus(
|
||||||
isManager = isManager,
|
isManager = isManager,
|
||||||
ksuVersion = ksuVersion,
|
ksuVersion = ksuVersion,
|
||||||
|
ksuFullVersion = ksuFullVersion,
|
||||||
lkmMode = lkmMode,
|
lkmMode = lkmMode,
|
||||||
kernelVersion = kernelVersion,
|
kernelVersion = kernelVersion,
|
||||||
isRootAvailable = rootAvailable(),
|
isRootAvailable = isRootAvailable,
|
||||||
isKpmConfigured = Natives.isKPMEnabled(),
|
isKpmConfigured = isKpmConfigured,
|
||||||
requireNewKernel = isManager && Natives.requireNewKernel()
|
requireNewKernel = requireNewKernel
|
||||||
)
|
)
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
Log.e(TAG, "Error fetching system status", e)
|
Log.e(TAG, "Error fetching system status", e)
|
||||||
|
throw e
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -190,60 +370,188 @@ class HomeViewModel : ViewModel() {
|
|||||||
private suspend fun fetchSystemInfo() {
|
private suspend fun fetchSystemInfo() {
|
||||||
withContext(Dispatchers.IO) {
|
withContext(Dispatchers.IO) {
|
||||||
try {
|
try {
|
||||||
val uname = Os.uname()
|
val uname = try {
|
||||||
val kpmVersion = getKpmVersion()
|
Os.uname()
|
||||||
val suSFS = getSuSFS()
|
} catch (e: Exception) {
|
||||||
|
Log.w(TAG, "Failed to get uname", e)
|
||||||
|
null
|
||||||
|
}
|
||||||
|
|
||||||
|
val kpmVersion = try {
|
||||||
|
getKpmVersion().orSafe("Unknown")
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.w(TAG, "Failed to get kpm version", e)
|
||||||
|
"Unknown"
|
||||||
|
}
|
||||||
|
|
||||||
|
val suSFS = try {
|
||||||
|
getSuSFS().orSafe("Unknown")
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.w(TAG, "Failed to get SuSFS", e)
|
||||||
|
"Unknown"
|
||||||
|
}
|
||||||
|
|
||||||
var suSFSVersion = ""
|
var suSFSVersion = ""
|
||||||
var suSFSVariant = ""
|
var suSFSVariant = ""
|
||||||
var suSFSFeatures = ""
|
var suSFSFeatures = ""
|
||||||
var susSUMode = ""
|
var susSUMode = ""
|
||||||
|
|
||||||
if (suSFS == "Supported") {
|
if (suSFS == "Supported") {
|
||||||
suSFSVersion = getSuSFSVersion()
|
suSFSVersion = try {
|
||||||
|
getSuSFSVersion().orSafe("")
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.w(TAG, "Failed to get SuSFS version", e)
|
||||||
|
""
|
||||||
|
}
|
||||||
|
|
||||||
if (suSFSVersion.isNotEmpty()) {
|
if (suSFSVersion.isNotEmpty()) {
|
||||||
suSFSVariant = getSuSFSVariant()
|
suSFSVariant = try {
|
||||||
suSFSFeatures = getSuSFSFeatures()
|
getSuSFSVariant().orSafe("")
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.w(TAG, "Failed to get SuSFS variant", e)
|
||||||
|
""
|
||||||
|
}
|
||||||
|
|
||||||
|
suSFSFeatures = try {
|
||||||
|
getSuSFSFeatures().orSafe("")
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.w(TAG, "Failed to get SuSFS features", e)
|
||||||
|
""
|
||||||
|
}
|
||||||
|
|
||||||
val isSUS_SU = suSFSFeatures == "CONFIG_KSU_SUSFS_SUS_SU"
|
val isSUS_SU = suSFSFeatures == "CONFIG_KSU_SUSFS_SUS_SU"
|
||||||
if (isSUS_SU) {
|
if (isSUS_SU) {
|
||||||
susSUMode = try {
|
susSUMode = try {
|
||||||
susfsSUS_SU_Mode().toString()
|
susfsSUS_SU_Mode()
|
||||||
} catch (_: Exception) {
|
} catch (e: Exception) {
|
||||||
|
Log.w(TAG, "Failed to get SUS SU mode", e)
|
||||||
""
|
""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取动态管理器状态和管理器列表
|
||||||
|
val dynamicSignConfig = try {
|
||||||
|
Natives.getDynamicManager()
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.w(TAG, "Failed to get dynamic manager config", e)
|
||||||
|
null
|
||||||
|
}
|
||||||
|
|
||||||
|
val isDynamicSignEnabled = try {
|
||||||
|
dynamicSignConfig?.isValid() == true
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.w(TAG, "Failed to check dynamic manager validity", e)
|
||||||
|
false
|
||||||
|
}
|
||||||
|
|
||||||
|
val managersList = if (isDynamicSignEnabled) {
|
||||||
|
try {
|
||||||
|
Natives.getManagersList()
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.w(TAG, "Failed to get managers list", e)
|
||||||
|
null
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
null
|
||||||
|
}
|
||||||
|
|
||||||
|
val deviceModel = try {
|
||||||
|
getDeviceModel().orSafe("Unknown")
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.w(TAG, "Failed to get device model", e)
|
||||||
|
"Unknown"
|
||||||
|
}
|
||||||
|
|
||||||
|
val managerVersion = try {
|
||||||
|
getManagerVersion(ksuApp.applicationContext).orSafe(Pair("Unknown", 0L))
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.w(TAG, "Failed to get manager version", e)
|
||||||
|
Pair("Unknown", 0L)
|
||||||
|
}
|
||||||
|
|
||||||
|
val seLinuxStatus = try {
|
||||||
|
getSELinuxStatus(context).orSafe("Unknown")
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.w(TAG, "Failed to get SELinux status", e)
|
||||||
|
"Unknown"
|
||||||
|
}
|
||||||
|
|
||||||
|
val superuserCount = try {
|
||||||
|
getSuperuserCount()
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.w(TAG, "Failed to get superuser count", e)
|
||||||
|
0
|
||||||
|
}
|
||||||
|
|
||||||
|
val moduleCount = try {
|
||||||
|
getModuleCount()
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.w(TAG, "Failed to get module count", e)
|
||||||
|
0
|
||||||
|
}
|
||||||
|
|
||||||
|
val kpmModuleCount = try {
|
||||||
|
getKpmModuleCount()
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.w(TAG, "Failed to get kpm module count", e)
|
||||||
|
0
|
||||||
|
}
|
||||||
|
|
||||||
|
val zygiskImplement = try {
|
||||||
|
getZygiskImplement().orSafe("None")
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.w(TAG, "Failed to get Zygisk implement", e)
|
||||||
|
"None"
|
||||||
|
}
|
||||||
|
|
||||||
systemInfo = SystemInfo(
|
systemInfo = SystemInfo(
|
||||||
kernelRelease = uname.release,
|
kernelRelease = uname?.release.orSafe("Unknown"),
|
||||||
androidVersion = Build.VERSION.RELEASE,
|
androidVersion = Build.VERSION.RELEASE.orSafe("Unknown"),
|
||||||
deviceModel = getDeviceModel(),
|
deviceModel = deviceModel,
|
||||||
managerVersion = getManagerVersion(ksuApp.applicationContext),
|
managerVersion = managerVersion,
|
||||||
seLinuxStatus = getSELinuxStatus(context),
|
seLinuxStatus = seLinuxStatus,
|
||||||
kpmVersion = kpmVersion,
|
kpmVersion = kpmVersion,
|
||||||
suSFSStatus = suSFS,
|
suSFSStatus = suSFS,
|
||||||
suSFSVersion = suSFSVersion,
|
suSFSVersion = suSFSVersion,
|
||||||
suSFSVariant = suSFSVariant,
|
suSFSVariant = suSFSVariant,
|
||||||
suSFSFeatures = suSFSFeatures,
|
suSFSFeatures = suSFSFeatures,
|
||||||
susSUMode = susSUMode,
|
susSUMode = susSUMode,
|
||||||
superuserCount = getSuperuserCount(),
|
superuserCount = superuserCount,
|
||||||
moduleCount = getModuleCount(),
|
moduleCount = moduleCount,
|
||||||
kpmModuleCount = getKpmModuleCount()
|
kpmModuleCount = kpmModuleCount,
|
||||||
|
managersList = managersList,
|
||||||
|
isDynamicSignEnabled = isDynamicSignEnabled,
|
||||||
|
zygiskImplement = zygiskImplement
|
||||||
)
|
)
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
Log.e(TAG, "Error fetching system info", e)
|
Log.e(TAG, "Error fetching system info", e)
|
||||||
|
throw e
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getDeviceInfo(): String {
|
private fun getDeviceInfo(): String {
|
||||||
var manufacturer =
|
return try {
|
||||||
Build.MANUFACTURER[0].uppercaseChar().toString() + Build.MANUFACTURER.substring(1)
|
var manufacturer = Build.MANUFACTURER.orSafe("Unknown")
|
||||||
if (Build.BRAND != Build.MANUFACTURER) {
|
manufacturer = manufacturer[0].uppercaseChar().toString() + manufacturer.substring(1)
|
||||||
manufacturer += " " + Build.BRAND[0].uppercaseChar() + Build.BRAND.substring(1)
|
|
||||||
|
val brand = Build.BRAND.orSafe("")
|
||||||
|
if (brand.isNotEmpty() && !brand.equals(Build.MANUFACTURER, ignoreCase = true)) {
|
||||||
|
manufacturer += " " + brand[0].uppercaseChar() + brand.substring(1)
|
||||||
|
}
|
||||||
|
|
||||||
|
val model = Build.MODEL.orSafe("")
|
||||||
|
if (model.isNotEmpty()) {
|
||||||
|
manufacturer += " $model "
|
||||||
|
}
|
||||||
|
|
||||||
|
manufacturer
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.w(TAG, "Failed to get device info", e)
|
||||||
|
"Unknown Device"
|
||||||
}
|
}
|
||||||
manufacturer += " " + Build.MODEL + " "
|
|
||||||
return manufacturer
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("PrivateApi")
|
@SuppressLint("PrivateApi")
|
||||||
@@ -259,27 +567,32 @@ class HomeViewModel : ViewModel() {
|
|||||||
)
|
)
|
||||||
var result = getDeviceInfo()
|
var result = getDeviceInfo()
|
||||||
for (key in marketNameKeys) {
|
for (key in marketNameKeys) {
|
||||||
val marketName = getMethod.invoke(null, key, "") as String
|
try {
|
||||||
if (marketName.isNotEmpty()) {
|
val marketName = getMethod.invoke(null, key, "") as String
|
||||||
result = marketName
|
if (marketName.isNotEmpty()) {
|
||||||
break
|
result = marketName
|
||||||
|
break
|
||||||
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.w(TAG, "Failed to get market name for key: $key", e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
result
|
result
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
Log.e(TAG, "Error getting device model", e)
|
Log.w(TAG, "Error getting device model", e)
|
||||||
getDeviceInfo()
|
getDeviceInfo()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getManagerVersion(context: Context): Pair<String, Long> {
|
private fun getManagerVersion(context: Context): Pair<String, Long> {
|
||||||
return try {
|
return try {
|
||||||
val packageInfo = context.packageManager.getPackageInfo(context.packageName, 0)!!
|
val packageInfo = context.packageManager.getPackageInfo(context.packageName, 0)
|
||||||
val versionCode = androidx.core.content.pm.PackageInfoCompat.getLongVersionCode(packageInfo)
|
val versionCode = androidx.core.content.pm.PackageInfoCompat.getLongVersionCode(packageInfo)
|
||||||
Pair(packageInfo.versionName!!, versionCode)
|
val versionName = packageInfo.versionName.orSafe("Unknown")
|
||||||
|
Pair(versionName, versionCode)
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
Log.e(TAG, "Error getting manager version", e)
|
Log.w(TAG, "Error getting manager version", e)
|
||||||
Pair("", 0L)
|
Pair("Unknown", 0L)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.sukisu.ultra.ui.viewmodel
|
package com.sukisu.ultra.ui.viewmodel
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
import android.os.SystemClock
|
import android.os.SystemClock
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import androidx.compose.runtime.derivedStateOf
|
import androidx.compose.runtime.derivedStateOf
|
||||||
@@ -14,12 +15,18 @@ import kotlinx.coroutines.Dispatchers
|
|||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import com.sukisu.ultra.ui.util.HanziToPinyin
|
import com.sukisu.ultra.ui.util.HanziToPinyin
|
||||||
import com.sukisu.ultra.ui.util.listModules
|
import com.sukisu.ultra.ui.util.listModules
|
||||||
|
import com.sukisu.ultra.ui.util.getRootShell
|
||||||
|
import com.sukisu.ultra.ui.util.ModuleVerificationManager
|
||||||
import kotlinx.coroutines.withContext
|
import kotlinx.coroutines.withContext
|
||||||
import org.json.JSONArray
|
import org.json.JSONArray
|
||||||
import org.json.JSONObject
|
import org.json.JSONObject
|
||||||
import java.text.Collator
|
import java.text.Collator
|
||||||
|
import java.text.DecimalFormat
|
||||||
import java.util.Locale
|
import java.util.Locale
|
||||||
import java.util.concurrent.TimeUnit
|
import java.util.concurrent.TimeUnit
|
||||||
|
import kotlin.math.log10
|
||||||
|
import kotlin.math.pow
|
||||||
|
import androidx.core.content.edit
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author ShirkNeko
|
* @author ShirkNeko
|
||||||
@@ -33,6 +40,38 @@ class ModuleViewModel : ViewModel() {
|
|||||||
private const val CUSTOM_USER_AGENT = "SukiSU-Ultra/2.0"
|
private const val CUSTOM_USER_AGENT = "SukiSU-Ultra/2.0"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 模块大小缓存管理器
|
||||||
|
private lateinit var moduleSizeCache: ModuleSizeCache
|
||||||
|
|
||||||
|
fun initializeCache(context: Context) {
|
||||||
|
if (!::moduleSizeCache.isInitialized) {
|
||||||
|
moduleSizeCache = ModuleSizeCache(context)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getModuleSize(dirId: String): String {
|
||||||
|
if (!::moduleSizeCache.isInitialized) {
|
||||||
|
return "0 KB"
|
||||||
|
}
|
||||||
|
val size = moduleSizeCache.getModuleSize(dirId)
|
||||||
|
return formatFileSize(size)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 刷新所有模块的大小缓存
|
||||||
|
* 只在安装、卸载、更新模块后调用
|
||||||
|
*/
|
||||||
|
fun refreshModuleSizeCache() {
|
||||||
|
if (!::moduleSizeCache.isInitialized) return
|
||||||
|
|
||||||
|
viewModelScope.launch(Dispatchers.IO) {
|
||||||
|
Log.d(TAG, "开始刷新模块大小缓存")
|
||||||
|
val currentModules = modules.map { it.dirId }
|
||||||
|
moduleSizeCache.refreshCache(currentModules)
|
||||||
|
Log.d(TAG, "模块大小缓存刷新完成")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class ModuleInfo(
|
class ModuleInfo(
|
||||||
val id: String,
|
val id: String,
|
||||||
val name: String,
|
val name: String,
|
||||||
@@ -48,6 +87,8 @@ class ModuleViewModel : ViewModel() {
|
|||||||
val hasActionScript: Boolean,
|
val hasActionScript: Boolean,
|
||||||
val dirId: String, // real module id (dir name)
|
val dirId: String, // real module id (dir name)
|
||||||
var config: ModuleConfig? = null,
|
var config: ModuleConfig? = null,
|
||||||
|
var isVerified: Boolean = false, // 添加验证状态字段
|
||||||
|
var verificationTimestamp: Long = 0L, // 添加验证时间戳
|
||||||
)
|
)
|
||||||
|
|
||||||
var isRefreshing by mutableStateOf(false)
|
var isRefreshing by mutableStateOf(false)
|
||||||
@@ -75,6 +116,8 @@ class ModuleViewModel : ViewModel() {
|
|||||||
|
|
||||||
fun markNeedRefresh() {
|
fun markNeedRefresh() {
|
||||||
isNeedRefresh = true
|
isNeedRefresh = true
|
||||||
|
// 标记需要刷新时,同时刷新大小缓存
|
||||||
|
refreshModuleSizeCache()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun fetchModuleList() {
|
fun fetchModuleList() {
|
||||||
@@ -91,7 +134,7 @@ class ModuleViewModel : ViewModel() {
|
|||||||
Log.i(TAG, "result: $result")
|
Log.i(TAG, "result: $result")
|
||||||
|
|
||||||
val array = JSONArray(result)
|
val array = JSONArray(result)
|
||||||
modules = (0 until array.length())
|
val moduleInfos = (0 until array.length())
|
||||||
.asSequence()
|
.asSequence()
|
||||||
.map { array.getJSONObject(it) }
|
.map { array.getJSONObject(it) }
|
||||||
.map { obj ->
|
.map { obj ->
|
||||||
@@ -111,6 +154,26 @@ class ModuleViewModel : ViewModel() {
|
|||||||
obj.getString("dir_id")
|
obj.getString("dir_id")
|
||||||
)
|
)
|
||||||
}.toList()
|
}.toList()
|
||||||
|
|
||||||
|
// 批量检查所有模块的验证状态
|
||||||
|
val moduleIds = moduleInfos.map { it.dirId }
|
||||||
|
val verificationStatus = ModuleVerificationManager.batchCheckVerificationStatus(moduleIds)
|
||||||
|
|
||||||
|
// 更新模块验证状态
|
||||||
|
modules = moduleInfos.map { moduleInfo ->
|
||||||
|
val isVerified = verificationStatus[moduleInfo.dirId] ?: false
|
||||||
|
val verificationTimestamp = if (isVerified) {
|
||||||
|
ModuleVerificationManager.getVerificationTimestamp(moduleInfo.dirId)
|
||||||
|
} else {
|
||||||
|
0L
|
||||||
|
}
|
||||||
|
|
||||||
|
moduleInfo.copy(
|
||||||
|
isVerified = isVerified,
|
||||||
|
verificationTimestamp = verificationTimestamp
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
launch {
|
launch {
|
||||||
modules.forEach { module ->
|
modules.forEach { module ->
|
||||||
withContext(Dispatchers.IO) {
|
withContext(Dispatchers.IO) {
|
||||||
@@ -144,6 +207,13 @@ class ModuleViewModel : ViewModel() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 首次加载模块列表时,初始化缓存
|
||||||
|
if (::moduleSizeCache.isInitialized) {
|
||||||
|
val currentModules = modules.map { it.dirId }
|
||||||
|
moduleSizeCache.initializeCacheIfNeeded(currentModules)
|
||||||
|
}
|
||||||
|
|
||||||
isNeedRefresh = false
|
isNeedRefresh = false
|
||||||
}.onFailure { e ->
|
}.onFailure { e ->
|
||||||
Log.e(TAG, "fetchModuleList: ", e)
|
Log.e(TAG, "fetchModuleList: ", e)
|
||||||
@@ -221,3 +291,194 @@ class ModuleViewModel : ViewModel() {
|
|||||||
return Triple(zipUrl, version, changelog)
|
return Triple(zipUrl, version, changelog)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun ModuleViewModel.ModuleInfo.copy(
|
||||||
|
id: String = this.id,
|
||||||
|
name: String = this.name,
|
||||||
|
author: String = this.author,
|
||||||
|
version: String = this.version,
|
||||||
|
versionCode: Int = this.versionCode,
|
||||||
|
description: String = this.description,
|
||||||
|
enabled: Boolean = this.enabled,
|
||||||
|
update: Boolean = this.update,
|
||||||
|
remove: Boolean = this.remove,
|
||||||
|
updateJson: String = this.updateJson,
|
||||||
|
hasWebUi: Boolean = this.hasWebUi,
|
||||||
|
hasActionScript: Boolean = this.hasActionScript,
|
||||||
|
dirId: String = this.dirId,
|
||||||
|
config: ModuleConfig? = this.config,
|
||||||
|
isVerified: Boolean = this.isVerified,
|
||||||
|
verificationTimestamp: Long = this.verificationTimestamp
|
||||||
|
): ModuleViewModel.ModuleInfo {
|
||||||
|
return ModuleViewModel.ModuleInfo(
|
||||||
|
id, name, author, version, versionCode, description,
|
||||||
|
enabled, update, remove, updateJson, hasWebUi, hasActionScript,
|
||||||
|
dirId, config, isVerified, verificationTimestamp
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 模块大小缓存管理器
|
||||||
|
*/
|
||||||
|
class ModuleSizeCache(context: Context) {
|
||||||
|
companion object {
|
||||||
|
private const val TAG = "ModuleSizeCache"
|
||||||
|
private const val CACHE_PREFS_NAME = "module_size_cache"
|
||||||
|
private const val CACHE_VERSION_KEY = "cache_version"
|
||||||
|
private const val CACHE_INITIALIZED_KEY = "cache_initialized"
|
||||||
|
private const val CURRENT_CACHE_VERSION = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
private val cachePrefs = context.getSharedPreferences(CACHE_PREFS_NAME, Context.MODE_PRIVATE)
|
||||||
|
private val sizeCache = mutableMapOf<String, Long>()
|
||||||
|
|
||||||
|
init {
|
||||||
|
loadCacheFromPrefs()
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 从SharedPreferences加载缓存
|
||||||
|
*/
|
||||||
|
private fun loadCacheFromPrefs() {
|
||||||
|
try {
|
||||||
|
val cacheVersion = cachePrefs.getInt(CACHE_VERSION_KEY, 0)
|
||||||
|
if (cacheVersion != CURRENT_CACHE_VERSION) {
|
||||||
|
Log.d(TAG, "缓存版本不匹配,清空缓存")
|
||||||
|
clearCache()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
val allEntries = cachePrefs.all
|
||||||
|
for ((key, value) in allEntries) {
|
||||||
|
if (key != CACHE_VERSION_KEY && key != CACHE_INITIALIZED_KEY && value is Long) {
|
||||||
|
sizeCache[key] = value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Log.d(TAG, "从缓存加载了 ${sizeCache.size} 个模块大小数据")
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.e(TAG, "加载缓存失败", e)
|
||||||
|
clearCache()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存缓存到SharedPreferences
|
||||||
|
*/
|
||||||
|
private fun saveCacheToPrefs() {
|
||||||
|
try {
|
||||||
|
cachePrefs.edit {
|
||||||
|
putInt(CACHE_VERSION_KEY, CURRENT_CACHE_VERSION)
|
||||||
|
putBoolean(CACHE_INITIALIZED_KEY, true)
|
||||||
|
|
||||||
|
for ((dirId, size) in sizeCache) {
|
||||||
|
putLong(dirId, size)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
Log.d(TAG, "保存了 ${sizeCache.size} 个模块大小到缓存")
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.e(TAG, "保存缓存失败", e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取模块大小(从缓存)
|
||||||
|
*/
|
||||||
|
fun getModuleSize(dirId: String): Long {
|
||||||
|
return sizeCache[dirId] ?: 0L
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查缓存是否已初始化,如果没有则初始化
|
||||||
|
*/
|
||||||
|
fun initializeCacheIfNeeded(currentModules: List<String>) {
|
||||||
|
val isInitialized = cachePrefs.getBoolean(CACHE_INITIALIZED_KEY, false)
|
||||||
|
if (!isInitialized || sizeCache.isEmpty()) {
|
||||||
|
Log.d(TAG, "首次初始化缓存,计算所有模块大小")
|
||||||
|
refreshCache(currentModules)
|
||||||
|
} else {
|
||||||
|
// 检查是否有新模块需要计算大小
|
||||||
|
val newModules = currentModules.filter { !sizeCache.containsKey(it) }
|
||||||
|
if (newModules.isNotEmpty()) {
|
||||||
|
Log.d(TAG, "发现 ${newModules.size} 个新模块,计算大小: $newModules")
|
||||||
|
for (dirId in newModules) {
|
||||||
|
val size = calculateModuleFolderSize(dirId)
|
||||||
|
sizeCache[dirId] = size
|
||||||
|
Log.d(TAG, "新模块 $dirId 大小: ${formatFileSize(size)}")
|
||||||
|
}
|
||||||
|
saveCacheToPrefs()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 刷新所有模块的大小缓存
|
||||||
|
*/
|
||||||
|
fun refreshCache(currentModules: List<String>) {
|
||||||
|
try {
|
||||||
|
// 清理不存在的模块缓存
|
||||||
|
val toRemove = sizeCache.keys.filter { it !in currentModules }
|
||||||
|
toRemove.forEach { sizeCache.remove(it) }
|
||||||
|
|
||||||
|
if (toRemove.isNotEmpty()) {
|
||||||
|
Log.d(TAG, "清理了 ${toRemove.size} 个不存在的模块缓存: $toRemove")
|
||||||
|
}
|
||||||
|
|
||||||
|
// 计算所有当前模块的大小
|
||||||
|
for (dirId in currentModules) {
|
||||||
|
val size = calculateModuleFolderSize(dirId)
|
||||||
|
sizeCache[dirId] = size
|
||||||
|
Log.d(TAG, "更新模块 $dirId 大小: ${formatFileSize(size)}")
|
||||||
|
}
|
||||||
|
|
||||||
|
// 保存到持久化存储
|
||||||
|
saveCacheToPrefs()
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.e(TAG, "刷新缓存失败", e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 清空所有缓存
|
||||||
|
*/
|
||||||
|
private fun clearCache() {
|
||||||
|
sizeCache.clear()
|
||||||
|
cachePrefs.edit { clear() }
|
||||||
|
Log.d(TAG, "清空所有缓存")
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 实际计算模块文件夹大小
|
||||||
|
*/
|
||||||
|
private fun calculateModuleFolderSize(dirId: String): Long {
|
||||||
|
return try {
|
||||||
|
val shell = getRootShell()
|
||||||
|
val command = "du -sb /data/adb/modules/$dirId"
|
||||||
|
val result = shell.newJob().add(command).to(ArrayList(), null).exec()
|
||||||
|
|
||||||
|
if (result.isSuccess && result.out.isNotEmpty()) {
|
||||||
|
val sizeStr = result.out.firstOrNull()?.split("\t")?.firstOrNull()
|
||||||
|
sizeStr?.toLongOrNull() ?: 0L
|
||||||
|
} else {
|
||||||
|
0L
|
||||||
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.e(TAG, "计算模块大小失败 $dirId: ${e.message}")
|
||||||
|
0L
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 格式化文件大小的工具函数
|
||||||
|
*/
|
||||||
|
fun formatFileSize(bytes: Long): String {
|
||||||
|
if (bytes <= 0) return "0 KB"
|
||||||
|
|
||||||
|
val units = arrayOf("B", "KB", "MB", "GB", "TB")
|
||||||
|
val digitGroups = (log10(bytes.toDouble()) / log10(1024.0)).toInt()
|
||||||
|
|
||||||
|
return DecimalFormat("#,##0.#").format(
|
||||||
|
bytes / 1024.0.pow(digitGroups.toDouble())
|
||||||
|
) + " " + units[digitGroups]
|
||||||
|
}
|
||||||
@@ -1,42 +1,93 @@
|
|||||||
package com.sukisu.ultra.ui.viewmodel
|
package com.sukisu.ultra.ui.viewmodel
|
||||||
|
|
||||||
|
import android.content.ComponentName
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
|
import android.content.Intent
|
||||||
|
import android.content.ServiceConnection
|
||||||
|
import android.content.SharedPreferences
|
||||||
import android.content.pm.ApplicationInfo
|
import android.content.pm.ApplicationInfo
|
||||||
import android.content.pm.PackageInfo
|
import android.content.pm.PackageInfo
|
||||||
|
import android.os.IBinder
|
||||||
import android.os.Parcelable
|
import android.os.Parcelable
|
||||||
import android.os.SystemClock
|
import android.os.SystemClock
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import android.widget.Toast
|
|
||||||
import androidx.compose.runtime.derivedStateOf
|
import androidx.compose.runtime.derivedStateOf
|
||||||
import androidx.compose.runtime.getValue
|
import androidx.compose.runtime.getValue
|
||||||
|
import androidx.compose.runtime.mutableFloatStateOf
|
||||||
import androidx.compose.runtime.mutableStateOf
|
import androidx.compose.runtime.mutableStateOf
|
||||||
import androidx.compose.runtime.setValue
|
import androidx.compose.runtime.setValue
|
||||||
import androidx.lifecycle.ViewModel
|
import androidx.lifecycle.ViewModel
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.withContext
|
import kotlinx.coroutines.withContext
|
||||||
|
import kotlinx.coroutines.async
|
||||||
|
import kotlinx.coroutines.awaitAll
|
||||||
|
import kotlinx.coroutines.supervisorScope
|
||||||
|
import kotlinx.coroutines.sync.Mutex
|
||||||
|
import kotlinx.coroutines.sync.withLock
|
||||||
import kotlinx.parcelize.Parcelize
|
import kotlinx.parcelize.Parcelize
|
||||||
import com.sukisu.ultra.Natives
|
import com.sukisu.ultra.Natives
|
||||||
import com.sukisu.ultra.ksuApp
|
import com.sukisu.ultra.ksuApp
|
||||||
import com.sukisu.ultra.ui.util.HanziToPinyin
|
import com.sukisu.ultra.ui.util.HanziToPinyin
|
||||||
import java.text.Collator
|
import java.text.Collator
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import com.dergoogler.mmrl.platform.Platform
|
import java.util.concurrent.ThreadPoolExecutor
|
||||||
import com.dergoogler.mmrl.platform.TIMEOUT_MILLIS
|
import java.util.concurrent.TimeUnit
|
||||||
import com.sukisu.ultra.ui.webui.getInstalledPackagesAll
|
import java.util.concurrent.LinkedBlockingQueue
|
||||||
import kotlinx.coroutines.delay
|
|
||||||
import kotlinx.coroutines.withTimeoutOrNull
|
|
||||||
import androidx.core.content.edit
|
import androidx.core.content.edit
|
||||||
|
import com.sukisu.ultra.ui.KsuService
|
||||||
|
import com.sukisu.ultra.ui.util.KsuCli
|
||||||
|
import com.topjohnwu.superuser.Shell
|
||||||
|
import kotlinx.coroutines.asCoroutineDispatcher
|
||||||
|
import kotlin.coroutines.resume
|
||||||
|
import kotlin.coroutines.suspendCoroutine
|
||||||
|
|
||||||
|
// 应用分类
|
||||||
|
enum class AppCategory(val displayNameRes: Int, val persistKey: String) {
|
||||||
|
ALL(com.sukisu.ultra.R.string.category_all_apps, "ALL"),
|
||||||
|
ROOT(com.sukisu.ultra.R.string.category_root_apps, "ROOT"),
|
||||||
|
CUSTOM(com.sukisu.ultra.R.string.category_custom_apps, "CUSTOM"),
|
||||||
|
DEFAULT(com.sukisu.ultra.R.string.category_default_apps, "DEFAULT");
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
fun fromPersistKey(key: String): AppCategory {
|
||||||
|
return entries.find { it.persistKey == key } ?: ALL
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 排序方式
|
||||||
|
enum class SortType(val displayNameRes: Int, val persistKey: String) {
|
||||||
|
NAME_ASC(com.sukisu.ultra.R.string.sort_name_asc, "NAME_ASC"),
|
||||||
|
NAME_DESC(com.sukisu.ultra.R.string.sort_name_desc, "NAME_DESC"),
|
||||||
|
INSTALL_TIME_NEW(com.sukisu.ultra.R.string.sort_install_time_new, "INSTALL_TIME_NEW"),
|
||||||
|
INSTALL_TIME_OLD(com.sukisu.ultra.R.string.sort_install_time_old, "INSTALL_TIME_OLD"),
|
||||||
|
SIZE_DESC(com.sukisu.ultra.R.string.sort_size_desc, "SIZE_DESC"),
|
||||||
|
SIZE_ASC(com.sukisu.ultra.R.string.sort_size_asc, "SIZE_ASC"),
|
||||||
|
USAGE_FREQ(com.sukisu.ultra.R.string.sort_usage_freq, "USAGE_FREQ");
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
fun fromPersistKey(key: String): SortType {
|
||||||
|
return entries.find { it.persistKey == key } ?: NAME_ASC
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author ShirkNeko
|
* @author ShirkNeko
|
||||||
* @date 2025/5/31.
|
* @date 2025/5/31.
|
||||||
*/
|
*/
|
||||||
class SuperUserViewModel : ViewModel() {
|
class SuperUserViewModel : ViewModel() {
|
||||||
val isPlatformAlive get() = Platform.isAlive
|
|
||||||
companion object {
|
companion object {
|
||||||
private const val TAG = "SuperUserViewModel"
|
private const val TAG = "SuperUserViewModel"
|
||||||
var apps by mutableStateOf<List<AppInfo>>(emptyList())
|
var apps by mutableStateOf<List<AppInfo>>(emptyList())
|
||||||
|
private const val PREFS_NAME = "settings"
|
||||||
|
private const val KEY_SHOW_SYSTEM_APPS = "show_system_apps"
|
||||||
|
private const val KEY_SELECTED_CATEGORY = "selected_category"
|
||||||
|
private const val KEY_CURRENT_SORT_TYPE = "current_sort_type"
|
||||||
|
private const val CORE_POOL_SIZE = 8
|
||||||
|
private const val MAX_POOL_SIZE = 16
|
||||||
|
private const val KEEP_ALIVE_TIME = 60L
|
||||||
|
private const val BATCH_SIZE = 20
|
||||||
}
|
}
|
||||||
|
|
||||||
@Parcelize
|
@Parcelize
|
||||||
@@ -64,10 +115,35 @@ class SuperUserViewModel : ViewModel() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private val prefs = ksuApp.getSharedPreferences("settings", Context.MODE_PRIVATE)!!
|
|
||||||
|
private val appProcessingThreadPool = ThreadPoolExecutor(
|
||||||
|
CORE_POOL_SIZE,
|
||||||
|
MAX_POOL_SIZE,
|
||||||
|
KEEP_ALIVE_TIME,
|
||||||
|
TimeUnit.SECONDS,
|
||||||
|
LinkedBlockingQueue()
|
||||||
|
) { runnable ->
|
||||||
|
Thread(runnable, "AppProcessing-${System.currentTimeMillis()}").apply {
|
||||||
|
isDaemon = true
|
||||||
|
priority = Thread.NORM_PRIORITY
|
||||||
|
}
|
||||||
|
}.asCoroutineDispatcher()
|
||||||
|
|
||||||
|
private val appListMutex = Mutex()
|
||||||
|
|
||||||
|
private val configChangeListeners = mutableSetOf<(String) -> Unit>()
|
||||||
|
|
||||||
|
private val prefs: SharedPreferences = ksuApp.getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE)
|
||||||
|
|
||||||
var search by mutableStateOf("")
|
var search by mutableStateOf("")
|
||||||
var showSystemApps by mutableStateOf(prefs.getBoolean("show_system_apps", false))
|
|
||||||
|
var showSystemApps by mutableStateOf(loadShowSystemApps())
|
||||||
|
private set
|
||||||
|
|
||||||
|
var selectedCategory by mutableStateOf(loadSelectedCategory())
|
||||||
|
private set
|
||||||
|
|
||||||
|
var currentSortType by mutableStateOf(loadCurrentSortType())
|
||||||
private set
|
private set
|
||||||
var isRefreshing by mutableStateOf(false)
|
var isRefreshing by mutableStateOf(false)
|
||||||
private set
|
private set
|
||||||
@@ -78,9 +154,94 @@ class SuperUserViewModel : ViewModel() {
|
|||||||
var selectedApps by mutableStateOf<Set<String>>(emptySet())
|
var selectedApps by mutableStateOf<Set<String>>(emptySet())
|
||||||
internal set
|
internal set
|
||||||
|
|
||||||
|
// 加载进度状态
|
||||||
|
var loadingProgress by mutableFloatStateOf(0f)
|
||||||
|
private set
|
||||||
|
var loadingMessage by mutableStateOf("")
|
||||||
|
private set
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 从SharedPreferences加载显示系统应用设置
|
||||||
|
*/
|
||||||
|
private fun loadShowSystemApps(): Boolean {
|
||||||
|
return prefs.getBoolean(KEY_SHOW_SYSTEM_APPS, false)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 从SharedPreferences加载选择的应用分类
|
||||||
|
*/
|
||||||
|
private fun loadSelectedCategory(): AppCategory {
|
||||||
|
val categoryKey = prefs.getString(KEY_SELECTED_CATEGORY, AppCategory.ALL.persistKey) ?: AppCategory.ALL.persistKey
|
||||||
|
return AppCategory.fromPersistKey(categoryKey)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 从SharedPreferences加载当前排序方式
|
||||||
|
*/
|
||||||
|
private fun loadCurrentSortType(): SortType {
|
||||||
|
val sortKey = prefs.getString(KEY_CURRENT_SORT_TYPE, SortType.NAME_ASC.persistKey) ?: SortType.NAME_ASC.persistKey
|
||||||
|
return SortType.fromPersistKey(sortKey)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新显示系统应用设置并保存到SharedPreferences
|
||||||
|
*/
|
||||||
fun updateShowSystemApps(newValue: Boolean) {
|
fun updateShowSystemApps(newValue: Boolean) {
|
||||||
showSystemApps = newValue
|
showSystemApps = newValue
|
||||||
prefs.edit { putBoolean("show_system_apps", newValue) }
|
saveShowSystemApps(newValue)
|
||||||
|
notifyAppListChanged()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun notifyAppListChanged() {
|
||||||
|
val currentApps = apps
|
||||||
|
apps = emptyList()
|
||||||
|
apps = currentApps
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新选择的应用分类并保存到SharedPreferences
|
||||||
|
*/
|
||||||
|
fun updateSelectedCategory(newCategory: AppCategory) {
|
||||||
|
selectedCategory = newCategory
|
||||||
|
saveSelectedCategory(newCategory)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新当前排序方式并保存到SharedPreferences
|
||||||
|
*/
|
||||||
|
fun updateCurrentSortType(newSortType: SortType) {
|
||||||
|
currentSortType = newSortType
|
||||||
|
saveCurrentSortType(newSortType)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存显示系统应用设置到SharedPreferences
|
||||||
|
*/
|
||||||
|
private fun saveShowSystemApps(value: Boolean) {
|
||||||
|
prefs.edit {
|
||||||
|
putBoolean(KEY_SHOW_SYSTEM_APPS, value)
|
||||||
|
}
|
||||||
|
Log.d(TAG, "Saved show system apps: $value")
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存选择的应用分类到SharedPreferences
|
||||||
|
*/
|
||||||
|
private fun saveSelectedCategory(category: AppCategory) {
|
||||||
|
prefs.edit {
|
||||||
|
putString(KEY_SELECTED_CATEGORY, category.persistKey)
|
||||||
|
}
|
||||||
|
Log.d(TAG, "Saved selected category: ${category.persistKey}")
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存当前排序方式到SharedPreferences
|
||||||
|
*/
|
||||||
|
private fun saveCurrentSortType(sortType: SortType) {
|
||||||
|
prefs.edit {
|
||||||
|
putString(KEY_CURRENT_SORT_TYPE, sortType.persistKey)
|
||||||
|
}
|
||||||
|
Log.d(TAG, "Saved current sort type: ${sortType.persistKey}")
|
||||||
}
|
}
|
||||||
|
|
||||||
private val sortedList by derivedStateOf {
|
private val sortedList by derivedStateOf {
|
||||||
@@ -97,7 +258,7 @@ class SuperUserViewModel : ViewModel() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
val appList by derivedStateOf {
|
val appList by derivedStateOf {
|
||||||
sortedList.filter {
|
val filtered = sortedList.filter {
|
||||||
it.label.contains(search, true) || it.packageName.contains(
|
it.label.contains(search, true) || it.packageName.contains(
|
||||||
search,
|
search,
|
||||||
true
|
true
|
||||||
@@ -106,6 +267,8 @@ class SuperUserViewModel : ViewModel() {
|
|||||||
}.filter {
|
}.filter {
|
||||||
it.uid == 2000 || showSystemApps || it.packageInfo.applicationInfo!!.flags.and(ApplicationInfo.FLAG_SYSTEM) == 0
|
it.uid == 2000 || showSystemApps || it.packageInfo.applicationInfo!!.flags.and(ApplicationInfo.FLAG_SYSTEM) == 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
filtered
|
||||||
}
|
}
|
||||||
|
|
||||||
// 切换批量操作模式
|
// 切换批量操作模式
|
||||||
@@ -138,19 +301,14 @@ class SuperUserViewModel : ViewModel() {
|
|||||||
val profile = Natives.getAppProfile(packageName, it.uid)
|
val profile = Natives.getAppProfile(packageName, it.uid)
|
||||||
val updatedProfile = profile.copy(allowSu = allowSu)
|
val updatedProfile = profile.copy(allowSu = allowSu)
|
||||||
if (Natives.setAppProfile(updatedProfile)) {
|
if (Natives.setAppProfile(updatedProfile)) {
|
||||||
apps = apps.map { app ->
|
updateAppProfileLocally(packageName, updatedProfile)
|
||||||
if (app.packageName == packageName) {
|
notifyConfigChange(packageName)
|
||||||
app.copy(profile = updatedProfile)
|
|
||||||
} else {
|
|
||||||
app
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
clearSelection()
|
clearSelection()
|
||||||
showBatchActions = false // 批量操作完成后退出批量模式
|
showBatchActions = false
|
||||||
fetchAppList() // 刷新列表以显示最新状态
|
refreshAppConfigurations()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 批量更新权限和umount模块设置
|
// 批量更新权限和umount模块设置
|
||||||
@@ -165,6 +323,21 @@ class SuperUserViewModel : ViewModel() {
|
|||||||
nonRootUseDefault = false
|
nonRootUseDefault = false
|
||||||
)
|
)
|
||||||
if (Natives.setAppProfile(updatedProfile)) {
|
if (Natives.setAppProfile(updatedProfile)) {
|
||||||
|
updateAppProfileLocally(packageName, updatedProfile)
|
||||||
|
notifyConfigChange(packageName)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
clearSelection()
|
||||||
|
showBatchActions = false
|
||||||
|
refreshAppConfigurations()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新本地应用配置
|
||||||
|
fun updateAppProfileLocally(packageName: String, updatedProfile: Natives.Profile) {
|
||||||
|
appListMutex.tryLock().let { locked ->
|
||||||
|
if (locked) {
|
||||||
|
try {
|
||||||
apps = apps.map { app ->
|
apps = apps.map { app ->
|
||||||
if (app.packageName == packageName) {
|
if (app.packageName == packageName) {
|
||||||
app.copy(profile = updatedProfile)
|
app.copy(profile = updatedProfile)
|
||||||
@@ -172,52 +345,175 @@ class SuperUserViewModel : ViewModel() {
|
|||||||
app
|
app
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} finally {
|
||||||
|
appListMutex.unlock()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
clearSelection()
|
|
||||||
showBatchActions = false // 批量操作完成后退出批量模式
|
|
||||||
fetchAppList() // 刷新列表以显示最新状态
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 更新本地应用配置
|
private fun notifyConfigChange(packageName: String) {
|
||||||
fun updateAppProfileLocally(packageName: String, updatedProfile: Natives.Profile) {
|
configChangeListeners.forEach { listener ->
|
||||||
apps = apps.map { app ->
|
try {
|
||||||
if (app.packageName == packageName) {
|
listener(packageName)
|
||||||
app.copy(profile = updatedProfile)
|
} catch (e: Exception) {
|
||||||
} else {
|
Log.e(TAG, "Error notifying config change for $packageName", e)
|
||||||
app
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 刷新应用配置状态
|
||||||
|
*/
|
||||||
|
suspend fun refreshAppConfigurations() {
|
||||||
|
withContext(appProcessingThreadPool) {
|
||||||
|
supervisorScope {
|
||||||
|
val currentApps = apps.toList()
|
||||||
|
val batches = currentApps.chunked(BATCH_SIZE)
|
||||||
|
|
||||||
|
loadingProgress = 0f
|
||||||
|
|
||||||
|
val updatedApps = batches.mapIndexed { batchIndex, batch ->
|
||||||
|
async {
|
||||||
|
val batchResult = batch.map { app ->
|
||||||
|
try {
|
||||||
|
val updatedProfile = Natives.getAppProfile(app.packageName, app.uid)
|
||||||
|
app.copy(profile = updatedProfile)
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.e(TAG, "Error refreshing profile for ${app.packageName}", e)
|
||||||
|
app
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
val progress = (batchIndex + 1).toFloat() / batches.size
|
||||||
|
loadingProgress = progress
|
||||||
|
|
||||||
|
batchResult
|
||||||
|
}
|
||||||
|
}.awaitAll().flatten()
|
||||||
|
|
||||||
|
appListMutex.withLock {
|
||||||
|
apps = updatedApps
|
||||||
|
}
|
||||||
|
|
||||||
|
loadingProgress = 1f
|
||||||
|
|
||||||
|
Log.i(TAG, "Refreshed configurations for ${updatedApps.size} apps")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private var serviceConnection: ServiceConnection? = null
|
||||||
|
|
||||||
|
private suspend fun connectKsuService(
|
||||||
|
onDisconnect: () -> Unit = {}
|
||||||
|
): IBinder? = suspendCoroutine { continuation ->
|
||||||
|
val connection = object : ServiceConnection {
|
||||||
|
override fun onServiceDisconnected(name: ComponentName?) {
|
||||||
|
onDisconnect()
|
||||||
|
serviceConnection = null
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onServiceConnected(name: ComponentName?, binder: IBinder?) {
|
||||||
|
continuation.resume(binder)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
serviceConnection = connection
|
||||||
|
val intent = Intent(ksuApp, KsuService::class.java)
|
||||||
|
|
||||||
|
try {
|
||||||
|
val task = com.topjohnwu.superuser.ipc.RootService.bindOrTask(
|
||||||
|
intent,
|
||||||
|
Shell.EXECUTOR,
|
||||||
|
connection
|
||||||
|
)
|
||||||
|
val shell = KsuCli.SHELL
|
||||||
|
task?.let { shell.execTask(it) }
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.e(TAG, "Failed to bind KsuService", e)
|
||||||
|
continuation.resume(null)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun stopKsuService() {
|
||||||
|
serviceConnection?.let { connection ->
|
||||||
|
try {
|
||||||
|
val intent = Intent(ksuApp, KsuService::class.java)
|
||||||
|
com.topjohnwu.superuser.ipc.RootService.stop(intent)
|
||||||
|
serviceConnection = null
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.e(TAG, "Failed to stop KsuService", e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun fetchAppList() {
|
suspend fun fetchAppList() {
|
||||||
isRefreshing = true
|
isRefreshing = true
|
||||||
|
loadingProgress = 0f
|
||||||
|
|
||||||
|
val result = connectKsuService {
|
||||||
|
Log.w(TAG, "KsuService disconnected")
|
||||||
|
}
|
||||||
|
|
||||||
|
if (result == null) {
|
||||||
|
Log.e(TAG, "Failed to connect to KsuService")
|
||||||
|
isRefreshing = false
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
withContext(Dispatchers.IO) {
|
withContext(Dispatchers.IO) {
|
||||||
withTimeoutOrNull(TIMEOUT_MILLIS) {
|
|
||||||
while (!isPlatformAlive) {
|
|
||||||
delay(500)
|
|
||||||
}
|
|
||||||
} ?: return@withContext // Exit early if timeout
|
|
||||||
val pm = ksuApp.packageManager
|
val pm = ksuApp.packageManager
|
||||||
val start = SystemClock.elapsedRealtime()
|
val start = SystemClock.elapsedRealtime()
|
||||||
|
|
||||||
val packages = Platform.getInstalledPackagesAll {
|
try {
|
||||||
Log.e(TAG, "getInstalledPackagesAll:", it)
|
val service = KsuService.Stub.asInterface(result)
|
||||||
Toast.makeText(ksuApp, "Something went wrong, check logs", Toast.LENGTH_SHORT).show()
|
val allPackages = service?.getPackages(0)
|
||||||
|
|
||||||
|
withContext(Dispatchers.Main) {
|
||||||
|
stopKsuService()
|
||||||
|
}
|
||||||
|
loadingProgress = 0.3f
|
||||||
|
|
||||||
|
val packages = allPackages?.list ?: emptyList()
|
||||||
|
|
||||||
|
apps = packages.map { packageInfo ->
|
||||||
|
val appInfo = packageInfo.applicationInfo!!
|
||||||
|
val uid = appInfo.uid
|
||||||
|
val profile = Natives.getAppProfile(packageInfo.packageName, uid)
|
||||||
|
AppInfo(
|
||||||
|
label = appInfo.loadLabel(pm).toString(),
|
||||||
|
packageInfo = packageInfo,
|
||||||
|
profile = profile,
|
||||||
|
)
|
||||||
|
}.filter { it.packageName != ksuApp.packageName }
|
||||||
|
|
||||||
|
loadingProgress = 1f
|
||||||
|
|
||||||
|
Log.i(TAG, "load cost: ${SystemClock.elapsedRealtime() - start}")
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.e(TAG, "Error fetching app list", e)
|
||||||
|
withContext(Dispatchers.Main) {
|
||||||
|
stopKsuService()
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
isRefreshing = false
|
||||||
|
loadingProgress = 0f
|
||||||
|
loadingMessage = ""
|
||||||
}
|
}
|
||||||
apps = packages.map {
|
}
|
||||||
val appInfo = it.applicationInfo
|
}
|
||||||
val uid = appInfo!!.uid
|
/**
|
||||||
val profile = Natives.getAppProfile(it.packageName, uid)
|
* 清理资源
|
||||||
AppInfo(
|
*/
|
||||||
label = appInfo.loadLabel(pm).toString(),
|
override fun onCleared() {
|
||||||
packageInfo = it,
|
super.onCleared()
|
||||||
profile = profile,
|
try {
|
||||||
)
|
stopKsuService()
|
||||||
}.filter { it.packageName != ksuApp.packageName }
|
appProcessingThreadPool.close()
|
||||||
Log.i(TAG, "load cost: ${SystemClock.elapsedRealtime() - start}")
|
configChangeListeners.clear()
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.e(TAG, "Error cleaning up resources", e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -41,10 +41,10 @@ class WebUIActivity : ComponentActivity() {
|
|||||||
val name = intent.getStringExtra("name")!!
|
val name = intent.getStringExtra("name")!!
|
||||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) {
|
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) {
|
||||||
@Suppress("DEPRECATION")
|
@Suppress("DEPRECATION")
|
||||||
setTaskDescription(ActivityManager.TaskDescription("KernelSU - $name"))
|
setTaskDescription(ActivityManager.TaskDescription("SukiSU-Ultra - $name"))
|
||||||
} else {
|
} else {
|
||||||
val taskDescription =
|
val taskDescription =
|
||||||
ActivityManager.TaskDescription.Builder().setLabel("KernelSU - $name").build()
|
ActivityManager.TaskDescription.Builder().setLabel("SukiSU-Ultra - $name").build()
|
||||||
setTaskDescription(taskDescription)
|
setTaskDescription(taskDescription)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ class WebUIXActivity : ComponentActivity() {
|
|||||||
val osVersion = Build.VERSION.RELEASE
|
val osVersion = Build.VERSION.RELEASE
|
||||||
val deviceModel = Build.MODEL
|
val deviceModel = Build.MODEL
|
||||||
|
|
||||||
return "SukiSU /$ksuVersion (Linux; Android $osVersion; $deviceModel; $platform/$platformVersion)"
|
return "SukiSU-Ultra /$ksuVersion (Linux; Android $osVersion; $deviceModel; $platform/$platformVersion)"
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
@@ -59,10 +59,10 @@ class WebUIXActivity : ComponentActivity() {
|
|||||||
val name = intent.getStringExtra("name")!!
|
val name = intent.getStringExtra("name")!!
|
||||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) {
|
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) {
|
||||||
@Suppress("DEPRECATION")
|
@Suppress("DEPRECATION")
|
||||||
setTaskDescription(ActivityManager.TaskDescription("KernelSU - $name"))
|
setTaskDescription(ActivityManager.TaskDescription("SukiSU-Ultra - $name"))
|
||||||
} else {
|
} else {
|
||||||
val taskDescription =
|
val taskDescription =
|
||||||
ActivityManager.TaskDescription.Builder().setLabel("KernelSU - $name").build()
|
ActivityManager.TaskDescription.Builder().setLabel("SukiSU-Ultra - $name").build()
|
||||||
setTaskDescription(taskDescription)
|
setTaskDescription(taskDescription)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,10 +19,12 @@ public class UltraShellHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isPathExists(String path) {
|
public static boolean isPathExists(String path) {
|
||||||
return runCmd("file " + path).contains("No such file or directory");
|
String result = runCmd("test -f '" + path + "' && echo 'exists'");
|
||||||
|
return result.contains("exists");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void CopyFileTo(String path, String target) {
|
public static boolean CopyFileTo(String path, String target) {
|
||||||
runCmd("cp -f " + path + " " + target);
|
String result = runCmd("cp -f '" + path + "' '" + target + "' 2>&1");
|
||||||
|
return !result.contains("cp: ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -287,16 +287,10 @@ class HorizonKernelWorker(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun runCommand(su: Boolean, cmd: String): Int {
|
private fun runCommand(su: Boolean, cmd: String): Int {
|
||||||
val process = ProcessBuilder(if (su) "su" else "sh")
|
val shell = if (su) "su" else "sh"
|
||||||
.redirectErrorStream(true)
|
val process = Runtime.getRuntime().exec(arrayOf(shell, "-c", cmd))
|
||||||
.start()
|
|
||||||
|
|
||||||
return try {
|
return try {
|
||||||
process.outputStream.bufferedWriter().use { writer ->
|
|
||||||
writer.write("$cmd\n")
|
|
||||||
writer.write("exit\n")
|
|
||||||
writer.flush()
|
|
||||||
}
|
|
||||||
process.waitFor()
|
process.waitFor()
|
||||||
} finally {
|
} finally {
|
||||||
process.destroy()
|
process.destroy()
|
||||||
@@ -304,16 +298,10 @@ class HorizonKernelWorker(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun runCommandGetOutput(su: Boolean, cmd: String): String? {
|
private fun runCommandGetOutput(su: Boolean, cmd: String): String? {
|
||||||
val process = ProcessBuilder(if (su) "su" else "sh")
|
val shell = if (su) "su" else "sh"
|
||||||
.redirectErrorStream(true)
|
val process = Runtime.getRuntime().exec(arrayOf(shell, "-c", cmd))
|
||||||
.start()
|
|
||||||
|
|
||||||
return try {
|
return try {
|
||||||
process.outputStream.bufferedWriter().use { writer ->
|
|
||||||
writer.write("$cmd\n")
|
|
||||||
writer.write("exit\n")
|
|
||||||
writer.flush()
|
|
||||||
}
|
|
||||||
process.inputStream.bufferedReader().use { reader ->
|
process.inputStream.bufferedReader().use { reader ->
|
||||||
reader.readText().trim()
|
reader.readText().trim()
|
||||||
}
|
}
|
||||||
@@ -326,7 +314,7 @@ class HorizonKernelWorker(
|
|||||||
|
|
||||||
private fun rootAvailable(): Boolean {
|
private fun rootAvailable(): Boolean {
|
||||||
return try {
|
return try {
|
||||||
val process = Runtime.getRuntime().exec("su -c id")
|
val process = Runtime.getRuntime().exec("su -c true")
|
||||||
val exitValue = process.waitFor()
|
val exitValue = process.waitFor()
|
||||||
exitValue == 0
|
exitValue == 0
|
||||||
} catch (_: Exception) {
|
} catch (_: Exception) {
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package zako.zako.zako.zakoui.screen
|
package zako.zako.zako.zakoui.screen
|
||||||
|
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import android.app.Activity
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.content.res.Configuration
|
import android.content.res.Configuration
|
||||||
@@ -61,7 +60,6 @@ import com.ramcosta.composedestinations.annotation.Destination
|
|||||||
import com.ramcosta.composedestinations.annotation.RootGraph
|
import com.ramcosta.composedestinations.annotation.RootGraph
|
||||||
import com.sukisu.ultra.Natives
|
import com.sukisu.ultra.Natives
|
||||||
import com.sukisu.ultra.R
|
import com.sukisu.ultra.R
|
||||||
import com.sukisu.ultra.ui.MainActivity
|
|
||||||
import com.sukisu.ultra.ui.component.ImageEditorDialog
|
import com.sukisu.ultra.ui.component.ImageEditorDialog
|
||||||
import com.sukisu.ultra.ui.component.KsuIsValid
|
import com.sukisu.ultra.ui.component.KsuIsValid
|
||||||
import com.sukisu.ultra.ui.theme.CardConfig.cardElevation
|
import com.sukisu.ultra.ui.theme.CardConfig.cardElevation
|
||||||
@@ -75,11 +73,13 @@ import kotlin.math.roundToInt
|
|||||||
import androidx.compose.foundation.border
|
import androidx.compose.foundation.border
|
||||||
import androidx.compose.foundation.layout.height
|
import androidx.compose.foundation.layout.height
|
||||||
import androidx.compose.foundation.shape.CircleShape
|
import androidx.compose.foundation.shape.CircleShape
|
||||||
|
import androidx.compose.foundation.text.KeyboardOptions
|
||||||
import androidx.compose.material.icons.automirrored.filled.ArrowBack
|
import androidx.compose.material.icons.automirrored.filled.ArrowBack
|
||||||
import androidx.compose.material.icons.automirrored.filled.NavigateNext
|
import androidx.compose.material.icons.automirrored.filled.NavigateNext
|
||||||
import androidx.compose.material3.Card
|
import androidx.compose.material3.Card
|
||||||
import androidx.compose.material3.HorizontalDivider
|
import androidx.compose.material3.HorizontalDivider
|
||||||
import androidx.compose.material3.IconButton
|
import androidx.compose.material3.IconButton
|
||||||
|
import androidx.compose.material3.OutlinedTextField
|
||||||
import androidx.compose.material3.Switch
|
import androidx.compose.material3.Switch
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.ui.graphics.vector.ImageVector
|
import androidx.compose.ui.graphics.vector.ImageVector
|
||||||
@@ -88,6 +88,7 @@ import com.sukisu.ultra.ui.theme.getCardElevation
|
|||||||
import androidx.compose.material3.RadioButton
|
import androidx.compose.material3.RadioButton
|
||||||
import androidx.compose.material3.TextButton
|
import androidx.compose.material3.TextButton
|
||||||
import androidx.compose.runtime.saveable.rememberSaveable
|
import androidx.compose.runtime.saveable.rememberSaveable
|
||||||
|
import androidx.compose.ui.text.input.KeyboardType
|
||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
import com.ramcosta.composedestinations.navigation.DestinationsNavigator
|
import com.ramcosta.composedestinations.navigation.DestinationsNavigator
|
||||||
import com.sukisu.ultra.ksuApp
|
import com.sukisu.ultra.ksuApp
|
||||||
@@ -147,6 +148,13 @@ fun MoreSettingsScreen(
|
|||||||
var showDpiConfirmDialog by remember { mutableStateOf(false) }
|
var showDpiConfirmDialog by remember { mutableStateOf(false) }
|
||||||
var showImageEditor by remember { mutableStateOf(false) }
|
var showImageEditor by remember { mutableStateOf(false) }
|
||||||
|
|
||||||
|
// 动态管理器配置状态
|
||||||
|
var dynamicSignConfig by remember { mutableStateOf<Natives.DynamicManagerConfig?>(null) }
|
||||||
|
var isDynamicSignEnabled by remember { mutableStateOf(false) }
|
||||||
|
var dynamicSignSize by remember { mutableStateOf("") }
|
||||||
|
var dynamicSignHash by remember { mutableStateOf("") }
|
||||||
|
var showDynamicSignDialog by remember { mutableStateOf(false) }
|
||||||
|
|
||||||
// 主题模式选项
|
// 主题模式选项
|
||||||
val themeOptions = listOf(
|
val themeOptions = listOf(
|
||||||
stringResource(R.string.theme_follow_system),
|
stringResource(R.string.theme_follow_system),
|
||||||
@@ -224,6 +232,11 @@ fun MoreSettingsScreen(
|
|||||||
mutableStateOf(prefs.getBoolean("show_kpm_info", false))
|
mutableStateOf(prefs.getBoolean("show_kpm_info", false))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 隐藏 Zygisk 状态开关状态
|
||||||
|
var isHideZygiskImplement by remember {
|
||||||
|
mutableStateOf(prefs.getBoolean("is_hide_zygisk_Implement", false))
|
||||||
|
}
|
||||||
|
|
||||||
// 隐藏SuSFS状态开关状态
|
// 隐藏SuSFS状态开关状态
|
||||||
var isHideSusfsStatus by remember {
|
var isHideSusfsStatus by remember {
|
||||||
mutableStateOf(prefs.getBoolean("is_hide_susfs_status", false))
|
mutableStateOf(prefs.getBoolean("is_hide_susfs_status", false))
|
||||||
@@ -234,6 +247,21 @@ fun MoreSettingsScreen(
|
|||||||
mutableStateOf(prefs.getBoolean("is_hide_link_card", false))
|
mutableStateOf(prefs.getBoolean("is_hide_link_card", false))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 隐藏标签行开关状态
|
||||||
|
var isHideTagRow by remember {
|
||||||
|
mutableStateOf(prefs.getBoolean("is_hide_tag_row", false))
|
||||||
|
}
|
||||||
|
|
||||||
|
// 内核版本简洁模式开关状态
|
||||||
|
var isKernelSimpleMode by remember {
|
||||||
|
mutableStateOf(prefs.getBoolean("is_kernel_simple_mode", false))
|
||||||
|
}
|
||||||
|
|
||||||
|
// 显示更多模块信息开关状态
|
||||||
|
var showMoreModuleInfo by remember {
|
||||||
|
mutableStateOf(prefs.getBoolean("show_more_module_info", false))
|
||||||
|
}
|
||||||
|
|
||||||
// SELinux状态
|
// SELinux状态
|
||||||
var selinuxEnabled by remember {
|
var selinuxEnabled by remember {
|
||||||
mutableStateOf(Shell.cmd("getenforce").exec().out.firstOrNull() == "Enforcing")
|
mutableStateOf(Shell.cmd("getenforce").exec().out.firstOrNull() == "Enforcing")
|
||||||
@@ -286,6 +314,12 @@ fun MoreSettingsScreen(
|
|||||||
isSimpleMode = newValue
|
isSimpleMode = newValue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 内核版本简洁模式开关状态
|
||||||
|
val onKernelSimpleModeChange = { newValue: Boolean ->
|
||||||
|
prefs.edit { putBoolean("is_kernel_simple_mode", newValue) }
|
||||||
|
isKernelSimpleMode = newValue
|
||||||
|
}
|
||||||
|
|
||||||
// 隐藏内核版本号开关状态
|
// 隐藏内核版本号开关状态
|
||||||
val onHideVersionChange = { newValue: Boolean ->
|
val onHideVersionChange = { newValue: Boolean ->
|
||||||
prefs.edit { putBoolean("is_hide_version", newValue) }
|
prefs.edit { putBoolean("is_hide_version", newValue) }
|
||||||
@@ -310,12 +344,30 @@ fun MoreSettingsScreen(
|
|||||||
isHideSusfsStatus = newValue
|
isHideSusfsStatus = newValue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val onHideZygiskImplement = { newValue: Boolean ->
|
||||||
|
prefs.edit { putBoolean("is_hide_zygisk_Implement", newValue) }
|
||||||
|
isHideZygiskImplement = newValue
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// 隐藏链接状态开关状态
|
// 隐藏链接状态开关状态
|
||||||
val onHideLinkCardChange = { newValue: Boolean ->
|
val onHideLinkCardChange = { newValue: Boolean ->
|
||||||
prefs.edit { putBoolean("is_hide_link_card", newValue) }
|
prefs.edit { putBoolean("is_hide_link_card", newValue) }
|
||||||
isHideLinkCard = newValue
|
isHideLinkCard = newValue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 隐藏标签行开关状态
|
||||||
|
val onHideTagRowChange = { newValue: Boolean ->
|
||||||
|
prefs.edit { putBoolean("is_hide_tag_row", newValue) }
|
||||||
|
isHideTagRow = newValue
|
||||||
|
}
|
||||||
|
|
||||||
|
// 显示更多模块信息开关状态
|
||||||
|
val onShowMoreModuleInfoChange = { newValue: Boolean ->
|
||||||
|
prefs.edit { putBoolean("show_more_module_info", newValue) }
|
||||||
|
showMoreModuleInfo = newValue
|
||||||
|
}
|
||||||
|
|
||||||
// 备用图标开关状态
|
// 备用图标开关状态
|
||||||
val onUseAltIconChange = { newValue: Boolean ->
|
val onUseAltIconChange = { newValue: Boolean ->
|
||||||
prefs.edit { putBoolean("use_alt_icon", newValue) }
|
prefs.edit { putBoolean("use_alt_icon", newValue) }
|
||||||
@@ -621,6 +673,167 @@ fun MoreSettingsScreen(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LaunchedEffect(Unit) {
|
||||||
|
// 初始化动态管理器配置
|
||||||
|
dynamicSignConfig = Natives.getDynamicManager()
|
||||||
|
dynamicSignConfig?.let { config ->
|
||||||
|
if (config.isValid()) {
|
||||||
|
isDynamicSignEnabled = true
|
||||||
|
dynamicSignSize = config.size.toString()
|
||||||
|
dynamicSignHash = config.hash
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun parseDynamicSignSize(input: String): Int? {
|
||||||
|
return try {
|
||||||
|
when {
|
||||||
|
input.startsWith("0x", true) -> input.substring(2).toInt(16)
|
||||||
|
else -> input.toInt()
|
||||||
|
}
|
||||||
|
} catch (_: NumberFormatException) {
|
||||||
|
null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 动态管理器配置对话框
|
||||||
|
if (showDynamicSignDialog) {
|
||||||
|
AlertDialog(
|
||||||
|
onDismissRequest = { showDynamicSignDialog = false },
|
||||||
|
title = { Text(stringResource(R.string.dynamic_manager_title)) },
|
||||||
|
text = {
|
||||||
|
Column(
|
||||||
|
modifier = Modifier.verticalScroll(rememberScrollState())
|
||||||
|
) {
|
||||||
|
// 启用开关
|
||||||
|
Row(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.clickable { isDynamicSignEnabled = !isDynamicSignEnabled }
|
||||||
|
.padding(vertical = 8.dp),
|
||||||
|
verticalAlignment = Alignment.CenterVertically
|
||||||
|
) {
|
||||||
|
Switch(
|
||||||
|
checked = isDynamicSignEnabled,
|
||||||
|
onCheckedChange = { isDynamicSignEnabled = it }
|
||||||
|
)
|
||||||
|
Spacer(modifier = Modifier.width(12.dp))
|
||||||
|
Text(stringResource(R.string.enable_dynamic_manager))
|
||||||
|
}
|
||||||
|
|
||||||
|
Spacer(modifier = Modifier.height(16.dp))
|
||||||
|
|
||||||
|
// 签名大小输入
|
||||||
|
OutlinedTextField(
|
||||||
|
value = dynamicSignSize,
|
||||||
|
onValueChange = { input ->
|
||||||
|
val isValid = when {
|
||||||
|
input.isEmpty() -> true
|
||||||
|
input.matches(Regex("^\\d+$")) -> true
|
||||||
|
input.matches(Regex("^0[xX][0-9a-fA-F]*$")) -> true
|
||||||
|
else -> false
|
||||||
|
}
|
||||||
|
if (isValid) {
|
||||||
|
dynamicSignSize = input
|
||||||
|
}
|
||||||
|
},
|
||||||
|
label = { Text(stringResource(R.string.signature_size)) },
|
||||||
|
enabled = isDynamicSignEnabled,
|
||||||
|
modifier = Modifier.fillMaxWidth(),
|
||||||
|
singleLine = true,
|
||||||
|
keyboardOptions = KeyboardOptions(
|
||||||
|
keyboardType = KeyboardType.Text
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
Spacer(modifier = Modifier.height(12.dp))
|
||||||
|
|
||||||
|
// 签名哈希输入
|
||||||
|
OutlinedTextField(
|
||||||
|
value = dynamicSignHash,
|
||||||
|
onValueChange = { hash ->
|
||||||
|
if (hash.all { it in '0'..'9' || it in 'a'..'f' || it in 'A'..'F' }) {
|
||||||
|
dynamicSignHash = hash
|
||||||
|
}
|
||||||
|
},
|
||||||
|
label = { Text(stringResource(R.string.signature_hash)) },
|
||||||
|
enabled = isDynamicSignEnabled,
|
||||||
|
modifier = Modifier.fillMaxWidth(),
|
||||||
|
singleLine = true,
|
||||||
|
supportingText = {
|
||||||
|
Text(stringResource(R.string.hash_must_be_64_chars))
|
||||||
|
},
|
||||||
|
isError = isDynamicSignEnabled && dynamicSignHash.isNotEmpty() && dynamicSignHash.length != 64
|
||||||
|
)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
confirmButton = {
|
||||||
|
Button(
|
||||||
|
onClick = {
|
||||||
|
if (isDynamicSignEnabled) {
|
||||||
|
val size = parseDynamicSignSize(dynamicSignSize)
|
||||||
|
if (size != null && size > 0 && dynamicSignHash.length == 64) {
|
||||||
|
val success = Natives.setDynamicManager(size, dynamicSignHash)
|
||||||
|
if (success) {
|
||||||
|
dynamicSignConfig = Natives.DynamicManagerConfig(size, dynamicSignHash)
|
||||||
|
Toast.makeText(
|
||||||
|
context,
|
||||||
|
context.getString(R.string.dynamic_manager_set_success),
|
||||||
|
Toast.LENGTH_SHORT
|
||||||
|
).show()
|
||||||
|
} else {
|
||||||
|
Toast.makeText(
|
||||||
|
context,
|
||||||
|
context.getString(R.string.dynamic_manager_set_failed),
|
||||||
|
Toast.LENGTH_SHORT
|
||||||
|
).show()
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Toast.makeText(
|
||||||
|
context,
|
||||||
|
context.getString(R.string.invalid_sign_config),
|
||||||
|
Toast.LENGTH_SHORT
|
||||||
|
).show()
|
||||||
|
return@Button
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
val success = Natives.clearDynamicManager()
|
||||||
|
if (success) {
|
||||||
|
dynamicSignConfig = null
|
||||||
|
dynamicSignSize = ""
|
||||||
|
dynamicSignHash = ""
|
||||||
|
Toast.makeText(
|
||||||
|
context,
|
||||||
|
context.getString(R.string.dynamic_manager_disabled_success),
|
||||||
|
Toast.LENGTH_SHORT
|
||||||
|
).show()
|
||||||
|
} else {
|
||||||
|
Toast.makeText(
|
||||||
|
context,
|
||||||
|
context.getString(R.string.dynamic_manager_clear_failed),
|
||||||
|
Toast.LENGTH_SHORT
|
||||||
|
).show()
|
||||||
|
return@Button
|
||||||
|
}
|
||||||
|
}
|
||||||
|
showDynamicSignDialog = false
|
||||||
|
},
|
||||||
|
enabled = if (isDynamicSignEnabled) {
|
||||||
|
parseDynamicSignSize(dynamicSignSize)?.let { it > 0 } == true &&
|
||||||
|
dynamicSignHash.length == 64
|
||||||
|
} else true
|
||||||
|
) {
|
||||||
|
Text(stringResource(R.string.confirm))
|
||||||
|
}
|
||||||
|
},
|
||||||
|
dismissButton = {
|
||||||
|
TextButton(onClick = { showDynamicSignDialog = false }) {
|
||||||
|
Text(stringResource(R.string.cancel))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
Scaffold(
|
Scaffold(
|
||||||
modifier = Modifier.nestedScroll(scrollBehavior.nestedScrollConnection),
|
modifier = Modifier.nestedScroll(scrollBehavior.nestedScrollConnection),
|
||||||
topBar = {
|
topBar = {
|
||||||
@@ -1026,6 +1239,15 @@ fun MoreSettingsScreen(
|
|||||||
onChange = onUseAltIconChange
|
onChange = onUseAltIconChange
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// 显示更多模块信息开关
|
||||||
|
SwitchSettingItem(
|
||||||
|
icon = Icons.Filled.Info,
|
||||||
|
title = stringResource(R.string.show_more_module_info),
|
||||||
|
summary = stringResource(R.string.show_more_module_info_summary),
|
||||||
|
checked = showMoreModuleInfo,
|
||||||
|
onChange = onShowMoreModuleInfoChange
|
||||||
|
)
|
||||||
|
|
||||||
// 添加简洁模式开关
|
// 添加简洁模式开关
|
||||||
SwitchSettingItem(
|
SwitchSettingItem(
|
||||||
icon = Icons.Filled.Brush,
|
icon = Icons.Filled.Brush,
|
||||||
@@ -1035,6 +1257,14 @@ fun MoreSettingsScreen(
|
|||||||
onChange = onSimpleModeChange
|
onChange = onSimpleModeChange
|
||||||
)
|
)
|
||||||
|
|
||||||
|
SwitchSettingItem(
|
||||||
|
icon = Icons.Filled.Brush,
|
||||||
|
title = stringResource(R.string.kernel_simple_kernel),
|
||||||
|
summary = stringResource(R.string.kernel_simple_kernel_summary),
|
||||||
|
checked = isKernelSimpleMode,
|
||||||
|
onChange = onKernelSimpleModeChange
|
||||||
|
)
|
||||||
|
|
||||||
// 隐藏内核部分版本号
|
// 隐藏内核部分版本号
|
||||||
SwitchSettingItem(
|
SwitchSettingItem(
|
||||||
icon = Icons.Filled.VisibilityOff,
|
icon = Icons.Filled.VisibilityOff,
|
||||||
@@ -1062,6 +1292,15 @@ fun MoreSettingsScreen(
|
|||||||
onChange = onHideSusfsStatusChange
|
onChange = onHideSusfsStatusChange
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Zygsik 实现状态信息
|
||||||
|
SwitchSettingItem(
|
||||||
|
icon = Icons.Filled.VisibilityOff,
|
||||||
|
title = stringResource(R.string.hide_zygisk_implement),
|
||||||
|
summary = stringResource(R.string.hide_zygisk_implement_summary),
|
||||||
|
checked = isHideZygiskImplement,
|
||||||
|
onChange = onHideZygiskImplement
|
||||||
|
)
|
||||||
|
|
||||||
if (Natives.version >= Natives.MINIMAL_SUPPORTED_KPM) {
|
if (Natives.version >= Natives.MINIMAL_SUPPORTED_KPM) {
|
||||||
// 隐藏KPM开关
|
// 隐藏KPM开关
|
||||||
SwitchSettingItem(
|
SwitchSettingItem(
|
||||||
@@ -1081,14 +1320,22 @@ fun MoreSettingsScreen(
|
|||||||
checked = isHideLinkCard,
|
checked = isHideLinkCard,
|
||||||
onChange = onHideLinkCardChange
|
onChange = onHideLinkCardChange
|
||||||
)
|
)
|
||||||
}
|
|
||||||
|
|
||||||
// 高级设置
|
// 隐藏标签行
|
||||||
SettingsCard(
|
SwitchSettingItem(
|
||||||
title = stringResource(R.string.advanced_settings)
|
icon = Icons.Filled.VisibilityOff,
|
||||||
) {
|
title = stringResource(R.string.hide_tag_card),
|
||||||
// SELinux 开关
|
summary = stringResource(R.string.hide_tag_card_summary),
|
||||||
KsuIsValid {
|
checked = isHideTagRow,
|
||||||
|
onChange = onHideTagRowChange
|
||||||
|
)
|
||||||
|
}
|
||||||
|
KsuIsValid {
|
||||||
|
// 高级设置
|
||||||
|
SettingsCard(
|
||||||
|
title = stringResource(R.string.advanced_settings)
|
||||||
|
) {
|
||||||
|
// SELinux 开关
|
||||||
SwitchSettingItem(
|
SwitchSettingItem(
|
||||||
icon = Icons.Filled.Security,
|
icon = Icons.Filled.Security,
|
||||||
title = stringResource(R.string.selinux),
|
title = stringResource(R.string.selinux),
|
||||||
@@ -1119,57 +1366,73 @@ fun MoreSettingsScreen(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
|
||||||
|
|
||||||
// SuSFS 配置(仅在支持时显示)
|
// SuSFS 开关(仅在支持时显示)
|
||||||
val suSFS = getSuSFS()
|
val suSFS = getSuSFS()
|
||||||
val isSUS_SU = getSuSFSFeatures()
|
val isSUS_SU = getSuSFSFeatures()
|
||||||
if (suSFS == "Supported" && isSUS_SU == "CONFIG_KSU_SUSFS_SUS_SU") {
|
if (suSFS == "Supported" && isSUS_SU == "CONFIG_KSU_SUSFS_SUS_SU") {
|
||||||
// 默认启用
|
// 默认启用
|
||||||
var isEnabled by rememberSaveable {
|
var isEnabled by rememberSaveable {
|
||||||
mutableStateOf(true)
|
mutableStateOf(true)
|
||||||
}
|
|
||||||
|
|
||||||
// 在启动时检查状态
|
|
||||||
LaunchedEffect(Unit) {
|
|
||||||
// 如果当前模式不是2就强制启用
|
|
||||||
val currentMode = susfsSUS_SU_Mode()
|
|
||||||
val wasManuallyDisabled = prefs.getBoolean("enable_sus_su", true)
|
|
||||||
if (currentMode != "2" && wasManuallyDisabled) {
|
|
||||||
susfsSUS_SU_2() // 强制切换到模式2
|
|
||||||
prefs.edit { putBoolean("enable_sus_su", true) }
|
|
||||||
}
|
}
|
||||||
isEnabled = currentMode == "2"
|
|
||||||
}
|
|
||||||
|
|
||||||
SwitchSettingItem(
|
// 在启动时检查状态
|
||||||
icon = Icons.Filled.Security,
|
LaunchedEffect(Unit) {
|
||||||
title = stringResource(id = R.string.settings_susfs_toggle),
|
// 如果当前模式不是2就强制启用
|
||||||
summary = stringResource(id = R.string.settings_susfs_toggle_summary),
|
val currentMode = susfsSUS_SU_Mode()
|
||||||
checked = isEnabled,
|
val wasManuallyDisabled = prefs.getBoolean("enable_sus_su", true)
|
||||||
onChange = {
|
if (currentMode != "2" && wasManuallyDisabled) {
|
||||||
if (it) {
|
susfsSUS_SU_2() // 强制切换到模式2
|
||||||
// 手动启用
|
|
||||||
susfsSUS_SU_2()
|
|
||||||
prefs.edit { putBoolean("enable_sus_su", true) }
|
prefs.edit { putBoolean("enable_sus_su", true) }
|
||||||
Toast.makeText(
|
|
||||||
context,
|
|
||||||
context.getString(R.string.susfs_enabled),
|
|
||||||
Toast.LENGTH_SHORT
|
|
||||||
).show()
|
|
||||||
} else {
|
|
||||||
// 手动关闭
|
|
||||||
susfsSUS_SU_0()
|
|
||||||
prefs.edit { putBoolean("enable_sus_su", false) }
|
|
||||||
Toast.makeText(
|
|
||||||
context,
|
|
||||||
context.getString(R.string.susfs_disabled),
|
|
||||||
Toast.LENGTH_SHORT
|
|
||||||
).show()
|
|
||||||
}
|
}
|
||||||
isEnabled = it
|
isEnabled = currentMode == "2"
|
||||||
}
|
}
|
||||||
)
|
|
||||||
|
SwitchSettingItem(
|
||||||
|
icon = Icons.Filled.Security,
|
||||||
|
title = stringResource(id = R.string.settings_susfs_toggle),
|
||||||
|
summary = stringResource(id = R.string.settings_susfs_toggle_summary),
|
||||||
|
checked = isEnabled,
|
||||||
|
onChange = {
|
||||||
|
if (it) {
|
||||||
|
// 手动启用
|
||||||
|
susfsSUS_SU_2()
|
||||||
|
prefs.edit { putBoolean("enable_sus_su", true) }
|
||||||
|
Toast.makeText(
|
||||||
|
context,
|
||||||
|
context.getString(R.string.susfs_enabled),
|
||||||
|
Toast.LENGTH_SHORT
|
||||||
|
).show()
|
||||||
|
} else {
|
||||||
|
// 手动关闭
|
||||||
|
susfsSUS_SU_0()
|
||||||
|
prefs.edit { putBoolean("enable_sus_su", false) }
|
||||||
|
Toast.makeText(
|
||||||
|
context,
|
||||||
|
context.getString(R.string.susfs_disabled),
|
||||||
|
Toast.LENGTH_SHORT
|
||||||
|
).show()
|
||||||
|
}
|
||||||
|
isEnabled = it
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
// 动态管理器设置
|
||||||
|
if (Natives.version >= Natives.MINIMAL_SUPPORTED_DYNAMIC_MANAGER) {
|
||||||
|
SettingItem(
|
||||||
|
icon = Icons.Filled.Security,
|
||||||
|
title = stringResource(R.string.dynamic_manager_title),
|
||||||
|
subtitle = if (isDynamicSignEnabled) {
|
||||||
|
stringResource(
|
||||||
|
R.string.dynamic_manager_enabled_summary,
|
||||||
|
dynamicSignSize
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
stringResource(R.string.dynamic_manager_disabled)
|
||||||
|
},
|
||||||
|
onClick = { showDynamicSignDialog = true }
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1258,8 +1521,8 @@ fun SettingItem(
|
|||||||
Text(
|
Text(
|
||||||
text = title,
|
text = title,
|
||||||
style = MaterialTheme.typography.titleMedium,
|
style = MaterialTheme.typography.titleMedium,
|
||||||
maxLines = 1,
|
maxLines = Int.MAX_VALUE,
|
||||||
overflow = TextOverflow.Ellipsis
|
overflow = TextOverflow.Visible
|
||||||
)
|
)
|
||||||
if (subtitle != null) {
|
if (subtitle != null) {
|
||||||
Spacer(modifier = Modifier.height(2.dp))
|
Spacer(modifier = Modifier.height(2.dp))
|
||||||
@@ -1267,8 +1530,8 @@ fun SettingItem(
|
|||||||
text = subtitle,
|
text = subtitle,
|
||||||
style = MaterialTheme.typography.bodyMedium,
|
style = MaterialTheme.typography.bodyMedium,
|
||||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||||
maxLines = 2,
|
maxLines = Int.MAX_VALUE,
|
||||||
overflow = TextOverflow.Ellipsis
|
overflow = TextOverflow.Visible
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
BIN
manager/app/src/main/jniLibs/arm64-v8a/libzakosign.so
Normal file
BIN
manager/app/src/main/jniLibs/arm64-v8a/libzakosign.so
Normal file
Binary file not shown.
BIN
manager/app/src/main/jniLibs/armeabi-v7a/libzakoboot.so
Normal file
BIN
manager/app/src/main/jniLibs/armeabi-v7a/libzakoboot.so
Normal file
Binary file not shown.
BIN
manager/app/src/main/jniLibs/armeabi-v7a/libzakosign.so
Normal file
BIN
manager/app/src/main/jniLibs/armeabi-v7a/libzakosign.so
Normal file
Binary file not shown.
BIN
manager/app/src/main/jniLibs/x86_64/libzakoboot.so
Normal file
BIN
manager/app/src/main/jniLibs/x86_64/libzakoboot.so
Normal file
Binary file not shown.
42
manager/app/src/main/res/drawable/package_import.xml
Normal file
42
manager/app/src/main/res/drawable/package_import.xml
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:pathData="M12,21l-8,-4.5v-9l8,-4.5l8,4.5v4.5"
|
||||||
|
android:strokeLineJoin="round"
|
||||||
|
android:strokeWidth="2"
|
||||||
|
android:strokeColor="#ffff"
|
||||||
|
android:strokeLineCap="round"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M12,12l8,-4.5"
|
||||||
|
android:strokeLineJoin="round"
|
||||||
|
android:strokeWidth="2"
|
||||||
|
android:strokeColor="#ffff"
|
||||||
|
android:strokeLineCap="round"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M12,12v9"
|
||||||
|
android:strokeLineJoin="round"
|
||||||
|
android:strokeWidth="2"
|
||||||
|
android:strokeColor="#ffff"
|
||||||
|
android:strokeLineCap="round"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M12,12l-8,-4.5"
|
||||||
|
android:strokeLineJoin="round"
|
||||||
|
android:strokeWidth="2"
|
||||||
|
android:strokeColor="#ffff"
|
||||||
|
android:strokeLineCap="round"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M22,18h-7"
|
||||||
|
android:strokeLineJoin="round"
|
||||||
|
android:strokeWidth="2"
|
||||||
|
android:strokeColor="#ffff"
|
||||||
|
android:strokeLineCap="round"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M18,15l-3,3l3,3"
|
||||||
|
android:strokeLineJoin="round"
|
||||||
|
android:strokeWidth="2"
|
||||||
|
android:strokeColor="#ffff"
|
||||||
|
android:strokeLineCap="round"/>
|
||||||
|
</vector>
|
||||||
@@ -4,17 +4,12 @@
|
|||||||
<string name="home_not_installed">غير مثبت</string>
|
<string name="home_not_installed">غير مثبت</string>
|
||||||
<string name="home_click_to_install">إضغط للتثبيت</string>
|
<string name="home_click_to_install">إضغط للتثبيت</string>
|
||||||
<string name="home_working">يعمل</string>
|
<string name="home_working">يعمل</string>
|
||||||
<string name="home_working_version">الإصدار: %d</string>
|
<string name="home_working_version">الإصدار: %s</string>
|
||||||
<string name="home_superuser_count">مستخدمين الجذر: %d</string>
|
|
||||||
<string name="home_module_count">الإضافات: %d</string>
|
|
||||||
<string name="home_unsupported">غير مدعوم</string>
|
<string name="home_unsupported">غير مدعوم</string>
|
||||||
<string name="home_unsupported_reason">KernelSU يدعم GKI kernels فقط</string>
|
<string name="home_unsupported_reason">KernelSU يدعم GKI kernels فقط</string>
|
||||||
<string name="home_kernel">إصدار النواة</string>
|
<string name="home_kernel">إصدار النواة</string>
|
||||||
<string name="home_susfs">SuSFS: %s</string>
|
|
||||||
<string name="home_susfs_version">إصدار SuSFS</string>
|
<string name="home_susfs_version">إصدار SuSFS</string>
|
||||||
<string name="home_susfs_sus_su">SuS SU</string>
|
|
||||||
<string name="home_manager_version">إصدار المدير</string>
|
<string name="home_manager_version">إصدار المدير</string>
|
||||||
<string name="home_fingerprint">البصمة</string>
|
|
||||||
<string name="home_selinux_status">وضع SELinux</string>
|
<string name="home_selinux_status">وضع SELinux</string>
|
||||||
<string name="selinux_status_disabled">معطل</string>
|
<string name="selinux_status_disabled">معطل</string>
|
||||||
<string name="selinux_status_enforcing">مفروض</string>
|
<string name="selinux_status_enforcing">مفروض</string>
|
||||||
@@ -28,7 +23,6 @@
|
|||||||
<string name="module_sort_action_first">فرز (الإجراء أولاً)</string>
|
<string name="module_sort_action_first">فرز (الإجراء أولاً)</string>
|
||||||
<string name="module_sort_enabled_first">فرز (الممكن أولاً)</string>
|
<string name="module_sort_enabled_first">فرز (الممكن أولاً)</string>
|
||||||
<string name="uninstall">إلغاء التثبيت</string>
|
<string name="uninstall">إلغاء التثبيت</string>
|
||||||
<string name="restore">إسترجاع</string>
|
|
||||||
<string name="module_install">تثبيت الوحدة</string>
|
<string name="module_install">تثبيت الوحدة</string>
|
||||||
<string name="install">تثبيت</string>
|
<string name="install">تثبيت</string>
|
||||||
<string name="reboot">إعادة تشغيل</string>
|
<string name="reboot">إعادة تشغيل</string>
|
||||||
@@ -61,16 +55,12 @@
|
|||||||
<string name="profile_template">نموذج</string>
|
<string name="profile_template">نموذج</string>
|
||||||
<string name="profile_custom">مُخصّص</string>
|
<string name="profile_custom">مُخصّص</string>
|
||||||
<string name="profile_name">اسم الملف الشخصي</string>
|
<string name="profile_name">اسم الملف الشخصي</string>
|
||||||
<string name="profile_namespace">تركيب مساحة الاسم</string>
|
|
||||||
<string name="profile_namespace_inherited">موروث</string>
|
|
||||||
<string name="profile_namespace_global">عالمي</string>
|
|
||||||
<string name="profile_namespace_individual">فردي</string>
|
|
||||||
<string name="profile_groups">مجموعات</string>
|
<string name="profile_groups">مجموعات</string>
|
||||||
<string name="profile_capabilities">القدرات</string>
|
<string name="profile_capabilities">القدرات</string>
|
||||||
<string name="profile_selinux_context">سياق SELinux</string>
|
<string name="profile_selinux_context">سياق SELinux</string>
|
||||||
<string name="profile_umount_modules">الغاء تحميل الإضافات</string>
|
<string name="profile_umount_modules">الغاء تحميل الإضافات</string>
|
||||||
<string name="failed_to_update_app_profile">فشل تحديث ملف تعريف التطبيق لـ %s</string>
|
<string name="failed_to_update_app_profile">فشل تحديث ملف تعريف التطبيق لـ %s</string>
|
||||||
<string name="require_kernel_version" formatted="false">إصدار KernelSU الحالي %d منخفض جدًا بحيث لا يعمل المدير بشكل صحيح. الرجاء الترقية إلى الإصدار %d أو أعلى!</string>
|
<string name="require_kernel_version" formatted="false">إصدار KernelSU الحالي %s منخفض جدًا بحيث لا يعمل المدير بشكل صحيح. الرجاء الترقية إلى الإصدار %s أو أعلى!</string>
|
||||||
<string name="settings_umount_modules_default">الغاء تحميل الإضافات بشكل افتراضي</string>
|
<string name="settings_umount_modules_default">الغاء تحميل الإضافات بشكل افتراضي</string>
|
||||||
<string name="settings_umount_modules_default_summary">القيمة الافتراضية العامة لـ\"إلغاء تحميل الإضافات\" في ملفات تعريف التطبيقات. إذا تم تمكينه، إزالة جميع تعديلات الإضافات على النظام للتطبيقات التي لا تحتوي على مجموعة ملف تعريف.</string>
|
<string name="settings_umount_modules_default_summary">القيمة الافتراضية العامة لـ\"إلغاء تحميل الإضافات\" في ملفات تعريف التطبيقات. إذا تم تمكينه، إزالة جميع تعديلات الإضافات على النظام للتطبيقات التي لا تحتوي على مجموعة ملف تعريف.</string>
|
||||||
<string name="settings_susfs_toggle">تعطيل روابط kprobe</string>
|
<string name="settings_susfs_toggle">تعطيل روابط kprobe</string>
|
||||||
@@ -112,7 +102,6 @@
|
|||||||
<string name="settings_check_update_summary">التحقق تلقائيًا من وجود تحديثات عند فتح التطبيق</string>
|
<string name="settings_check_update_summary">التحقق تلقائيًا من وجود تحديثات عند فتح التطبيق</string>
|
||||||
<string name="grant_root_failed">فشل في منح صلاحية الجذر!</string>
|
<string name="grant_root_failed">فشل في منح صلاحية الجذر!</string>
|
||||||
<string name="action">إجراء</string>
|
<string name="action">إجراء</string>
|
||||||
<string name="open">فتح</string>
|
|
||||||
<string name="close">إغلاق</string>
|
<string name="close">إغلاق</string>
|
||||||
<string name="enable_web_debugging">تمكين تصحيح أخطاء WebView</string>
|
<string name="enable_web_debugging">تمكين تصحيح أخطاء WebView</string>
|
||||||
<string name="enable_web_debugging_summary">يمكن استخدامه لتصحيح أخطاء WebUI، يرجى تمكينه فقط عند الحاجة.</string>
|
<string name="enable_web_debugging_summary">يمكن استخدامه لتصحيح أخطاء WebUI، يرجى تمكينه فقط عند الحاجة.</string>
|
||||||
@@ -138,9 +127,6 @@
|
|||||||
<string name="selected_lkm">LKM المحددة: %s</string>
|
<string name="selected_lkm">LKM المحددة: %s</string>
|
||||||
<string name="save_log">حفظ السجلات</string>
|
<string name="save_log">حفظ السجلات</string>
|
||||||
<string name="log_saved">السجلات محفوظة</string>
|
<string name="log_saved">السجلات محفوظة</string>
|
||||||
<string name="status_supported">إدعمنا</string>
|
|
||||||
<string name="status_not_supported">غير مدعوم</string>
|
|
||||||
<string name="status_unknown">غير معروف</string>
|
|
||||||
<string name="sus_su_mode">وضع SuS SU</string>
|
<string name="sus_su_mode">وضع SuS SU</string>
|
||||||
<!-- Module related -->
|
<!-- Module related -->
|
||||||
<string name="module_install_confirm">تأكيد وحدة التثبيت %1$s؟</string>
|
<string name="module_install_confirm">تأكيد وحدة التثبيت %1$s؟</string>
|
||||||
@@ -174,14 +160,11 @@
|
|||||||
<string name="settings_custom_background">خلفية التطبيق المخصصة</string>
|
<string name="settings_custom_background">خلفية التطبيق المخصصة</string>
|
||||||
<string name="settings_custom_background_summary">حدد صورة كخلفية</string>
|
<string name="settings_custom_background_summary">حدد صورة كخلفية</string>
|
||||||
<string name="settings_card_alpha">شفافية شريط التنقل</string>
|
<string name="settings_card_alpha">شفافية شريط التنقل</string>
|
||||||
<string name="settings_restore_default">استعادة الإعدادات الافتراضية</string>
|
|
||||||
<string name="home_android_version">إصدار Android</string>
|
<string name="home_android_version">إصدار Android</string>
|
||||||
<string name="home_device_model">نوع الجهاز</string>
|
<string name="home_device_model">نوع الجهاز</string>
|
||||||
<string name="su_not_allowed">لا يسمح بمنح المستخدم المتميز ل %s</string>
|
<string name="su_not_allowed">لا يسمح بمنح المستخدم المتميز ل %s</string>
|
||||||
<string name="settings_disable_su">تعطيل توافق su</string>
|
<string name="settings_disable_su">تعطيل توافق su</string>
|
||||||
<string name="settings_disable_su_summary">تعطيل أي تطبيقات مؤقتًا من الحصول على امتيازات الجذر عن طريق الأمر <unk> su (لن تتأثر عمليات الجذر الحالية).</string>
|
<string name="settings_disable_su_summary">تعطيل أي تطبيقات مؤقتًا من الحصول على امتيازات الجذر عن طريق الأمر <unk> su (لن تتأثر عمليات الجذر الحالية).</string>
|
||||||
<string name="using_mksu_manager">أنت تستخدم مدير Beta SukiSU</string>
|
|
||||||
<string name="module_install_multiple_confirm">هل أنت متأكد من أنك تريد تثبيت وحدات %d المحددة؟</string>
|
|
||||||
<string name="module_install_multiple_confirm_with_names">هل أنت متأكد من أنك تريد تثبيت وحدات %1$d التالية؟ \n\n%2$s</string>
|
<string name="module_install_multiple_confirm_with_names">هل أنت متأكد من أنك تريد تثبيت وحدات %1$d التالية؟ \n\n%2$s</string>
|
||||||
<string name="more_settings">المزيد من الإعدادات</string>
|
<string name="more_settings">المزيد من الإعدادات</string>
|
||||||
<string name="selinux">SELinux</string>
|
<string name="selinux">SELinux</string>
|
||||||
@@ -212,20 +195,14 @@
|
|||||||
<string name="color_pink">وردي</string>
|
<string name="color_pink">وردي</string>
|
||||||
<string name="color_gray">رمادي</string>
|
<string name="color_gray">رمادي</string>
|
||||||
<string name="color_yellow">الأصفر</string>
|
<string name="color_yellow">الأصفر</string>
|
||||||
<string name="flash_option">خيارات الفرشاة</string>
|
|
||||||
<string name="flash_option_tip">حدد الملف المراد إلفاؤه</string>
|
|
||||||
<string name="horizon_kernel">Anykernel3 yükle</string>
|
<string name="horizon_kernel">Anykernel3 yükle</string>
|
||||||
<string name="horizon_kernel_summary">فلاش AnyKernel3 ملف kernel</string>
|
<string name="horizon_kernel_summary">فلاش AnyKernel3 ملف kernel</string>
|
||||||
<string name="root_required">يتطلب امتيازات الجذر</string>
|
<string name="root_required">يتطلب امتيازات الجذر</string>
|
||||||
<string name="copy_failed">فشل نسخ الملف</string>
|
|
||||||
<string name="reboot_complete_title">اكتمل التشويش</string>
|
<string name="reboot_complete_title">اكتمل التشويش</string>
|
||||||
<string name="reboot_complete_msg">هل تريد إعادة التشغيل فوراً؟</string>
|
<string name="reboot_complete_msg">هل تريد إعادة التشغيل فوراً؟</string>
|
||||||
<string name="yes">نعم</string>
|
<string name="yes">نعم</string>
|
||||||
<string name="no">لايوجد</string>
|
<string name="no">لايوجد</string>
|
||||||
<string name="failed_reboot">فشل إعادة التشغيل</string>
|
<string name="failed_reboot">فشل إعادة التشغيل</string>
|
||||||
<string name="batch_authorization">التمكين</string>
|
|
||||||
<string name="batch_cancel_authorization">السحب</string>
|
|
||||||
<string name="backup">النسخ الاحتياطية</string>
|
|
||||||
<string name="kpm_title">KPM</string>
|
<string name="kpm_title">KPM</string>
|
||||||
<string name="kpm_empty">لا توجد وحدات نواة مثبتة في هذا الوقت</string>
|
<string name="kpm_empty">لا توجد وحدات نواة مثبتة في هذا الوقت</string>
|
||||||
<string name="kpm_version">الإصدار</string>
|
<string name="kpm_version">الإصدار</string>
|
||||||
@@ -233,7 +210,6 @@
|
|||||||
<string name="kpm_uninstall">إلغاء التثبيت</string>
|
<string name="kpm_uninstall">إلغاء التثبيت</string>
|
||||||
<string name="kpm_uninstall_success">تم إلغاء التثبيت بنجاح</string>
|
<string name="kpm_uninstall_success">تم إلغاء التثبيت بنجاح</string>
|
||||||
<string name="kpm_uninstall_failed">فشل في إلغاء التثبيت</string>
|
<string name="kpm_uninstall_failed">فشل في إلغاء التثبيت</string>
|
||||||
<string name="kpm_install">تثبيت</string>
|
|
||||||
<string name="kpm_install_success">تم تحميل وحدة كيلو جزء بنجاح</string>
|
<string name="kpm_install_success">تم تحميل وحدة كيلو جزء بنجاح</string>
|
||||||
<string name="kpm_install_failed">فشل تحميل وحدة كيلو بايم</string>
|
<string name="kpm_install_failed">فشل تحميل وحدة كيلو بايم</string>
|
||||||
<string name="kpm_args">العوامل المتغيرة</string>
|
<string name="kpm_args">العوامل المتغيرة</string>
|
||||||
@@ -247,8 +223,6 @@
|
|||||||
<string name="home_click_to_ContributionCard_kernelsu">وستشكل سوكيسو أولترا في المستقبل فرعا مستقلا نسبيا من فروع الوحدة، ولكننا لا نزال نقدر كيرنيل سو وموكسو الرسميين وما إلى ذلك. لإسهاماتهم!</string>
|
<string name="home_click_to_ContributionCard_kernelsu">وستشكل سوكيسو أولترا في المستقبل فرعا مستقلا نسبيا من فروع الوحدة، ولكننا لا نزال نقدر كيرنيل سو وموكسو الرسميين وما إلى ذلك. لإسهاماتهم!</string>
|
||||||
<string name="not_supported">غير مدعوم</string>
|
<string name="not_supported">غير مدعوم</string>
|
||||||
<string name="supported">إدعمنا</string>
|
<string name="supported">إدعمنا</string>
|
||||||
<string name="home_kpm_module">"عدد وحدات KPM: %d "</string>
|
|
||||||
<string name="kpm_invalid_file">ملف KPM غير صحيح</string>
|
|
||||||
<string name="kernel_patched">النواة غير مصحوبة</string>
|
<string name="kernel_patched">النواة غير مصحوبة</string>
|
||||||
<string name="kernel_not_enabled">لم يتم تكوين النواة</string>
|
<string name="kernel_not_enabled">لم يتم تكوين النواة</string>
|
||||||
<string name="custom_settings">الإعدادات المُخصصة</string>
|
<string name="custom_settings">الإعدادات المُخصصة</string>
|
||||||
@@ -256,19 +230,13 @@
|
|||||||
<string name="kpm_install_mode_load">التحميل</string>
|
<string name="kpm_install_mode_load">التحميل</string>
|
||||||
<string name="kpm_install_mode_embed">فسيفساء</string>
|
<string name="kpm_install_mode_embed">فسيفساء</string>
|
||||||
<string name="kpm_install_mode_description">الرجاء التحديد: %1\$s وضع تثبيت الوحدة \n\nالتحميل: قم بتحميل الوحدة \nمؤقتا: تثبيت دائم في النظام</string>
|
<string name="kpm_install_mode_description">الرجاء التحديد: %1\$s وضع تثبيت الوحدة \n\nالتحميل: قم بتحميل الوحدة \nمؤقتا: تثبيت دائم في النظام</string>
|
||||||
<string name="log_failed_to_check_module_file">فشل التحقق من وجود ملف الوحدة</string>
|
|
||||||
<string name="snackbar_failed_to_check_module_file">غير قادر على التحقق من وجود ملف الوحدة</string>
|
<string name="snackbar_failed_to_check_module_file">غير قادر على التحقق من وجود ملف الوحدة</string>
|
||||||
<string name="confirm_uninstall_title">تأكيد إلغاء التثبيت</string>
|
|
||||||
<string name="confirm_uninstall_confirm">إلغاء التثبيت</string>
|
|
||||||
<string name="confirm_uninstall_dismiss">إلغاء</string>
|
|
||||||
<string name="theme_color">ألوان المظهر</string>
|
<string name="theme_color">ألوان المظهر</string>
|
||||||
<string name="invalid_file_type">نوع الملف غير صحيح! الرجاء تحديد ملف .kpm.</string>
|
<string name="invalid_file_type">نوع الملف غير صحيح! الرجاء تحديد ملف .kpm.</string>
|
||||||
<string name="confirm_uninstall_title_with_filename">إلغاء التثبيت</string>
|
<string name="confirm_uninstall_title_with_filename">إلغاء التثبيت</string>
|
||||||
<string name="confirm_uninstall_content">سيتم إلغاء تثبيت KPM التالية: %s</string>
|
<string name="confirm_uninstall_content">سيتم إلغاء تثبيت KPM التالية: %s</string>
|
||||||
<string name="settings_susfs_toggle_summary">تعطيل روابط kprobe التي أنشأتها KernelSU، باستخدام الروابط الواردة بدلاً من ذلك، والتي تشبه طريقة الربط غير GKI غير GKI.</string>
|
<string name="settings_susfs_toggle_summary">تعطيل روابط kprobe التي أنشأتها KernelSU، باستخدام الروابط الواردة بدلاً من ذلك، والتي تشبه طريقة الربط غير GKI غير GKI.</string>
|
||||||
<string name="image_editor_title">ضبط صورة الخلفية</string>
|
|
||||||
<string name="image_editor_hint">استخدم إصبعين لتكبير الصورة، وأصبع واحد لسحبها لضبط الموضع</string>
|
<string name="image_editor_hint">استخدم إصبعين لتكبير الصورة، وأصبع واحد لسحبها لضبط الموضع</string>
|
||||||
<string name="background_image_error">تعذر تحميل الصورة</string>
|
|
||||||
<string name="reprovision">إعادة</string>
|
<string name="reprovision">إعادة</string>
|
||||||
<!-- Kernel Flash Progress Related -->
|
<!-- Kernel Flash Progress Related -->
|
||||||
<string name="horizon_flash_title">ضرب النواة</string>
|
<string name="horizon_flash_title">ضرب النواة</string>
|
||||||
@@ -305,10 +273,6 @@
|
|||||||
<string name="app_settings">إعدادات التطبيق </string>
|
<string name="app_settings">إعدادات التطبيق </string>
|
||||||
<string name="tools">ادوات</string>
|
<string name="tools">ادوات</string>
|
||||||
<!-- String resources used in SuperUser -->
|
<!-- String resources used in SuperUser -->
|
||||||
<string name="clear">إزالة</string>
|
|
||||||
<string name="apps_with_root">التطبيقات مع امتيازات الجذر</string>
|
|
||||||
<string name="apps_with_custom_profile">التطبيقات مع الإعدادات المخصصة</string>
|
|
||||||
<string name="other_apps">التطبيقات ذات الإعدادات الافتراضية بدون تغيير</string>
|
|
||||||
<string name="no_apps_found">التطبيق غير موجود</string>
|
<string name="no_apps_found">التطبيق غير موجود</string>
|
||||||
<string name="selinux_enabled_toast">تم تمكين SELinux</string>
|
<string name="selinux_enabled_toast">تم تمكين SELinux</string>
|
||||||
<string name="selinux_disabled_toast">تم تعطيل SELinux</string>
|
<string name="selinux_disabled_toast">تم تعطيل SELinux</string>
|
||||||
@@ -316,8 +280,6 @@
|
|||||||
<string name="advanced_settings">إعدادات متقدمة</string>
|
<string name="advanced_settings">إعدادات متقدمة</string>
|
||||||
<string name="appearance_settings">تخصيص شريط الأدوات</string>
|
<string name="appearance_settings">تخصيص شريط الأدوات</string>
|
||||||
<string name="back">عد مرة أخرى</string>
|
<string name="back">عد مرة أخرى</string>
|
||||||
<string name="expand">كن في طريقه كامل</string>
|
|
||||||
<string name="collapse">وضع بعيدا</string>
|
|
||||||
<string name="susfs_enabled">تم تمكين SuSFS</string>
|
<string name="susfs_enabled">تم تمكين SuSFS</string>
|
||||||
<string name="susfs_disabled">تم تعطيل SuSFS</string>
|
<string name="susfs_disabled">تم تعطيل SuSFS</string>
|
||||||
<string name="background_set_success">تم تعيين الخلفية بنجاح</string>
|
<string name="background_set_success">تم تعيين الخلفية بنجاح</string>
|
||||||
@@ -325,7 +287,6 @@
|
|||||||
<string name="icon_switch_title">Alternate icon</string>
|
<string name="icon_switch_title">Alternate icon</string>
|
||||||
<string name="icon_switch_summary">Change the launcher icon to KernelSU\'s icon.</string>
|
<string name="icon_switch_summary">Change the launcher icon to KernelSU\'s icon.</string>
|
||||||
<string name="icon_switched">Icon switched</string>
|
<string name="icon_switched">Icon switched</string>
|
||||||
<string name="root_require_for_install">يتطلب امتيازات الجذر</string>
|
|
||||||
<!-- KPM display settings -->
|
<!-- KPM display settings -->
|
||||||
<string name="show_kpm_info">عرض وظيفة KPM</string>
|
<string name="show_kpm_info">عرض وظيفة KPM</string>
|
||||||
<string name="show_kpm_info_summary">إخفاء معلومات KPM ووظيفتها في الشريط المنزلي والأسفل</string>
|
<string name="show_kpm_info_summary">إخفاء معلومات KPM ووظيفتها في الشريط المنزلي والأسفل</string>
|
||||||
@@ -337,7 +298,6 @@
|
|||||||
<string name="use_webuix_eruda">حقن Eruda في WebUI X</string>
|
<string name="use_webuix_eruda">حقن Eruda في WebUI X</string>
|
||||||
<string name="use_webuix_eruda_summary">حقن وحدة التصحيح في WebUI X لجعل تصحيح الأخطاء أسهل. يتطلب تصحيح أخطاء الويب لتكون قيد التشغيل.</string>
|
<string name="use_webuix_eruda_summary">حقن وحدة التصحيح في WebUI X لجعل تصحيح الأخطاء أسهل. يتطلب تصحيح أخطاء الويب لتكون قيد التشغيل.</string>
|
||||||
<!-- DPI setting related strings -->
|
<!-- DPI setting related strings -->
|
||||||
<string name="dpi_settings">إعداد DPI</string>
|
|
||||||
<string name="app_dpi_title">تم تطبيق DPI</string>
|
<string name="app_dpi_title">تم تطبيق DPI</string>
|
||||||
<string name="app_dpi_summary">ضبط كثافة عرض الشاشة للتطبيق الحالي فقط</string>
|
<string name="app_dpi_summary">ضبط كثافة عرض الشاشة للتطبيق الحالي فقط</string>
|
||||||
<string name="dpi_size_small">صغير </string>
|
<string name="dpi_size_small">صغير </string>
|
||||||
@@ -355,16 +315,6 @@
|
|||||||
<string name="language_follow_system">اتبع النظام</string>
|
<string name="language_follow_system">اتبع النظام</string>
|
||||||
<string name="language_changed">تم تغيير اللغة، إعادة التشغيل لتطبيق التغييرات</string>
|
<string name="language_changed">تم تغيير اللغة، إعادة التشغيل لتطبيق التغييرات</string>
|
||||||
<string name="settings_card_dim">تعديل ظلام البطاقة</string>
|
<string name="settings_card_dim">تعديل ظلام البطاقة</string>
|
||||||
<!-- Super User Related -->
|
|
||||||
<string name="scroll_to_top">في الأعلى</string>
|
|
||||||
<string name="scroll_to_bottom">أسفل</string>
|
|
||||||
<string name="scroll_to_top_description">التمرير لأعلى</string>
|
|
||||||
<string name="scroll_to_bottom_description">التمرير إلى الأسفل</string>
|
|
||||||
<string name="authorized">مصرح</string>
|
|
||||||
<string name="unauthorized">غير مصرح</string>
|
|
||||||
<string name="selected">محدد</string>
|
|
||||||
<string name="select">خيار</string>
|
|
||||||
<string name="profile_umount_modules_disable">تعطيل وحدة إلغاء التثبيت المخصصة</string>
|
|
||||||
<!-- Flash related -->
|
<!-- Flash related -->
|
||||||
<string name="error_code">رمز الخطأ</string>
|
<string name="error_code">رمز الخطأ</string>
|
||||||
<string name="check_log">يرجى التحقق من السجل</string>
|
<string name="check_log">يرجى التحقق من السجل</string>
|
||||||
@@ -372,4 +322,51 @@
|
|||||||
<string name="module_failed_count">أخفق %d في تثبيت وحدة جديدة</string>
|
<string name="module_failed_count">أخفق %d في تثبيت وحدة جديدة</string>
|
||||||
<string name="module_download_error">فشل تحميل الوحدة</string>
|
<string name="module_download_error">فشل تحميل الوحدة</string>
|
||||||
<string name="kernel_flashing">ضرب النواة</string>
|
<string name="kernel_flashing">ضرب النواة</string>
|
||||||
|
<!-- 分类相关 -->
|
||||||
|
<string name="category_all_apps">All</string>
|
||||||
|
<string name="category_root_apps">Root</string>
|
||||||
|
<string name="category_custom_apps">Custom</string>
|
||||||
|
<string name="category_default_apps">Default</string>
|
||||||
|
<!-- 排序相关 -->
|
||||||
|
<string name="sort_name_asc">Ascending order of name</string>
|
||||||
|
<string name="sort_name_desc">Name descending</string>
|
||||||
|
<string name="sort_install_time_new">Installation time (new)</string>
|
||||||
|
<string name="sort_install_time_old">Installation time (old)</string>
|
||||||
|
<string name="sort_size_desc">descending order of size</string>
|
||||||
|
<string name="sort_size_asc">ascending order of size</string>
|
||||||
|
<string name="sort_usage_freq">frequency of use</string>
|
||||||
|
<!-- 状态相关 -->
|
||||||
|
<string name="no_apps_in_category">No application in this category</string>
|
||||||
|
<!-- 标签相关 -->
|
||||||
|
<!-- FAB菜单相关 -->
|
||||||
|
<string name="deny_authorization">Delegation of authority</string>
|
||||||
|
<string name="grant_authorization">Authorizations</string>
|
||||||
|
<string name="unmount_modules">Unmounting Module Mounts</string>
|
||||||
|
<string name="disable_unmount">Disable uninstall module mounting</string>
|
||||||
|
<string name="expand_menu">Expand menu</string>
|
||||||
|
<string name="collapse_menu">Put away the menu</string>
|
||||||
|
<string name="scroll_to_top">في الأعلى</string>
|
||||||
|
<string name="scroll_to_bottom">أسفل</string>
|
||||||
|
<string name="selected">محدد</string>
|
||||||
|
<string name="select">خيار</string>
|
||||||
|
<!-- BottomSheet相关 -->
|
||||||
|
<string name="menu_options">Menu Options</string>
|
||||||
|
<string name="sort_options">Sort by</string>
|
||||||
|
<string name="app_categories">Application Type Selection</string>
|
||||||
|
<!-- SuSFS Configuration -->
|
||||||
|
<!-- SuSFS Reset Confirmation -->
|
||||||
|
<!-- SuSFS Toast Messages -->
|
||||||
|
<!-- SuSFS Settings Item -->
|
||||||
|
<!-- 开机自启动相关 -->
|
||||||
|
<!-- SuSFS Tab Titles -->
|
||||||
|
<!-- SuSFS Dialog Actions -->
|
||||||
|
<!-- SuSFS Path Management -->
|
||||||
|
<!-- SuSFS Umount Mode -->
|
||||||
|
<!-- SuSFS Run Umount -->
|
||||||
|
<!-- SuSFS Reset Categories -->
|
||||||
|
<!-- SuSFS Path Settings -->
|
||||||
|
<!-- SuSFS Enabled Features -->
|
||||||
|
<!-- Feature Labels -->
|
||||||
|
<!-- 可切换状态 -->
|
||||||
|
<!-- Settings related strings -->
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -4,17 +4,12 @@
|
|||||||
<string name="home_not_installed">Yüklənmədi</string>
|
<string name="home_not_installed">Yüklənmədi</string>
|
||||||
<string name="home_click_to_install">Yükləmək üçün toxunun</string>
|
<string name="home_click_to_install">Yükləmək üçün toxunun</string>
|
||||||
<string name="home_working">İşləyir</string>
|
<string name="home_working">İşləyir</string>
|
||||||
<string name="home_working_version">Versiya: %d</string>
|
<string name="home_working_version">Versiya: %s</string>
|
||||||
<string name="home_superuser_count">Super istifadəçilər: %d</string>
|
|
||||||
<string name="home_module_count">Modullar: %d</string>
|
|
||||||
<string name="home_unsupported">Dəstəklənmir</string>
|
<string name="home_unsupported">Dəstəklənmir</string>
|
||||||
<string name="home_unsupported_reason">Hal-hazırda KernelSU yalnız GKI nüvələrini dəstəkləyir</string>
|
<string name="home_unsupported_reason">Hal-hazırda KernelSU yalnız GKI nüvələrini dəstəkləyir</string>
|
||||||
<string name="home_kernel">Nüvə</string>
|
<string name="home_kernel">Nüvə</string>
|
||||||
<string name="home_susfs">SuSFS: %s</string>
|
|
||||||
<string name="home_susfs_version">SuSFS Version</string>
|
<string name="home_susfs_version">SuSFS Version</string>
|
||||||
<string name="home_susfs_sus_su">SuS SU</string>
|
|
||||||
<string name="home_manager_version">Menecer versiyası</string>
|
<string name="home_manager_version">Menecer versiyası</string>
|
||||||
<string name="home_fingerprint">Barmaq izi</string>
|
|
||||||
<string name="home_selinux_status">SELinux vəziyyəti</string>
|
<string name="home_selinux_status">SELinux vəziyyəti</string>
|
||||||
<string name="selinux_status_disabled">Qeyri-aktiv</string>
|
<string name="selinux_status_disabled">Qeyri-aktiv</string>
|
||||||
<string name="selinux_status_enforcing">Məcburi</string>
|
<string name="selinux_status_enforcing">Məcburi</string>
|
||||||
@@ -28,7 +23,6 @@
|
|||||||
<string name="module_sort_action_first">Sort (Action first)</string>
|
<string name="module_sort_action_first">Sort (Action first)</string>
|
||||||
<string name="module_sort_enabled_first">Sort (Enabled first)</string>
|
<string name="module_sort_enabled_first">Sort (Enabled first)</string>
|
||||||
<string name="uninstall">Sil</string>
|
<string name="uninstall">Sil</string>
|
||||||
<string name="restore">Restore</string>
|
|
||||||
<string name="module_install">Yüklə</string>
|
<string name="module_install">Yüklə</string>
|
||||||
<string name="install">Yüklə</string>
|
<string name="install">Yüklə</string>
|
||||||
<string name="reboot">Yenidən başlat</string>
|
<string name="reboot">Yenidən başlat</string>
|
||||||
@@ -61,16 +55,12 @@
|
|||||||
<string name="profile_template">Şablon</string>
|
<string name="profile_template">Şablon</string>
|
||||||
<string name="profile_custom">Özəl</string>
|
<string name="profile_custom">Özəl</string>
|
||||||
<string name="profile_name">Profil adı</string>
|
<string name="profile_name">Profil adı</string>
|
||||||
<string name="profile_namespace">Bölmənin ad sahəsi</string>
|
|
||||||
<string name="profile_namespace_inherited">Miras qalmış</string>
|
|
||||||
<string name="profile_namespace_global">Qlobal</string>
|
|
||||||
<string name="profile_namespace_individual">Fərdi</string>
|
|
||||||
<string name="profile_groups">Qruplar</string>
|
<string name="profile_groups">Qruplar</string>
|
||||||
<string name="profile_capabilities">Bacarıqlar</string>
|
<string name="profile_capabilities">Bacarıqlar</string>
|
||||||
<string name="profile_selinux_context">SELinux konteksi</string>
|
<string name="profile_selinux_context">SELinux konteksi</string>
|
||||||
<string name="profile_umount_modules">Modulları umount et</string>
|
<string name="profile_umount_modules">Modulları umount et</string>
|
||||||
<string name="failed_to_update_app_profile">%s görə tətbiq profillərini güncəlləmək mümkün olmadı</string>
|
<string name="failed_to_update_app_profile">%s görə tətbiq profillərini güncəlləmək mümkün olmadı</string>
|
||||||
<string name="require_kernel_version" formatted="false">The current KernelSU version %d is too low for the manager to work properly. Please upgrade to version %d or higher!</string>
|
<string name="require_kernel_version" formatted="false">The current KernelSU version %s is too low for the manager to work properly. Please upgrade to version %s or higher!</string>
|
||||||
<string name="settings_umount_modules_default">Defolt olaraq modulları umount et</string>
|
<string name="settings_umount_modules_default">Defolt olaraq modulları umount et</string>
|
||||||
<string name="settings_umount_modules_default_summary">Tətbiq Profillərində \"Umount modulları\" üçün qlobal standart dəyər. Aktivləşdirilərsə, o, Profil dəsti olmayan proqramlar üçün sistemdəki bütün modul dəyişikliklərini siləcək.</string>
|
<string name="settings_umount_modules_default_summary">Tətbiq Profillərində \"Umount modulları\" üçün qlobal standart dəyər. Aktivləşdirilərsə, o, Profil dəsti olmayan proqramlar üçün sistemdəki bütün modul dəyişikliklərini siləcək.</string>
|
||||||
<string name="settings_susfs_toggle">Disable kprobe hooks</string>
|
<string name="settings_susfs_toggle">Disable kprobe hooks</string>
|
||||||
@@ -112,7 +102,6 @@
|
|||||||
<string name="settings_check_update_summary">Automatically check for updates when opening the app</string>
|
<string name="settings_check_update_summary">Automatically check for updates when opening the app</string>
|
||||||
<string name="grant_root_failed">Failed to grant root!</string>
|
<string name="grant_root_failed">Failed to grant root!</string>
|
||||||
<string name="action">Action</string>
|
<string name="action">Action</string>
|
||||||
<string name="open">Open</string>
|
|
||||||
<string name="close">Close</string>
|
<string name="close">Close</string>
|
||||||
<string name="enable_web_debugging">Enable WebView debugging</string>
|
<string name="enable_web_debugging">Enable WebView debugging</string>
|
||||||
<string name="enable_web_debugging_summary">Can be used to debug WebUI. Please enable only when needed.</string>
|
<string name="enable_web_debugging_summary">Can be used to debug WebUI. Please enable only when needed.</string>
|
||||||
@@ -136,9 +125,6 @@
|
|||||||
<string name="selected_lkm">Selected LKM: %s</string>
|
<string name="selected_lkm">Selected LKM: %s</string>
|
||||||
<string name="save_log">Girişləri Saxla</string>
|
<string name="save_log">Girişləri Saxla</string>
|
||||||
<string name="log_saved">Logs saved</string>
|
<string name="log_saved">Logs saved</string>
|
||||||
<string name="status_supported">Supported</string>
|
|
||||||
<string name="status_not_supported">Not Supported</string>
|
|
||||||
<string name="status_unknown">Unknown</string>
|
|
||||||
<string name="sus_su_mode">SuS SU mode:</string>
|
<string name="sus_su_mode">SuS SU mode:</string>
|
||||||
<!-- Module related -->
|
<!-- Module related -->
|
||||||
<string name="module_install_confirm">confirm install module %1$s?</string>
|
<string name="module_install_confirm">confirm install module %1$s?</string>
|
||||||
@@ -172,14 +158,11 @@
|
|||||||
<string name="settings_custom_background">Custom App Background</string>
|
<string name="settings_custom_background">Custom App Background</string>
|
||||||
<string name="settings_custom_background_summary">Select an image as background</string>
|
<string name="settings_custom_background_summary">Select an image as background</string>
|
||||||
<string name="settings_card_alpha">Navigation bar transparency</string>
|
<string name="settings_card_alpha">Navigation bar transparency</string>
|
||||||
<string name="settings_restore_default">Restore default</string>
|
|
||||||
<string name="home_android_version">Android version</string>
|
<string name="home_android_version">Android version</string>
|
||||||
<string name="home_device_model">Device model</string>
|
<string name="home_device_model">Device model</string>
|
||||||
<string name="su_not_allowed">Granting superuser to %s is not allowed</string>
|
<string name="su_not_allowed">Granting superuser to %s is not allowed</string>
|
||||||
<string name="settings_disable_su">Disable su compatibility</string>
|
<string name="settings_disable_su">Disable su compatibility</string>
|
||||||
<string name="settings_disable_su_summary">Temporarily disable any applications from obtaining root privileges via the su command (existing root processes will not be affected).</string>
|
<string name="settings_disable_su_summary">Temporarily disable any applications from obtaining root privileges via the su command (existing root processes will not be affected).</string>
|
||||||
<string name="using_mksu_manager">You are using the SukiSU Beta manager</string>
|
|
||||||
<string name="module_install_multiple_confirm">Are you sure you want to install the selected %d modules?</string>
|
|
||||||
<string name="module_install_multiple_confirm_with_names">Sure you want to install the following %1$d modules? \n\n%2$s</string>
|
<string name="module_install_multiple_confirm_with_names">Sure you want to install the following %1$d modules? \n\n%2$s</string>
|
||||||
<string name="more_settings">More settings</string>
|
<string name="more_settings">More settings</string>
|
||||||
<string name="selinux">SELinux</string>
|
<string name="selinux">SELinux</string>
|
||||||
@@ -210,20 +193,14 @@
|
|||||||
<string name="color_pink">Pink</string>
|
<string name="color_pink">Pink</string>
|
||||||
<string name="color_gray">Gray</string>
|
<string name="color_gray">Gray</string>
|
||||||
<string name="color_yellow">Yellow</string>
|
<string name="color_yellow">Yellow</string>
|
||||||
<string name="flash_option">Brush Options</string>
|
|
||||||
<string name="flash_option_tip">Select the file to be flashed</string>
|
|
||||||
<string name="horizon_kernel">Install Anykernel3</string>
|
<string name="horizon_kernel">Install Anykernel3</string>
|
||||||
<string name="horizon_kernel_summary">Flash AnyKernel3 kernel file</string>
|
<string name="horizon_kernel_summary">Flash AnyKernel3 kernel file</string>
|
||||||
<string name="root_required">Requires root privileges</string>
|
<string name="root_required">Requires root privileges</string>
|
||||||
<string name="copy_failed">File Copy Failure</string>
|
|
||||||
<string name="reboot_complete_title">Scrubbing complete</string>
|
<string name="reboot_complete_title">Scrubbing complete</string>
|
||||||
<string name="reboot_complete_msg">Whether to reboot immediately?</string>
|
<string name="reboot_complete_msg">Whether to reboot immediately?</string>
|
||||||
<string name="yes">Yes</string>
|
<string name="yes">Yes</string>
|
||||||
<string name="no">No</string>
|
<string name="no">No</string>
|
||||||
<string name="failed_reboot">Reboot Failed</string>
|
<string name="failed_reboot">Reboot Failed</string>
|
||||||
<string name="batch_authorization">empower</string>
|
|
||||||
<string name="batch_cancel_authorization">withdraw</string>
|
|
||||||
<string name="backup">Backup</string>
|
|
||||||
<string name="kpm_title">KPM</string>
|
<string name="kpm_title">KPM</string>
|
||||||
<string name="kpm_empty">No installed kernel modules at this time</string>
|
<string name="kpm_empty">No installed kernel modules at this time</string>
|
||||||
<string name="kpm_version">Version</string>
|
<string name="kpm_version">Version</string>
|
||||||
@@ -231,7 +208,6 @@
|
|||||||
<string name="kpm_uninstall">Uninstall</string>
|
<string name="kpm_uninstall">Uninstall</string>
|
||||||
<string name="kpm_uninstall_success">Uninstalled successfully</string>
|
<string name="kpm_uninstall_success">Uninstalled successfully</string>
|
||||||
<string name="kpm_uninstall_failed">Failed to uninstall</string>
|
<string name="kpm_uninstall_failed">Failed to uninstall</string>
|
||||||
<string name="kpm_install">Install</string>
|
|
||||||
<string name="kpm_install_success">Load of kpm module successful</string>
|
<string name="kpm_install_success">Load of kpm module successful</string>
|
||||||
<string name="kpm_install_failed">Load of kpm module failed</string>
|
<string name="kpm_install_failed">Load of kpm module failed</string>
|
||||||
<string name="kpm_args">Parameters</string>
|
<string name="kpm_args">Parameters</string>
|
||||||
@@ -245,8 +221,6 @@
|
|||||||
<string name="home_click_to_ContributionCard_kernelsu">SukiSU Ultra will be a relatively independent branch of KSU in the future, but we still appreciate the official KernelSU and MKSU etc. for their contributions!</string>
|
<string name="home_click_to_ContributionCard_kernelsu">SukiSU Ultra will be a relatively independent branch of KSU in the future, but we still appreciate the official KernelSU and MKSU etc. for their contributions!</string>
|
||||||
<string name="not_supported">Unsupported</string>
|
<string name="not_supported">Unsupported</string>
|
||||||
<string name="supported">Supported</string>
|
<string name="supported">Supported</string>
|
||||||
<string name="home_kpm_module">"Number of KPMs: %d "</string>
|
|
||||||
<string name="kpm_invalid_file">Invalid KPM file</string>
|
|
||||||
<string name="kernel_patched">Kernel not patched</string>
|
<string name="kernel_patched">Kernel not patched</string>
|
||||||
<string name="kernel_not_enabled">Kernel not configured</string>
|
<string name="kernel_not_enabled">Kernel not configured</string>
|
||||||
<string name="custom_settings">Custom settings</string>
|
<string name="custom_settings">Custom settings</string>
|
||||||
@@ -254,19 +228,13 @@
|
|||||||
<string name="kpm_install_mode_load">Load</string>
|
<string name="kpm_install_mode_load">Load</string>
|
||||||
<string name="kpm_install_mode_embed">Embed</string>
|
<string name="kpm_install_mode_embed">Embed</string>
|
||||||
<string name="kpm_install_mode_description">Please select: %1\$s Module Installation Mode \n\nLoad: Temporarily load the module \nEmbedded: Permanently install into the system</string>
|
<string name="kpm_install_mode_description">Please select: %1\$s Module Installation Mode \n\nLoad: Temporarily load the module \nEmbedded: Permanently install into the system</string>
|
||||||
<string name="log_failed_to_check_module_file">Failed to check module file existence</string>
|
|
||||||
<string name="snackbar_failed_to_check_module_file">Unable to check if module file exists</string>
|
<string name="snackbar_failed_to_check_module_file">Unable to check if module file exists</string>
|
||||||
<string name="confirm_uninstall_title">Confirm uninstallation</string>
|
|
||||||
<string name="confirm_uninstall_confirm">Uninstall</string>
|
|
||||||
<string name="confirm_uninstall_dismiss">Cancel</string>
|
|
||||||
<string name="theme_color">Theme Color</string>
|
<string name="theme_color">Theme Color</string>
|
||||||
<string name="invalid_file_type">Incorrect file type! Please select .kpm file.</string>
|
<string name="invalid_file_type">Incorrect file type! Please select .kpm file.</string>
|
||||||
<string name="confirm_uninstall_title_with_filename">Uninstall</string>
|
<string name="confirm_uninstall_title_with_filename">Uninstall</string>
|
||||||
<string name="confirm_uninstall_content">The following KPM will be uninstalled: %s</string>
|
<string name="confirm_uninstall_content">The following KPM will be uninstalled: %s</string>
|
||||||
<string name="settings_susfs_toggle_summary">Disable kprobe hooks created by KernelSU, using inline hooks instead, which is similar to non-GKI kernel hooking method.</string>
|
<string name="settings_susfs_toggle_summary">Disable kprobe hooks created by KernelSU, using inline hooks instead, which is similar to non-GKI kernel hooking method.</string>
|
||||||
<string name="image_editor_title">Adjust background image</string>
|
|
||||||
<string name="image_editor_hint">Use two fingers to zoom the image, and one finger to drag it to adjust the position</string>
|
<string name="image_editor_hint">Use two fingers to zoom the image, and one finger to drag it to adjust the position</string>
|
||||||
<string name="background_image_error">Could not load image</string>
|
|
||||||
<string name="reprovision">Reprovision</string>
|
<string name="reprovision">Reprovision</string>
|
||||||
<!-- Kernel Flash Progress Related -->
|
<!-- Kernel Flash Progress Related -->
|
||||||
<string name="horizon_flash_title">Kernel Flashing</string>
|
<string name="horizon_flash_title">Kernel Flashing</string>
|
||||||
@@ -303,10 +271,6 @@
|
|||||||
<string name="app_settings">Application Settings</string>
|
<string name="app_settings">Application Settings</string>
|
||||||
<string name="tools">Tools</string>
|
<string name="tools">Tools</string>
|
||||||
<!-- String resources used in SuperUser -->
|
<!-- String resources used in SuperUser -->
|
||||||
<string name="clear">Removals</string>
|
|
||||||
<string name="apps_with_root">Applications with root privileges</string>
|
|
||||||
<string name="apps_with_custom_profile">Applications with customized configurations</string>
|
|
||||||
<string name="other_apps">Applications with unchanged defaults</string>
|
|
||||||
<string name="no_apps_found">Application not found</string>
|
<string name="no_apps_found">Application not found</string>
|
||||||
<string name="selinux_enabled_toast">SELinux Enabled</string>
|
<string name="selinux_enabled_toast">SELinux Enabled</string>
|
||||||
<string name="selinux_disabled_toast">SELinux Disabled</string>
|
<string name="selinux_disabled_toast">SELinux Disabled</string>
|
||||||
@@ -314,8 +278,6 @@
|
|||||||
<string name="advanced_settings">Advanced Settings</string>
|
<string name="advanced_settings">Advanced Settings</string>
|
||||||
<string name="appearance_settings">Customize the toolbar</string>
|
<string name="appearance_settings">Customize the toolbar</string>
|
||||||
<string name="back">Comeback</string>
|
<string name="back">Comeback</string>
|
||||||
<string name="expand">Be in full swing</string>
|
|
||||||
<string name="collapse">put away</string>
|
|
||||||
<string name="susfs_enabled">SuSFS enabled</string>
|
<string name="susfs_enabled">SuSFS enabled</string>
|
||||||
<string name="susfs_disabled">SuSFS disabled</string>
|
<string name="susfs_disabled">SuSFS disabled</string>
|
||||||
<string name="background_set_success">Background set successfully</string>
|
<string name="background_set_success">Background set successfully</string>
|
||||||
@@ -323,7 +285,6 @@
|
|||||||
<string name="icon_switch_title">Alternate icon</string>
|
<string name="icon_switch_title">Alternate icon</string>
|
||||||
<string name="icon_switch_summary">Change the launcher icon to KernelSU\'s icon.</string>
|
<string name="icon_switch_summary">Change the launcher icon to KernelSU\'s icon.</string>
|
||||||
<string name="icon_switched">Icon switched</string>
|
<string name="icon_switched">Icon switched</string>
|
||||||
<string name="root_require_for_install">Requires root privileges</string>
|
|
||||||
<!-- KPM display settings -->
|
<!-- KPM display settings -->
|
||||||
<string name="show_kpm_info">Display KPM Function</string>
|
<string name="show_kpm_info">Display KPM Function</string>
|
||||||
<string name="show_kpm_info_summary">Display KPM information and Function in home and bottom bar (Need to reopen the app)</string>
|
<string name="show_kpm_info_summary">Display KPM information and Function in home and bottom bar (Need to reopen the app)</string>
|
||||||
@@ -335,7 +296,6 @@
|
|||||||
<string name="use_webuix_eruda">Inject Eruda into WebUI X</string>
|
<string name="use_webuix_eruda">Inject Eruda into WebUI X</string>
|
||||||
<string name="use_webuix_eruda_summary">Inject a debug console into WebUI X to make debugging easier. Requires web debugging to be on.</string>
|
<string name="use_webuix_eruda_summary">Inject a debug console into WebUI X to make debugging easier. Requires web debugging to be on.</string>
|
||||||
<!-- DPI setting related strings -->
|
<!-- DPI setting related strings -->
|
||||||
<string name="dpi_settings">DPI setting</string>
|
|
||||||
<string name="app_dpi_title">Applied DPI</string>
|
<string name="app_dpi_title">Applied DPI</string>
|
||||||
<string name="app_dpi_summary">Adjust the screen display density for the current application only</string>
|
<string name="app_dpi_summary">Adjust the screen display density for the current application only</string>
|
||||||
<string name="dpi_size_small">Small </string>
|
<string name="dpi_size_small">Small </string>
|
||||||
@@ -353,16 +313,6 @@
|
|||||||
<string name="language_follow_system">Follow System</string>
|
<string name="language_follow_system">Follow System</string>
|
||||||
<string name="language_changed">Language changed, restarting to apply changes</string>
|
<string name="language_changed">Language changed, restarting to apply changes</string>
|
||||||
<string name="settings_card_dim">Card Darkness Adjustment</string>
|
<string name="settings_card_dim">Card Darkness Adjustment</string>
|
||||||
<!-- Super User Related -->
|
|
||||||
<string name="scroll_to_top">Top</string>
|
|
||||||
<string name="scroll_to_bottom">Bottom</string>
|
|
||||||
<string name="scroll_to_top_description">Scroll to top</string>
|
|
||||||
<string name="scroll_to_bottom_description">Scroll to the bottom</string>
|
|
||||||
<string name="authorized">authorized</string>
|
|
||||||
<string name="unauthorized">unauthorized</string>
|
|
||||||
<string name="selected">Selected</string>
|
|
||||||
<string name="select">option</string>
|
|
||||||
<string name="profile_umount_modules_disable">Disable custom uninstallation module</string>
|
|
||||||
<!-- Flash related -->
|
<!-- Flash related -->
|
||||||
<string name="error_code">error code</string>
|
<string name="error_code">error code</string>
|
||||||
<string name="check_log">Please check the log</string>
|
<string name="check_log">Please check the log</string>
|
||||||
@@ -370,4 +320,51 @@
|
|||||||
<string name="module_failed_count">%d Failed to install a new module</string>
|
<string name="module_failed_count">%d Failed to install a new module</string>
|
||||||
<string name="module_download_error">Module download failed</string>
|
<string name="module_download_error">Module download failed</string>
|
||||||
<string name="kernel_flashing">Kernel Flashing</string>
|
<string name="kernel_flashing">Kernel Flashing</string>
|
||||||
|
<!-- 分类相关 -->
|
||||||
|
<string name="category_all_apps">All</string>
|
||||||
|
<string name="category_root_apps">Root</string>
|
||||||
|
<string name="category_custom_apps">Custom</string>
|
||||||
|
<string name="category_default_apps">Default</string>
|
||||||
|
<!-- 排序相关 -->
|
||||||
|
<string name="sort_name_asc">Ascending order of name</string>
|
||||||
|
<string name="sort_name_desc">Name descending</string>
|
||||||
|
<string name="sort_install_time_new">Installation time (new)</string>
|
||||||
|
<string name="sort_install_time_old">Installation time (old)</string>
|
||||||
|
<string name="sort_size_desc">descending order of size</string>
|
||||||
|
<string name="sort_size_asc">ascending order of size</string>
|
||||||
|
<string name="sort_usage_freq">frequency of use</string>
|
||||||
|
<!-- 状态相关 -->
|
||||||
|
<string name="no_apps_in_category">No application in this category</string>
|
||||||
|
<!-- 标签相关 -->
|
||||||
|
<!-- FAB菜单相关 -->
|
||||||
|
<string name="deny_authorization">Delegation of authority</string>
|
||||||
|
<string name="grant_authorization">Authorizations</string>
|
||||||
|
<string name="unmount_modules">Unmounting Module Mounts</string>
|
||||||
|
<string name="disable_unmount">Disable uninstall module mounting</string>
|
||||||
|
<string name="expand_menu">Expand menu</string>
|
||||||
|
<string name="collapse_menu">Put away the menu</string>
|
||||||
|
<string name="scroll_to_top">Top</string>
|
||||||
|
<string name="scroll_to_bottom">Bottom</string>
|
||||||
|
<string name="selected">Selected</string>
|
||||||
|
<string name="select">option</string>
|
||||||
|
<!-- BottomSheet相关 -->
|
||||||
|
<string name="menu_options">Menu Options</string>
|
||||||
|
<string name="sort_options">Sort by</string>
|
||||||
|
<string name="app_categories">Application Type Selection</string>
|
||||||
|
<!-- SuSFS Configuration -->
|
||||||
|
<!-- SuSFS Reset Confirmation -->
|
||||||
|
<!-- SuSFS Toast Messages -->
|
||||||
|
<!-- SuSFS Settings Item -->
|
||||||
|
<!-- 开机自启动相关 -->
|
||||||
|
<!-- SuSFS Tab Titles -->
|
||||||
|
<!-- SuSFS Dialog Actions -->
|
||||||
|
<!-- SuSFS Path Management -->
|
||||||
|
<!-- SuSFS Umount Mode -->
|
||||||
|
<!-- SuSFS Run Umount -->
|
||||||
|
<!-- SuSFS Reset Categories -->
|
||||||
|
<!-- SuSFS Path Settings -->
|
||||||
|
<!-- SuSFS Enabled Features -->
|
||||||
|
<!-- Feature Labels -->
|
||||||
|
<!-- 可切换状态 -->
|
||||||
|
<!-- Settings related strings -->
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -6,11 +6,9 @@
|
|||||||
<string name="module_failed_to_enable">মোডিউল ইনেবল করা যায়নি: %s</string>
|
<string name="module_failed_to_enable">মোডিউল ইনেবল করা যায়নি: %s</string>
|
||||||
<string name="home_click_to_install">ইন্সটল করটে চাপুন</string>
|
<string name="home_click_to_install">ইন্সটল করটে চাপুন</string>
|
||||||
<string name="home_working">কাজ করছে</string>
|
<string name="home_working">কাজ করছে</string>
|
||||||
<string name="home_module_count">মোডিউল: %d</string>
|
|
||||||
<string name="home_unsupported">অমূলক</string>
|
<string name="home_unsupported">অমূলক</string>
|
||||||
<string name="home_kernel">কর্নেল</string>
|
<string name="home_kernel">কর্নেল</string>
|
||||||
<string name="home_manager_version">ম্যানেজার ভারসন</string>
|
<string name="home_manager_version">ম্যানেজার ভারসন</string>
|
||||||
<string name="home_fingerprint">ফিঙ্গারপ্রিন্ট</string>
|
|
||||||
<string name="selinux_status_disabled">ডিসেবল</string>
|
<string name="selinux_status_disabled">ডিসেবল</string>
|
||||||
<string name="selinux_status_enforcing">এনফোর্সিং</string>
|
<string name="selinux_status_enforcing">এনফোর্সিং</string>
|
||||||
<string name="superuser">সুপার ইউজার</string>
|
<string name="superuser">সুপার ইউজার</string>
|
||||||
@@ -21,7 +19,6 @@
|
|||||||
<string name="reboot">রিবুট</string>
|
<string name="reboot">রিবুট</string>
|
||||||
<string name="settings">সেটিংস</string>
|
<string name="settings">সেটিংস</string>
|
||||||
<string name="reboot_userspace">সফট রিবুট</string>
|
<string name="reboot_userspace">সফট রিবুট</string>
|
||||||
<string name="profile_namespace_global">গ্লোবাল</string>
|
|
||||||
<string name="profile_groups">গ্রুপস</string>
|
<string name="profile_groups">গ্রুপস</string>
|
||||||
<string name="profile_selinux_context">এসইলিনাক্স কন্টেক্সট</string>
|
<string name="profile_selinux_context">এসইলিনাক্স কন্টেক্সট</string>
|
||||||
<string name="failed_to_update_app_profile">%s এর জন্য অ্যাপ প্রফাইল আপডেট করা যায়নি</string>
|
<string name="failed_to_update_app_profile">%s এর জন্য অ্যাপ প্রফাইল আপডেট করা যায়নি</string>
|
||||||
@@ -31,11 +28,7 @@
|
|||||||
<string name="selinux_status_permissive">পারমিসিভ</string>
|
<string name="selinux_status_permissive">পারমিসিভ</string>
|
||||||
<string name="module_failed_to_disable">মোডিউল ডিসেবল করা যায়নি: %s</string>
|
<string name="module_failed_to_disable">মোডিউল ডিসেবল করা যায়নি: %s</string>
|
||||||
<string name="module_empty">কোনো মোডিউল ইন্সটল করা নেই</string>
|
<string name="module_empty">কোনো মোডিউল ইন্সটল করা নেই</string>
|
||||||
<string name="home_working_version">সংস্করণ: %d</string>
|
<string name="home_working_version">সংস্করণ: %s</string>
|
||||||
<string name="home_superuser_count">সুপার ইউজার: %d</string>
|
|
||||||
<string name="profile_namespace">নেইম স্পেস মাউন্ট</string>
|
|
||||||
<string name="profile_namespace_inherited">ইনহেরিটেড</string>
|
|
||||||
<string name="profile_namespace_individual">ইন্ডিভিজুয়াল</string>
|
|
||||||
<string name="profile_capabilities">ক্যাপাবিলিটিস</string>
|
<string name="profile_capabilities">ক্যাপাবিলিটিস</string>
|
||||||
<string name="profile_umount_modules">আনমাউন্ট মোডিউলস</string>
|
<string name="profile_umount_modules">আনমাউন্ট মোডিউলস</string>
|
||||||
<string name="reboot_recovery">রিকভারিতে বুট</string>
|
<string name="reboot_recovery">রিকভারিতে বুট</string>
|
||||||
|
|||||||
@@ -4,14 +4,11 @@
|
|||||||
<string name="home_not_installed">ইনস্টল করা হয়নি</string>
|
<string name="home_not_installed">ইনস্টল করা হয়নি</string>
|
||||||
<string name="home_click_to_install">ইনস্টল করার জন্য ক্লিক করুন</string>
|
<string name="home_click_to_install">ইনস্টল করার জন্য ক্লিক করুন</string>
|
||||||
<string name="home_working"> ওয়ার্কিং</string>
|
<string name="home_working"> ওয়ার্কিং</string>
|
||||||
<string name="home_working_version">ওয়ার্কিং সংস্করণ: %d</string>
|
<string name="home_working_version">ওয়ার্কিং সংস্করণ: %s</string>
|
||||||
<string name="home_superuser_count">সুপার ইউজার: %d</string>
|
|
||||||
<string name="home_module_count">মডিউল: %d</string>
|
|
||||||
<string name="home_unsupported">অসমর্থিত</string>
|
<string name="home_unsupported">অসমর্থিত</string>
|
||||||
<string name="home_unsupported_reason">KernelSU শুধুমাত্র GKI কার্নেল সমর্থন করে</string>
|
<string name="home_unsupported_reason">KernelSU শুধুমাত্র GKI কার্নেল সমর্থন করে</string>
|
||||||
<string name="home_kernel">কার্নেল</string>
|
<string name="home_kernel">কার্নেল</string>
|
||||||
<string name="home_manager_version">ম্যানেজার সংস্করণ</string>
|
<string name="home_manager_version">ম্যানেজার সংস্করণ</string>
|
||||||
<string name="home_fingerprint">ফিঙ্গারপ্রিন্ট</string>
|
|
||||||
<string name="home_selinux_status">SELinux স্টেটাস</string>
|
<string name="home_selinux_status">SELinux স্টেটাস</string>
|
||||||
<string name="selinux_status_disabled">ডিজেবল</string>
|
<string name="selinux_status_disabled">ডিজেবল</string>
|
||||||
<string name="selinux_status_enforcing">কার্যকর</string>
|
<string name="selinux_status_enforcing">কার্যকর</string>
|
||||||
@@ -51,15 +48,12 @@
|
|||||||
<string name="home_support_title">সাপোর্ট টাইটেল</string>
|
<string name="home_support_title">সাপোর্ট টাইটেল</string>
|
||||||
<string name="home_support_content">কার্নেলএসইউ বিনামূল্যে এবং ওপেন সোর্স, এবং সবসময় থাকবে। আপনি সবসময় একটি অনুদান দিয়ে আপনার কৃতজ্ঞতা প্রদর্শন করতে পারেন.</string>
|
<string name="home_support_content">কার্নেলএসইউ বিনামূল্যে এবং ওপেন সোর্স, এবং সবসময় থাকবে। আপনি সবসময় একটি অনুদান দিয়ে আপনার কৃতজ্ঞতা প্রদর্শন করতে পারেন.</string>
|
||||||
<string name="profile_name">প্রফাইলের নাম</string>
|
<string name="profile_name">প্রফাইলের নাম</string>
|
||||||
<string name="profile_namespace">নেমস্পেস মাউন্ট</string>
|
|
||||||
<string name="profile_groups">গ্রুপস</string>
|
<string name="profile_groups">গ্রুপস</string>
|
||||||
<string name="profile_capabilities">যোগ্যতা</string>
|
<string name="profile_capabilities">যোগ্যতা</string>
|
||||||
<string name="profile_selinux_context">এসই লিনাক্স কনটেক্সট</string>
|
<string name="profile_selinux_context">এসই লিনাক্স কনটেক্সট</string>
|
||||||
<string name="profile_default">ডিফল্ট</string>
|
<string name="profile_default">ডিফল্ট</string>
|
||||||
<string name="profile_template">টেমপ্লেট</string>
|
<string name="profile_template">টেমপ্লেট</string>
|
||||||
<string name="profile_custom">কাস্টম</string>
|
<string name="profile_custom">কাস্টম</string>
|
||||||
<string name="profile_namespace_global">গ্লোবাল</string>
|
|
||||||
<string name="profile_namespace_individual">আলাদাভাবে</string>
|
|
||||||
<string name="profile_umount_modules">আনমাউন্ট মোডিউল</string>
|
<string name="profile_umount_modules">আনমাউন্ট মোডিউল</string>
|
||||||
<string name="save_log">লগ সংরক্ষণ করুন</string>
|
<string name="save_log">লগ সংরক্ষণ করুন</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -4,17 +4,12 @@
|
|||||||
<string name="home_not_installed">Nije instalirano</string>
|
<string name="home_not_installed">Nije instalirano</string>
|
||||||
<string name="home_click_to_install">Kliknite da instalirate</string>
|
<string name="home_click_to_install">Kliknite da instalirate</string>
|
||||||
<string name="home_working">Radi</string>
|
<string name="home_working">Radi</string>
|
||||||
<string name="home_working_version">Verzija: %d</string>
|
<string name="home_working_version">Verzija: %s</string>
|
||||||
<string name="home_superuser_count">Superkorisnici: %d</string>
|
|
||||||
<string name="home_module_count">Module: %d</string>
|
|
||||||
<string name="home_unsupported">Nepodržano</string>
|
<string name="home_unsupported">Nepodržano</string>
|
||||||
<string name="home_unsupported_reason">KernelSU samo podržava GKI kernele sad</string>
|
<string name="home_unsupported_reason">KernelSU samo podržava GKI kernele sad</string>
|
||||||
<string name="home_kernel">Kernel</string>
|
<string name="home_kernel">Kernel</string>
|
||||||
<string name="home_susfs">SuSFS: %s</string>
|
|
||||||
<string name="home_susfs_version">SuSFS Version</string>
|
<string name="home_susfs_version">SuSFS Version</string>
|
||||||
<string name="home_susfs_sus_su">SuS SU</string>
|
|
||||||
<string name="home_manager_version">Verzija Upravitelja</string>
|
<string name="home_manager_version">Verzija Upravitelja</string>
|
||||||
<string name="home_fingerprint">Otisak prsta</string>
|
|
||||||
<string name="home_selinux_status">SELinux stanje</string>
|
<string name="home_selinux_status">SELinux stanje</string>
|
||||||
<string name="selinux_status_disabled">Isključeno</string>
|
<string name="selinux_status_disabled">Isključeno</string>
|
||||||
<string name="selinux_status_enforcing">U Provođenju</string>
|
<string name="selinux_status_enforcing">U Provođenju</string>
|
||||||
@@ -28,7 +23,6 @@
|
|||||||
<string name="module_sort_action_first">Sort (Action first)</string>
|
<string name="module_sort_action_first">Sort (Action first)</string>
|
||||||
<string name="module_sort_enabled_first">Sort (Enabled first)</string>
|
<string name="module_sort_enabled_first">Sort (Enabled first)</string>
|
||||||
<string name="uninstall">Deinstalirajte</string>
|
<string name="uninstall">Deinstalirajte</string>
|
||||||
<string name="restore">Restore</string>
|
|
||||||
<string name="module_install">Instalirajte</string>
|
<string name="module_install">Instalirajte</string>
|
||||||
<string name="install">Instalirajte</string>
|
<string name="install">Instalirajte</string>
|
||||||
<string name="reboot">Ponovo pokrenite</string>
|
<string name="reboot">Ponovo pokrenite</string>
|
||||||
@@ -61,16 +55,12 @@
|
|||||||
<string name="profile_template">Šablon</string>
|
<string name="profile_template">Šablon</string>
|
||||||
<string name="profile_custom">Prilagođeno</string>
|
<string name="profile_custom">Prilagođeno</string>
|
||||||
<string name="profile_name">Naziv profila</string>
|
<string name="profile_name">Naziv profila</string>
|
||||||
<string name="profile_namespace">Imenski prostor nosača</string>
|
|
||||||
<string name="profile_namespace_inherited">Naslijeđen</string>
|
|
||||||
<string name="profile_namespace_global">Globalan</string>
|
|
||||||
<string name="profile_namespace_individual">Pojedinačan</string>
|
|
||||||
<string name="profile_groups">Grupe</string>
|
<string name="profile_groups">Grupe</string>
|
||||||
<string name="profile_capabilities">Sposobnosti</string>
|
<string name="profile_capabilities">Sposobnosti</string>
|
||||||
<string name="profile_selinux_context">SELinux kontekst</string>
|
<string name="profile_selinux_context">SELinux kontekst</string>
|
||||||
<string name="profile_umount_modules">Umount module</string>
|
<string name="profile_umount_modules">Umount module</string>
|
||||||
<string name="failed_to_update_app_profile">Ažuriranje Profila Aplikacije za %s nije uspjelo</string>
|
<string name="failed_to_update_app_profile">Ažuriranje Profila Aplikacije za %s nije uspjelo</string>
|
||||||
<string name="require_kernel_version" formatted="false">The current KernelSU version %d is too low for the manager to work properly. Please upgrade to version %d or higher!</string>
|
<string name="require_kernel_version" formatted="false">The current KernelSU version %s is too low for the manager to work properly. Please upgrade to version %s or higher!</string>
|
||||||
<string name="settings_umount_modules_default">Umount module po zadanom</string>
|
<string name="settings_umount_modules_default">Umount module po zadanom</string>
|
||||||
<string name="settings_umount_modules_default_summary">Globalna zadana vrijednost za \"Umount module\" u Profilima Aplikacije. Ako je omogućeno, uklonit će sve izmjene modula na sistemu za aplikacije koje nemaju postavljen Profil.</string>
|
<string name="settings_umount_modules_default_summary">Globalna zadana vrijednost za \"Umount module\" u Profilima Aplikacije. Ako je omogućeno, uklonit će sve izmjene modula na sistemu za aplikacije koje nemaju postavljen Profil.</string>
|
||||||
<string name="settings_susfs_toggle">Disable kprobe hooks</string>
|
<string name="settings_susfs_toggle">Disable kprobe hooks</string>
|
||||||
@@ -112,7 +102,6 @@
|
|||||||
<string name="settings_check_update_summary">Automatically check for updates when opening the app</string>
|
<string name="settings_check_update_summary">Automatically check for updates when opening the app</string>
|
||||||
<string name="grant_root_failed">Failed to grant root!</string>
|
<string name="grant_root_failed">Failed to grant root!</string>
|
||||||
<string name="action">Action</string>
|
<string name="action">Action</string>
|
||||||
<string name="open">Open</string>
|
|
||||||
<string name="close">Close</string>
|
<string name="close">Close</string>
|
||||||
<string name="enable_web_debugging">Enable WebView debugging</string>
|
<string name="enable_web_debugging">Enable WebView debugging</string>
|
||||||
<string name="enable_web_debugging_summary">Can be used to debug WebUI. Please enable only when needed.</string>
|
<string name="enable_web_debugging_summary">Can be used to debug WebUI. Please enable only when needed.</string>
|
||||||
@@ -136,9 +125,6 @@
|
|||||||
<string name="selected_lkm">Selected LKM: %s</string>
|
<string name="selected_lkm">Selected LKM: %s</string>
|
||||||
<string name="save_log">Sačuvaj Dnevnike</string>
|
<string name="save_log">Sačuvaj Dnevnike</string>
|
||||||
<string name="log_saved">Logs saved</string>
|
<string name="log_saved">Logs saved</string>
|
||||||
<string name="status_supported">Supported</string>
|
|
||||||
<string name="status_not_supported">Not Supported</string>
|
|
||||||
<string name="status_unknown">Unknown</string>
|
|
||||||
<string name="sus_su_mode">SuS SU mode:</string>
|
<string name="sus_su_mode">SuS SU mode:</string>
|
||||||
<!-- Module related -->
|
<!-- Module related -->
|
||||||
<string name="module_install_confirm">confirm install module %1$s?</string>
|
<string name="module_install_confirm">confirm install module %1$s?</string>
|
||||||
@@ -172,14 +158,11 @@
|
|||||||
<string name="settings_custom_background">Custom App Background</string>
|
<string name="settings_custom_background">Custom App Background</string>
|
||||||
<string name="settings_custom_background_summary">Select an image as background</string>
|
<string name="settings_custom_background_summary">Select an image as background</string>
|
||||||
<string name="settings_card_alpha">Navigation bar transparency</string>
|
<string name="settings_card_alpha">Navigation bar transparency</string>
|
||||||
<string name="settings_restore_default">Restore default</string>
|
|
||||||
<string name="home_android_version">Android version</string>
|
<string name="home_android_version">Android version</string>
|
||||||
<string name="home_device_model">Device model</string>
|
<string name="home_device_model">Device model</string>
|
||||||
<string name="su_not_allowed">Granting superuser to %s is not allowed</string>
|
<string name="su_not_allowed">Granting superuser to %s is not allowed</string>
|
||||||
<string name="settings_disable_su">Disable su compatibility</string>
|
<string name="settings_disable_su">Disable su compatibility</string>
|
||||||
<string name="settings_disable_su_summary">Temporarily disable any applications from obtaining root privileges via the su command (existing root processes will not be affected).</string>
|
<string name="settings_disable_su_summary">Temporarily disable any applications from obtaining root privileges via the su command (existing root processes will not be affected).</string>
|
||||||
<string name="using_mksu_manager">You are using the SukiSU Beta manager</string>
|
|
||||||
<string name="module_install_multiple_confirm">Are you sure you want to install the selected %d modules?</string>
|
|
||||||
<string name="module_install_multiple_confirm_with_names">Sure you want to install the following %1$d modules? \n\n%2$s</string>
|
<string name="module_install_multiple_confirm_with_names">Sure you want to install the following %1$d modules? \n\n%2$s</string>
|
||||||
<string name="more_settings">More settings</string>
|
<string name="more_settings">More settings</string>
|
||||||
<string name="selinux">SELinux</string>
|
<string name="selinux">SELinux</string>
|
||||||
@@ -210,20 +193,14 @@
|
|||||||
<string name="color_pink">Pink</string>
|
<string name="color_pink">Pink</string>
|
||||||
<string name="color_gray">Gray</string>
|
<string name="color_gray">Gray</string>
|
||||||
<string name="color_yellow">Yellow</string>
|
<string name="color_yellow">Yellow</string>
|
||||||
<string name="flash_option">Brush Options</string>
|
|
||||||
<string name="flash_option_tip">Select the file to be flashed</string>
|
|
||||||
<string name="horizon_kernel">Install Anykernel3</string>
|
<string name="horizon_kernel">Install Anykernel3</string>
|
||||||
<string name="horizon_kernel_summary">Flash AnyKernel3 kernel file</string>
|
<string name="horizon_kernel_summary">Flash AnyKernel3 kernel file</string>
|
||||||
<string name="root_required">Requires root privileges</string>
|
<string name="root_required">Requires root privileges</string>
|
||||||
<string name="copy_failed">File Copy Failure</string>
|
|
||||||
<string name="reboot_complete_title">Scrubbing complete</string>
|
<string name="reboot_complete_title">Scrubbing complete</string>
|
||||||
<string name="reboot_complete_msg">Whether to reboot immediately?</string>
|
<string name="reboot_complete_msg">Whether to reboot immediately?</string>
|
||||||
<string name="yes">Yes</string>
|
<string name="yes">Yes</string>
|
||||||
<string name="no">No</string>
|
<string name="no">No</string>
|
||||||
<string name="failed_reboot">Reboot Failed</string>
|
<string name="failed_reboot">Reboot Failed</string>
|
||||||
<string name="batch_authorization">empower</string>
|
|
||||||
<string name="batch_cancel_authorization">withdraw</string>
|
|
||||||
<string name="backup">Backup</string>
|
|
||||||
<string name="kpm_title">KPM</string>
|
<string name="kpm_title">KPM</string>
|
||||||
<string name="kpm_empty">No installed kernel modules at this time</string>
|
<string name="kpm_empty">No installed kernel modules at this time</string>
|
||||||
<string name="kpm_version">Version</string>
|
<string name="kpm_version">Version</string>
|
||||||
@@ -231,7 +208,6 @@
|
|||||||
<string name="kpm_uninstall">Uninstall</string>
|
<string name="kpm_uninstall">Uninstall</string>
|
||||||
<string name="kpm_uninstall_success">Uninstalled successfully</string>
|
<string name="kpm_uninstall_success">Uninstalled successfully</string>
|
||||||
<string name="kpm_uninstall_failed">Failed to uninstall</string>
|
<string name="kpm_uninstall_failed">Failed to uninstall</string>
|
||||||
<string name="kpm_install">Install</string>
|
|
||||||
<string name="kpm_install_success">Load of kpm module successful</string>
|
<string name="kpm_install_success">Load of kpm module successful</string>
|
||||||
<string name="kpm_install_failed">Load of kpm module failed</string>
|
<string name="kpm_install_failed">Load of kpm module failed</string>
|
||||||
<string name="kpm_args">Parameters</string>
|
<string name="kpm_args">Parameters</string>
|
||||||
@@ -245,8 +221,6 @@
|
|||||||
<string name="home_click_to_ContributionCard_kernelsu">SukiSU Ultra will be a relatively independent branch of KSU in the future, but we still appreciate the official KernelSU and MKSU etc. for their contributions!</string>
|
<string name="home_click_to_ContributionCard_kernelsu">SukiSU Ultra will be a relatively independent branch of KSU in the future, but we still appreciate the official KernelSU and MKSU etc. for their contributions!</string>
|
||||||
<string name="not_supported">Unsupported</string>
|
<string name="not_supported">Unsupported</string>
|
||||||
<string name="supported">Supported</string>
|
<string name="supported">Supported</string>
|
||||||
<string name="home_kpm_module">"Number of KPMs: %d "</string>
|
|
||||||
<string name="kpm_invalid_file">Invalid KPM file</string>
|
|
||||||
<string name="kernel_patched">Kernel not patched</string>
|
<string name="kernel_patched">Kernel not patched</string>
|
||||||
<string name="kernel_not_enabled">Kernel not configured</string>
|
<string name="kernel_not_enabled">Kernel not configured</string>
|
||||||
<string name="custom_settings">Custom settings</string>
|
<string name="custom_settings">Custom settings</string>
|
||||||
@@ -254,19 +228,13 @@
|
|||||||
<string name="kpm_install_mode_load">Load</string>
|
<string name="kpm_install_mode_load">Load</string>
|
||||||
<string name="kpm_install_mode_embed">Embed</string>
|
<string name="kpm_install_mode_embed">Embed</string>
|
||||||
<string name="kpm_install_mode_description">Please select: %1\$s Module Installation Mode \n\nLoad: Temporarily load the module \nEmbedded: Permanently install into the system</string>
|
<string name="kpm_install_mode_description">Please select: %1\$s Module Installation Mode \n\nLoad: Temporarily load the module \nEmbedded: Permanently install into the system</string>
|
||||||
<string name="log_failed_to_check_module_file">Failed to check module file existence</string>
|
|
||||||
<string name="snackbar_failed_to_check_module_file">Unable to check if module file exists</string>
|
<string name="snackbar_failed_to_check_module_file">Unable to check if module file exists</string>
|
||||||
<string name="confirm_uninstall_title">Confirm uninstallation</string>
|
|
||||||
<string name="confirm_uninstall_confirm">Uninstall</string>
|
|
||||||
<string name="confirm_uninstall_dismiss">Cancel</string>
|
|
||||||
<string name="theme_color">Theme Color</string>
|
<string name="theme_color">Theme Color</string>
|
||||||
<string name="invalid_file_type">Incorrect file type! Please select .kpm file.</string>
|
<string name="invalid_file_type">Incorrect file type! Please select .kpm file.</string>
|
||||||
<string name="confirm_uninstall_title_with_filename">Uninstall</string>
|
<string name="confirm_uninstall_title_with_filename">Uninstall</string>
|
||||||
<string name="confirm_uninstall_content">The following KPM will be uninstalled: %s</string>
|
<string name="confirm_uninstall_content">The following KPM will be uninstalled: %s</string>
|
||||||
<string name="settings_susfs_toggle_summary">Disable kprobe hooks created by KernelSU, using inline hooks instead, which is similar to non-GKI kernel hooking method.</string>
|
<string name="settings_susfs_toggle_summary">Disable kprobe hooks created by KernelSU, using inline hooks instead, which is similar to non-GKI kernel hooking method.</string>
|
||||||
<string name="image_editor_title">Adjust background image</string>
|
|
||||||
<string name="image_editor_hint">Use two fingers to zoom the image, and one finger to drag it to adjust the position</string>
|
<string name="image_editor_hint">Use two fingers to zoom the image, and one finger to drag it to adjust the position</string>
|
||||||
<string name="background_image_error">Could not load image</string>
|
|
||||||
<string name="reprovision">Reprovision</string>
|
<string name="reprovision">Reprovision</string>
|
||||||
<!-- Kernel Flash Progress Related -->
|
<!-- Kernel Flash Progress Related -->
|
||||||
<string name="horizon_flash_title">Kernel Flashing</string>
|
<string name="horizon_flash_title">Kernel Flashing</string>
|
||||||
@@ -303,10 +271,6 @@
|
|||||||
<string name="app_settings">Application Settings</string>
|
<string name="app_settings">Application Settings</string>
|
||||||
<string name="tools">Tools</string>
|
<string name="tools">Tools</string>
|
||||||
<!-- String resources used in SuperUser -->
|
<!-- String resources used in SuperUser -->
|
||||||
<string name="clear">Removals</string>
|
|
||||||
<string name="apps_with_root">Applications with root privileges</string>
|
|
||||||
<string name="apps_with_custom_profile">Applications with customized configurations</string>
|
|
||||||
<string name="other_apps">Applications with unchanged defaults</string>
|
|
||||||
<string name="no_apps_found">Application not found</string>
|
<string name="no_apps_found">Application not found</string>
|
||||||
<string name="selinux_enabled_toast">SELinux Enabled</string>
|
<string name="selinux_enabled_toast">SELinux Enabled</string>
|
||||||
<string name="selinux_disabled_toast">SELinux Disabled</string>
|
<string name="selinux_disabled_toast">SELinux Disabled</string>
|
||||||
@@ -314,8 +278,6 @@
|
|||||||
<string name="advanced_settings">Advanced Settings</string>
|
<string name="advanced_settings">Advanced Settings</string>
|
||||||
<string name="appearance_settings">Customize the toolbar</string>
|
<string name="appearance_settings">Customize the toolbar</string>
|
||||||
<string name="back">Comeback</string>
|
<string name="back">Comeback</string>
|
||||||
<string name="expand">Be in full swing</string>
|
|
||||||
<string name="collapse">put away</string>
|
|
||||||
<string name="susfs_enabled">SuSFS enabled</string>
|
<string name="susfs_enabled">SuSFS enabled</string>
|
||||||
<string name="susfs_disabled">SuSFS disabled</string>
|
<string name="susfs_disabled">SuSFS disabled</string>
|
||||||
<string name="background_set_success">Background set successfully</string>
|
<string name="background_set_success">Background set successfully</string>
|
||||||
@@ -323,7 +285,6 @@
|
|||||||
<string name="icon_switch_title">Alternate icon</string>
|
<string name="icon_switch_title">Alternate icon</string>
|
||||||
<string name="icon_switch_summary">Change the launcher icon to KernelSU\'s icon.</string>
|
<string name="icon_switch_summary">Change the launcher icon to KernelSU\'s icon.</string>
|
||||||
<string name="icon_switched">Icon switched</string>
|
<string name="icon_switched">Icon switched</string>
|
||||||
<string name="root_require_for_install">Requires root privileges</string>
|
|
||||||
<!-- KPM display settings -->
|
<!-- KPM display settings -->
|
||||||
<string name="show_kpm_info">Display KPM Function</string>
|
<string name="show_kpm_info">Display KPM Function</string>
|
||||||
<string name="show_kpm_info_summary">Display KPM information and Function in home and bottom bar (Need to reopen the app)</string>
|
<string name="show_kpm_info_summary">Display KPM information and Function in home and bottom bar (Need to reopen the app)</string>
|
||||||
@@ -335,7 +296,6 @@
|
|||||||
<string name="use_webuix_eruda">Inject Eruda into WebUI X</string>
|
<string name="use_webuix_eruda">Inject Eruda into WebUI X</string>
|
||||||
<string name="use_webuix_eruda_summary">Inject a debug console into WebUI X to make debugging easier. Requires web debugging to be on.</string>
|
<string name="use_webuix_eruda_summary">Inject a debug console into WebUI X to make debugging easier. Requires web debugging to be on.</string>
|
||||||
<!-- DPI setting related strings -->
|
<!-- DPI setting related strings -->
|
||||||
<string name="dpi_settings">DPI setting</string>
|
|
||||||
<string name="app_dpi_title">Applied DPI</string>
|
<string name="app_dpi_title">Applied DPI</string>
|
||||||
<string name="app_dpi_summary">Adjust the screen display density for the current application only</string>
|
<string name="app_dpi_summary">Adjust the screen display density for the current application only</string>
|
||||||
<string name="dpi_size_small">Small </string>
|
<string name="dpi_size_small">Small </string>
|
||||||
@@ -353,16 +313,6 @@
|
|||||||
<string name="language_follow_system">Follow System</string>
|
<string name="language_follow_system">Follow System</string>
|
||||||
<string name="language_changed">Language changed, restarting to apply changes</string>
|
<string name="language_changed">Language changed, restarting to apply changes</string>
|
||||||
<string name="settings_card_dim">Card Darkness Adjustment</string>
|
<string name="settings_card_dim">Card Darkness Adjustment</string>
|
||||||
<!-- Super User Related -->
|
|
||||||
<string name="scroll_to_top">Top</string>
|
|
||||||
<string name="scroll_to_bottom">Bottom</string>
|
|
||||||
<string name="scroll_to_top_description">Scroll to top</string>
|
|
||||||
<string name="scroll_to_bottom_description">Scroll to the bottom</string>
|
|
||||||
<string name="authorized">authorized</string>
|
|
||||||
<string name="unauthorized">unauthorized</string>
|
|
||||||
<string name="selected">Selected</string>
|
|
||||||
<string name="select">option</string>
|
|
||||||
<string name="profile_umount_modules_disable">Disable custom uninstallation module</string>
|
|
||||||
<!-- Flash related -->
|
<!-- Flash related -->
|
||||||
<string name="error_code">error code</string>
|
<string name="error_code">error code</string>
|
||||||
<string name="check_log">Please check the log</string>
|
<string name="check_log">Please check the log</string>
|
||||||
@@ -370,4 +320,51 @@
|
|||||||
<string name="module_failed_count">%d Failed to install a new module</string>
|
<string name="module_failed_count">%d Failed to install a new module</string>
|
||||||
<string name="module_download_error">Module download failed</string>
|
<string name="module_download_error">Module download failed</string>
|
||||||
<string name="kernel_flashing">Kernel Flashing</string>
|
<string name="kernel_flashing">Kernel Flashing</string>
|
||||||
|
<!-- 分类相关 -->
|
||||||
|
<string name="category_all_apps">All</string>
|
||||||
|
<string name="category_root_apps">Root</string>
|
||||||
|
<string name="category_custom_apps">Custom</string>
|
||||||
|
<string name="category_default_apps">Default</string>
|
||||||
|
<!-- 排序相关 -->
|
||||||
|
<string name="sort_name_asc">Ascending order of name</string>
|
||||||
|
<string name="sort_name_desc">Name descending</string>
|
||||||
|
<string name="sort_install_time_new">Installation time (new)</string>
|
||||||
|
<string name="sort_install_time_old">Installation time (old)</string>
|
||||||
|
<string name="sort_size_desc">descending order of size</string>
|
||||||
|
<string name="sort_size_asc">ascending order of size</string>
|
||||||
|
<string name="sort_usage_freq">frequency of use</string>
|
||||||
|
<!-- 状态相关 -->
|
||||||
|
<string name="no_apps_in_category">No application in this category</string>
|
||||||
|
<!-- 标签相关 -->
|
||||||
|
<!-- FAB菜单相关 -->
|
||||||
|
<string name="deny_authorization">Delegation of authority</string>
|
||||||
|
<string name="grant_authorization">Authorizations</string>
|
||||||
|
<string name="unmount_modules">Unmounting Module Mounts</string>
|
||||||
|
<string name="disable_unmount">Disable uninstall module mounting</string>
|
||||||
|
<string name="expand_menu">Expand menu</string>
|
||||||
|
<string name="collapse_menu">Put away the menu</string>
|
||||||
|
<string name="scroll_to_top">Top</string>
|
||||||
|
<string name="scroll_to_bottom">Bottom</string>
|
||||||
|
<string name="selected">Selected</string>
|
||||||
|
<string name="select">option</string>
|
||||||
|
<!-- BottomSheet相关 -->
|
||||||
|
<string name="menu_options">Menu Options</string>
|
||||||
|
<string name="sort_options">Sort by</string>
|
||||||
|
<string name="app_categories">Application Type Selection</string>
|
||||||
|
<!-- SuSFS Configuration -->
|
||||||
|
<!-- SuSFS Reset Confirmation -->
|
||||||
|
<!-- SuSFS Toast Messages -->
|
||||||
|
<!-- SuSFS Settings Item -->
|
||||||
|
<!-- 开机自启动相关 -->
|
||||||
|
<!-- SuSFS Tab Titles -->
|
||||||
|
<!-- SuSFS Dialog Actions -->
|
||||||
|
<!-- SuSFS Path Management -->
|
||||||
|
<!-- SuSFS Umount Mode -->
|
||||||
|
<!-- SuSFS Run Umount -->
|
||||||
|
<!-- SuSFS Reset Categories -->
|
||||||
|
<!-- SuSFS Path Settings -->
|
||||||
|
<!-- SuSFS Enabled Features -->
|
||||||
|
<!-- Feature Labels -->
|
||||||
|
<!-- 可切换状态 -->
|
||||||
|
<!-- Settings related strings -->
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -4,17 +4,12 @@
|
|||||||
<string name="home_not_installed">Ikke installeret</string>
|
<string name="home_not_installed">Ikke installeret</string>
|
||||||
<string name="home_click_to_install">Klik for at installere</string>
|
<string name="home_click_to_install">Klik for at installere</string>
|
||||||
<string name="home_working">Arbejder</string>
|
<string name="home_working">Arbejder</string>
|
||||||
<string name="home_working_version">Version: %d</string>
|
<string name="home_working_version">Version: %s</string>
|
||||||
<string name="home_superuser_count">Superbrugere: %d</string>
|
|
||||||
<string name="home_module_count">Moduler: %d</string>
|
|
||||||
<string name="home_unsupported">Ikke understøttet</string>
|
<string name="home_unsupported">Ikke understøttet</string>
|
||||||
<string name="home_unsupported_reason">KernelSU understøtter kun GKI kernels</string>
|
<string name="home_unsupported_reason">KernelSU understøtter kun GKI kernels</string>
|
||||||
<string name="home_kernel">Kernel</string>
|
<string name="home_kernel">Kernel</string>
|
||||||
<string name="home_susfs">SuSFS: %s</string>
|
|
||||||
<string name="home_susfs_version">SuSFS Version</string>
|
<string name="home_susfs_version">SuSFS Version</string>
|
||||||
<string name="home_susfs_sus_su">SuS SU</string>
|
|
||||||
<string name="home_manager_version">Manager Version</string>
|
<string name="home_manager_version">Manager Version</string>
|
||||||
<string name="home_fingerprint">Fingeraftryk</string>
|
|
||||||
<string name="home_selinux_status">SELinux-status</string>
|
<string name="home_selinux_status">SELinux-status</string>
|
||||||
<string name="selinux_status_disabled">Deaktiveret</string>
|
<string name="selinux_status_disabled">Deaktiveret</string>
|
||||||
<string name="selinux_status_enforcing">Håndhævende</string>
|
<string name="selinux_status_enforcing">Håndhævende</string>
|
||||||
@@ -28,7 +23,6 @@
|
|||||||
<string name="module_sort_action_first">Sort (Action first)</string>
|
<string name="module_sort_action_first">Sort (Action first)</string>
|
||||||
<string name="module_sort_enabled_first">Sort (Enabled first)</string>
|
<string name="module_sort_enabled_first">Sort (Enabled first)</string>
|
||||||
<string name="uninstall">Afinstaller</string>
|
<string name="uninstall">Afinstaller</string>
|
||||||
<string name="restore">Restore</string>
|
|
||||||
<string name="module_install">Installer</string>
|
<string name="module_install">Installer</string>
|
||||||
<string name="install">Installer</string>
|
<string name="install">Installer</string>
|
||||||
<string name="reboot">Genstart</string>
|
<string name="reboot">Genstart</string>
|
||||||
@@ -61,16 +55,12 @@
|
|||||||
<string name="profile_template">Skabelon</string>
|
<string name="profile_template">Skabelon</string>
|
||||||
<string name="profile_custom">Brugerdefineret</string>
|
<string name="profile_custom">Brugerdefineret</string>
|
||||||
<string name="profile_name">Profilnavn</string>
|
<string name="profile_name">Profilnavn</string>
|
||||||
<string name="profile_namespace">Monter navnerum</string>
|
|
||||||
<string name="profile_namespace_inherited">Arvet</string>
|
|
||||||
<string name="profile_namespace_global">Global</string>
|
|
||||||
<string name="profile_namespace_individual">Individuel</string>
|
|
||||||
<string name="profile_groups">Grupper</string>
|
<string name="profile_groups">Grupper</string>
|
||||||
<string name="profile_capabilities">Evner</string>
|
<string name="profile_capabilities">Evner</string>
|
||||||
<string name="profile_selinux_context">SELinux-kontext</string>
|
<string name="profile_selinux_context">SELinux-kontext</string>
|
||||||
<string name="profile_umount_modules">Afmonteret moduler</string>
|
<string name="profile_umount_modules">Afmonteret moduler</string>
|
||||||
<string name="failed_to_update_app_profile">Opdatering af App Profil for %s fejlede</string>
|
<string name="failed_to_update_app_profile">Opdatering af App Profil for %s fejlede</string>
|
||||||
<string name="require_kernel_version" formatted="false">The current KernelSU version %d is too low for the manager to work properly. Please upgrade to version %d or higher!</string>
|
<string name="require_kernel_version" formatted="false">The current KernelSU version %s is too low for the manager to work properly. Please upgrade to version %s or higher!</string>
|
||||||
<string name="settings_umount_modules_default">Afmontere moduler som standard</string>
|
<string name="settings_umount_modules_default">Afmontere moduler som standard</string>
|
||||||
<string name="settings_umount_modules_default_summary">Den globale standard værdi for \"Afmonter moduler\" i App Profiler. Hvis aktiveret vil den fjerne alle modulers modifikationer til system applikationerne der ikke har en sat Profil.</string>
|
<string name="settings_umount_modules_default_summary">Den globale standard værdi for \"Afmonter moduler\" i App Profiler. Hvis aktiveret vil den fjerne alle modulers modifikationer til system applikationerne der ikke har en sat Profil.</string>
|
||||||
<string name="settings_susfs_toggle">Disable kprobe hooks</string>
|
<string name="settings_susfs_toggle">Disable kprobe hooks</string>
|
||||||
@@ -112,7 +102,6 @@
|
|||||||
<string name="settings_check_update_summary">Automatically check for updates when opening the app</string>
|
<string name="settings_check_update_summary">Automatically check for updates when opening the app</string>
|
||||||
<string name="grant_root_failed">Failed to grant root!</string>
|
<string name="grant_root_failed">Failed to grant root!</string>
|
||||||
<string name="action">Action</string>
|
<string name="action">Action</string>
|
||||||
<string name="open">Open</string>
|
|
||||||
<string name="close">Close</string>
|
<string name="close">Close</string>
|
||||||
<string name="enable_web_debugging">Enable WebView debugging</string>
|
<string name="enable_web_debugging">Enable WebView debugging</string>
|
||||||
<string name="enable_web_debugging_summary">Can be used to debug WebUI. Please enable only when needed.</string>
|
<string name="enable_web_debugging_summary">Can be used to debug WebUI. Please enable only when needed.</string>
|
||||||
@@ -136,9 +125,6 @@
|
|||||||
<string name="selected_lkm">Selected LKM: %s</string>
|
<string name="selected_lkm">Selected LKM: %s</string>
|
||||||
<string name="save_log">Gem Logfiler</string>
|
<string name="save_log">Gem Logfiler</string>
|
||||||
<string name="log_saved">Logs saved</string>
|
<string name="log_saved">Logs saved</string>
|
||||||
<string name="status_supported">Supported</string>
|
|
||||||
<string name="status_not_supported">Not Supported</string>
|
|
||||||
<string name="status_unknown">Unknown</string>
|
|
||||||
<string name="sus_su_mode">SuS SU mode:</string>
|
<string name="sus_su_mode">SuS SU mode:</string>
|
||||||
<!-- Module related -->
|
<!-- Module related -->
|
||||||
<string name="module_install_confirm">confirm install module %1$s?</string>
|
<string name="module_install_confirm">confirm install module %1$s?</string>
|
||||||
@@ -172,14 +158,11 @@
|
|||||||
<string name="settings_custom_background">Custom App Background</string>
|
<string name="settings_custom_background">Custom App Background</string>
|
||||||
<string name="settings_custom_background_summary">Select an image as background</string>
|
<string name="settings_custom_background_summary">Select an image as background</string>
|
||||||
<string name="settings_card_alpha">Navigation bar transparency</string>
|
<string name="settings_card_alpha">Navigation bar transparency</string>
|
||||||
<string name="settings_restore_default">Restore default</string>
|
|
||||||
<string name="home_android_version">Android version</string>
|
<string name="home_android_version">Android version</string>
|
||||||
<string name="home_device_model">Device model</string>
|
<string name="home_device_model">Device model</string>
|
||||||
<string name="su_not_allowed">Granting superuser to %s is not allowed</string>
|
<string name="su_not_allowed">Granting superuser to %s is not allowed</string>
|
||||||
<string name="settings_disable_su">Disable su compatibility</string>
|
<string name="settings_disable_su">Disable su compatibility</string>
|
||||||
<string name="settings_disable_su_summary">Temporarily disable any applications from obtaining root privileges via the su command (existing root processes will not be affected).</string>
|
<string name="settings_disable_su_summary">Temporarily disable any applications from obtaining root privileges via the su command (existing root processes will not be affected).</string>
|
||||||
<string name="using_mksu_manager">You are using the SukiSU Beta manager</string>
|
|
||||||
<string name="module_install_multiple_confirm">Are you sure you want to install the selected %d modules?</string>
|
|
||||||
<string name="module_install_multiple_confirm_with_names">Sure you want to install the following %1$d modules? \n\n%2$s</string>
|
<string name="module_install_multiple_confirm_with_names">Sure you want to install the following %1$d modules? \n\n%2$s</string>
|
||||||
<string name="more_settings">More settings</string>
|
<string name="more_settings">More settings</string>
|
||||||
<string name="selinux">SELinux</string>
|
<string name="selinux">SELinux</string>
|
||||||
@@ -210,20 +193,14 @@
|
|||||||
<string name="color_pink">Pink</string>
|
<string name="color_pink">Pink</string>
|
||||||
<string name="color_gray">Gray</string>
|
<string name="color_gray">Gray</string>
|
||||||
<string name="color_yellow">Yellow</string>
|
<string name="color_yellow">Yellow</string>
|
||||||
<string name="flash_option">Brush Options</string>
|
|
||||||
<string name="flash_option_tip">Select the file to be flashed</string>
|
|
||||||
<string name="horizon_kernel">Install Anykernel3</string>
|
<string name="horizon_kernel">Install Anykernel3</string>
|
||||||
<string name="horizon_kernel_summary">Flash AnyKernel3 kernel file</string>
|
<string name="horizon_kernel_summary">Flash AnyKernel3 kernel file</string>
|
||||||
<string name="root_required">Requires root privileges</string>
|
<string name="root_required">Requires root privileges</string>
|
||||||
<string name="copy_failed">File Copy Failure</string>
|
|
||||||
<string name="reboot_complete_title">Scrubbing complete</string>
|
<string name="reboot_complete_title">Scrubbing complete</string>
|
||||||
<string name="reboot_complete_msg">Whether to reboot immediately?</string>
|
<string name="reboot_complete_msg">Whether to reboot immediately?</string>
|
||||||
<string name="yes">Yes</string>
|
<string name="yes">Yes</string>
|
||||||
<string name="no">No</string>
|
<string name="no">No</string>
|
||||||
<string name="failed_reboot">Reboot Failed</string>
|
<string name="failed_reboot">Reboot Failed</string>
|
||||||
<string name="batch_authorization">empower</string>
|
|
||||||
<string name="batch_cancel_authorization">withdraw</string>
|
|
||||||
<string name="backup">Backup</string>
|
|
||||||
<string name="kpm_title">KPM</string>
|
<string name="kpm_title">KPM</string>
|
||||||
<string name="kpm_empty">No installed kernel modules at this time</string>
|
<string name="kpm_empty">No installed kernel modules at this time</string>
|
||||||
<string name="kpm_version">Version</string>
|
<string name="kpm_version">Version</string>
|
||||||
@@ -231,7 +208,6 @@
|
|||||||
<string name="kpm_uninstall">Uninstall</string>
|
<string name="kpm_uninstall">Uninstall</string>
|
||||||
<string name="kpm_uninstall_success">Uninstalled successfully</string>
|
<string name="kpm_uninstall_success">Uninstalled successfully</string>
|
||||||
<string name="kpm_uninstall_failed">Failed to uninstall</string>
|
<string name="kpm_uninstall_failed">Failed to uninstall</string>
|
||||||
<string name="kpm_install">Install</string>
|
|
||||||
<string name="kpm_install_success">Load of kpm module successful</string>
|
<string name="kpm_install_success">Load of kpm module successful</string>
|
||||||
<string name="kpm_install_failed">Load of kpm module failed</string>
|
<string name="kpm_install_failed">Load of kpm module failed</string>
|
||||||
<string name="kpm_args">Parameters</string>
|
<string name="kpm_args">Parameters</string>
|
||||||
@@ -245,8 +221,6 @@
|
|||||||
<string name="home_click_to_ContributionCard_kernelsu">SukiSU Ultra will be a relatively independent branch of KSU in the future, but we still appreciate the official KernelSU and MKSU etc. for their contributions!</string>
|
<string name="home_click_to_ContributionCard_kernelsu">SukiSU Ultra will be a relatively independent branch of KSU in the future, but we still appreciate the official KernelSU and MKSU etc. for their contributions!</string>
|
||||||
<string name="not_supported">Unsupported</string>
|
<string name="not_supported">Unsupported</string>
|
||||||
<string name="supported">Supported</string>
|
<string name="supported">Supported</string>
|
||||||
<string name="home_kpm_module">"Number of KPMs: %d "</string>
|
|
||||||
<string name="kpm_invalid_file">Invalid KPM file</string>
|
|
||||||
<string name="kernel_patched">Kernel not patched</string>
|
<string name="kernel_patched">Kernel not patched</string>
|
||||||
<string name="kernel_not_enabled">Kernel not configured</string>
|
<string name="kernel_not_enabled">Kernel not configured</string>
|
||||||
<string name="custom_settings">Custom settings</string>
|
<string name="custom_settings">Custom settings</string>
|
||||||
@@ -254,19 +228,13 @@
|
|||||||
<string name="kpm_install_mode_load">Load</string>
|
<string name="kpm_install_mode_load">Load</string>
|
||||||
<string name="kpm_install_mode_embed">Embed</string>
|
<string name="kpm_install_mode_embed">Embed</string>
|
||||||
<string name="kpm_install_mode_description">Please select: %1\$s Module Installation Mode \n\nLoad: Temporarily load the module \nEmbedded: Permanently install into the system</string>
|
<string name="kpm_install_mode_description">Please select: %1\$s Module Installation Mode \n\nLoad: Temporarily load the module \nEmbedded: Permanently install into the system</string>
|
||||||
<string name="log_failed_to_check_module_file">Failed to check module file existence</string>
|
|
||||||
<string name="snackbar_failed_to_check_module_file">Unable to check if module file exists</string>
|
<string name="snackbar_failed_to_check_module_file">Unable to check if module file exists</string>
|
||||||
<string name="confirm_uninstall_title">Confirm uninstallation</string>
|
|
||||||
<string name="confirm_uninstall_confirm">Uninstall</string>
|
|
||||||
<string name="confirm_uninstall_dismiss">Cancel</string>
|
|
||||||
<string name="theme_color">Theme Color</string>
|
<string name="theme_color">Theme Color</string>
|
||||||
<string name="invalid_file_type">Incorrect file type! Please select .kpm file.</string>
|
<string name="invalid_file_type">Incorrect file type! Please select .kpm file.</string>
|
||||||
<string name="confirm_uninstall_title_with_filename">Uninstall</string>
|
<string name="confirm_uninstall_title_with_filename">Uninstall</string>
|
||||||
<string name="confirm_uninstall_content">The following KPM will be uninstalled: %s</string>
|
<string name="confirm_uninstall_content">The following KPM will be uninstalled: %s</string>
|
||||||
<string name="settings_susfs_toggle_summary">Disable kprobe hooks created by KernelSU, using inline hooks instead, which is similar to non-GKI kernel hooking method.</string>
|
<string name="settings_susfs_toggle_summary">Disable kprobe hooks created by KernelSU, using inline hooks instead, which is similar to non-GKI kernel hooking method.</string>
|
||||||
<string name="image_editor_title">Adjust background image</string>
|
|
||||||
<string name="image_editor_hint">Use two fingers to zoom the image, and one finger to drag it to adjust the position</string>
|
<string name="image_editor_hint">Use two fingers to zoom the image, and one finger to drag it to adjust the position</string>
|
||||||
<string name="background_image_error">Could not load image</string>
|
|
||||||
<string name="reprovision">Reprovision</string>
|
<string name="reprovision">Reprovision</string>
|
||||||
<!-- Kernel Flash Progress Related -->
|
<!-- Kernel Flash Progress Related -->
|
||||||
<string name="horizon_flash_title">Kernel Flashing</string>
|
<string name="horizon_flash_title">Kernel Flashing</string>
|
||||||
@@ -303,10 +271,6 @@
|
|||||||
<string name="app_settings">Application Settings</string>
|
<string name="app_settings">Application Settings</string>
|
||||||
<string name="tools">Tools</string>
|
<string name="tools">Tools</string>
|
||||||
<!-- String resources used in SuperUser -->
|
<!-- String resources used in SuperUser -->
|
||||||
<string name="clear">Removals</string>
|
|
||||||
<string name="apps_with_root">Applications with root privileges</string>
|
|
||||||
<string name="apps_with_custom_profile">Applications with customized configurations</string>
|
|
||||||
<string name="other_apps">Applications with unchanged defaults</string>
|
|
||||||
<string name="no_apps_found">Application not found</string>
|
<string name="no_apps_found">Application not found</string>
|
||||||
<string name="selinux_enabled_toast">SELinux Enabled</string>
|
<string name="selinux_enabled_toast">SELinux Enabled</string>
|
||||||
<string name="selinux_disabled_toast">SELinux Disabled</string>
|
<string name="selinux_disabled_toast">SELinux Disabled</string>
|
||||||
@@ -314,8 +278,6 @@
|
|||||||
<string name="advanced_settings">Advanced Settings</string>
|
<string name="advanced_settings">Advanced Settings</string>
|
||||||
<string name="appearance_settings">Customize the toolbar</string>
|
<string name="appearance_settings">Customize the toolbar</string>
|
||||||
<string name="back">Comeback</string>
|
<string name="back">Comeback</string>
|
||||||
<string name="expand">Be in full swing</string>
|
|
||||||
<string name="collapse">put away</string>
|
|
||||||
<string name="susfs_enabled">SuSFS enabled</string>
|
<string name="susfs_enabled">SuSFS enabled</string>
|
||||||
<string name="susfs_disabled">SuSFS disabled</string>
|
<string name="susfs_disabled">SuSFS disabled</string>
|
||||||
<string name="background_set_success">Background set successfully</string>
|
<string name="background_set_success">Background set successfully</string>
|
||||||
@@ -323,7 +285,6 @@
|
|||||||
<string name="icon_switch_title">Alternate icon</string>
|
<string name="icon_switch_title">Alternate icon</string>
|
||||||
<string name="icon_switch_summary">Change the launcher icon to KernelSU\'s icon.</string>
|
<string name="icon_switch_summary">Change the launcher icon to KernelSU\'s icon.</string>
|
||||||
<string name="icon_switched">Icon switched</string>
|
<string name="icon_switched">Icon switched</string>
|
||||||
<string name="root_require_for_install">Requires root privileges</string>
|
|
||||||
<!-- KPM display settings -->
|
<!-- KPM display settings -->
|
||||||
<string name="show_kpm_info">Display KPM Function</string>
|
<string name="show_kpm_info">Display KPM Function</string>
|
||||||
<string name="show_kpm_info_summary">Display KPM information and Function in home and bottom bar (Need to reopen the app)</string>
|
<string name="show_kpm_info_summary">Display KPM information and Function in home and bottom bar (Need to reopen the app)</string>
|
||||||
@@ -335,7 +296,6 @@
|
|||||||
<string name="use_webuix_eruda">Inject Eruda into WebUI X</string>
|
<string name="use_webuix_eruda">Inject Eruda into WebUI X</string>
|
||||||
<string name="use_webuix_eruda_summary">Inject a debug console into WebUI X to make debugging easier. Requires web debugging to be on.</string>
|
<string name="use_webuix_eruda_summary">Inject a debug console into WebUI X to make debugging easier. Requires web debugging to be on.</string>
|
||||||
<!-- DPI setting related strings -->
|
<!-- DPI setting related strings -->
|
||||||
<string name="dpi_settings">DPI setting</string>
|
|
||||||
<string name="app_dpi_title">Applied DPI</string>
|
<string name="app_dpi_title">Applied DPI</string>
|
||||||
<string name="app_dpi_summary">Adjust the screen display density for the current application only</string>
|
<string name="app_dpi_summary">Adjust the screen display density for the current application only</string>
|
||||||
<string name="dpi_size_small">Small </string>
|
<string name="dpi_size_small">Small </string>
|
||||||
@@ -353,16 +313,6 @@
|
|||||||
<string name="language_follow_system">Follow System</string>
|
<string name="language_follow_system">Follow System</string>
|
||||||
<string name="language_changed">Language changed, restarting to apply changes</string>
|
<string name="language_changed">Language changed, restarting to apply changes</string>
|
||||||
<string name="settings_card_dim">Card Darkness Adjustment</string>
|
<string name="settings_card_dim">Card Darkness Adjustment</string>
|
||||||
<!-- Super User Related -->
|
|
||||||
<string name="scroll_to_top">Top</string>
|
|
||||||
<string name="scroll_to_bottom">Bottom</string>
|
|
||||||
<string name="scroll_to_top_description">Scroll to top</string>
|
|
||||||
<string name="scroll_to_bottom_description">Scroll to the bottom</string>
|
|
||||||
<string name="authorized">authorized</string>
|
|
||||||
<string name="unauthorized">unauthorized</string>
|
|
||||||
<string name="selected">Selected</string>
|
|
||||||
<string name="select">option</string>
|
|
||||||
<string name="profile_umount_modules_disable">Disable custom uninstallation module</string>
|
|
||||||
<!-- Flash related -->
|
<!-- Flash related -->
|
||||||
<string name="error_code">error code</string>
|
<string name="error_code">error code</string>
|
||||||
<string name="check_log">Please check the log</string>
|
<string name="check_log">Please check the log</string>
|
||||||
@@ -370,4 +320,51 @@
|
|||||||
<string name="module_failed_count">%d Failed to install a new module</string>
|
<string name="module_failed_count">%d Failed to install a new module</string>
|
||||||
<string name="module_download_error">Module download failed</string>
|
<string name="module_download_error">Module download failed</string>
|
||||||
<string name="kernel_flashing">Kernel Flashing</string>
|
<string name="kernel_flashing">Kernel Flashing</string>
|
||||||
|
<!-- 分类相关 -->
|
||||||
|
<string name="category_all_apps">All</string>
|
||||||
|
<string name="category_root_apps">Root</string>
|
||||||
|
<string name="category_custom_apps">Custom</string>
|
||||||
|
<string name="category_default_apps">Default</string>
|
||||||
|
<!-- 排序相关 -->
|
||||||
|
<string name="sort_name_asc">Ascending order of name</string>
|
||||||
|
<string name="sort_name_desc">Name descending</string>
|
||||||
|
<string name="sort_install_time_new">Installation time (new)</string>
|
||||||
|
<string name="sort_install_time_old">Installation time (old)</string>
|
||||||
|
<string name="sort_size_desc">descending order of size</string>
|
||||||
|
<string name="sort_size_asc">ascending order of size</string>
|
||||||
|
<string name="sort_usage_freq">frequency of use</string>
|
||||||
|
<!-- 状态相关 -->
|
||||||
|
<string name="no_apps_in_category">No application in this category</string>
|
||||||
|
<!-- 标签相关 -->
|
||||||
|
<!-- FAB菜单相关 -->
|
||||||
|
<string name="deny_authorization">Delegation of authority</string>
|
||||||
|
<string name="grant_authorization">Authorizations</string>
|
||||||
|
<string name="unmount_modules">Unmounting Module Mounts</string>
|
||||||
|
<string name="disable_unmount">Disable uninstall module mounting</string>
|
||||||
|
<string name="expand_menu">Expand menu</string>
|
||||||
|
<string name="collapse_menu">Put away the menu</string>
|
||||||
|
<string name="scroll_to_top">Top</string>
|
||||||
|
<string name="scroll_to_bottom">Bottom</string>
|
||||||
|
<string name="selected">Selected</string>
|
||||||
|
<string name="select">option</string>
|
||||||
|
<!-- BottomSheet相关 -->
|
||||||
|
<string name="menu_options">Menu Options</string>
|
||||||
|
<string name="sort_options">Sort by</string>
|
||||||
|
<string name="app_categories">Application Type Selection</string>
|
||||||
|
<!-- SuSFS Configuration -->
|
||||||
|
<!-- SuSFS Reset Confirmation -->
|
||||||
|
<!-- SuSFS Toast Messages -->
|
||||||
|
<!-- SuSFS Settings Item -->
|
||||||
|
<!-- 开机自启动相关 -->
|
||||||
|
<!-- SuSFS Tab Titles -->
|
||||||
|
<!-- SuSFS Dialog Actions -->
|
||||||
|
<!-- SuSFS Path Management -->
|
||||||
|
<!-- SuSFS Umount Mode -->
|
||||||
|
<!-- SuSFS Run Umount -->
|
||||||
|
<!-- SuSFS Reset Categories -->
|
||||||
|
<!-- SuSFS Path Settings -->
|
||||||
|
<!-- SuSFS Enabled Features -->
|
||||||
|
<!-- Feature Labels -->
|
||||||
|
<!-- 可切换状态 -->
|
||||||
|
<!-- Settings related strings -->
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -4,17 +4,12 @@
|
|||||||
<string name="home_not_installed">Nicht installiert</string>
|
<string name="home_not_installed">Nicht installiert</string>
|
||||||
<string name="home_click_to_install">Tippe zum Installieren</string>
|
<string name="home_click_to_install">Tippe zum Installieren</string>
|
||||||
<string name="home_working">Funktioniert</string>
|
<string name="home_working">Funktioniert</string>
|
||||||
<string name="home_working_version">Version: %d</string>
|
<string name="home_working_version">Version: %s</string>
|
||||||
<string name="home_superuser_count">Superuser: %d</string>
|
|
||||||
<string name="home_module_count">Module: %d</string>
|
|
||||||
<string name="home_unsupported">Nicht unterstützt</string>
|
<string name="home_unsupported">Nicht unterstützt</string>
|
||||||
<string name="home_unsupported_reason">KernelSU unterstützt derzeit nur GKI-Kernel</string>
|
<string name="home_unsupported_reason">KernelSU unterstützt derzeit nur GKI-Kernel</string>
|
||||||
<string name="home_kernel">Kernel</string>
|
<string name="home_kernel">Kernel</string>
|
||||||
<string name="home_susfs">SuSFS: %s</string>
|
|
||||||
<string name="home_susfs_version">SuSFS version</string>
|
<string name="home_susfs_version">SuSFS version</string>
|
||||||
<string name="home_susfs_sus_su">SuS SU</string>
|
|
||||||
<string name="home_manager_version">Manager-Version</string>
|
<string name="home_manager_version">Manager-Version</string>
|
||||||
<string name="home_fingerprint">Fingerabdruck</string>
|
|
||||||
<string name="home_selinux_status">SELinux Status</string>
|
<string name="home_selinux_status">SELinux Status</string>
|
||||||
<string name="selinux_status_disabled">Deaktiviert</string>
|
<string name="selinux_status_disabled">Deaktiviert</string>
|
||||||
<string name="selinux_status_enforcing">Erzwingen</string>
|
<string name="selinux_status_enforcing">Erzwingen</string>
|
||||||
@@ -28,7 +23,6 @@
|
|||||||
<string name="module_sort_action_first">Sortiere zuerst (Aktion)</string>
|
<string name="module_sort_action_first">Sortiere zuerst (Aktion)</string>
|
||||||
<string name="module_sort_enabled_first">Sortieren (zuerst aktiviert)</string>
|
<string name="module_sort_enabled_first">Sortieren (zuerst aktiviert)</string>
|
||||||
<string name="uninstall">Deinstallieren</string>
|
<string name="uninstall">Deinstallieren</string>
|
||||||
<string name="restore">Wiederherstellen</string>
|
|
||||||
<string name="module_install">Installieren</string>
|
<string name="module_install">Installieren</string>
|
||||||
<string name="install">Installieren</string>
|
<string name="install">Installieren</string>
|
||||||
<string name="reboot">Neustarten</string>
|
<string name="reboot">Neustarten</string>
|
||||||
@@ -61,16 +55,12 @@
|
|||||||
<string name="profile_template">Vorlage</string>
|
<string name="profile_template">Vorlage</string>
|
||||||
<string name="profile_custom">Benutzerdefiniert</string>
|
<string name="profile_custom">Benutzerdefiniert</string>
|
||||||
<string name="profile_name">Profilname</string>
|
<string name="profile_name">Profilname</string>
|
||||||
<string name="profile_namespace">Namespace einhängen</string>
|
|
||||||
<string name="profile_namespace_inherited">Geerbt</string>
|
|
||||||
<string name="profile_namespace_global">Global</string>
|
|
||||||
<string name="profile_namespace_individual">Individuell</string>
|
|
||||||
<string name="profile_groups">Gruppen</string>
|
<string name="profile_groups">Gruppen</string>
|
||||||
<string name="profile_capabilities">Fähigkeiten</string>
|
<string name="profile_capabilities">Fähigkeiten</string>
|
||||||
<string name="profile_selinux_context">SELinux-Kontext</string>
|
<string name="profile_selinux_context">SELinux-Kontext</string>
|
||||||
<string name="profile_umount_modules">Module aushängen</string>
|
<string name="profile_umount_modules">Module aushängen</string>
|
||||||
<string name="failed_to_update_app_profile">App-Profilaktualisierung für %s fehlgeschlagen</string>
|
<string name="failed_to_update_app_profile">App-Profilaktualisierung für %s fehlgeschlagen</string>
|
||||||
<string name="require_kernel_version" formatted="false">Die aktuelle KernelSU-Version %d ist zu alt für diese Manager-Version. Bitte auf Version %d oder höher aktualisieren!</string>
|
<string name="require_kernel_version" formatted="false">Die aktuelle KernelSU-Version %s ist zu alt für diese Manager-Version. Bitte auf Version %s oder höher aktualisieren!</string>
|
||||||
<string name="settings_umount_modules_default">Module standardmäßig aushängen</string>
|
<string name="settings_umount_modules_default">Module standardmäßig aushängen</string>
|
||||||
<string name="settings_umount_modules_default_summary">Globaler Standardwert für \"Module aushängen\" im App-Profil. Falls er aktiviert ist, werden alle Moduländerungen im System für alle Apps entfernt, für die kein Profil festgelegt ist.</string>
|
<string name="settings_umount_modules_default_summary">Globaler Standardwert für \"Module aushängen\" im App-Profil. Falls er aktiviert ist, werden alle Moduländerungen im System für alle Apps entfernt, für die kein Profil festgelegt ist.</string>
|
||||||
<string name="settings_susfs_toggle">Kprobe-Hooks deaktivieren</string>
|
<string name="settings_susfs_toggle">Kprobe-Hooks deaktivieren</string>
|
||||||
@@ -112,7 +102,6 @@
|
|||||||
<string name="settings_check_update_summary">Prüfe automatisch auf Aktualisierungen, wenn die App geöffnet wird</string>
|
<string name="settings_check_update_summary">Prüfe automatisch auf Aktualisierungen, wenn die App geöffnet wird</string>
|
||||||
<string name="grant_root_failed">Root-Zugriff konnte nicht gewährt werden!</string>
|
<string name="grant_root_failed">Root-Zugriff konnte nicht gewährt werden!</string>
|
||||||
<string name="action">Aktion</string>
|
<string name="action">Aktion</string>
|
||||||
<string name="open">Öffnen</string>
|
|
||||||
<string name="close">Schließen</string>
|
<string name="close">Schließen</string>
|
||||||
<string name="enable_web_debugging">WebView-Debugging aktivieren</string>
|
<string name="enable_web_debugging">WebView-Debugging aktivieren</string>
|
||||||
<string name="enable_web_debugging_summary">Kann zum Fehlerbeheben der WebUI verwendet werden, bitte nur im Notfall aktivieren.</string>
|
<string name="enable_web_debugging_summary">Kann zum Fehlerbeheben der WebUI verwendet werden, bitte nur im Notfall aktivieren.</string>
|
||||||
@@ -138,9 +127,6 @@
|
|||||||
<string name="selected_lkm">Wähle LKM: %s</string>
|
<string name="selected_lkm">Wähle LKM: %s</string>
|
||||||
<string name="save_log">Protokolle Speichern</string>
|
<string name="save_log">Protokolle Speichern</string>
|
||||||
<string name="log_saved">Protokolle gespeichert</string>
|
<string name="log_saved">Protokolle gespeichert</string>
|
||||||
<string name="status_supported">Unterstützt:</string>
|
|
||||||
<string name="status_not_supported">Nicht unterstützt</string>
|
|
||||||
<string name="status_unknown">Unbekannt</string>
|
|
||||||
<string name="sus_su_mode">SuS SU-Modus:</string>
|
<string name="sus_su_mode">SuS SU-Modus:</string>
|
||||||
<!-- Module related -->
|
<!-- Module related -->
|
||||||
<string name="module_install_confirm">das Installationsmodul %1$s bestätigen ?</string>
|
<string name="module_install_confirm">das Installationsmodul %1$s bestätigen ?</string>
|
||||||
@@ -174,14 +160,11 @@
|
|||||||
<string name="settings_custom_background">Eigener App-Hintergrund</string>
|
<string name="settings_custom_background">Eigener App-Hintergrund</string>
|
||||||
<string name="settings_custom_background_summary">Wählen Sie ein Bild als Hintergrund</string>
|
<string name="settings_custom_background_summary">Wählen Sie ein Bild als Hintergrund</string>
|
||||||
<string name="settings_card_alpha">Transparenz der Navigationsleiste</string>
|
<string name="settings_card_alpha">Transparenz der Navigationsleiste</string>
|
||||||
<string name="settings_restore_default">Standard wiederherstellen</string>
|
|
||||||
<string name="home_android_version">Androidversion</string>
|
<string name="home_android_version">Androidversion</string>
|
||||||
<string name="home_device_model">Geräteausführung</string>
|
<string name="home_device_model">Geräteausführung</string>
|
||||||
<string name="su_not_allowed">Superuser %s zu erlauben ist nicht erlaubt</string>
|
<string name="su_not_allowed">Superuser %s zu erlauben ist nicht erlaubt</string>
|
||||||
<string name="settings_disable_su">Su Kompatibilität deaktivieren</string>
|
<string name="settings_disable_su">Su Kompatibilität deaktivieren</string>
|
||||||
<string name="settings_disable_su_summary">Deaktivieren Sie temporär alle Anwendungen, die root-Privilegien über den Befehl <unk> su zu erhalten (bestehende root-Prozesse werden nicht beeinflusst).</string>
|
<string name="settings_disable_su_summary">Deaktivieren Sie temporär alle Anwendungen, die root-Privilegien über den Befehl <unk> su zu erhalten (bestehende root-Prozesse werden nicht beeinflusst).</string>
|
||||||
<string name="using_mksu_manager">Sie verwenden den SukiSU Beta-Manager</string>
|
|
||||||
<string name="module_install_multiple_confirm">Sind Sie sicher, dass Sie die ausgewählten %d -Module installieren möchten?</string>
|
|
||||||
<string name="module_install_multiple_confirm_with_names">Möchten Sie die folgenden %1$d Module installieren? \n\n\n%2$s</string>
|
<string name="module_install_multiple_confirm_with_names">Möchten Sie die folgenden %1$d Module installieren? \n\n\n%2$s</string>
|
||||||
<string name="more_settings">Weitere Einstellungen</string>
|
<string name="more_settings">Weitere Einstellungen</string>
|
||||||
<string name="selinux">SELinux</string>
|
<string name="selinux">SELinux</string>
|
||||||
@@ -212,20 +195,14 @@
|
|||||||
<string name="color_pink">Pink</string>
|
<string name="color_pink">Pink</string>
|
||||||
<string name="color_gray">Grau</string>
|
<string name="color_gray">Grau</string>
|
||||||
<string name="color_yellow">Gelb</string>
|
<string name="color_yellow">Gelb</string>
|
||||||
<string name="flash_option">Pinseloptionen</string>
|
|
||||||
<string name="flash_option_tip">Wählen Sie die zu flashende Datei</string>
|
|
||||||
<string name="horizon_kernel">Install Anykernel3</string>
|
<string name="horizon_kernel">Install Anykernel3</string>
|
||||||
<string name="horizon_kernel_summary">Flash AnyKernel3 Kernel-Datei</string>
|
<string name="horizon_kernel_summary">Flash AnyKernel3 Kernel-Datei</string>
|
||||||
<string name="root_required">Erfordert Root-Rechte</string>
|
<string name="root_required">Erfordert Root-Rechte</string>
|
||||||
<string name="copy_failed">Datei-Kopierfehler</string>
|
|
||||||
<string name="reboot_complete_title">Scrubbing abgeschlossen</string>
|
<string name="reboot_complete_title">Scrubbing abgeschlossen</string>
|
||||||
<string name="reboot_complete_msg">Ob sofort neu gestartet werden soll?</string>
|
<string name="reboot_complete_msg">Ob sofort neu gestartet werden soll?</string>
|
||||||
<string name="yes">Ja</string>
|
<string name="yes">Ja</string>
|
||||||
<string name="no">Nein</string>
|
<string name="no">Nein</string>
|
||||||
<string name="failed_reboot">Neustart fehlgeschlagen</string>
|
<string name="failed_reboot">Neustart fehlgeschlagen</string>
|
||||||
<string name="batch_authorization">empowern</string>
|
|
||||||
<string name="batch_cancel_authorization">abheben</string>
|
|
||||||
<string name="backup">Sicherung</string>
|
|
||||||
<string name="kpm_title">KPM</string>
|
<string name="kpm_title">KPM</string>
|
||||||
<string name="kpm_empty">Keine installierten Kernelmodule</string>
|
<string name="kpm_empty">Keine installierten Kernelmodule</string>
|
||||||
<string name="kpm_version">Version</string>
|
<string name="kpm_version">Version</string>
|
||||||
@@ -233,7 +210,6 @@
|
|||||||
<string name="kpm_uninstall">Deinstallieren</string>
|
<string name="kpm_uninstall">Deinstallieren</string>
|
||||||
<string name="kpm_uninstall_success">Erfolgreich deinstalliert</string>
|
<string name="kpm_uninstall_success">Erfolgreich deinstalliert</string>
|
||||||
<string name="kpm_uninstall_failed">Deinstallation fehlgeschlagen</string>
|
<string name="kpm_uninstall_failed">Deinstallation fehlgeschlagen</string>
|
||||||
<string name="kpm_install">Installieren</string>
|
|
||||||
<string name="kpm_install_success">Laden des kpm Moduls erfolgreich</string>
|
<string name="kpm_install_success">Laden des kpm Moduls erfolgreich</string>
|
||||||
<string name="kpm_install_failed">Laden des kpm-Moduls fehlgeschlagen</string>
|
<string name="kpm_install_failed">Laden des kpm-Moduls fehlgeschlagen</string>
|
||||||
<string name="kpm_args">Parameter</string>
|
<string name="kpm_args">Parameter</string>
|
||||||
@@ -247,8 +223,6 @@
|
|||||||
<string name="home_click_to_ContributionCard_kernelsu">SukiSU Ultra wird in Zukunft ein relativ unabhängiger Zweig der KSU sein, aber wir schätzen immer noch die offiziellen KernelSU und MKSU usw. für ihre Beiträge!</string>
|
<string name="home_click_to_ContributionCard_kernelsu">SukiSU Ultra wird in Zukunft ein relativ unabhängiger Zweig der KSU sein, aber wir schätzen immer noch die offiziellen KernelSU und MKSU usw. für ihre Beiträge!</string>
|
||||||
<string name="not_supported">Nicht unterstützt</string>
|
<string name="not_supported">Nicht unterstützt</string>
|
||||||
<string name="supported">Unterstützt:</string>
|
<string name="supported">Unterstützt:</string>
|
||||||
<string name="home_kpm_module">"Anzahl der KPM-Module: %d "</string>
|
|
||||||
<string name="kpm_invalid_file">Ungültige KPM-Datei</string>
|
|
||||||
<string name="kernel_patched">Kernel nicht gepatcht</string>
|
<string name="kernel_patched">Kernel nicht gepatcht</string>
|
||||||
<string name="kernel_not_enabled">Kernel nicht konfiguriert</string>
|
<string name="kernel_not_enabled">Kernel nicht konfiguriert</string>
|
||||||
<string name="custom_settings">Eigene Einstellungen</string>
|
<string name="custom_settings">Eigene Einstellungen</string>
|
||||||
@@ -256,19 +230,13 @@
|
|||||||
<string name="kpm_install_mode_load">Laden</string>
|
<string name="kpm_install_mode_load">Laden</string>
|
||||||
<string name="kpm_install_mode_embed">Einbetten</string>
|
<string name="kpm_install_mode_embed">Einbetten</string>
|
||||||
<string name="kpm_install_mode_description">Bitte wählen: %1\$s Modul-Installationsmodus \n\nLaden: Das Modul \ntemporär laden: Dauerhaft in das System installieren</string>
|
<string name="kpm_install_mode_description">Bitte wählen: %1\$s Modul-Installationsmodus \n\nLaden: Das Modul \ntemporär laden: Dauerhaft in das System installieren</string>
|
||||||
<string name="log_failed_to_check_module_file">Fehler beim Prüfen der Moduldatei-Existenz</string>
|
|
||||||
<string name="snackbar_failed_to_check_module_file">Kann nicht überprüfen, ob die Moduldatei existiert</string>
|
<string name="snackbar_failed_to_check_module_file">Kann nicht überprüfen, ob die Moduldatei existiert</string>
|
||||||
<string name="confirm_uninstall_title">Deinstallation bestätigen.</string>
|
|
||||||
<string name="confirm_uninstall_confirm">Deinstallieren</string>
|
|
||||||
<string name="confirm_uninstall_dismiss">Abbrechen</string>
|
|
||||||
<string name="theme_color">Themenfarbe</string>
|
<string name="theme_color">Themenfarbe</string>
|
||||||
<string name="invalid_file_type">Falscher Dateityp! Bitte wählen Sie eine .kpm Datei.</string>
|
<string name="invalid_file_type">Falscher Dateityp! Bitte wählen Sie eine .kpm Datei.</string>
|
||||||
<string name="confirm_uninstall_title_with_filename">Deinstallieren</string>
|
<string name="confirm_uninstall_title_with_filename">Deinstallieren</string>
|
||||||
<string name="confirm_uninstall_content">Folgende KPM wird deinstalliert: %s</string>
|
<string name="confirm_uninstall_content">Folgende KPM wird deinstalliert: %s</string>
|
||||||
<string name="settings_susfs_toggle_summary">Deaktiviere kprobe Hooks die von KernelSU erstellt wurden und stattdessen inline Hooks verwenden, was der Nicht-GKI-Kernel-Hooking Methode ähnlich ist.</string>
|
<string name="settings_susfs_toggle_summary">Deaktiviere kprobe Hooks die von KernelSU erstellt wurden und stattdessen inline Hooks verwenden, was der Nicht-GKI-Kernel-Hooking Methode ähnlich ist.</string>
|
||||||
<string name="image_editor_title">Hintergrundbild anpassen</string>
|
|
||||||
<string name="image_editor_hint">Verwende zwei Finger um das Bild zu vergrößern und einen Finger um die Position anzupassen</string>
|
<string name="image_editor_hint">Verwende zwei Finger um das Bild zu vergrößern und einen Finger um die Position anzupassen</string>
|
||||||
<string name="background_image_error">Bild konnte nicht geladen werden</string>
|
|
||||||
<string name="reprovision">Rückzahlung</string>
|
<string name="reprovision">Rückzahlung</string>
|
||||||
<!-- Kernel Flash Progress Related -->
|
<!-- Kernel Flash Progress Related -->
|
||||||
<string name="horizon_flash_title">Kernel-Flashen</string>
|
<string name="horizon_flash_title">Kernel-Flashen</string>
|
||||||
@@ -305,10 +273,6 @@
|
|||||||
<string name="app_settings">Anwendungs-Einstellungen</string>
|
<string name="app_settings">Anwendungs-Einstellungen</string>
|
||||||
<string name="tools">Tools</string>
|
<string name="tools">Tools</string>
|
||||||
<!-- String resources used in SuperUser -->
|
<!-- String resources used in SuperUser -->
|
||||||
<string name="clear">Entfernen</string>
|
|
||||||
<string name="apps_with_root">Anwendungen mit Root-Rechten</string>
|
|
||||||
<string name="apps_with_custom_profile">Anwendungen mit angepassten Konfigurationen</string>
|
|
||||||
<string name="other_apps">Anwendungen mit unveränderten Standardeinstellungen</string>
|
|
||||||
<string name="no_apps_found">Anwendung nicht gefunden</string>
|
<string name="no_apps_found">Anwendung nicht gefunden</string>
|
||||||
<string name="selinux_enabled_toast">SELinux aktiviert</string>
|
<string name="selinux_enabled_toast">SELinux aktiviert</string>
|
||||||
<string name="selinux_disabled_toast">SELinux deaktiviert</string>
|
<string name="selinux_disabled_toast">SELinux deaktiviert</string>
|
||||||
@@ -316,8 +280,6 @@
|
|||||||
<string name="advanced_settings">Erweiterte Einstellungen</string>
|
<string name="advanced_settings">Erweiterte Einstellungen</string>
|
||||||
<string name="appearance_settings">Passt die Symbolleiste an.</string>
|
<string name="appearance_settings">Passt die Symbolleiste an.</string>
|
||||||
<string name="back">Comeback</string>
|
<string name="back">Comeback</string>
|
||||||
<string name="expand">Seien Sie in vollem Gange</string>
|
|
||||||
<string name="collapse">wegziehen</string>
|
|
||||||
<string name="susfs_enabled">SuSFS aktiviert</string>
|
<string name="susfs_enabled">SuSFS aktiviert</string>
|
||||||
<string name="susfs_disabled">SuSFS deaktiviert</string>
|
<string name="susfs_disabled">SuSFS deaktiviert</string>
|
||||||
<string name="background_set_success">Hintergrund erfolgreich gesetzt</string>
|
<string name="background_set_success">Hintergrund erfolgreich gesetzt</string>
|
||||||
@@ -325,7 +287,6 @@
|
|||||||
<string name="icon_switch_title">Alternatives Symbol</string>
|
<string name="icon_switch_title">Alternatives Symbol</string>
|
||||||
<string name="icon_switch_summary">Ändere das Launcher-Symbol auf das KernelSU Icon.</string>
|
<string name="icon_switch_summary">Ändere das Launcher-Symbol auf das KernelSU Icon.</string>
|
||||||
<string name="icon_switched">Icon gewechselt</string>
|
<string name="icon_switched">Icon gewechselt</string>
|
||||||
<string name="root_require_for_install">Erfordert Root-Rechte</string>
|
|
||||||
<!-- KPM display settings -->
|
<!-- KPM display settings -->
|
||||||
<string name="show_kpm_info">KPM-Funktion anzeigen</string>
|
<string name="show_kpm_info">KPM-Funktion anzeigen</string>
|
||||||
<string name="show_kpm_info_summary">Versteckt KPM-Informationen und Funktion in der Home- und Unterleiste</string>
|
<string name="show_kpm_info_summary">Versteckt KPM-Informationen und Funktion in der Home- und Unterleiste</string>
|
||||||
@@ -337,7 +298,6 @@
|
|||||||
<string name="use_webuix_eruda">Eruda in WebUI X injizieren</string>
|
<string name="use_webuix_eruda">Eruda in WebUI X injizieren</string>
|
||||||
<string name="use_webuix_eruda_summary">Fügen Sie eine Debug-Konsole in WebUI X ein, um das Debuggen zu vereinfachen. Benötigt Debugging im WebUI X.</string>
|
<string name="use_webuix_eruda_summary">Fügen Sie eine Debug-Konsole in WebUI X ein, um das Debuggen zu vereinfachen. Benötigt Debugging im WebUI X.</string>
|
||||||
<!-- DPI setting related strings -->
|
<!-- DPI setting related strings -->
|
||||||
<string name="dpi_settings">DPI-Einstellung</string>
|
|
||||||
<string name="app_dpi_title">Angewendeter DPI</string>
|
<string name="app_dpi_title">Angewendeter DPI</string>
|
||||||
<string name="app_dpi_summary">Bildschirmanzahl nur für die aktuelle Anwendung anpassen</string>
|
<string name="app_dpi_summary">Bildschirmanzahl nur für die aktuelle Anwendung anpassen</string>
|
||||||
<string name="dpi_size_small">Klein </string>
|
<string name="dpi_size_small">Klein </string>
|
||||||
@@ -355,16 +315,6 @@
|
|||||||
<string name="language_follow_system">Folge Systemeinstellung</string>
|
<string name="language_follow_system">Folge Systemeinstellung</string>
|
||||||
<string name="language_changed">Sprache geändert, Neustart um Änderungen zu übernehmen</string>
|
<string name="language_changed">Sprache geändert, Neustart um Änderungen zu übernehmen</string>
|
||||||
<string name="settings_card_dim">Kartenfinsternis Anpassung</string>
|
<string name="settings_card_dim">Kartenfinsternis Anpassung</string>
|
||||||
<!-- Super User Related -->
|
|
||||||
<string name="scroll_to_top">Top</string>
|
|
||||||
<string name="scroll_to_bottom">Unten</string>
|
|
||||||
<string name="scroll_to_top_description">Bildlauf nach oben scrollen</string>
|
|
||||||
<string name="scroll_to_bottom_description">Scrolle zum Ende</string>
|
|
||||||
<string name="authorized">Autorisiert</string>
|
|
||||||
<string name="unauthorized">Unberechtigt</string>
|
|
||||||
<string name="selected">Ausgewählt</string>
|
|
||||||
<string name="select">variieren</string>
|
|
||||||
<string name="profile_umount_modules_disable">Eigenes Deinstallationsmodul deaktivieren</string>
|
|
||||||
<!-- Flash related -->
|
<!-- Flash related -->
|
||||||
<string name="error_code">fehlercode</string>
|
<string name="error_code">fehlercode</string>
|
||||||
<string name="check_log">Bitte überprüfen Sie das Log</string>
|
<string name="check_log">Bitte überprüfen Sie das Log</string>
|
||||||
@@ -372,4 +322,51 @@
|
|||||||
<string name="module_failed_count">%d Fehler bei der Installation eines neuen Moduls</string>
|
<string name="module_failed_count">%d Fehler bei der Installation eines neuen Moduls</string>
|
||||||
<string name="module_download_error">Modul-Download fehlgeschlagen</string>
|
<string name="module_download_error">Modul-Download fehlgeschlagen</string>
|
||||||
<string name="kernel_flashing">Kernel-Flashen</string>
|
<string name="kernel_flashing">Kernel-Flashen</string>
|
||||||
|
<!-- 分类相关 -->
|
||||||
|
<string name="category_all_apps">All</string>
|
||||||
|
<string name="category_root_apps">Root</string>
|
||||||
|
<string name="category_custom_apps">Custom</string>
|
||||||
|
<string name="category_default_apps">Default</string>
|
||||||
|
<!-- 排序相关 -->
|
||||||
|
<string name="sort_name_asc">Ascending order of name</string>
|
||||||
|
<string name="sort_name_desc">Name descending</string>
|
||||||
|
<string name="sort_install_time_new">Installation time (new)</string>
|
||||||
|
<string name="sort_install_time_old">Installation time (old)</string>
|
||||||
|
<string name="sort_size_desc">descending order of size</string>
|
||||||
|
<string name="sort_size_asc">ascending order of size</string>
|
||||||
|
<string name="sort_usage_freq">frequency of use</string>
|
||||||
|
<!-- 状态相关 -->
|
||||||
|
<string name="no_apps_in_category">No application in this category</string>
|
||||||
|
<!-- 标签相关 -->
|
||||||
|
<!-- FAB菜单相关 -->
|
||||||
|
<string name="deny_authorization">Delegation of authority</string>
|
||||||
|
<string name="grant_authorization">Authorizations</string>
|
||||||
|
<string name="unmount_modules">Unmounting Module Mounts</string>
|
||||||
|
<string name="disable_unmount">Disable uninstall module mounting</string>
|
||||||
|
<string name="expand_menu">Expand menu</string>
|
||||||
|
<string name="collapse_menu">Put away the menu</string>
|
||||||
|
<string name="scroll_to_top">Top</string>
|
||||||
|
<string name="scroll_to_bottom">Unten</string>
|
||||||
|
<string name="selected">Ausgewählt</string>
|
||||||
|
<string name="select">variieren</string>
|
||||||
|
<!-- BottomSheet相关 -->
|
||||||
|
<string name="menu_options">Menu Options</string>
|
||||||
|
<string name="sort_options">Sort by</string>
|
||||||
|
<string name="app_categories">Application Type Selection</string>
|
||||||
|
<!-- SuSFS Configuration -->
|
||||||
|
<!-- SuSFS Reset Confirmation -->
|
||||||
|
<!-- SuSFS Toast Messages -->
|
||||||
|
<!-- SuSFS Settings Item -->
|
||||||
|
<!-- 开机自启动相关 -->
|
||||||
|
<!-- SuSFS Tab Titles -->
|
||||||
|
<!-- SuSFS Dialog Actions -->
|
||||||
|
<!-- SuSFS Path Management -->
|
||||||
|
<!-- SuSFS Umount Mode -->
|
||||||
|
<!-- SuSFS Run Umount -->
|
||||||
|
<!-- SuSFS Reset Categories -->
|
||||||
|
<!-- SuSFS Path Settings -->
|
||||||
|
<!-- SuSFS Enabled Features -->
|
||||||
|
<!-- Feature Labels -->
|
||||||
|
<!-- 可切换状态 -->
|
||||||
|
<!-- Settings related strings -->
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -4,17 +4,12 @@
|
|||||||
<string name="home_not_installed">No instalado</string>
|
<string name="home_not_installed">No instalado</string>
|
||||||
<string name="home_click_to_install">Haz clic para instalar</string>
|
<string name="home_click_to_install">Haz clic para instalar</string>
|
||||||
<string name="home_working">Funcionando</string>
|
<string name="home_working">Funcionando</string>
|
||||||
<string name="home_working_version">Versión: %d</string>
|
<string name="home_working_version">Versión: %s</string>
|
||||||
<string name="home_superuser_count">Superusuarios: %d</string>
|
|
||||||
<string name="home_module_count">Módulos: %d</string>
|
|
||||||
<string name="home_unsupported">Sin soporte</string>
|
<string name="home_unsupported">Sin soporte</string>
|
||||||
<string name="home_unsupported_reason">KernelSU solo admite kernels GKI por ahora</string>
|
<string name="home_unsupported_reason">KernelSU solo admite kernels GKI por ahora</string>
|
||||||
<string name="home_kernel">Versión del kernel</string>
|
<string name="home_kernel">Versión del kernel</string>
|
||||||
<string name="home_susfs">SuSFS: %s</string>
|
|
||||||
<string name="home_susfs_version">Versión SuSFS</string>
|
<string name="home_susfs_version">Versión SuSFS</string>
|
||||||
<string name="home_susfs_sus_su">SuS SU</string>
|
|
||||||
<string name="home_manager_version">Versión del gestor</string>
|
<string name="home_manager_version">Versión del gestor</string>
|
||||||
<string name="home_fingerprint">Huella del dispositivo</string>
|
|
||||||
<string name="home_selinux_status">Estado de SELinux</string>
|
<string name="home_selinux_status">Estado de SELinux</string>
|
||||||
<string name="selinux_status_disabled">Desactivado</string>
|
<string name="selinux_status_disabled">Desactivado</string>
|
||||||
<string name="selinux_status_enforcing">Estricto</string>
|
<string name="selinux_status_enforcing">Estricto</string>
|
||||||
@@ -28,7 +23,6 @@
|
|||||||
<string name="module_sort_action_first">Ordenar (Acción primero)</string>
|
<string name="module_sort_action_first">Ordenar (Acción primero)</string>
|
||||||
<string name="module_sort_enabled_first">Ordenar (Activado primero)</string>
|
<string name="module_sort_enabled_first">Ordenar (Activado primero)</string>
|
||||||
<string name="uninstall">Desinstalar</string>
|
<string name="uninstall">Desinstalar</string>
|
||||||
<string name="restore">Restaurar</string>
|
|
||||||
<string name="module_install">Instalar</string>
|
<string name="module_install">Instalar</string>
|
||||||
<string name="install">Instalar</string>
|
<string name="install">Instalar</string>
|
||||||
<string name="reboot">Reiniciar</string>
|
<string name="reboot">Reiniciar</string>
|
||||||
@@ -61,16 +55,12 @@
|
|||||||
<string name="profile_template">Plantilla</string>
|
<string name="profile_template">Plantilla</string>
|
||||||
<string name="profile_custom">Personalizado</string>
|
<string name="profile_custom">Personalizado</string>
|
||||||
<string name="profile_name">Nombre de perfil</string>
|
<string name="profile_name">Nombre de perfil</string>
|
||||||
<string name="profile_namespace">Montaje del espacio de nombres</string>
|
|
||||||
<string name="profile_namespace_inherited">Heredado</string>
|
|
||||||
<string name="profile_namespace_global">Global</string>
|
|
||||||
<string name="profile_namespace_individual">Individual</string>
|
|
||||||
<string name="profile_groups">Grupos</string>
|
<string name="profile_groups">Grupos</string>
|
||||||
<string name="profile_capabilities">Capacidades</string>
|
<string name="profile_capabilities">Capacidades</string>
|
||||||
<string name="profile_selinux_context">Contexto SELinux</string>
|
<string name="profile_selinux_context">Contexto SELinux</string>
|
||||||
<string name="profile_umount_modules">Desmontar módulos</string>
|
<string name="profile_umount_modules">Desmontar módulos</string>
|
||||||
<string name="failed_to_update_app_profile">Error al actualizar el perfil de la aplicación para %s</string>
|
<string name="failed_to_update_app_profile">Error al actualizar el perfil de la aplicación para %s</string>
|
||||||
<string name="require_kernel_version" formatted="false">La versión %d actual de KernelSU es demasiado baja para que el gestor funcione correctamente. Por favor, ¡actualice a la versión %d o superior!</string>
|
<string name="require_kernel_version" formatted="false">La versión %s actual de KernelSU es demasiado baja para que el gestor funcione correctamente. Por favor, ¡actualice a la versión %s o superior!</string>
|
||||||
<string name="settings_umount_modules_default">Desmontar módulos por defecto</string>
|
<string name="settings_umount_modules_default">Desmontar módulos por defecto</string>
|
||||||
<string name="settings_umount_modules_default_summary">El valor global predeterminado para \"Umount modules\" en App Profile. Si está activado, eliminará todas las modificaciones de módulos del sistema para las apps que no tengan un perfil establecido.</string>
|
<string name="settings_umount_modules_default_summary">El valor global predeterminado para \"Umount modules\" en App Profile. Si está activado, eliminará todas las modificaciones de módulos del sistema para las apps que no tengan un perfil establecido.</string>
|
||||||
<string name="settings_susfs_toggle">Desactivar kprobe hooks</string>
|
<string name="settings_susfs_toggle">Desactivar kprobe hooks</string>
|
||||||
@@ -112,7 +102,6 @@
|
|||||||
<string name="settings_check_update_summary">Comprobación automática de actualizaciones al abrir la aplicación</string>
|
<string name="settings_check_update_summary">Comprobación automática de actualizaciones al abrir la aplicación</string>
|
||||||
<string name="grant_root_failed">¡No se ha podido conceder el acceso root!</string>
|
<string name="grant_root_failed">¡No se ha podido conceder el acceso root!</string>
|
||||||
<string name="action">Aktion</string>
|
<string name="action">Aktion</string>
|
||||||
<string name="open">Abrir</string>
|
|
||||||
<string name="close">Cancelar</string>
|
<string name="close">Cancelar</string>
|
||||||
<string name="enable_web_debugging">Activar la depuración de WebView</string>
|
<string name="enable_web_debugging">Activar la depuración de WebView</string>
|
||||||
<string name="enable_web_debugging_summary">Puede ser usado para depurar WebUI, por favor habilítalo sólo cuando sea necesario.</string>
|
<string name="enable_web_debugging_summary">Puede ser usado para depurar WebUI, por favor habilítalo sólo cuando sea necesario.</string>
|
||||||
@@ -136,9 +125,6 @@
|
|||||||
<string name="selected_lkm">LKM seleccionado: %s</string>
|
<string name="selected_lkm">LKM seleccionado: %s</string>
|
||||||
<string name="save_log">Guardar registros</string>
|
<string name="save_log">Guardar registros</string>
|
||||||
<string name="log_saved">Registro guardado</string>
|
<string name="log_saved">Registro guardado</string>
|
||||||
<string name="status_supported">Apóyanos</string>
|
|
||||||
<string name="status_not_supported">No soportado</string>
|
|
||||||
<string name="status_unknown">Desconocido</string>
|
|
||||||
<string name="sus_su_mode">Modo SuS SU:</string>
|
<string name="sus_su_mode">Modo SuS SU:</string>
|
||||||
<!-- Module related -->
|
<!-- Module related -->
|
||||||
<string name="module_install_confirm">¿confirmar la instalación del módulo %1$s?</string>
|
<string name="module_install_confirm">¿confirmar la instalación del módulo %1$s?</string>
|
||||||
@@ -172,14 +158,11 @@
|
|||||||
<string name="settings_custom_background">Fondo de aplicación personalizado</string>
|
<string name="settings_custom_background">Fondo de aplicación personalizado</string>
|
||||||
<string name="settings_custom_background_summary">Seleccionar una imagen como fondo</string>
|
<string name="settings_custom_background_summary">Seleccionar una imagen como fondo</string>
|
||||||
<string name="settings_card_alpha">Transparencia de la barra de navegación</string>
|
<string name="settings_card_alpha">Transparencia de la barra de navegación</string>
|
||||||
<string name="settings_restore_default">Restaurar</string>
|
|
||||||
<string name="home_android_version">Versión de Android</string>
|
<string name="home_android_version">Versión de Android</string>
|
||||||
<string name="home_device_model">Modelo del dispositivo</string>
|
<string name="home_device_model">Modelo del dispositivo</string>
|
||||||
<string name="su_not_allowed">No se permite conceder superusuario a %s</string>
|
<string name="su_not_allowed">No se permite conceder superusuario a %s</string>
|
||||||
<string name="settings_disable_su">Desactivar compatibilidad su</string>
|
<string name="settings_disable_su">Desactivar compatibilidad su</string>
|
||||||
<string name="settings_disable_su_summary">Deshabilita temporalmente cualquier aplicación para obtener privilegios de root a través del comando de \"it\" (los procesos de root existentes no se verán afectados).</string>
|
<string name="settings_disable_su_summary">Deshabilita temporalmente cualquier aplicación para obtener privilegios de root a través del comando de \"it\" (los procesos de root existentes no se verán afectados).</string>
|
||||||
<string name="using_mksu_manager">Estás usando el administrador de la Beta de SukiSU</string>
|
|
||||||
<string name="module_install_multiple_confirm">¿Está seguro que desea instalar los módulos %d seleccionados?</string>
|
|
||||||
<string name="module_install_multiple_confirm_with_names">¿Seguro que quieres instalar los siguientes módulos %1$d ? \n\n%2$s</string>
|
<string name="module_install_multiple_confirm_with_names">¿Seguro que quieres instalar los siguientes módulos %1$d ? \n\n%2$s</string>
|
||||||
<string name="more_settings">Opciones avanzadas</string>
|
<string name="more_settings">Opciones avanzadas</string>
|
||||||
<string name="selinux">SELinux</string>
|
<string name="selinux">SELinux</string>
|
||||||
@@ -210,20 +193,14 @@
|
|||||||
<string name="color_pink">Rosa</string>
|
<string name="color_pink">Rosa</string>
|
||||||
<string name="color_gray">Gris</string>
|
<string name="color_gray">Gris</string>
|
||||||
<string name="color_yellow">Amarillo</string>
|
<string name="color_yellow">Amarillo</string>
|
||||||
<string name="flash_option">Opciones de flash</string>
|
|
||||||
<string name="flash_option_tip">Seleccione el archivo a flashear</string>
|
|
||||||
<string name="horizon_kernel">Install Anykernel3</string>
|
<string name="horizon_kernel">Install Anykernel3</string>
|
||||||
<string name="horizon_kernel_summary">Flash archivo del kernel AnyKernel3</string>
|
<string name="horizon_kernel_summary">Flash archivo del kernel AnyKernel3</string>
|
||||||
<string name="root_required">Requiere privilegios de root</string>
|
<string name="root_required">Requiere privilegios de root</string>
|
||||||
<string name="copy_failed">Fallo al copiar archivo</string>
|
|
||||||
<string name="reboot_complete_title">Desguace completo</string>
|
<string name="reboot_complete_title">Desguace completo</string>
|
||||||
<string name="reboot_complete_msg">¿Reiniciar inmediatamente?</string>
|
<string name="reboot_complete_msg">¿Reiniciar inmediatamente?</string>
|
||||||
<string name="yes">Si</string>
|
<string name="yes">Si</string>
|
||||||
<string name="no">No</string>
|
<string name="no">No</string>
|
||||||
<string name="failed_reboot">Reinicio fallido</string>
|
<string name="failed_reboot">Reinicio fallido</string>
|
||||||
<string name="batch_authorization">empoderar</string>
|
|
||||||
<string name="batch_cancel_authorization">gasto</string>
|
|
||||||
<string name="backup">Copia de seguridad</string>
|
|
||||||
<string name="kpm_title">KPM</string>
|
<string name="kpm_title">KPM</string>
|
||||||
<string name="kpm_empty">No hay módulos del núcleo instalados en este momento</string>
|
<string name="kpm_empty">No hay módulos del núcleo instalados en este momento</string>
|
||||||
<string name="kpm_version">Versión</string>
|
<string name="kpm_version">Versión</string>
|
||||||
@@ -231,7 +208,6 @@
|
|||||||
<string name="kpm_uninstall">Desinstalar</string>
|
<string name="kpm_uninstall">Desinstalar</string>
|
||||||
<string name="kpm_uninstall_success">Desinstalado con éxito</string>
|
<string name="kpm_uninstall_success">Desinstalado con éxito</string>
|
||||||
<string name="kpm_uninstall_failed">Error al desinstalar</string>
|
<string name="kpm_uninstall_failed">Error al desinstalar</string>
|
||||||
<string name="kpm_install">Instalar</string>
|
|
||||||
<string name="kpm_install_success">Carga exitosa del módulo kpm</string>
|
<string name="kpm_install_success">Carga exitosa del módulo kpm</string>
|
||||||
<string name="kpm_install_failed">Error al cargar el módulo kpm</string>
|
<string name="kpm_install_failed">Error al cargar el módulo kpm</string>
|
||||||
<string name="kpm_args">Parámetros</string>
|
<string name="kpm_args">Parámetros</string>
|
||||||
@@ -245,8 +221,6 @@
|
|||||||
<string name="home_click_to_ContributionCard_kernelsu">SukiSU Ultra será una rama relativamente independiente de KSU en el futuro, pero todavía apreciamos el KernelSU oficial y MKSU etc. ¡por sus contribuciones!</string>
|
<string name="home_click_to_ContributionCard_kernelsu">SukiSU Ultra será una rama relativamente independiente de KSU en el futuro, pero todavía apreciamos el KernelSU oficial y MKSU etc. ¡por sus contribuciones!</string>
|
||||||
<string name="not_supported">Sin soporte</string>
|
<string name="not_supported">Sin soporte</string>
|
||||||
<string name="supported">Apoyado</string>
|
<string name="supported">Apoyado</string>
|
||||||
<string name="home_kpm_module">"Número de módulos KPM: %d "</string>
|
|
||||||
<string name="kpm_invalid_file">Archivo KPM inválido</string>
|
|
||||||
<string name="kernel_patched">Kernel no parcheado</string>
|
<string name="kernel_patched">Kernel no parcheado</string>
|
||||||
<string name="kernel_not_enabled">Kernel no configurado</string>
|
<string name="kernel_not_enabled">Kernel no configurado</string>
|
||||||
<string name="custom_settings">Ajustes personalizados</string>
|
<string name="custom_settings">Ajustes personalizados</string>
|
||||||
@@ -254,19 +228,13 @@
|
|||||||
<string name="kpm_install_mode_load">Cargar</string>
|
<string name="kpm_install_mode_load">Cargar</string>
|
||||||
<string name="kpm_install_mode_embed">Insertar</string>
|
<string name="kpm_install_mode_embed">Insertar</string>
|
||||||
<string name="kpm_install_mode_description">Por favor seleccione: %1\$s Modo de instalación del Módulo \n\nCarga: Cargar temporalmente el módulo \nInsertar: Instalar permanentemente en el sistema</string>
|
<string name="kpm_install_mode_description">Por favor seleccione: %1\$s Modo de instalación del Módulo \n\nCarga: Cargar temporalmente el módulo \nInsertar: Instalar permanentemente en el sistema</string>
|
||||||
<string name="log_failed_to_check_module_file">Error al comprobar la existencia del archivo de módulo</string>
|
|
||||||
<string name="snackbar_failed_to_check_module_file">No se puede comprobar si el archivo de módulo existe</string>
|
<string name="snackbar_failed_to_check_module_file">No se puede comprobar si el archivo de módulo existe</string>
|
||||||
<string name="confirm_uninstall_title">Confirme las desinstalaciones</string>
|
|
||||||
<string name="confirm_uninstall_confirm">Desinstalar</string>
|
|
||||||
<string name="confirm_uninstall_dismiss">Cancelar</string>
|
|
||||||
<string name="theme_color">Color del tema</string>
|
<string name="theme_color">Color del tema</string>
|
||||||
<string name="invalid_file_type">¡Tipo de archivo incorrecto! Por favor seleccione el archivo .kpm.</string>
|
<string name="invalid_file_type">¡Tipo de archivo incorrecto! Por favor seleccione el archivo .kpm.</string>
|
||||||
<string name="confirm_uninstall_title_with_filename">Desinstalar</string>
|
<string name="confirm_uninstall_title_with_filename">Desinstalar</string>
|
||||||
<string name="confirm_uninstall_content">El siguiente KPM será desinstalado: %s</string>
|
<string name="confirm_uninstall_content">El siguiente KPM será desinstalado: %s</string>
|
||||||
<string name="settings_susfs_toggle_summary">Deshabilita los ganchos kprobe creados por KernelSU, usando ganchos en línea en su lugar, que es similar al método de enganche del núcleo no GKI.</string>
|
<string name="settings_susfs_toggle_summary">Deshabilita los ganchos kprobe creados por KernelSU, usando ganchos en línea en su lugar, que es similar al método de enganche del núcleo no GKI.</string>
|
||||||
<string name="image_editor_title">Ajustar imagen de fondo</string>
|
|
||||||
<string name="image_editor_hint">Usa dos dedos para acercar la imagen, y un dedo para arrastrarla para ajustar la posición</string>
|
<string name="image_editor_hint">Usa dos dedos para acercar la imagen, y un dedo para arrastrarla para ajustar la posición</string>
|
||||||
<string name="background_image_error">Imposible cargar imagen</string>
|
|
||||||
<string name="reprovision">Reaprovisionamiento</string>
|
<string name="reprovision">Reaprovisionamiento</string>
|
||||||
<!-- Kernel Flash Progress Related -->
|
<!-- Kernel Flash Progress Related -->
|
||||||
<string name="horizon_flash_title">Parpadeo Kernel</string>
|
<string name="horizon_flash_title">Parpadeo Kernel</string>
|
||||||
@@ -303,10 +271,6 @@
|
|||||||
<string name="app_settings">Configuración de la Aplicación</string>
|
<string name="app_settings">Configuración de la Aplicación</string>
|
||||||
<string name="tools">Herramientas</string>
|
<string name="tools">Herramientas</string>
|
||||||
<!-- String resources used in SuperUser -->
|
<!-- String resources used in SuperUser -->
|
||||||
<string name="clear">Eliminaciones</string>
|
|
||||||
<string name="apps_with_root">Aplicaciones con privilegios de root</string>
|
|
||||||
<string name="apps_with_custom_profile">Aplicaciones con configuraciones personalizadas</string>
|
|
||||||
<string name="other_apps">Aplicaciones con valores por defecto sin cambios</string>
|
|
||||||
<string name="no_apps_found">No se ha encontrado la solicitud</string>
|
<string name="no_apps_found">No se ha encontrado la solicitud</string>
|
||||||
<string name="selinux_enabled_toast">SELinux habilitado</string>
|
<string name="selinux_enabled_toast">SELinux habilitado</string>
|
||||||
<string name="selinux_disabled_toast">SELinux desactivado</string>
|
<string name="selinux_disabled_toast">SELinux desactivado</string>
|
||||||
@@ -314,8 +278,6 @@
|
|||||||
<string name="advanced_settings">Configuraciones avanzadas</string>
|
<string name="advanced_settings">Configuraciones avanzadas</string>
|
||||||
<string name="appearance_settings">Personalizar la barra de herramientas.</string>
|
<string name="appearance_settings">Personalizar la barra de herramientas.</string>
|
||||||
<string name="back">Retorno</string>
|
<string name="back">Retorno</string>
|
||||||
<string name="expand">Estar en pleno swing</string>
|
|
||||||
<string name="collapse">poner</string>
|
|
||||||
<string name="susfs_enabled">SuSFS activado</string>
|
<string name="susfs_enabled">SuSFS activado</string>
|
||||||
<string name="susfs_disabled">SuSFS desactivado</string>
|
<string name="susfs_disabled">SuSFS desactivado</string>
|
||||||
<string name="background_set_success">Fondo establecido correctamente</string>
|
<string name="background_set_success">Fondo establecido correctamente</string>
|
||||||
@@ -323,7 +285,6 @@
|
|||||||
<string name="icon_switch_title">Icono alternativo</string>
|
<string name="icon_switch_title">Icono alternativo</string>
|
||||||
<string name="icon_switch_summary">Cambiar el icono del lanzador al icono de KernelSU.</string>
|
<string name="icon_switch_summary">Cambiar el icono del lanzador al icono de KernelSU.</string>
|
||||||
<string name="icon_switched">Icono cambiado</string>
|
<string name="icon_switched">Icono cambiado</string>
|
||||||
<string name="root_require_for_install">Requiere privilegios de root</string>
|
|
||||||
<!-- KPM display settings -->
|
<!-- KPM display settings -->
|
||||||
<string name="show_kpm_info">Mostrar función KPM</string>
|
<string name="show_kpm_info">Mostrar función KPM</string>
|
||||||
<string name="show_kpm_info_summary">Oculta la información y función del KPM en la barra de inicio e inferior</string>
|
<string name="show_kpm_info_summary">Oculta la información y función del KPM en la barra de inicio e inferior</string>
|
||||||
@@ -335,7 +296,6 @@
|
|||||||
<string name="use_webuix_eruda">Inyectar Eruda en WebUI X</string>
|
<string name="use_webuix_eruda">Inyectar Eruda en WebUI X</string>
|
||||||
<string name="use_webuix_eruda_summary">Inyecta una consola de depuración en WebUI X para facilitar la depuración. Requiere que la depuración web esté encendida.</string>
|
<string name="use_webuix_eruda_summary">Inyecta una consola de depuración en WebUI X para facilitar la depuración. Requiere que la depuración web esté encendida.</string>
|
||||||
<!-- DPI setting related strings -->
|
<!-- DPI setting related strings -->
|
||||||
<string name="dpi_settings">Configuración DPI</string>
|
|
||||||
<string name="app_dpi_title">DPI aplicado</string>
|
<string name="app_dpi_title">DPI aplicado</string>
|
||||||
<string name="app_dpi_summary">Ajustar la densidad de pantalla para la aplicación actual</string>
|
<string name="app_dpi_summary">Ajustar la densidad de pantalla para la aplicación actual</string>
|
||||||
<string name="dpi_size_small">Pequeño </string>
|
<string name="dpi_size_small">Pequeño </string>
|
||||||
@@ -353,16 +313,6 @@
|
|||||||
<string name="language_follow_system">Seguir sistema</string>
|
<string name="language_follow_system">Seguir sistema</string>
|
||||||
<string name="language_changed">Idioma cambiado, reiniciando para aplicar cambios</string>
|
<string name="language_changed">Idioma cambiado, reiniciando para aplicar cambios</string>
|
||||||
<string name="settings_card_dim">Ajuste de oscuridad de tarjeta</string>
|
<string name="settings_card_dim">Ajuste de oscuridad de tarjeta</string>
|
||||||
<!-- Super User Related -->
|
|
||||||
<string name="scroll_to_top">Arriba</string>
|
|
||||||
<string name="scroll_to_bottom">Abajo</string>
|
|
||||||
<string name="scroll_to_top_description">Ir arriba</string>
|
|
||||||
<string name="scroll_to_bottom_description">Desplazar hacia abajo</string>
|
|
||||||
<string name="authorized">autorizado</string>
|
|
||||||
<string name="unauthorized">Sin Autorización</string>
|
|
||||||
<string name="selected">Seleccionados</string>
|
|
||||||
<string name="select">opción</string>
|
|
||||||
<string name="profile_umount_modules_disable">Desactivar módulo personalizado de desinstalación</string>
|
|
||||||
<!-- Flash related -->
|
<!-- Flash related -->
|
||||||
<string name="error_code">código de error</string>
|
<string name="error_code">código de error</string>
|
||||||
<string name="check_log">Por favor, compruebe el registro</string>
|
<string name="check_log">Por favor, compruebe el registro</string>
|
||||||
@@ -370,4 +320,51 @@
|
|||||||
<string name="module_failed_count">%d falló al instalar un nuevo módulo</string>
|
<string name="module_failed_count">%d falló al instalar un nuevo módulo</string>
|
||||||
<string name="module_download_error">La descarga del modelo falló</string>
|
<string name="module_download_error">La descarga del modelo falló</string>
|
||||||
<string name="kernel_flashing">Parpadeo Kernel</string>
|
<string name="kernel_flashing">Parpadeo Kernel</string>
|
||||||
|
<!-- 分类相关 -->
|
||||||
|
<string name="category_all_apps">All</string>
|
||||||
|
<string name="category_root_apps">Root</string>
|
||||||
|
<string name="category_custom_apps">Custom</string>
|
||||||
|
<string name="category_default_apps">Default</string>
|
||||||
|
<!-- 排序相关 -->
|
||||||
|
<string name="sort_name_asc">Ascending order of name</string>
|
||||||
|
<string name="sort_name_desc">Name descending</string>
|
||||||
|
<string name="sort_install_time_new">Installation time (new)</string>
|
||||||
|
<string name="sort_install_time_old">Installation time (old)</string>
|
||||||
|
<string name="sort_size_desc">descending order of size</string>
|
||||||
|
<string name="sort_size_asc">ascending order of size</string>
|
||||||
|
<string name="sort_usage_freq">frequency of use</string>
|
||||||
|
<!-- 状态相关 -->
|
||||||
|
<string name="no_apps_in_category">No application in this category</string>
|
||||||
|
<!-- 标签相关 -->
|
||||||
|
<!-- FAB菜单相关 -->
|
||||||
|
<string name="deny_authorization">Delegation of authority</string>
|
||||||
|
<string name="grant_authorization">Authorizations</string>
|
||||||
|
<string name="unmount_modules">Unmounting Module Mounts</string>
|
||||||
|
<string name="disable_unmount">Disable uninstall module mounting</string>
|
||||||
|
<string name="expand_menu">Expand menu</string>
|
||||||
|
<string name="collapse_menu">Put away the menu</string>
|
||||||
|
<string name="scroll_to_top">Arriba</string>
|
||||||
|
<string name="scroll_to_bottom">Abajo</string>
|
||||||
|
<string name="selected">Seleccionados</string>
|
||||||
|
<string name="select">opción</string>
|
||||||
|
<!-- BottomSheet相关 -->
|
||||||
|
<string name="menu_options">Menu Options</string>
|
||||||
|
<string name="sort_options">Sort by</string>
|
||||||
|
<string name="app_categories">Application Type Selection</string>
|
||||||
|
<!-- SuSFS Configuration -->
|
||||||
|
<!-- SuSFS Reset Confirmation -->
|
||||||
|
<!-- SuSFS Toast Messages -->
|
||||||
|
<!-- SuSFS Settings Item -->
|
||||||
|
<!-- 开机自启动相关 -->
|
||||||
|
<!-- SuSFS Tab Titles -->
|
||||||
|
<!-- SuSFS Dialog Actions -->
|
||||||
|
<!-- SuSFS Path Management -->
|
||||||
|
<!-- SuSFS Umount Mode -->
|
||||||
|
<!-- SuSFS Run Umount -->
|
||||||
|
<!-- SuSFS Reset Categories -->
|
||||||
|
<!-- SuSFS Path Settings -->
|
||||||
|
<!-- SuSFS Enabled Features -->
|
||||||
|
<!-- Feature Labels -->
|
||||||
|
<!-- 可切换状态 -->
|
||||||
|
<!-- Settings related strings -->
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -4,17 +4,12 @@
|
|||||||
<string name="home_not_installed">Pole paigaldatud</string>
|
<string name="home_not_installed">Pole paigaldatud</string>
|
||||||
<string name="home_click_to_install">Klõpsa paigaldamiseks</string>
|
<string name="home_click_to_install">Klõpsa paigaldamiseks</string>
|
||||||
<string name="home_working">Töötamine</string>
|
<string name="home_working">Töötamine</string>
|
||||||
<string name="home_working_version">Versioon: %d</string>
|
<string name="home_working_version">Versioon: %s</string>
|
||||||
<string name="home_superuser_count">Superkasutajaid: %d</string>
|
|
||||||
<string name="home_module_count">Mooduleid: %d</string>
|
|
||||||
<string name="home_unsupported">Mittetoetatud</string>
|
<string name="home_unsupported">Mittetoetatud</string>
|
||||||
<string name="home_unsupported_reason">KernelSU toetab hetkel vaid GSI tuumasid</string>
|
<string name="home_unsupported_reason">KernelSU toetab hetkel vaid GSI tuumasid</string>
|
||||||
<string name="home_kernel">Tuum</string>
|
<string name="home_kernel">Tuum</string>
|
||||||
<string name="home_susfs">SuSFS: %s</string>
|
|
||||||
<string name="home_susfs_version">SuSFS Version</string>
|
<string name="home_susfs_version">SuSFS Version</string>
|
||||||
<string name="home_susfs_sus_su">SuS SU</string>
|
|
||||||
<string name="home_manager_version">Manageri versioon</string>
|
<string name="home_manager_version">Manageri versioon</string>
|
||||||
<string name="home_fingerprint">Sõrmejälg</string>
|
|
||||||
<string name="home_selinux_status">SELinuxi olek</string>
|
<string name="home_selinux_status">SELinuxi olek</string>
|
||||||
<string name="selinux_status_disabled">Keelatud</string>
|
<string name="selinux_status_disabled">Keelatud</string>
|
||||||
<string name="selinux_status_enforcing">Jõustav</string>
|
<string name="selinux_status_enforcing">Jõustav</string>
|
||||||
@@ -28,7 +23,6 @@
|
|||||||
<string name="module_sort_action_first">Sort (Action first)</string>
|
<string name="module_sort_action_first">Sort (Action first)</string>
|
||||||
<string name="module_sort_enabled_first">Sort (Enabled first)</string>
|
<string name="module_sort_enabled_first">Sort (Enabled first)</string>
|
||||||
<string name="uninstall">Eemalda</string>
|
<string name="uninstall">Eemalda</string>
|
||||||
<string name="restore">Restore</string>
|
|
||||||
<string name="module_install">Paigalda</string>
|
<string name="module_install">Paigalda</string>
|
||||||
<string name="install">Paigalda</string>
|
<string name="install">Paigalda</string>
|
||||||
<string name="reboot">Taaskäivita</string>
|
<string name="reboot">Taaskäivita</string>
|
||||||
@@ -61,16 +55,12 @@
|
|||||||
<string name="profile_template">Mall</string>
|
<string name="profile_template">Mall</string>
|
||||||
<string name="profile_custom">Kohandatud</string>
|
<string name="profile_custom">Kohandatud</string>
|
||||||
<string name="profile_name">Profiili nimi</string>
|
<string name="profile_name">Profiili nimi</string>
|
||||||
<string name="profile_namespace">Haagi nimeruum</string>
|
|
||||||
<string name="profile_namespace_inherited">Päritud</string>
|
|
||||||
<string name="profile_namespace_global">Globaalne</string>
|
|
||||||
<string name="profile_namespace_individual">Individuaalne</string>
|
|
||||||
<string name="profile_groups">Grupid</string>
|
<string name="profile_groups">Grupid</string>
|
||||||
<string name="profile_capabilities">Võimekused</string>
|
<string name="profile_capabilities">Võimekused</string>
|
||||||
<string name="profile_selinux_context">SELinux kontekst</string>
|
<string name="profile_selinux_context">SELinux kontekst</string>
|
||||||
<string name="profile_umount_modules">Lahtihaagitud moodulid</string>
|
<string name="profile_umount_modules">Lahtihaagitud moodulid</string>
|
||||||
<string name="failed_to_update_app_profile">Rakenduseprofiili uuendamine %s jaoks ebaõnnestus</string>
|
<string name="failed_to_update_app_profile">Rakenduseprofiili uuendamine %s jaoks ebaõnnestus</string>
|
||||||
<string name="require_kernel_version" formatted="false">The current KernelSU version %d is too low for the manager to work properly. Please upgrade to version %d or higher!</string>
|
<string name="require_kernel_version" formatted="false">The current KernelSU version %s is too low for the manager to work properly. Please upgrade to version %s or higher!</string>
|
||||||
<string name="settings_umount_modules_default">Haagi moodulid vaikimisi lahti</string>
|
<string name="settings_umount_modules_default">Haagi moodulid vaikimisi lahti</string>
|
||||||
<string name="settings_umount_modules_default_summary">Globaalne vaikeväärtus \"Lahtihaagitud moodulitele\" rakenduseprofiilis. Lubamisel eemaldab see kõik moodulite süsteemimuudatused rakendustele, millel ei ole profiili määratud.</string>
|
<string name="settings_umount_modules_default_summary">Globaalne vaikeväärtus \"Lahtihaagitud moodulitele\" rakenduseprofiilis. Lubamisel eemaldab see kõik moodulite süsteemimuudatused rakendustele, millel ei ole profiili määratud.</string>
|
||||||
<string name="settings_susfs_toggle">Disable kprobe hooks</string>
|
<string name="settings_susfs_toggle">Disable kprobe hooks</string>
|
||||||
@@ -112,7 +102,6 @@
|
|||||||
<string name="settings_check_update_summary">Rakenduse avamisel kontrolli automaatselt uuendusi</string>
|
<string name="settings_check_update_summary">Rakenduse avamisel kontrolli automaatselt uuendusi</string>
|
||||||
<string name="grant_root_failed">Juurkasutaja andmine ebaõnnestus!</string>
|
<string name="grant_root_failed">Juurkasutaja andmine ebaõnnestus!</string>
|
||||||
<string name="action">Action</string>
|
<string name="action">Action</string>
|
||||||
<string name="open">Ava</string>
|
|
||||||
<string name="close">Close</string>
|
<string name="close">Close</string>
|
||||||
<string name="enable_web_debugging">Luba WebView silumine</string>
|
<string name="enable_web_debugging">Luba WebView silumine</string>
|
||||||
<string name="enable_web_debugging_summary">Saab kasutada WebUI silumiseks, palun luba ainult vajadusel.</string>
|
<string name="enable_web_debugging_summary">Saab kasutada WebUI silumiseks, palun luba ainult vajadusel.</string>
|
||||||
@@ -136,9 +125,6 @@
|
|||||||
<string name="selected_lkm">Valitud LKM: %s</string>
|
<string name="selected_lkm">Valitud LKM: %s</string>
|
||||||
<string name="save_log">Salvesta Logid</string>
|
<string name="save_log">Salvesta Logid</string>
|
||||||
<string name="log_saved">Logs saved</string>
|
<string name="log_saved">Logs saved</string>
|
||||||
<string name="status_supported">Supported</string>
|
|
||||||
<string name="status_not_supported">Not Supported</string>
|
|
||||||
<string name="status_unknown">Unknown</string>
|
|
||||||
<string name="sus_su_mode">SuS SU mode:</string>
|
<string name="sus_su_mode">SuS SU mode:</string>
|
||||||
<!-- Module related -->
|
<!-- Module related -->
|
||||||
<string name="module_install_confirm">confirm install module %1$s?</string>
|
<string name="module_install_confirm">confirm install module %1$s?</string>
|
||||||
@@ -172,14 +158,11 @@
|
|||||||
<string name="settings_custom_background">Custom App Background</string>
|
<string name="settings_custom_background">Custom App Background</string>
|
||||||
<string name="settings_custom_background_summary">Select an image as background</string>
|
<string name="settings_custom_background_summary">Select an image as background</string>
|
||||||
<string name="settings_card_alpha">Navigation bar transparency</string>
|
<string name="settings_card_alpha">Navigation bar transparency</string>
|
||||||
<string name="settings_restore_default">Restore default</string>
|
|
||||||
<string name="home_android_version">Android version</string>
|
<string name="home_android_version">Android version</string>
|
||||||
<string name="home_device_model">Device model</string>
|
<string name="home_device_model">Device model</string>
|
||||||
<string name="su_not_allowed">Granting superuser to %s is not allowed</string>
|
<string name="su_not_allowed">Granting superuser to %s is not allowed</string>
|
||||||
<string name="settings_disable_su">Disable su compatibility</string>
|
<string name="settings_disable_su">Disable su compatibility</string>
|
||||||
<string name="settings_disable_su_summary">Temporarily disable any applications from obtaining root privileges via the su command (existing root processes will not be affected).</string>
|
<string name="settings_disable_su_summary">Temporarily disable any applications from obtaining root privileges via the su command (existing root processes will not be affected).</string>
|
||||||
<string name="using_mksu_manager">You are using the SukiSU Beta manager</string>
|
|
||||||
<string name="module_install_multiple_confirm">Are you sure you want to install the selected %d modules?</string>
|
|
||||||
<string name="module_install_multiple_confirm_with_names">Sure you want to install the following %1$d modules? \n\n%2$s</string>
|
<string name="module_install_multiple_confirm_with_names">Sure you want to install the following %1$d modules? \n\n%2$s</string>
|
||||||
<string name="more_settings">More settings</string>
|
<string name="more_settings">More settings</string>
|
||||||
<string name="selinux">SELinux</string>
|
<string name="selinux">SELinux</string>
|
||||||
@@ -210,20 +193,14 @@
|
|||||||
<string name="color_pink">Pink</string>
|
<string name="color_pink">Pink</string>
|
||||||
<string name="color_gray">Gray</string>
|
<string name="color_gray">Gray</string>
|
||||||
<string name="color_yellow">Yellow</string>
|
<string name="color_yellow">Yellow</string>
|
||||||
<string name="flash_option">Brush Options</string>
|
|
||||||
<string name="flash_option_tip">Select the file to be flashed</string>
|
|
||||||
<string name="horizon_kernel">Install Anykernel3</string>
|
<string name="horizon_kernel">Install Anykernel3</string>
|
||||||
<string name="horizon_kernel_summary">Flash AnyKernel3 kernel file</string>
|
<string name="horizon_kernel_summary">Flash AnyKernel3 kernel file</string>
|
||||||
<string name="root_required">Requires root privileges</string>
|
<string name="root_required">Requires root privileges</string>
|
||||||
<string name="copy_failed">File Copy Failure</string>
|
|
||||||
<string name="reboot_complete_title">Scrubbing complete</string>
|
<string name="reboot_complete_title">Scrubbing complete</string>
|
||||||
<string name="reboot_complete_msg">Whether to reboot immediately?</string>
|
<string name="reboot_complete_msg">Whether to reboot immediately?</string>
|
||||||
<string name="yes">Yes</string>
|
<string name="yes">Yes</string>
|
||||||
<string name="no">No</string>
|
<string name="no">No</string>
|
||||||
<string name="failed_reboot">Reboot Failed</string>
|
<string name="failed_reboot">Reboot Failed</string>
|
||||||
<string name="batch_authorization">empower</string>
|
|
||||||
<string name="batch_cancel_authorization">withdraw</string>
|
|
||||||
<string name="backup">Backup</string>
|
|
||||||
<string name="kpm_title">KPM</string>
|
<string name="kpm_title">KPM</string>
|
||||||
<string name="kpm_empty">No installed kernel modules at this time</string>
|
<string name="kpm_empty">No installed kernel modules at this time</string>
|
||||||
<string name="kpm_version">Version</string>
|
<string name="kpm_version">Version</string>
|
||||||
@@ -231,7 +208,6 @@
|
|||||||
<string name="kpm_uninstall">Uninstall</string>
|
<string name="kpm_uninstall">Uninstall</string>
|
||||||
<string name="kpm_uninstall_success">Uninstalled successfully</string>
|
<string name="kpm_uninstall_success">Uninstalled successfully</string>
|
||||||
<string name="kpm_uninstall_failed">Failed to uninstall</string>
|
<string name="kpm_uninstall_failed">Failed to uninstall</string>
|
||||||
<string name="kpm_install">Install</string>
|
|
||||||
<string name="kpm_install_success">Load of kpm module successful</string>
|
<string name="kpm_install_success">Load of kpm module successful</string>
|
||||||
<string name="kpm_install_failed">Load of kpm module failed</string>
|
<string name="kpm_install_failed">Load of kpm module failed</string>
|
||||||
<string name="kpm_args">Parameters</string>
|
<string name="kpm_args">Parameters</string>
|
||||||
@@ -245,8 +221,6 @@
|
|||||||
<string name="home_click_to_ContributionCard_kernelsu">SukiSU Ultra will be a relatively independent branch of KSU in the future, but we still appreciate the official KernelSU and MKSU etc. for their contributions!</string>
|
<string name="home_click_to_ContributionCard_kernelsu">SukiSU Ultra will be a relatively independent branch of KSU in the future, but we still appreciate the official KernelSU and MKSU etc. for their contributions!</string>
|
||||||
<string name="not_supported">Unsupported</string>
|
<string name="not_supported">Unsupported</string>
|
||||||
<string name="supported">Supported</string>
|
<string name="supported">Supported</string>
|
||||||
<string name="home_kpm_module">"Number of KPMs: %d "</string>
|
|
||||||
<string name="kpm_invalid_file">Invalid KPM file</string>
|
|
||||||
<string name="kernel_patched">Kernel not patched</string>
|
<string name="kernel_patched">Kernel not patched</string>
|
||||||
<string name="kernel_not_enabled">Kernel not configured</string>
|
<string name="kernel_not_enabled">Kernel not configured</string>
|
||||||
<string name="custom_settings">Custom settings</string>
|
<string name="custom_settings">Custom settings</string>
|
||||||
@@ -254,19 +228,13 @@
|
|||||||
<string name="kpm_install_mode_load">Load</string>
|
<string name="kpm_install_mode_load">Load</string>
|
||||||
<string name="kpm_install_mode_embed">Embed</string>
|
<string name="kpm_install_mode_embed">Embed</string>
|
||||||
<string name="kpm_install_mode_description">Please select: %1\$s Module Installation Mode \n\nLoad: Temporarily load the module \nEmbedded: Permanently install into the system</string>
|
<string name="kpm_install_mode_description">Please select: %1\$s Module Installation Mode \n\nLoad: Temporarily load the module \nEmbedded: Permanently install into the system</string>
|
||||||
<string name="log_failed_to_check_module_file">Failed to check module file existence</string>
|
|
||||||
<string name="snackbar_failed_to_check_module_file">Unable to check if module file exists</string>
|
<string name="snackbar_failed_to_check_module_file">Unable to check if module file exists</string>
|
||||||
<string name="confirm_uninstall_title">Confirm uninstallation</string>
|
|
||||||
<string name="confirm_uninstall_confirm">Uninstall</string>
|
|
||||||
<string name="confirm_uninstall_dismiss">Cancel</string>
|
|
||||||
<string name="theme_color">Theme Color</string>
|
<string name="theme_color">Theme Color</string>
|
||||||
<string name="invalid_file_type">Incorrect file type! Please select .kpm file.</string>
|
<string name="invalid_file_type">Incorrect file type! Please select .kpm file.</string>
|
||||||
<string name="confirm_uninstall_title_with_filename">Uninstall</string>
|
<string name="confirm_uninstall_title_with_filename">Uninstall</string>
|
||||||
<string name="confirm_uninstall_content">The following KPM will be uninstalled: %s</string>
|
<string name="confirm_uninstall_content">The following KPM will be uninstalled: %s</string>
|
||||||
<string name="settings_susfs_toggle_summary">Disable kprobe hooks created by KernelSU, using inline hooks instead, which is similar to non-GKI kernel hooking method.</string>
|
<string name="settings_susfs_toggle_summary">Disable kprobe hooks created by KernelSU, using inline hooks instead, which is similar to non-GKI kernel hooking method.</string>
|
||||||
<string name="image_editor_title">Adjust background image</string>
|
|
||||||
<string name="image_editor_hint">Use two fingers to zoom the image, and one finger to drag it to adjust the position</string>
|
<string name="image_editor_hint">Use two fingers to zoom the image, and one finger to drag it to adjust the position</string>
|
||||||
<string name="background_image_error">Could not load image</string>
|
|
||||||
<string name="reprovision">Reprovision</string>
|
<string name="reprovision">Reprovision</string>
|
||||||
<!-- Kernel Flash Progress Related -->
|
<!-- Kernel Flash Progress Related -->
|
||||||
<string name="horizon_flash_title">Kernel Flashing</string>
|
<string name="horizon_flash_title">Kernel Flashing</string>
|
||||||
@@ -303,10 +271,6 @@
|
|||||||
<string name="app_settings">Application Settings</string>
|
<string name="app_settings">Application Settings</string>
|
||||||
<string name="tools">Tools</string>
|
<string name="tools">Tools</string>
|
||||||
<!-- String resources used in SuperUser -->
|
<!-- String resources used in SuperUser -->
|
||||||
<string name="clear">Removals</string>
|
|
||||||
<string name="apps_with_root">Applications with root privileges</string>
|
|
||||||
<string name="apps_with_custom_profile">Applications with customized configurations</string>
|
|
||||||
<string name="other_apps">Applications with unchanged defaults</string>
|
|
||||||
<string name="no_apps_found">Application not found</string>
|
<string name="no_apps_found">Application not found</string>
|
||||||
<string name="selinux_enabled_toast">SELinux Enabled</string>
|
<string name="selinux_enabled_toast">SELinux Enabled</string>
|
||||||
<string name="selinux_disabled_toast">SELinux Disabled</string>
|
<string name="selinux_disabled_toast">SELinux Disabled</string>
|
||||||
@@ -314,8 +278,6 @@
|
|||||||
<string name="advanced_settings">Advanced Settings</string>
|
<string name="advanced_settings">Advanced Settings</string>
|
||||||
<string name="appearance_settings">Customize the toolbar</string>
|
<string name="appearance_settings">Customize the toolbar</string>
|
||||||
<string name="back">Comeback</string>
|
<string name="back">Comeback</string>
|
||||||
<string name="expand">Be in full swing</string>
|
|
||||||
<string name="collapse">put away</string>
|
|
||||||
<string name="susfs_enabled">SuSFS enabled</string>
|
<string name="susfs_enabled">SuSFS enabled</string>
|
||||||
<string name="susfs_disabled">SuSFS disabled</string>
|
<string name="susfs_disabled">SuSFS disabled</string>
|
||||||
<string name="background_set_success">Background set successfully</string>
|
<string name="background_set_success">Background set successfully</string>
|
||||||
@@ -323,7 +285,6 @@
|
|||||||
<string name="icon_switch_title">Alternate icon</string>
|
<string name="icon_switch_title">Alternate icon</string>
|
||||||
<string name="icon_switch_summary">Change the launcher icon to KernelSU\'s icon.</string>
|
<string name="icon_switch_summary">Change the launcher icon to KernelSU\'s icon.</string>
|
||||||
<string name="icon_switched">Icon switched</string>
|
<string name="icon_switched">Icon switched</string>
|
||||||
<string name="root_require_for_install">Requires root privileges</string>
|
|
||||||
<!-- KPM display settings -->
|
<!-- KPM display settings -->
|
||||||
<string name="show_kpm_info">Display KPM Function</string>
|
<string name="show_kpm_info">Display KPM Function</string>
|
||||||
<string name="show_kpm_info_summary">Display KPM information and Function in home and bottom bar (Need to reopen the app)</string>
|
<string name="show_kpm_info_summary">Display KPM information and Function in home and bottom bar (Need to reopen the app)</string>
|
||||||
@@ -335,7 +296,6 @@
|
|||||||
<string name="use_webuix_eruda">Inject Eruda into WebUI X</string>
|
<string name="use_webuix_eruda">Inject Eruda into WebUI X</string>
|
||||||
<string name="use_webuix_eruda_summary">Inject a debug console into WebUI X to make debugging easier. Requires web debugging to be on.</string>
|
<string name="use_webuix_eruda_summary">Inject a debug console into WebUI X to make debugging easier. Requires web debugging to be on.</string>
|
||||||
<!-- DPI setting related strings -->
|
<!-- DPI setting related strings -->
|
||||||
<string name="dpi_settings">DPI setting</string>
|
|
||||||
<string name="app_dpi_title">Applied DPI</string>
|
<string name="app_dpi_title">Applied DPI</string>
|
||||||
<string name="app_dpi_summary">Adjust the screen display density for the current application only</string>
|
<string name="app_dpi_summary">Adjust the screen display density for the current application only</string>
|
||||||
<string name="dpi_size_small">Small </string>
|
<string name="dpi_size_small">Small </string>
|
||||||
@@ -353,16 +313,6 @@
|
|||||||
<string name="language_follow_system">Follow System</string>
|
<string name="language_follow_system">Follow System</string>
|
||||||
<string name="language_changed">Language changed, restarting to apply changes</string>
|
<string name="language_changed">Language changed, restarting to apply changes</string>
|
||||||
<string name="settings_card_dim">Card Darkness Adjustment</string>
|
<string name="settings_card_dim">Card Darkness Adjustment</string>
|
||||||
<!-- Super User Related -->
|
|
||||||
<string name="scroll_to_top">Top</string>
|
|
||||||
<string name="scroll_to_bottom">Bottom</string>
|
|
||||||
<string name="scroll_to_top_description">Scroll to top</string>
|
|
||||||
<string name="scroll_to_bottom_description">Scroll to the bottom</string>
|
|
||||||
<string name="authorized">authorized</string>
|
|
||||||
<string name="unauthorized">unauthorized</string>
|
|
||||||
<string name="selected">Selected</string>
|
|
||||||
<string name="select">option</string>
|
|
||||||
<string name="profile_umount_modules_disable">Disable custom uninstallation module</string>
|
|
||||||
<!-- Flash related -->
|
<!-- Flash related -->
|
||||||
<string name="error_code">error code</string>
|
<string name="error_code">error code</string>
|
||||||
<string name="check_log">Please check the log</string>
|
<string name="check_log">Please check the log</string>
|
||||||
@@ -370,4 +320,51 @@
|
|||||||
<string name="module_failed_count">%d Failed to install a new module</string>
|
<string name="module_failed_count">%d Failed to install a new module</string>
|
||||||
<string name="module_download_error">Module download failed</string>
|
<string name="module_download_error">Module download failed</string>
|
||||||
<string name="kernel_flashing">Kernel Flashing</string>
|
<string name="kernel_flashing">Kernel Flashing</string>
|
||||||
|
<!-- 分类相关 -->
|
||||||
|
<string name="category_all_apps">All</string>
|
||||||
|
<string name="category_root_apps">Root</string>
|
||||||
|
<string name="category_custom_apps">Custom</string>
|
||||||
|
<string name="category_default_apps">Default</string>
|
||||||
|
<!-- 排序相关 -->
|
||||||
|
<string name="sort_name_asc">Ascending order of name</string>
|
||||||
|
<string name="sort_name_desc">Name descending</string>
|
||||||
|
<string name="sort_install_time_new">Installation time (new)</string>
|
||||||
|
<string name="sort_install_time_old">Installation time (old)</string>
|
||||||
|
<string name="sort_size_desc">descending order of size</string>
|
||||||
|
<string name="sort_size_asc">ascending order of size</string>
|
||||||
|
<string name="sort_usage_freq">frequency of use</string>
|
||||||
|
<!-- 状态相关 -->
|
||||||
|
<string name="no_apps_in_category">No application in this category</string>
|
||||||
|
<!-- 标签相关 -->
|
||||||
|
<!-- FAB菜单相关 -->
|
||||||
|
<string name="deny_authorization">Delegation of authority</string>
|
||||||
|
<string name="grant_authorization">Authorizations</string>
|
||||||
|
<string name="unmount_modules">Unmounting Module Mounts</string>
|
||||||
|
<string name="disable_unmount">Disable uninstall module mounting</string>
|
||||||
|
<string name="expand_menu">Expand menu</string>
|
||||||
|
<string name="collapse_menu">Put away the menu</string>
|
||||||
|
<string name="scroll_to_top">Top</string>
|
||||||
|
<string name="scroll_to_bottom">Bottom</string>
|
||||||
|
<string name="selected">Selected</string>
|
||||||
|
<string name="select">option</string>
|
||||||
|
<!-- BottomSheet相关 -->
|
||||||
|
<string name="menu_options">Menu Options</string>
|
||||||
|
<string name="sort_options">Sort by</string>
|
||||||
|
<string name="app_categories">Application Type Selection</string>
|
||||||
|
<!-- SuSFS Configuration -->
|
||||||
|
<!-- SuSFS Reset Confirmation -->
|
||||||
|
<!-- SuSFS Toast Messages -->
|
||||||
|
<!-- SuSFS Settings Item -->
|
||||||
|
<!-- 开机自启动相关 -->
|
||||||
|
<!-- SuSFS Tab Titles -->
|
||||||
|
<!-- SuSFS Dialog Actions -->
|
||||||
|
<!-- SuSFS Path Management -->
|
||||||
|
<!-- SuSFS Umount Mode -->
|
||||||
|
<!-- SuSFS Run Umount -->
|
||||||
|
<!-- SuSFS Reset Categories -->
|
||||||
|
<!-- SuSFS Path Settings -->
|
||||||
|
<!-- SuSFS Enabled Features -->
|
||||||
|
<!-- Feature Labels -->
|
||||||
|
<!-- 可切换状态 -->
|
||||||
|
<!-- Settings related strings -->
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user