You've already forked KernelSU
mirror of
https://github.com/tiann/KernelSU.git
synced 2025-08-27 23:46:34 +00:00
Compare commits
141 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
afefe20c96 | ||
|
|
76e7d7c60c | ||
|
|
d08f537c89 | ||
|
|
88e20d102d | ||
|
|
32b3ec9844 | ||
|
|
fbeea49318 | ||
|
|
5deecb3b50 | ||
|
|
534ac88195 | ||
|
|
d867c3c5e2 | ||
|
|
aca9ac50f3 | ||
|
|
d6cbda49aa | ||
|
|
fe7f509f9d | ||
|
|
26da7d590e | ||
|
|
706cd1e73e | ||
|
|
6472b14a59 | ||
|
|
c305dca5ab | ||
|
|
94978b7b28 | ||
|
|
161b3280c4 | ||
|
|
e69769d25f | ||
|
|
a1153683e1 | ||
|
|
79341ab501 | ||
|
|
05b33abb79 | ||
|
|
f5095f96fa | ||
|
|
dcd9d65c92 | ||
|
|
fa3dec8852 | ||
|
|
87d10054ae | ||
|
|
1a308afe63 | ||
|
|
f46830f28f | ||
|
|
c560d603e6 | ||
|
|
064de704f2 | ||
|
|
860911c455 | ||
|
|
1d04c5086c | ||
|
|
f4eab986a9 | ||
|
|
701e85d931 | ||
|
|
bf43654725 | ||
|
|
a56a922f96 | ||
|
|
19a697a968 | ||
|
|
c9b540b12c | ||
|
|
cd48f64154 | ||
|
|
acd2c343e2 | ||
|
|
dec7f91182 | ||
|
|
d2684292e8 | ||
|
|
07b940d127 | ||
|
|
845515fa6b | ||
|
|
0db7aa573e | ||
|
|
3783f82b28 | ||
|
|
684973b4bf | ||
|
|
0617c4440b | ||
|
|
9223558197 | ||
|
|
c13040a0ea | ||
|
|
b45c4f57c5 | ||
|
|
8196243478 | ||
|
|
b7f937b7f9 | ||
|
|
8fdff569d6 | ||
|
|
b658d820a1 | ||
|
|
ce56c19ad9 | ||
|
|
d27561c505 | ||
|
|
57898f13c1 | ||
|
|
5da1767ff8 | ||
|
|
aa21385a36 | ||
|
|
697e06125a | ||
|
|
95c383ea18 | ||
|
|
048e94ba69 | ||
|
|
4a9f1de7a0 | ||
|
|
00438a6d6e | ||
|
|
88d4eca8ff | ||
|
|
8a298bb867 | ||
|
|
5526fa2468 | ||
|
|
c26a26b92d | ||
|
|
75e64eafd2 | ||
|
|
961478fa23 | ||
|
|
a903b0fa4e | ||
|
|
0f09b90f5b | ||
|
|
8b81aeaf70 | ||
|
|
b4a52f89cc | ||
|
|
e9df5105b3 | ||
|
|
cd2711395a | ||
|
|
83a8d77018 | ||
|
|
426fde58fd | ||
|
|
59040c3aea | ||
|
|
f4b53daddf | ||
|
|
4c79ad7a81 | ||
|
|
fb6565bd19 | ||
|
|
a3e939ab90 | ||
|
|
80797548b5 | ||
|
|
f86fce6e16 | ||
|
|
318be535a8 | ||
|
|
92d4de3a73 | ||
|
|
3cf5fc4c51 | ||
|
|
4e3cbf627a | ||
|
|
72febb34c0 | ||
|
|
03068f279d | ||
|
|
7371eae382 | ||
|
|
fae1fd9826 | ||
|
|
ec5d9e6368 | ||
|
|
64f849dc10 | ||
|
|
d68fa5aed5 | ||
|
|
1b67c1b153 | ||
|
|
f349507232 | ||
|
|
bf823a29e8 | ||
|
|
55f712d1b2 | ||
|
|
ca10d7bcb9 | ||
|
|
d24813b2c3 | ||
|
|
a6325193cf | ||
|
|
7a1767b4c9 | ||
|
|
2d4d26c68e | ||
|
|
3f98493bb3 | ||
|
|
927f2a26bd | ||
|
|
344c08bb79 | ||
|
|
84f16e4c82 | ||
|
|
4ff9dcaa17 | ||
|
|
34b64b8310 | ||
|
|
8f4e7f8a79 | ||
|
|
75b5fdfb9d | ||
|
|
d4e19bb8fc | ||
|
|
571f89fac3 | ||
|
|
9e058c48a6 | ||
|
|
e828053439 | ||
|
|
8a7d153b02 | ||
|
|
06fdae18d2 | ||
|
|
df8c91b306 | ||
|
|
10b31bd09a | ||
|
|
54a705d8dc | ||
|
|
294caf3deb | ||
|
|
a1f7d474f9 | ||
|
|
1df5fec49b | ||
|
|
fd03626362 | ||
|
|
9b294682b0 | ||
|
|
a4fb9e4031 | ||
|
|
3ebee74efc | ||
|
|
433627c82b | ||
|
|
6cce322107 | ||
|
|
906007a7b3 | ||
|
|
583426ecc5 | ||
|
|
ce892bc439 | ||
|
|
1f1d4d454e | ||
|
|
4695b41f53 | ||
|
|
52f17cde40 | ||
|
|
3408f944e6 | ||
|
|
b1830049f1 | ||
|
|
79951f06ed |
32
.github/ISSUE_TEMPLATE/bug_report.md
vendored
32
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -1,32 +0,0 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behaviour:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See the error
|
||||
|
||||
**Expected behaviour**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Smartphone (please complete the following information):**
|
||||
- Device: [e.g. iPhone6]
|
||||
- OS: [e.g. iOS8.1]
|
||||
- Version [e.g. 22]
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
72
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
72
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
name: Bug report
|
||||
description: Create a report to help us improve KernelSU
|
||||
labels: [Bug]
|
||||
|
||||
body:
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Please check before submitting an issue
|
||||
options:
|
||||
- label: I have searched the issues and haven't found anything relevant
|
||||
required: true
|
||||
|
||||
- label: I will upload bugreport file in KernelSU Manager - Settings - Report log
|
||||
required: true
|
||||
|
||||
- label: I know how to reproduce the issue which may not be specific to my device
|
||||
required: false
|
||||
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Describe the bug
|
||||
description: A clear and concise description of what the bug is
|
||||
validations:
|
||||
required: true
|
||||
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: To Reproduce
|
||||
description: Steps to reproduce the behaviour
|
||||
placeholder: |
|
||||
- 1. Go to '...'
|
||||
- 2. Click on '....'
|
||||
- 3. Scroll down to '....'
|
||||
- 4. See error
|
||||
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Expected behavior
|
||||
description: A clear and concise description of what you expected to happen.
|
||||
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Screenshots
|
||||
description: If applicable, add screenshots to help explain your problem.
|
||||
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Logs
|
||||
description: If applicable, add crash or any other logs to help us figure out the problem.
|
||||
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Device info
|
||||
value: |
|
||||
- Device:
|
||||
- OS Version:
|
||||
- KernelSU Version:
|
||||
- Kernel Version:
|
||||
validations:
|
||||
required: true
|
||||
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Additional context
|
||||
description: Add any other context about the problem here.
|
||||
17
.github/workflows/build-kernel-a12.yml
vendored
17
.github/workflows/build-kernel-a12.yml
vendored
@@ -43,6 +43,8 @@ jobs:
|
||||
os_patch_level: 2023-07
|
||||
- sub_level: 185
|
||||
os_patch_level: 2023-09
|
||||
- sub_level: 198
|
||||
os_patch_level: 2023-11
|
||||
uses: ./.github/workflows/gki-kernel.yml
|
||||
secrets: inherit
|
||||
with:
|
||||
@@ -57,7 +59,6 @@ jobs:
|
||||
if: ${{ ( github.event_name != 'pull_request' && github.ref == 'refs/heads/main' ) || github.ref_type == 'tag' || github.ref == 'refs/heads/ci' }}
|
||||
env:
|
||||
CHAT_ID: ${{ secrets.CHAT_ID }}
|
||||
CACHE_CHAT_ID: ${{ secrets.CACHE_CHAT_ID }}
|
||||
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
|
||||
MESSAGE_THREAD_ID: ${{ secrets.MESSAGE_THREAD_ID }}
|
||||
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
|
||||
@@ -65,7 +66,7 @@ jobs:
|
||||
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
||||
steps:
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@v3
|
||||
uses: actions/download-artifact@v4
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
@@ -83,7 +84,7 @@ jobs:
|
||||
git clone $AOSP_MIRROR/platform/prebuilts/build-tools -b $BRANCH --depth 1 build-tools
|
||||
git clone $AOSP_MIRROR/kernel/prebuilts/build-tools -b $BRANCH --depth 1 kernel-build-tools
|
||||
git clone $AOSP_MIRROR/platform/system/tools/mkbootimg -b $BRANCH --depth 1
|
||||
pip3 install python-telegram-bot
|
||||
pip3 install telethon==1.31.1
|
||||
|
||||
- name: Set boot sign key
|
||||
env:
|
||||
@@ -93,8 +94,12 @@ jobs:
|
||||
echo "$BOOT_SIGN_KEY" > ./kernel-build-tools/linux-x86/share/avb/testkey_rsa2048.pem
|
||||
fi
|
||||
|
||||
- name: Setup mutex for uploading
|
||||
uses: ben-z/gh-action-mutex@v1.0-alpha-7
|
||||
- name: Bot session cache
|
||||
id: bot_session_cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: scripts/ksubot.session
|
||||
key: ${{ runner.os }}-bot-session
|
||||
|
||||
- name: Build boot images
|
||||
run: |
|
||||
@@ -113,7 +118,7 @@ jobs:
|
||||
run: ls -R
|
||||
|
||||
- name: Upload images artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: boot-images-android12
|
||||
path: Image-android12*/*.img.gz
|
||||
|
||||
38
.github/workflows/build-kernel-a13.yml
vendored
38
.github/workflows/build-kernel-a13.yml
vendored
@@ -42,6 +42,12 @@ jobs:
|
||||
- version: "5.10"
|
||||
sub_level: 186
|
||||
os_patch_level: 2023-09
|
||||
- version: "5.10"
|
||||
sub_level: 189
|
||||
os_patch_level: 2023-11
|
||||
- version: "5.10"
|
||||
sub_level: 198
|
||||
os_patch_level: 2023-12
|
||||
- version: "5.15"
|
||||
sub_level: 41
|
||||
os_patch_level: 2022-11
|
||||
@@ -60,6 +66,12 @@ jobs:
|
||||
- version: "5.15"
|
||||
sub_level: 119
|
||||
os_patch_level: 2023-09
|
||||
- version: "5.15"
|
||||
sub_level: 123
|
||||
os_patch_level: 2023-11
|
||||
- version: "5.15"
|
||||
sub_level: 137
|
||||
os_patch_level: 2023-12
|
||||
uses: ./.github/workflows/gki-kernel.yml
|
||||
secrets: inherit
|
||||
with:
|
||||
@@ -74,7 +86,6 @@ jobs:
|
||||
if: ${{ ( github.event_name != 'pull_request' && github.ref == 'refs/heads/main' ) || github.ref_type == 'tag' || github.ref == 'refs/heads/ci' }}
|
||||
env:
|
||||
CHAT_ID: ${{ secrets.CHAT_ID }}
|
||||
CACHE_CHAT_ID: ${{ secrets.CACHE_CHAT_ID }}
|
||||
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
|
||||
MESSAGE_THREAD_ID: ${{ secrets.MESSAGE_THREAD_ID }}
|
||||
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
|
||||
@@ -82,7 +93,7 @@ jobs:
|
||||
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
||||
steps:
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@v3
|
||||
uses: actions/download-artifact@v4
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
@@ -100,7 +111,7 @@ jobs:
|
||||
git clone $AOSP_MIRROR/platform/prebuilts/build-tools -b $BRANCH --depth 1 build-tools
|
||||
git clone $AOSP_MIRROR/kernel/prebuilts/build-tools -b $BRANCH --depth 1 kernel-build-tools
|
||||
git clone $AOSP_MIRROR/platform/system/tools/mkbootimg -b $BRANCH --depth 1
|
||||
pip3 install python-telegram-bot
|
||||
pip3 install telethon==1.31.1
|
||||
|
||||
- name: Set boot sign key
|
||||
env:
|
||||
@@ -110,8 +121,12 @@ jobs:
|
||||
echo "$BOOT_SIGN_KEY" > ./kernel-build-tools/linux-x86/share/avb/testkey_rsa2048.pem
|
||||
fi
|
||||
|
||||
- name: Setup mutex for uploading
|
||||
uses: ben-z/gh-action-mutex@v1.0-alpha-7
|
||||
- name: Bot session cache
|
||||
id: bot_session_cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: scripts/ksubot.session
|
||||
key: ${{ runner.os }}-bot-session
|
||||
|
||||
- name: Build boot images
|
||||
run: |
|
||||
@@ -125,12 +140,12 @@ jobs:
|
||||
echo "VERSION: $VERSION"
|
||||
cd -
|
||||
bash $GITHUB_WORKSPACE/KernelSU/.github/scripts/build_a13.sh
|
||||
|
||||
|
||||
- name: Display structure of boot files
|
||||
run: ls -R
|
||||
|
||||
- name: Upload images artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: boot-images-android13
|
||||
path: Image-android13*/*.img.gz
|
||||
@@ -141,14 +156,15 @@ jobs:
|
||||
matrix:
|
||||
include:
|
||||
- version: "5.10"
|
||||
sub_level: 187
|
||||
os_patch_level: 2023-08
|
||||
sub_level: 189
|
||||
os_patch_level: 2023-10
|
||||
- version: "5.15"
|
||||
sub_level: 119
|
||||
os_patch_level: 2023-09
|
||||
sub_level: 123
|
||||
os_patch_level: 2023-10
|
||||
uses: ./.github/workflows/gki-kernel.yml
|
||||
with:
|
||||
version: android13-${{ matrix.version }}
|
||||
version_name: android13-${{ matrix.version }}.${{ matrix.sub_level }}
|
||||
tag: android13-${{ matrix.version }}-${{ matrix.os_patch_level }}
|
||||
os_patch_level: ${{ matrix.os_patch_level }}
|
||||
patch_path: ${{ matrix.version }}
|
||||
|
||||
131
.github/workflows/build-kernel-a14.yml
vendored
Normal file
131
.github/workflows/build-kernel-a14.yml
vendored
Normal file
@@ -0,0 +1,131 @@
|
||||
name: Build Kernel - Android 14
|
||||
on:
|
||||
push:
|
||||
branches: ["main", "ci"]
|
||||
paths:
|
||||
- ".github/workflows/build-kernel-a14.yml"
|
||||
- ".github/workflows/gki-kernel.yml"
|
||||
- ".github/scripts/build_a13.sh"
|
||||
- "kernel/**"
|
||||
pull_request:
|
||||
branches: ["main"]
|
||||
paths:
|
||||
- ".github/workflows/build-kernel-a14.yml"
|
||||
- ".github/workflows/gki-kernel.yml"
|
||||
- ".github/scripts/build-a13.sh"
|
||||
- "kernel/**"
|
||||
workflow_call:
|
||||
jobs:
|
||||
build-kernel:
|
||||
if: github.event_name != 'pull_request'
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- version: "5.15"
|
||||
sub_level: 110
|
||||
os_patch_level: 2023-09
|
||||
- version: "5.15"
|
||||
sub_level: 131
|
||||
os_patch_level: 2023-11
|
||||
- version: "6.1"
|
||||
sub_level: 25
|
||||
os_patch_level: 2023-10
|
||||
- version: "6.1"
|
||||
sub_level: 43
|
||||
os_patch_level: 2023-11
|
||||
- version: "6.1"
|
||||
sub_level: 57
|
||||
os_patch_level: 2023-12
|
||||
uses: ./.github/workflows/gki-kernel.yml
|
||||
secrets: inherit
|
||||
with:
|
||||
version: android14-${{ matrix.version }}
|
||||
version_name: android14-${{ matrix.version }}.${{ matrix.sub_level }}
|
||||
tag: android14-${{ matrix.version }}-${{ matrix.os_patch_level }}
|
||||
os_patch_level: ${{ matrix.os_patch_level }}
|
||||
patch_path: ${{ matrix.version }}
|
||||
upload-artifacts:
|
||||
needs: build-kernel
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ ( github.event_name != 'pull_request' && github.ref == 'refs/heads/main' ) || github.ref_type == 'tag' || github.ref == 'refs/heads/ci' }}
|
||||
env:
|
||||
CHAT_ID: ${{ secrets.CHAT_ID }}
|
||||
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
|
||||
MESSAGE_THREAD_ID: ${{ secrets.MESSAGE_THREAD_ID }}
|
||||
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
|
||||
COMMIT_URL: ${{ github.event.head_commit.url }}
|
||||
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
||||
steps:
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
path: KernelSU
|
||||
fetch-depth: 0
|
||||
|
||||
- name: List artifacts
|
||||
run: |
|
||||
tree
|
||||
|
||||
- name: Download prebuilt toolchain
|
||||
run: |
|
||||
AOSP_MIRROR=https://android.googlesource.com
|
||||
BRANCH=main-kernel-build-2023
|
||||
git clone $AOSP_MIRROR/platform/prebuilts/build-tools -b $BRANCH --depth 1 build-tools
|
||||
git clone $AOSP_MIRROR/kernel/prebuilts/build-tools -b $BRANCH --depth 1 kernel-build-tools
|
||||
git clone $AOSP_MIRROR/platform/system/tools/mkbootimg -b $BRANCH --depth 1
|
||||
pip3 install telethon==1.31.1
|
||||
|
||||
- name: Set boot sign key
|
||||
env:
|
||||
BOOT_SIGN_KEY: ${{ secrets.BOOT_SIGN_KEY }}
|
||||
run: |
|
||||
if [ ! -z "$BOOT_SIGN_KEY" ]; then
|
||||
echo "$BOOT_SIGN_KEY" > ./kernel-build-tools/linux-x86/share/avb/testkey_rsa2048.pem
|
||||
fi
|
||||
|
||||
- name: Bot session cache
|
||||
id: bot_session_cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: scripts/ksubot.session
|
||||
key: ${{ runner.os }}-bot-session
|
||||
|
||||
- name: Build boot images
|
||||
run: |
|
||||
export AVBTOOL=$GITHUB_WORKSPACE/kernel-build-tools/linux-x86/bin/avbtool
|
||||
export GZIP=$GITHUB_WORKSPACE/build-tools/path/linux-x86/gzip
|
||||
export LZ4=$GITHUB_WORKSPACE/build-tools/path/linux-x86/lz4
|
||||
export MKBOOTIMG=$GITHUB_WORKSPACE/mkbootimg/mkbootimg.py
|
||||
export UNPACK_BOOTIMG=$GITHUB_WORKSPACE/mkbootimg/unpack_bootimg.py
|
||||
cd $GITHUB_WORKSPACE/KernelSU
|
||||
export VERSION=$(($(git rev-list --count HEAD) + 10200))
|
||||
echo "VERSION: $VERSION"
|
||||
cd -
|
||||
bash $GITHUB_WORKSPACE/KernelSU/.github/scripts/build_a13.sh
|
||||
|
||||
- name: Display structure of boot files
|
||||
run: ls -R
|
||||
|
||||
- name: Upload images artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: boot-images-android14
|
||||
path: Image-android14*/*.img.gz
|
||||
|
||||
check-build-kernel:
|
||||
if: github.event_name == 'pull_request'
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- version: "5.15"
|
||||
sub_level: 110
|
||||
os_patch_level: 2023-09
|
||||
uses: ./.github/workflows/gki-kernel.yml
|
||||
with:
|
||||
version: android14-${{ matrix.version }}
|
||||
version_name: android14-${{ matrix.version }}.${{ matrix.sub_level }}
|
||||
tag: android14-${{ matrix.version }}-${{ matrix.os_patch_level }}
|
||||
os_patch_level: ${{ matrix.os_patch_level }}
|
||||
patch_path: ${{ matrix.version }}
|
||||
13
.github/workflows/build-kernel-arcvm.yml
vendored
13
.github/workflows/build-kernel-arcvm.yml
vendored
@@ -110,16 +110,23 @@ jobs:
|
||||
echo "file_path=${PWD}/arch/x86/boot/bzImage" >> $GITHUB_ENV
|
||||
|
||||
- name: Upload kernel-ARCVM-${{ matrix.arch }}-${{ matrix.version }}
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: kernel-ARCVM-${{ matrix.arch }}-${{ matrix.version }}
|
||||
path: "${{ env.file_path }}"
|
||||
|
||||
- name: Bot session cache
|
||||
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/main' ) || github.ref_type == 'tag' }}
|
||||
id: bot_session_cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: scripts/ksubot.session
|
||||
key: ${{ runner.os }}-bot-session
|
||||
|
||||
- name: Post to Telegram
|
||||
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/main' ) || github.ref_type == 'tag' }}
|
||||
env:
|
||||
CHAT_ID: ${{ secrets.CHAT_ID }}
|
||||
CACHE_CHAT_ID: ${{ secrets.CACHE_CHAT_ID }}
|
||||
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
|
||||
MESSAGE_THREAD_ID: ${{ secrets.MESSAGE_THREAD_ID }}
|
||||
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
|
||||
@@ -135,6 +142,6 @@ jobs:
|
||||
echo "[+] Image to upload"
|
||||
ls -l "${{ env.file_path }}.gz"
|
||||
if [ -n "${{ secrets.BOT_TOKEN }}" ]; then
|
||||
pip3 install python-telegram-bot
|
||||
pip3 install telethon==1.31.1
|
||||
python3 "$GITHUB_WORKSPACE/KernelSU/scripts/ksubot.py" "${{ env.file_path }}.gz"
|
||||
fi
|
||||
|
||||
56
.github/workflows/build-kernel-wsa.yml
vendored
56
.github/workflows/build-kernel-wsa.yml
vendored
@@ -18,7 +18,7 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
arch: [x86_64, arm64]
|
||||
version: ["5.15.94.2", "5.15.104.1", "5.15.104.2", "5.15.104.3"]
|
||||
version: ["5.15.94.2", "5.15.104.1", "5.15.104.2", "5.15.104.3", "5.15.104.4"]
|
||||
|
||||
name: Build WSA-Kernel-${{ matrix.version }}-${{ matrix.arch }}
|
||||
runs-on: ubuntu-20.04
|
||||
@@ -29,22 +29,25 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Install Build Tools
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y --no-install-recommends bc bison build-essential ca-certificates flex git gnupg libelf-dev libssl-dev lsb-release software-properties-common wget libncurses-dev binutils-aarch64-linux-gnu gcc-aarch64-linux-gnu nuget gzip
|
||||
export LLVM_VERSION=12
|
||||
wget -q https://apt.llvm.org/llvm.sh
|
||||
sudo bash ./llvm.sh $LLVM_VERSION
|
||||
cd /usr/bin
|
||||
sudo ln -sf clang-$LLVM_VERSION clang
|
||||
sudo ln -sf ld.lld-$LLVM_VERSION ld.lld
|
||||
sudo ln -sf llvm-objdump-$LLVM_VERSION llvm-objdump
|
||||
sudo ln -sf llvm-ar-$LLVM_VERSION llvm-ar
|
||||
sudo ln -sf llvm-nm-$LLVM_VERSION llvm-nm
|
||||
sudo ln -sf llvm-strip-$LLVM_VERSION llvm-strip
|
||||
sudo ln -sf llvm-objcopy-$LLVM_VERSION llvm-objcopy
|
||||
sudo ln -sf llvm-readelf-$LLVM_VERSION llvm-readelf
|
||||
sudo ln -sf clang++-$LLVM_VERSION clang++
|
||||
uses: awalsh128/cache-apt-pkgs-action@v1
|
||||
with:
|
||||
packages: bc bison build-essential flex libelf-dev binutils-aarch64-linux-gnu gcc-aarch64-linux-gnu gzip ccache
|
||||
version: 1.0
|
||||
|
||||
- name: Cache LLVM
|
||||
id: cache-llvm
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ./llvm
|
||||
key: llvm-12.0.1
|
||||
|
||||
- name: Setup LLVM
|
||||
uses: KyleMayes/install-llvm-action@v1
|
||||
with:
|
||||
version: "12.0.1"
|
||||
force-version: true
|
||||
ubuntu-version: "16.04"
|
||||
cached: ${{ steps.cache-llvm.outputs.cache-hit }}
|
||||
|
||||
- name: Checkout KernelSU
|
||||
uses: actions/checkout@v4
|
||||
@@ -88,29 +91,36 @@ jobs:
|
||||
- name: Build Kernel
|
||||
working-directory: WSA-Linux-Kernel
|
||||
run: |
|
||||
declare -A ARCH_MAP=(["x86_64"]="x64" ["arm64"]="arm64")
|
||||
cp configs/wsa/config-wsa-${ARCH_MAP[${{ matrix.arch }}]} .config
|
||||
make olddefconfig
|
||||
if [ ! -z ${{ vars.EXPECTED_SIZE }} ] && [ ! -z ${{ vars.EXPECTED_HASH }} ]; then
|
||||
export KSU_EXPECTED_SIZE=${{ vars.EXPECTED_SIZE }}
|
||||
export KSU_EXPECTED_HASH=${{ vars.EXPECTED_HASH }}
|
||||
fi
|
||||
declare -A ARCH_MAP=(["x86_64"]="x64" ["arm64"]="arm64")
|
||||
cp configs/wsa/config-wsa-${ARCH_MAP[${{ matrix.arch }}]} .config
|
||||
make olddefconfig
|
||||
declare -A FILE_NAME=(["x86_64"]="bzImage" ["arm64"]="Image")
|
||||
make -j`nproc` LLVM=1 ARCH=${{ matrix.arch }} $(if [ "${{ matrix.arch }}" == "arm64" ]; then echo CROSS_COMPILE=aarch64-linux-gnu; fi) ${FILE_NAME[${{ matrix.arch }}]} CCACHE="/usr/bin/ccache"
|
||||
declare -A ARCH_MAP_FILE=(["x86_64"]="x86" ["arm64"]="arm64")
|
||||
echo "file_path=WSA-Linux-Kernel/arch/${ARCH_MAP_FILE[${{ matrix.arch }}]}/boot/${FILE_NAME[${{ matrix.arch }}]}" >> $GITHUB_ENV
|
||||
|
||||
- name: Upload kernel-${{ matrix.arch }}-${{ matrix.version }}
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: kernel-WSA-${{ matrix.arch }}-${{ matrix.version }}
|
||||
path: "${{ env.file_path }}"
|
||||
|
||||
- name: Bot session cache
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main' || github.ref_type == 'tag'
|
||||
id: bot_session_cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: scripts/ksubot.session
|
||||
key: ${{ runner.os }}-bot-session
|
||||
|
||||
- name: Post to Telegram
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main' || github.ref_type == 'tag'
|
||||
env:
|
||||
CHAT_ID: ${{ secrets.CHAT_ID }}
|
||||
CACHE_CHAT_ID: ${{ secrets.CACHE_CHAT_ID }}
|
||||
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
|
||||
MESSAGE_THREAD_ID: ${{ secrets.MESSAGE_THREAD_ID }}
|
||||
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
|
||||
@@ -126,6 +136,6 @@ jobs:
|
||||
echo "[+] Image to upload"
|
||||
ls -l "${{ env.file_path }}.gz"
|
||||
if [ -n "${{ secrets.BOT_TOKEN }}" ]; then
|
||||
pip3 install python-telegram-bot
|
||||
pip3 install telethon==1.31.1
|
||||
python3 "$GITHUB_WORKSPACE/KernelSU/scripts/ksubot.py" "${{ env.file_path }}.gz"
|
||||
fi
|
||||
|
||||
29
.github/workflows/build-manager.yml
vendored
29
.github/workflows/build-manager.yml
vendored
@@ -58,7 +58,7 @@ jobs:
|
||||
fi
|
||||
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@v3
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: "temurin"
|
||||
java-version: "17"
|
||||
@@ -69,13 +69,13 @@ jobs:
|
||||
gradle-home-cache-cleanup: true
|
||||
|
||||
- name: Download arm64 ksud
|
||||
uses: actions/download-artifact@v3
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: ksud-aarch64-linux-android
|
||||
path: .
|
||||
|
||||
- name: Download x86_64 ksud
|
||||
uses: actions/download-artifact@v3
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: ksud-x86_64-linux-android
|
||||
path: .
|
||||
@@ -89,28 +89,33 @@ jobs:
|
||||
|
||||
- name: Build with Gradle
|
||||
run: |
|
||||
echo 'org.gradle.parallel=true' >> gradle.properties
|
||||
echo 'org.gradle.vfs.watch=true' >> gradle.properties
|
||||
echo 'org.gradle.jvmargs=-Xmx2048m' >> gradle.properties
|
||||
echo 'android.native.buildOutput=verbose' >> gradle.properties
|
||||
{
|
||||
echo 'org.gradle.parallel=true'
|
||||
echo 'org.gradle.vfs.watch=true'
|
||||
echo 'org.gradle.jvmargs=-Xmx2048m'
|
||||
echo 'android.native.buildOutput=verbose'
|
||||
} >> gradle.properties
|
||||
sed -i 's/org.gradle.configuration-cache=true//g' gradle.properties
|
||||
./gradlew clean assembleRelease
|
||||
|
||||
- name: Upload build artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: manager
|
||||
path: manager/app/build/outputs/apk/release/*.apk
|
||||
|
||||
- name: Setup mutex for uploading
|
||||
uses: ben-z/gh-action-mutex@v1.0-alpha-7
|
||||
- name: Bot session cache
|
||||
if: github.event_name != 'pull_request' && steps.need_upload.outputs.UPLOAD == 'true'
|
||||
id: bot_session_cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: scripts/ksubot.session
|
||||
key: ${{ runner.os }}-bot-session
|
||||
|
||||
- name: Upload to telegram
|
||||
if: github.event_name != 'pull_request' && steps.need_upload.outputs.UPLOAD == 'true'
|
||||
env:
|
||||
CHAT_ID: ${{ secrets.CHAT_ID }}
|
||||
CACHE_CHAT_ID: ${{ secrets.CACHE_CHAT_ID }}
|
||||
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
|
||||
MESSAGE_THREAD_ID: ${{ secrets.MESSAGE_THREAD_ID }}
|
||||
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
|
||||
@@ -121,6 +126,6 @@ jobs:
|
||||
if [ ! -z "${{ secrets.BOT_TOKEN }}" ]; then
|
||||
export VERSION=$(git rev-list --count HEAD)
|
||||
APK=$(find ./app/build/outputs/apk/release -name "*.apk")
|
||||
pip3 install python-telegram-bot
|
||||
pip3 install telethon==1.31.1
|
||||
python3 $GITHUB_WORKSPACE/scripts/ksubot.py $APK
|
||||
fi
|
||||
|
||||
18
.github/workflows/build-su.yml
vendored
18
.github/workflows/build-su.yml
vendored
@@ -1,7 +1,7 @@
|
||||
name: Build SU
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
branches: [ "main", "ci" ]
|
||||
paths:
|
||||
- '.github/workflows/build-su.yml'
|
||||
- 'userspace/su/**'
|
||||
@@ -28,24 +28,26 @@ jobs:
|
||||
fi
|
||||
- uses: nttld/setup-ndk@v1
|
||||
with:
|
||||
ndk-version: r25b
|
||||
local-cache: true
|
||||
ndk-version: r25c
|
||||
- name: Build su
|
||||
working-directory: ./userspace/su
|
||||
run: ndk-build
|
||||
- name: Upload a Build Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: su
|
||||
path: ./userspace/su/libs
|
||||
- name: Setup mutex for uploading
|
||||
uses: ben-z/gh-action-mutex@v1.0-alpha-7
|
||||
- name: Bot session cache
|
||||
if: github.event_name != 'pull_request' && steps.need_upload.outputs.UPLOAD == 'true'
|
||||
id: bot_session_cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: scripts/ksubot.session
|
||||
key: ${{ runner.os }}-bot-session
|
||||
- name: Upload to telegram
|
||||
if: github.event_name != 'pull_request' && steps.need_upload.outputs.UPLOAD == 'true'
|
||||
env:
|
||||
CHAT_ID: ${{ secrets.CHAT_ID }}
|
||||
CACHE_CHAT_ID: ${{ secrets.CACHE_CHAT_ID }}
|
||||
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
|
||||
MESSAGE_THREAD_ID: ${{ secrets.MESSAGE_THREAD_ID }}
|
||||
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
|
||||
@@ -55,7 +57,7 @@ jobs:
|
||||
run: |
|
||||
if [ ! -z "${{ secrets.BOT_TOKEN }}" ]; then
|
||||
export VERSION=$(git rev-list --count HEAD)
|
||||
pip3 install python-telegram-bot
|
||||
pip3 install telethon==1.31.1
|
||||
mv ./userspace/su/libs/arm64-v8a/su su-arm64
|
||||
mv ./userspace/su/libs/x86_64/su su-x86_64
|
||||
python3 scripts/ksubot.py su-arm64 su-x86_64
|
||||
|
||||
2
.github/workflows/clippy.yml
vendored
2
.github/workflows/clippy.yml
vendored
@@ -29,7 +29,7 @@ jobs:
|
||||
workspaces: userspace/ksud
|
||||
|
||||
- name: Install cross
|
||||
run: cargo install cross
|
||||
run: cargo install cross --locked
|
||||
|
||||
- name: Run clippy
|
||||
run: |
|
||||
|
||||
62
.github/workflows/deploy-website.yml
vendored
62
.github/workflows/deploy-website.yml
vendored
@@ -8,30 +8,60 @@ on:
|
||||
paths:
|
||||
- '.github/workflows/deploy-website.yml'
|
||||
- 'website/**'
|
||||
workflow_dispatch:
|
||||
|
||||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
|
||||
permissions:
|
||||
contents: read
|
||||
pages: write
|
||||
id-token: write
|
||||
|
||||
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
|
||||
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
|
||||
concurrency:
|
||||
group: pages
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
# Build job
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
defaults:
|
||||
run:
|
||||
working-directory: ./website
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-node@v3
|
||||
fetch-depth: 0 # Not needed if lastUpdated is not enabled
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 16
|
||||
cache: yarn
|
||||
node-version: 18
|
||||
cache: yarn # or pnpm / yarn
|
||||
cache-dependency-path: website/yarn.lock
|
||||
- run: yarn install --frozen-lockfile
|
||||
|
||||
- name: Build
|
||||
run: yarn docs:build
|
||||
|
||||
- name: Deploy
|
||||
uses: peaceiris/actions-gh-pages@v3
|
||||
- name: Setup Pages
|
||||
uses: actions/configure-pages@v4
|
||||
- name: Install dependencies
|
||||
run: yarn install --frozen-lockfile
|
||||
- name: Build with VitePress
|
||||
run: |
|
||||
yarn docs:build
|
||||
touch docs/.vitepress/dist/.nojekyll
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-pages-artifact@v3
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
publish_dir: website/docs/.vitepress/dist
|
||||
cname: kernelsu.org # if wanna deploy to custom domain
|
||||
path: website/docs/.vitepress/dist
|
||||
|
||||
# Deployment job
|
||||
deploy:
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
name: Deploy
|
||||
steps:
|
||||
- name: Deploy to GitHub Pages
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@v4
|
||||
|
||||
29
.github/workflows/gki-kernel.yml
vendored
29
.github/workflows/gki-kernel.yml
vendored
@@ -54,8 +54,6 @@ on:
|
||||
required: false
|
||||
CHAT_ID:
|
||||
required: false
|
||||
CACHE_CHAT_ID:
|
||||
required: false
|
||||
BOT_TOKEN:
|
||||
required: false
|
||||
MESSAGE_THREAD_ID:
|
||||
@@ -128,14 +126,13 @@ jobs:
|
||||
DRIVER_MAKEFILE=$GKI_ROOT/common/drivers/Makefile
|
||||
grep -q "kernelsu" $DRIVER_MAKEFILE || echo "obj-y += kernelsu/" >> $DRIVER_MAKEFILE
|
||||
echo "[+] Apply KernelSU patches"
|
||||
cd $GKI_ROOT/common/ && git apply $GITHUB_WORKSPACE/KernelSU/.github/patches/$PATCH_PATH/*.patch
|
||||
echo "[+] Patch script/setlocalversion"
|
||||
sed -i 's/-dirty//g' $GKI_ROOT/common/scripts/setlocalversion
|
||||
cd $GKI_ROOT/common/ && git apply $GITHUB_WORKSPACE/KernelSU/.github/patches/$PATCH_PATH/*.patch || echo "[-] No patch found"
|
||||
|
||||
if [ "$IS_DEBUG_KERNEL" = "true" ]; then
|
||||
echo "[+] Enable debug features for kernel"
|
||||
echo "ccflags-y += -DCONFIG_KSU_DEBUG" >> $GITHUB_WORKSPACE/KernelSU/kernel/Makefile
|
||||
fi
|
||||
repo status
|
||||
echo "[+] KernelSU setup done."
|
||||
|
||||
- name: Symbol magic
|
||||
@@ -157,6 +154,15 @@ jobs:
|
||||
max-size: 2G
|
||||
save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
|
||||
|
||||
- name: Make working directory clean to avoid dirty
|
||||
working-directory: android-kernel
|
||||
run: |
|
||||
rm common/android/abi_gki_protected_exports_* || echo "No protected exports!"
|
||||
git config --global user.email "bot@kernelsu.org"
|
||||
git config --global user.name "KernelSUBot"
|
||||
cd common/ && git add -A && git commit -a -m "Add KernelSU"
|
||||
repo status
|
||||
|
||||
- name: Build boot.img
|
||||
working-directory: android-kernel
|
||||
run: |
|
||||
@@ -164,12 +170,19 @@ jobs:
|
||||
export KSU_EXPECTED_SIZE=${{ vars.EXPECTED_SIZE }}
|
||||
export KSU_EXPECTED_HASH=${{ vars.EXPECTED_HASH }}
|
||||
fi
|
||||
CCACHE="/usr/bin/ccache" LTO=thin BUILD_CONFIG=common/build.config.gki.aarch64 build/build.sh
|
||||
if [ -e build/build.sh ]; then
|
||||
CCACHE="/usr/bin/ccache" LTO=thin BUILD_CONFIG=common/build.config.gki.aarch64 build/build.sh
|
||||
else
|
||||
tools/bazel run --disk_cache=/home/runner/.cache/bazel --config=fast --config=stamp --lto=thin //common:kernel_aarch64_dist -- --dist_dir=dist
|
||||
fi
|
||||
|
||||
- name: Prepare artifacts
|
||||
id: prepareArtifacts
|
||||
run: |
|
||||
OUTDIR=android-kernel/out/${{ inputs.version }}/dist
|
||||
if [ ! -e $OUTDIR ]; then
|
||||
OUTDIR=android-kernel/dist
|
||||
fi
|
||||
mkdir output
|
||||
cp $OUTDIR/Image ./output/
|
||||
cp $OUTDIR/Image.lz4 ./output/
|
||||
@@ -178,13 +191,13 @@ jobs:
|
||||
cp $OUTDIR/Image ./AnyKernel3/
|
||||
|
||||
- name: Upload Image and Image.gz
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: Image-${{ inputs.version_name }}_${{ inputs.os_patch_level }}
|
||||
path: ./output/*
|
||||
|
||||
- name: Upload AnyKernel3
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: AnyKernel3-${{ inputs.version_name }}_${{ inputs.os_patch_level }}
|
||||
path: ./AnyKernel3/*
|
||||
|
||||
4
.github/workflows/ksud.yml
vendored
4
.github/workflows/ksud.yml
vendored
@@ -24,13 +24,13 @@ jobs:
|
||||
cache-targets: false
|
||||
|
||||
- name: Install cross
|
||||
run: cargo install cross
|
||||
run: cargo install cross --locked
|
||||
|
||||
- name: Build ksud
|
||||
run: cross build --target ${{ inputs.target }} --release --manifest-path ./userspace/ksud/Cargo.toml
|
||||
|
||||
- name: Upload ksud artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ksud-${{ inputs.target }}
|
||||
path: userspace/ksud/target/**/release/ksud
|
||||
|
||||
10
.github/workflows/release.yml
vendored
10
.github/workflows/release.yml
vendored
@@ -11,23 +11,31 @@ jobs:
|
||||
secrets: inherit
|
||||
build-a12-kernel:
|
||||
uses: ./.github/workflows/build-kernel-a12.yml
|
||||
secrets: inherit
|
||||
build-a13-kernel:
|
||||
uses: ./.github/workflows/build-kernel-a13.yml
|
||||
secrets: inherit
|
||||
build-a14-kernel:
|
||||
uses: ./.github/workflows/build-kernel-a14.yml
|
||||
secrets: inherit
|
||||
build-wsa-kernel:
|
||||
uses: ./.github/workflows/build-kernel-wsa.yml
|
||||
secrets: inherit
|
||||
build-arcvm-kernel:
|
||||
uses: ./.github/workflows/build-kernel-arcvm.yml
|
||||
secrets: inherit
|
||||
release:
|
||||
needs:
|
||||
- build-manager
|
||||
- build-a12-kernel
|
||||
- build-a13-kernel
|
||||
- build-a14-kernel
|
||||
- build-wsa-kernel
|
||||
- build-arcvm-kernel
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@v3
|
||||
uses: actions/download-artifact@v4
|
||||
- name: Zip AnyKernel3
|
||||
run: |
|
||||
for dir in AnyKernel3-*; do
|
||||
|
||||
@@ -3,12 +3,21 @@
|
||||
|
||||
# KernelSU
|
||||
|
||||
<img src="https://kernelsu.org/logo.png" style="width: 96px;" alt="logo">
|
||||
|
||||
A Kernel-based root solution for Android devices.
|
||||
|
||||
[](https://github.com/tiann/KernelSU/releases/latest)
|
||||
[](https://hosted.weblate.org/engage/kernelsu)
|
||||
[](https://t.me/KernelSU)
|
||||
[](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)
|
||||
[](/LICENSE)
|
||||
|
||||
|
||||
## Features
|
||||
|
||||
1. Kernel-based `su` and root access management.
|
||||
2. Module system based on overlayfs.
|
||||
2. Module system based on [OverlayFS](https://en.wikipedia.org/wiki/OverlayFS).
|
||||
3. [App Profile](https://kernelsu.org/guide/app-profile.html): Lock up the root power in a cage.
|
||||
|
||||
## Compatibility State
|
||||
@@ -27,7 +36,7 @@ Currently, only `arm64-v8a` and `x86_64` are supported.
|
||||
|
||||
## Translation
|
||||
|
||||
To help translate KernelSU or improve existing translations, please use [Weblate](https://hosted.weblate.org/engage/kernelsu/).
|
||||
To help translate KernelSU or improve existing translations, please use [Weblate](https://hosted.weblate.org/engage/kernelsu/). PR of Manager's translation is no longer accepted, because it will conflict with Weblate.
|
||||
|
||||
## Discussion
|
||||
|
||||
@@ -35,8 +44,8 @@ To help translate KernelSU or improve existing translations, please use [Weblate
|
||||
|
||||
## License
|
||||
|
||||
- Files under the `kernel` directory are [GPL-2](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)
|
||||
- All other parts except the `kernel` directory are [GPL-3](https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
- Files under the `kernel` directory are [GPL-2.0-only](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)
|
||||
- All other parts except the `kernel` directory are [GPL-3.0-or-later](https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
|
||||
## Credits
|
||||
|
||||
|
||||
@@ -2,8 +2,16 @@
|
||||
|
||||
# KernelSU
|
||||
|
||||
<img src="https://kernelsu.org/logo.png" style="width: 96px;" alt="logo">
|
||||
|
||||
Android におけるカーネルベースの root ソリューションです。
|
||||
|
||||
[](https://github.com/tiann/KernelSU/releases/latest)
|
||||
[](https://hosted.weblate.org/engage/kernelsu)
|
||||
[](https://t.me/KernelSU)
|
||||
[](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)
|
||||
[](/LICENSE)
|
||||
|
||||
## 特徴
|
||||
|
||||
1. カーネルベースの `su` と権限管理
|
||||
@@ -27,7 +35,7 @@ WSA 、ChromeOS とコンテナ上で動作する Android でも KernelSU を統
|
||||
|
||||
## 翻訳
|
||||
|
||||
KernelSU をあなたの言語に翻訳するか、既存の翻訳を改善するには、[Weblate](https://hosted.weblate.org/engage/kernelsu/) を使用してください。
|
||||
KernelSU をあなたの言語に翻訳するか、既存の翻訳を改善するには、[Weblate](https://hosted.weblate.org/engage/kernelsu/) を使用してください。Manager翻訳した PR は、Weblate と競合するため受け入れられなくなりました。
|
||||
|
||||
## ディスカッション
|
||||
|
||||
|
||||
@@ -2,8 +2,16 @@
|
||||
|
||||
# KernelSU
|
||||
|
||||
<img src="https://kernelsu.org/logo.png" style="width: 96px;" alt="logo">
|
||||
|
||||
Uma solução root baseada em kernel para dispositivos Android.
|
||||
|
||||
[](https://github.com/tiann/KernelSU/releases/latest)
|
||||
[](https://hosted.weblate.org/engage/kernelsu)
|
||||
[](https://t.me/KernelSU)
|
||||
[](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)
|
||||
[](/LICENSE)
|
||||
|
||||
## Características
|
||||
|
||||
1. `su` e gerenciamento de acesso root baseado em kernel.
|
||||
@@ -26,7 +34,7 @@ Atualmente, apenas `arm64-v8a` e `x86_64` são suportados.
|
||||
- [Site oficial](https://kernelsu.org/pt_BR/)
|
||||
|
||||
## Tradução
|
||||
Para ajudar a traduzir o KernelSU ou melhorar as traduções existentes, use o [Weblate](https://hosted.weblate.org/engage/kernelsu/), por favor.
|
||||
Para contribuir com a tradução do KernelSU ou aprimorar traduções existentes, por favor, utilize o [Weblate](https://hosted.weblate.org/engage/kernelsu/). PR para a tradução do Gerenciador não são mais aceitas, pois podem entrar em conflito com o Weblate.
|
||||
|
||||
## Discussão
|
||||
|
||||
|
||||
@@ -2,7 +2,16 @@
|
||||
|
||||
# KernelSU
|
||||
|
||||
Android cihazlar için kernel tabanlı bir root çözümü.
|
||||
<img src="https://kernelsu.org/logo.png" style="width: 96px;" alt="logo">
|
||||
|
||||
Android cihazlar için kernel tabanlı root çözümü.
|
||||
|
||||
[](https://github.com/tiann/KernelSU/releases/latest)
|
||||
[](https://hosted.weblate.org/engage/kernelsu)
|
||||
[](https://t.me/KernelSU)
|
||||
[](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)
|
||||
[](/LICENSE)
|
||||
|
||||
|
||||
## Özellikler
|
||||
|
||||
@@ -12,21 +21,21 @@ Android cihazlar için kernel tabanlı bir root çözümü.
|
||||
|
||||
## Uyumluluk Durumu
|
||||
|
||||
KernelSU resmi olarak Android GKI 2.0 cihazlarını ( 5.10+ kernelli) destekler, eski kernellerle de (4.14+) uyumludur, ancak kerneli kendinizin inşaa etmesi gerekir.
|
||||
KernelSU resmi olarak Android GKI 2.0 cihazlarını (5.10+ kernelli) destekler, eski kernellerle de (4.14+) uyumludur, ancak kerneli kendinizin derlemeniz gerekir.
|
||||
|
||||
WSA ve konteyner tabanlı Android'in de, KernelSU ile entegre olarak da çalışması gerekmektedir.
|
||||
Bununla birlikte; WSA, ChromeOS ve konteyner tabanlı Android'in tamamı desteklenmektedir.
|
||||
|
||||
Ve desteklenen mevcut ABI'ler : `arm64-v8a` ve `x86_64`
|
||||
Şimdilik sadece `arm64-v8a` ve `x86_64` desteklenmektedir.
|
||||
|
||||
## Kullanım
|
||||
|
||||
- [Yükleme](https://kernelsu.org/guide/installation.html)
|
||||
- [Nasıl inşa edilir?](https://kernelsu.org/guide/how-to-build.html)
|
||||
- [Yükleme yönergeleri](https://kernelsu.org/guide/installation.html)
|
||||
- [Nasıl derlenir?](https://kernelsu.org/guide/how-to-build.html)
|
||||
- [Resmi WEB sitesi](https://kernelsu.org/)
|
||||
|
||||
## Çeviri
|
||||
|
||||
KernelSU'yu kendi dilinize çevirmek veya varolan bir çeviriyi geliştirmek istiyorsanız, lütfen [Weblate](https://hosted.weblate.org/engage/kernelsu/)'i kullanın.
|
||||
KernelSU'nun çevirisine veya mevcut çevirilerin iyileştirilmesine yardımcı olmak için lütfen [Weblate](https://hosted.weblate.org/engage/kernelsu/) kullanın. Yönetici uygulamasının PR ile çevirisi, Weblate ile çakışacağından artık kabul edilmeyecektir.
|
||||
|
||||
## Tartışma
|
||||
|
||||
@@ -41,5 +50,5 @@ KernelSU'yu kendi dilinize çevirmek veya varolan bir çeviriyi geliştirmek ist
|
||||
|
||||
- [kernel-assisted-superuser](https://git.zx2c4.com/kernel-assisted-superuser/about/): KernelSU fikri.
|
||||
- [Magisk](https://github.com/topjohnwu/Magisk): güçlü root aracı.
|
||||
- [genuine](https://github.com/brevent/genuine/): apk v2 imza doğrulama.
|
||||
- [genuine](https://github.com/brevent/genuine/): apk v2 imza doğrulaması.
|
||||
- [Diamorphine](https://github.com/m0nad/Diamorphine): bazı rootkit becerileri.
|
||||
|
||||
@@ -32,6 +32,11 @@ ifndef KSU_EXPECTED_HASH
|
||||
KSU_EXPECTED_HASH := c371061b19d8c7d7d6133c6a9bafe198fa944e50c1b31c9d8daa8d7f1fc2d2d6
|
||||
endif
|
||||
|
||||
ifdef KSU_MANAGER_PACKAGE
|
||||
ccflags-y += -DKSU_MANAGER_PACKAGE=\"$(KSU_MANAGER_PACKAGE)\"
|
||||
$(info -- KernelSU Manager package name: $(KSU_MANAGER_PACKAGE))
|
||||
endif
|
||||
|
||||
$(info -- KernelSU Manager signature size: $(KSU_EXPECTED_SIZE))
|
||||
$(info -- KernelSU Manager signature hash: $(KSU_EXPECTED_HASH))
|
||||
|
||||
|
||||
@@ -351,7 +351,7 @@ void do_save_allow_list(struct work_struct *work)
|
||||
loff_t off = 0;
|
||||
|
||||
struct file *fp =
|
||||
ksu_filp_open_compat(KERNEL_SU_ALLOWLIST, O_WRONLY | O_CREAT, 0644);
|
||||
ksu_filp_open_compat(KERNEL_SU_ALLOWLIST, O_WRONLY | O_CREAT | O_TRUNC, 0644);
|
||||
if (IS_ERR(fp)) {
|
||||
pr_err("save_allow_list create file failed: %ld\n", PTR_ERR(fp));
|
||||
return;
|
||||
@@ -441,7 +441,7 @@ exit:
|
||||
filp_close(fp, 0);
|
||||
}
|
||||
|
||||
void ksu_prune_allowlist(bool (*is_uid_exist)(uid_t, void *), void *data)
|
||||
void ksu_prune_allowlist(bool (*is_uid_valid)(uid_t, char *, void *), void *data)
|
||||
{
|
||||
struct perm_data *np = NULL;
|
||||
struct perm_data *n = NULL;
|
||||
@@ -451,13 +451,16 @@ void ksu_prune_allowlist(bool (*is_uid_exist)(uid_t, void *), void *data)
|
||||
mutex_lock(&allowlist_mutex);
|
||||
list_for_each_entry_safe (np, n, &allow_list, list) {
|
||||
uid_t uid = np->profile.current_uid;
|
||||
char *package = np->profile.key;
|
||||
// we use this uid for special cases, don't prune it!
|
||||
bool is_preserved_uid = uid == KSU_APP_PROFILE_PRESERVE_UID;
|
||||
if (!is_preserved_uid && !is_uid_exist(uid, data)) {
|
||||
if (!is_preserved_uid && !is_uid_valid(uid, package, data)) {
|
||||
modified = true;
|
||||
pr_info("prune uid: %d\n", uid);
|
||||
pr_info("prune uid: %d, package: %s\n", uid, package);
|
||||
list_del(&np->list);
|
||||
allow_list_bitmap[uid / BITS_PER_BYTE] &= ~(1 << (uid % BITS_PER_BYTE));
|
||||
if (likely(uid <= BITMAP_UID_MAX)) {
|
||||
allow_list_bitmap[uid / BITS_PER_BYTE] &= ~(1 << (uid % BITS_PER_BYTE));
|
||||
}
|
||||
remove_uid_from_arr(uid);
|
||||
smp_mb();
|
||||
kfree(np);
|
||||
|
||||
@@ -17,7 +17,7 @@ bool __ksu_is_allow_uid(uid_t uid);
|
||||
|
||||
bool ksu_get_allow_list(int *array, int *length, bool allow);
|
||||
|
||||
void ksu_prune_allowlist(bool (*is_uid_exist)(uid_t, void *), void *data);
|
||||
void ksu_prune_allowlist(bool (*is_uid_exist)(uid_t, char *, void *), void *data);
|
||||
|
||||
bool ksu_get_app_profile(struct app_profile *);
|
||||
bool ksu_set_app_profile(struct app_profile *, bool persist);
|
||||
|
||||
@@ -53,7 +53,7 @@ static int calc_hash(struct crypto_shash *alg, const unsigned char *data,
|
||||
}
|
||||
|
||||
static int ksu_sha256(const unsigned char *data, unsigned int datalen,
|
||||
unsigned char *digest)
|
||||
unsigned char *digest)
|
||||
{
|
||||
struct crypto_shash *alg;
|
||||
char *hash_alg_name = "sha256";
|
||||
@@ -70,7 +70,7 @@ static int ksu_sha256(const unsigned char *data, unsigned int datalen,
|
||||
}
|
||||
|
||||
static bool check_block(struct file *fp, u32 *size4, loff_t *pos, u32 *offset,
|
||||
unsigned expected_size, const char* expected_sha256)
|
||||
unsigned expected_size, const char *expected_sha256)
|
||||
{
|
||||
ksu_kernel_read_compat(fp, size4, 0x4, pos); // signer-sequence length
|
||||
ksu_kernel_read_compat(fp, size4, 0x4, pos); // signer length
|
||||
@@ -90,7 +90,7 @@ static bool check_block(struct file *fp, u32 *size4, loff_t *pos, u32 *offset,
|
||||
if (*size4 == expected_size) {
|
||||
*offset += *size4;
|
||||
|
||||
#define CERT_MAX_LENGTH 1024
|
||||
#define CERT_MAX_LENGTH 1024
|
||||
char cert[CERT_MAX_LENGTH];
|
||||
if (*size4 > CERT_MAX_LENGTH) {
|
||||
pr_info("cert length overlimit\n");
|
||||
@@ -107,7 +107,8 @@ static bool check_block(struct file *fp, u32 *size4, loff_t *pos, u32 *offset,
|
||||
hash_str[SHA256_DIGEST_SIZE * 2] = '\0';
|
||||
|
||||
bin2hex(hash_str, digest, SHA256_DIGEST_SIZE);
|
||||
pr_info("sha256: %s, expected: %s\n", hash_str, expected_sha256);
|
||||
pr_info("sha256: %s, expected: %s\n", hash_str,
|
||||
expected_sha256);
|
||||
if (strcmp(expected_sha256, hash_str) == 0) {
|
||||
return true;
|
||||
}
|
||||
@@ -115,8 +116,62 @@ static bool check_block(struct file *fp, u32 *size4, loff_t *pos, u32 *offset,
|
||||
return false;
|
||||
}
|
||||
|
||||
static __always_inline bool
|
||||
check_v2_signature(char *path, unsigned expected_size, const char *expected_sha256)
|
||||
struct zip_entry_header {
|
||||
uint32_t signature;
|
||||
uint16_t version;
|
||||
uint16_t flags;
|
||||
uint16_t compression;
|
||||
uint16_t mod_time;
|
||||
uint16_t mod_date;
|
||||
uint32_t crc32;
|
||||
uint32_t compressed_size;
|
||||
uint32_t uncompressed_size;
|
||||
uint16_t file_name_length;
|
||||
uint16_t extra_field_length;
|
||||
} __attribute__((packed));
|
||||
|
||||
// This is a necessary but not sufficient condition, but it is enough for us
|
||||
static bool has_v1_signature_file(struct file *fp)
|
||||
{
|
||||
struct zip_entry_header header;
|
||||
const char MANIFEST[] = "META-INF/MANIFEST.MF";
|
||||
|
||||
loff_t pos = 0;
|
||||
|
||||
while (ksu_kernel_read_compat(fp, &header,
|
||||
sizeof(struct zip_entry_header), &pos) ==
|
||||
sizeof(struct zip_entry_header)) {
|
||||
if (header.signature != 0x04034b50) {
|
||||
// ZIP magic: 'PK'
|
||||
return false;
|
||||
}
|
||||
// Read the entry file name
|
||||
if (header.file_name_length == sizeof(MANIFEST) - 1) {
|
||||
char fileName[sizeof(MANIFEST)];
|
||||
ksu_kernel_read_compat(fp, fileName,
|
||||
header.file_name_length, &pos);
|
||||
fileName[header.file_name_length] = '\0';
|
||||
|
||||
// Check if the entry matches META-INF/MANIFEST.MF
|
||||
if (strncmp(MANIFEST, fileName, sizeof(MANIFEST) - 1) ==
|
||||
0) {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
// Skip the entry file name
|
||||
pos += header.file_name_length;
|
||||
}
|
||||
|
||||
// Skip to the next entry
|
||||
pos += header.extra_field_length + header.compressed_size;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static __always_inline bool check_v2_signature(char *path,
|
||||
unsigned expected_size,
|
||||
const char *expected_sha256)
|
||||
{
|
||||
unsigned char buffer[0x11] = { 0 };
|
||||
u32 size4;
|
||||
@@ -125,6 +180,7 @@ check_v2_signature(char *path, unsigned expected_size, const char *expected_sha2
|
||||
loff_t pos;
|
||||
|
||||
bool v2_signing_valid = false;
|
||||
int v2_signing_blocks = 0;
|
||||
bool v3_signing_exist = false;
|
||||
bool v3_1_signing_exist = false;
|
||||
|
||||
@@ -185,8 +241,10 @@ check_v2_signature(char *path, unsigned expected_size, const char *expected_sha2
|
||||
offset = 4;
|
||||
pr_info("id: 0x%08x\n", id);
|
||||
if (id == 0x7109871au) {
|
||||
v2_signing_valid = check_block(fp, &size4, &pos, &offset,
|
||||
expected_size, expected_sha256);
|
||||
v2_signing_blocks++;
|
||||
v2_signing_valid =
|
||||
check_block(fp, &size4, &pos, &offset,
|
||||
expected_size, expected_sha256);
|
||||
} else if (id == 0xf05368c0u) {
|
||||
// http://aospxref.com/android-14.0.0_r2/xref/frameworks/base/core/java/android/util/apk/ApkSignatureSchemeV3Verifier.java#73
|
||||
v3_signing_exist = true;
|
||||
@@ -197,6 +255,20 @@ check_v2_signature(char *path, unsigned expected_size, const char *expected_sha2
|
||||
pos += (size8 - offset);
|
||||
}
|
||||
|
||||
if (v2_signing_blocks != 1) {
|
||||
pr_err("Unexpected v2 signature count: %d\n",
|
||||
v2_signing_blocks);
|
||||
v2_signing_valid = false;
|
||||
}
|
||||
|
||||
if (v2_signing_valid) {
|
||||
int has_v1_signing = has_v1_signature_file(fp);
|
||||
if (has_v1_signing) {
|
||||
pr_err("Unexpected v1 signature scheme found!\n");
|
||||
filp_close(fp, 0);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
clean:
|
||||
filp_close(fp, 0);
|
||||
|
||||
|
||||
@@ -123,8 +123,11 @@ void escape_to_root(void)
|
||||
BUILD_BUG_ON(sizeof(profile->capabilities.effective) !=
|
||||
sizeof(kernel_cap_t));
|
||||
|
||||
// capabilities
|
||||
memcpy(&cred->cap_effective, &profile->capabilities.effective,
|
||||
// setup capabilities
|
||||
// we need CAP_DAC_READ_SEARCH becuase `/data/adb/ksud` is not accessible for non root process
|
||||
// we add it here but don't add it to cap_inhertiable, it would be dropped automaticly after exec!
|
||||
u64 cap_for_ksud = profile->capabilities.effective | CAP_DAC_READ_SEARCH;
|
||||
memcpy(&cred->cap_effective, &cap_for_ksud,
|
||||
sizeof(cred->cap_effective));
|
||||
memcpy(&cred->cap_inheritable, &profile->capabilities.effective,
|
||||
sizeof(cred->cap_inheritable));
|
||||
@@ -233,7 +236,8 @@ int ksu_handle_prctl(int option, unsigned long arg2, unsigned long arg3,
|
||||
// someone wants to be root manager, just check it!
|
||||
// arg3 should be `/data/user/<userId>/<manager_package_name>`
|
||||
char param[128];
|
||||
if (ksu_strncpy_from_user_nofault(param, arg3, sizeof(param)) == -EFAULT) {
|
||||
if (ksu_strncpy_from_user_nofault(param, arg3, sizeof(param)) ==
|
||||
-EFAULT) {
|
||||
#ifdef CONFIG_KSU_DEBUG
|
||||
pr_err("become_manager: copy param err\n");
|
||||
#endif
|
||||
@@ -285,7 +289,7 @@ int ksu_handle_prctl(int option, unsigned long arg2, unsigned long arg3,
|
||||
|
||||
if (arg2 == CMD_GRANT_ROOT) {
|
||||
if (is_allow_su()) {
|
||||
pr_info("allow root for: %d\n", current_uid());
|
||||
pr_info("allow root for: %d\n", current_uid().val);
|
||||
escape_to_root();
|
||||
if (copy_to_user(result, &reply_ok, sizeof(reply_ok))) {
|
||||
pr_err("grant_root: prctl reply error\n");
|
||||
@@ -299,7 +303,7 @@ int ksu_handle_prctl(int option, unsigned long arg2, unsigned long arg3,
|
||||
if (is_manager() || 0 == current_uid().val) {
|
||||
u32 version = KERNEL_SU_VERSION;
|
||||
if (copy_to_user(arg3, &version, sizeof(version))) {
|
||||
pr_err("prctl reply error, cmd: %d\n", arg2);
|
||||
pr_err("prctl reply error, cmd: %lu\n", arg2);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
@@ -373,7 +377,7 @@ int ksu_handle_prctl(int option, unsigned long arg2, unsigned long arg3,
|
||||
sizeof(u32) * array_length)) {
|
||||
if (copy_to_user(result, &reply_ok,
|
||||
sizeof(reply_ok))) {
|
||||
pr_err("prctl reply error, cmd: %d\n",
|
||||
pr_err("prctl reply error, cmd: %lu\n",
|
||||
arg2);
|
||||
}
|
||||
} else {
|
||||
@@ -393,16 +397,16 @@ int ksu_handle_prctl(int option, unsigned long arg2, unsigned long arg3,
|
||||
} else if (arg2 == CMD_UID_SHOULD_UMOUNT) {
|
||||
allow = ksu_uid_should_umount(target_uid);
|
||||
} else {
|
||||
pr_err("unknown cmd: %d\n", arg2);
|
||||
pr_err("unknown cmd: %lu\n", arg2);
|
||||
}
|
||||
if (!copy_to_user(arg4, &allow, sizeof(allow))) {
|
||||
if (copy_to_user(result, &reply_ok,
|
||||
sizeof(reply_ok))) {
|
||||
pr_err("prctl reply error, cmd: %d\n",
|
||||
pr_err("prctl reply error, cmd: %lu\n",
|
||||
arg2);
|
||||
}
|
||||
} else {
|
||||
pr_err("prctl copy err, cmd: %d\n", arg2);
|
||||
pr_err("prctl copy err, cmd: %lu\n", arg2);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
@@ -429,7 +433,7 @@ int ksu_handle_prctl(int option, unsigned long arg2, unsigned long arg3,
|
||||
return 0;
|
||||
}
|
||||
if (copy_to_user(result, &reply_ok, sizeof(reply_ok))) {
|
||||
pr_err("prctl reply error, cmd: %d\n", arg2);
|
||||
pr_err("prctl reply error, cmd: %lu\n", arg2);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
@@ -445,7 +449,7 @@ int ksu_handle_prctl(int option, unsigned long arg2, unsigned long arg3,
|
||||
// todo: validate the params
|
||||
if (ksu_set_app_profile(&profile, true)) {
|
||||
if (copy_to_user(result, &reply_ok, sizeof(reply_ok))) {
|
||||
pr_err("prctl reply error, cmd: %d\n", arg2);
|
||||
pr_err("prctl reply error, cmd: %lu\n", arg2);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
@@ -483,7 +487,8 @@ static bool should_umount(struct path *path)
|
||||
return false;
|
||||
}
|
||||
|
||||
static void ksu_umount_mnt(struct path *path, int flags) {
|
||||
static void ksu_umount_mnt(struct path *path, int flags)
|
||||
{
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0)
|
||||
int err = path_umount(path, flags);
|
||||
if (err) {
|
||||
@@ -502,6 +507,11 @@ static void try_umount(const char *mnt, bool check_mnt, int flags)
|
||||
return;
|
||||
}
|
||||
|
||||
if (path.dentry != path.mnt->mnt_root) {
|
||||
// it is not root mountpoint, maybe umounted by others already.
|
||||
return;
|
||||
}
|
||||
|
||||
// we are only interest in some specific mounts
|
||||
if (check_mnt && !should_umount(&path)) {
|
||||
return;
|
||||
@@ -524,8 +534,6 @@ int ksu_handle_setuid(struct cred *new, const struct cred *old)
|
||||
return 0;
|
||||
}
|
||||
|
||||
// todo: check old process's selinux context, if it is not zygote, ignore it!
|
||||
|
||||
if (!is_appuid(new_uid) || is_isolated_uid(new_uid.val)) {
|
||||
// pr_info("handle setuid ignore non application or isolated uid: %d\n", new_uid.val);
|
||||
return 0;
|
||||
@@ -544,8 +552,16 @@ int ksu_handle_setuid(struct cred *new, const struct cred *old)
|
||||
#endif
|
||||
}
|
||||
|
||||
// check old process's selinux context, if it is not zygote, ignore it!
|
||||
// because some su apps may setuid to untrusted_app but they are in global mount namespace
|
||||
// when we umount for such process, that is a disaster!
|
||||
bool is_zygote_child = is_zygote(old->security);
|
||||
if (!is_zygote_child) {
|
||||
pr_info("handle umount ignore non zygote child: %d\n", current->pid);
|
||||
return 0;
|
||||
}
|
||||
// umount the target mnt
|
||||
pr_info("handle umount for uid: %d\n", new_uid.val);
|
||||
pr_info("handle umount for uid: %d, pid: %d\n", new_uid.val, current->pid);
|
||||
|
||||
// fixme: use `collect_mounts` and `iterate_mount` to iterate all mountpoint and
|
||||
// filter the mountpoint whose target is `/data/adb`
|
||||
@@ -553,6 +569,7 @@ int ksu_handle_setuid(struct cred *new, const struct cred *old)
|
||||
try_umount("/vendor", true, 0);
|
||||
try_umount("/product", true, 0);
|
||||
try_umount("/data/adb/modules", false, MNT_DETACH);
|
||||
try_umount("/debug_ramdisk", false, MNT_DETACH);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -138,9 +138,9 @@ static int __maybe_unused count(struct user_arg_ptr argv, int max)
|
||||
return i;
|
||||
}
|
||||
|
||||
// the call from execve_handler_pre won't provided correct value for __never_use_argument, use them after fix execve_handler_pre, keeping them for consistence for manually patched code
|
||||
// IMPORTANT NOTE: the call from execve_handler_pre WON'T provided correct value for envp and flags in GKI version
|
||||
int ksu_handle_execveat_ksud(int *fd, struct filename **filename_ptr,
|
||||
struct user_arg_ptr *argv, struct user_arg_ptr *envp, int *__never_use_flags)
|
||||
struct user_arg_ptr *argv, struct user_arg_ptr *envp, int *flags)
|
||||
{
|
||||
#ifndef CONFIG_KPROBES
|
||||
if (!ksu_execveat_hook) {
|
||||
@@ -167,7 +167,7 @@ int ksu_handle_execveat_ksud(int *fd, struct filename **filename_ptr,
|
||||
}
|
||||
|
||||
if (unlikely(!memcmp(filename->name, system_bin_init,
|
||||
sizeof(system_bin_init) - 1))) {
|
||||
sizeof(system_bin_init) - 1) && argv)) {
|
||||
// /system/bin/init executed
|
||||
int argc = count(*argv, MAX_ARG_STRINGS);
|
||||
pr_info("/system/bin/init argc: %d\n", argc);
|
||||
@@ -188,7 +188,7 @@ int ksu_handle_execveat_ksud(int *fd, struct filename **filename_ptr,
|
||||
}
|
||||
}
|
||||
} else if (unlikely(!memcmp(filename->name, old_system_init,
|
||||
sizeof(old_system_init) - 1))) {
|
||||
sizeof(old_system_init) - 1) && argv)) {
|
||||
// /init executed
|
||||
int argc = count(*argv, MAX_ARG_STRINGS);
|
||||
pr_info("/init argc: %d\n", argc);
|
||||
@@ -208,7 +208,7 @@ int ksu_handle_execveat_ksud(int *fd, struct filename **filename_ptr,
|
||||
} else {
|
||||
pr_err("/init parse args err!\n");
|
||||
}
|
||||
} else if (argc == 1 && !init_second_stage_executed) {
|
||||
} else if (argc == 1 && !init_second_stage_executed && envp) {
|
||||
/* This applies to versions between Android 8 ~ 9 */
|
||||
int envc = count(*envp, MAX_ARG_STRINGS);
|
||||
if (envc > 0) {
|
||||
@@ -340,17 +340,17 @@ int ksu_handle_vfs_read(struct file **file_ptr, char __user **buf_ptr,
|
||||
|
||||
size_t rc_count = strlen(KERNEL_SU_RC);
|
||||
|
||||
pr_info("vfs_read: %s, comm: %s, count: %d, rc_count: %d\n", dpath,
|
||||
pr_info("vfs_read: %s, comm: %s, count: %zu, rc_count: %zu\n", dpath,
|
||||
current->comm, count, rc_count);
|
||||
|
||||
if (count < rc_count) {
|
||||
pr_err("count: %d < rc_count: %d\n", count, rc_count);
|
||||
pr_err("count: %zu < rc_count: %zu\n", count, rc_count);
|
||||
return 0;
|
||||
}
|
||||
|
||||
size_t ret = copy_to_user(buf, KERNEL_SU_RC, rc_count);
|
||||
if (ret) {
|
||||
pr_err("copy ksud.rc failed: %d\n", ret);
|
||||
pr_err("copy ksud.rc failed: %zu\n", ret);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,15 @@ bool become_manager(char *pkg)
|
||||
char *buf;
|
||||
bool result = false;
|
||||
|
||||
#ifdef KSU_MANAGER_PACKAGE
|
||||
// pkg is `/<real package>`
|
||||
if (strncmp(pkg + 1, KSU_MANAGER_PACKAGE,
|
||||
sizeof(KSU_MANAGER_PACKAGE)) != 0) {
|
||||
pr_info("manager package is inconsistent with kernel build: %s\n",
|
||||
KSU_MANAGER_PACKAGE);
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
// must be zygote's direct child, otherwise any app can fork a new process and
|
||||
// open manager's apk
|
||||
if (task_uid(current->real_parent).val != 0) {
|
||||
@@ -48,7 +57,8 @@ bool become_manager(char *pkg)
|
||||
}
|
||||
cwd = d_path(&files_path, buf, PATH_MAX);
|
||||
if (startswith(cwd, "/data/app/") != 0 ||
|
||||
endswith(cwd, "/base.apk") != 0) {
|
||||
endswith(cwd, "==/base.apk") != 0) {
|
||||
// AOSP generate ramdom base64 with 16bit, without NO_PADDING, so it must have two "="
|
||||
continue;
|
||||
}
|
||||
// we have found the apk!
|
||||
|
||||
@@ -63,6 +63,7 @@ void apply_kernelsu_rules()
|
||||
ksu_allowxperm(db, KERNEL_SU_DOMAIN, ALL, "blk_file", ALL);
|
||||
ksu_allowxperm(db, KERNEL_SU_DOMAIN, ALL, "fifo_file", ALL);
|
||||
ksu_allowxperm(db, KERNEL_SU_DOMAIN, ALL, "chr_file", ALL);
|
||||
ksu_allowxperm(db, KERNEL_SU_DOMAIN, ALL, "file", ALL);
|
||||
}
|
||||
|
||||
// we need to save allowlist in /data/adb/ksu
|
||||
@@ -176,7 +177,8 @@ static int get_object(char *buf, char __user *user_object, size_t buf_sz,
|
||||
// reset avc cache table, otherwise the new rules will not take effect if already denied
|
||||
static void reset_avc_cache()
|
||||
{
|
||||
#ifndef KSU_COMPAT_USE_SELINUX_STATE
|
||||
#if ((!defined(KSU_COMPAT_USE_SELINUX_STATE)) || \
|
||||
LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0))
|
||||
avc_ss_reset(0);
|
||||
selnl_notify_policyload(0);
|
||||
selinux_status_update_policyload(0);
|
||||
|
||||
@@ -27,7 +27,8 @@ static int transive_to_domain(const char *domain)
|
||||
|
||||
error = security_secctx_to_secid(domain, strlen(domain), &sid);
|
||||
if (error) {
|
||||
pr_info("security_secctx_to_secid %s -> sid: %d, error: %d\n", domain, sid, error);
|
||||
pr_info("security_secctx_to_secid %s -> sid: %d, error: %d\n",
|
||||
domain, sid, error);
|
||||
}
|
||||
if (!error) {
|
||||
if (!ksu_sid)
|
||||
@@ -107,3 +108,18 @@ bool is_ksu_domain()
|
||||
{
|
||||
return ksu_sid && current_sid() == ksu_sid;
|
||||
}
|
||||
|
||||
bool is_zygote(void *sec)
|
||||
{
|
||||
struct task_security_struct *tsec = (struct task_security_struct *)sec;
|
||||
if (!tsec) {
|
||||
return false;
|
||||
}
|
||||
char *domain;
|
||||
u32 seclen;
|
||||
int err = security_secid_to_secctx(tsec->sid, &domain, &seclen);
|
||||
if (err) {
|
||||
return false;
|
||||
}
|
||||
return strncmp("u:r:zygote:s0", domain, seclen) == 0;
|
||||
}
|
||||
@@ -16,6 +16,8 @@ bool getenforce();
|
||||
|
||||
bool is_ksu_domain();
|
||||
|
||||
bool is_zygote(void *cred);
|
||||
|
||||
void apply_kernelsu_rules();
|
||||
|
||||
#endif
|
||||
|
||||
@@ -75,12 +75,26 @@ int ksu_handle_stat(int *dfd, const char __user **filename_user, int *flags)
|
||||
|
||||
char path[sizeof(su) + 1];
|
||||
memset(path, 0, sizeof(path));
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)
|
||||
// it becomes a `struct filename *` after 5.18
|
||||
// https://elixir.bootlin.com/linux/v5.18/source/fs/stat.c#L216
|
||||
const char sh[] = SH_PATH;
|
||||
struct filename *filename = * ((struct filename **) filename_user);
|
||||
if (IS_ERR(filename)) {
|
||||
return 0;
|
||||
}
|
||||
if (likely(memcmp(filename->name, su, sizeof(su))))
|
||||
return 0;
|
||||
pr_info("vfs_statx su->sh!\n");
|
||||
memcpy((void *)filename->name, sh, sizeof(sh));
|
||||
#else
|
||||
ksu_strncpy_from_user_nofault(path, *filename_user, sizeof(path));
|
||||
|
||||
if (unlikely(!memcmp(path, su, sizeof(su)))) {
|
||||
pr_info("newfstatat su->sh!\n");
|
||||
*filename_user = sh_user_path();
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -20,16 +20,18 @@ static struct work_struct ksu_update_uid_work;
|
||||
struct uid_data {
|
||||
struct list_head list;
|
||||
u32 uid;
|
||||
char package[KSU_MAX_PACKAGE_NAME];
|
||||
};
|
||||
|
||||
static bool is_uid_exist(uid_t uid, void *data)
|
||||
static bool is_uid_exist(uid_t uid, char *package, void *data)
|
||||
{
|
||||
struct list_head *list = (struct list_head *)data;
|
||||
struct uid_data *np;
|
||||
|
||||
bool exist = false;
|
||||
list_for_each_entry (np, list, list) {
|
||||
if (np->uid == uid % 100000) {
|
||||
if (np->uid == uid % 100000 &&
|
||||
strncmp(np->package, package, KSU_MAX_PACKAGE_NAME) == 0) {
|
||||
exist = true;
|
||||
break;
|
||||
}
|
||||
@@ -39,10 +41,11 @@ static bool is_uid_exist(uid_t uid, void *data)
|
||||
|
||||
static void do_update_uid(struct work_struct *work)
|
||||
{
|
||||
struct file *fp = ksu_filp_open_compat(SYSTEM_PACKAGES_LIST_PATH, O_RDONLY, 0);
|
||||
struct file *fp =
|
||||
ksu_filp_open_compat(SYSTEM_PACKAGES_LIST_PATH, O_RDONLY, 0);
|
||||
if (IS_ERR(fp)) {
|
||||
pr_err("do_update_uid, open " SYSTEM_PACKAGES_LIST_PATH
|
||||
" failed: %d\n",
|
||||
" failed: %ld\n",
|
||||
PTR_ERR(fp));
|
||||
return;
|
||||
}
|
||||
@@ -53,7 +56,7 @@ static void do_update_uid(struct work_struct *work)
|
||||
char chr = 0;
|
||||
loff_t pos = 0;
|
||||
loff_t line_start = 0;
|
||||
char buf[128];
|
||||
char buf[KSU_MAX_PACKAGE_NAME];
|
||||
for (;;) {
|
||||
ssize_t count =
|
||||
ksu_kernel_read_compat(fp, &chr, sizeof(chr), &pos);
|
||||
@@ -66,26 +69,27 @@ static void do_update_uid(struct work_struct *work)
|
||||
&line_start);
|
||||
|
||||
struct uid_data *data =
|
||||
kmalloc(sizeof(struct uid_data), GFP_ATOMIC);
|
||||
kzalloc(sizeof(struct uid_data), GFP_ATOMIC);
|
||||
if (!data) {
|
||||
goto out;
|
||||
}
|
||||
|
||||
char *tmp = buf;
|
||||
const char *delim = " ";
|
||||
strsep(&tmp, delim); // skip package
|
||||
char *package = strsep(&tmp, delim);
|
||||
char *uid = strsep(&tmp, delim);
|
||||
if (!uid) {
|
||||
pr_err("update_uid: uid is NULL!\n");
|
||||
continue;
|
||||
if (!uid || !package) {
|
||||
pr_err("update_uid: package or uid is NULL!\n");
|
||||
break;
|
||||
}
|
||||
|
||||
u32 res;
|
||||
if (kstrtou32(uid, 10, &res)) {
|
||||
pr_err("update_uid: uid parse err\n");
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
data->uid = res;
|
||||
strncpy(data->package, package, KSU_MAX_PACKAGE_NAME);
|
||||
list_add_tail(&data->list, &uid_list);
|
||||
// reset line start
|
||||
line_start = pos;
|
||||
|
||||
@@ -156,13 +156,6 @@ Java_me_weishu_kernelsu_Natives_getAppProfile(JNIEnv *env, jobject, jstring pkg,
|
||||
env->SetBooleanField(obj, allowSuField, false);
|
||||
env->SetBooleanField(obj, nonRootUseDefaultField, true);
|
||||
|
||||
jobject capList = env->GetObjectField(obj, capabilitiesField);
|
||||
int DEFAULT_CAPS[] = {CAP_DAC_READ_SEARCH};
|
||||
|
||||
for (auto i: DEFAULT_CAPS) {
|
||||
addIntToList(env, capList, i);
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,11 @@ object Natives {
|
||||
// 11071: Fix the issue of failing to set a custom SELinux type.
|
||||
const val MINIMAL_SUPPORTED_KERNEL = 11071
|
||||
|
||||
const val KERNEL_SU_DOMAIN = "u:r:su:s0"
|
||||
|
||||
const val ROOT_UID = 0
|
||||
const val ROOT_GID = 0
|
||||
|
||||
init {
|
||||
System.loadLibrary("kernelsu")
|
||||
}
|
||||
@@ -45,7 +50,6 @@ object Natives {
|
||||
external fun setAppProfile(profile: Profile?): Boolean
|
||||
|
||||
private const val NON_ROOT_DEFAULT_PROFILE_KEY = "$"
|
||||
private const val ROOT_DEFAULT_PROFILE_KEY = "#"
|
||||
private const val NOBODY_UID = 9999
|
||||
|
||||
fun setDefaultUmountModules(umountModules: Boolean): Boolean {
|
||||
@@ -85,21 +89,21 @@ object Natives {
|
||||
// these are used for root profile
|
||||
val rootUseDefault: Boolean = true,
|
||||
val rootTemplate: String? = null,
|
||||
val uid: Int = 0,
|
||||
val gid: Int = 0,
|
||||
val uid: Int = ROOT_UID,
|
||||
val gid: Int = ROOT_GID,
|
||||
val groups: List<Int> = mutableListOf(),
|
||||
val capabilities: List<Int> = mutableListOf(),
|
||||
val context: String = "u:r:su:s0",
|
||||
val namespace: Int = Namespace.Inherited.ordinal,
|
||||
val context: String = KERNEL_SU_DOMAIN,
|
||||
val namespace: Int = Namespace.INHERITED.ordinal,
|
||||
|
||||
val nonRootUseDefault: Boolean = true,
|
||||
val umountModules: Boolean = true,
|
||||
var rules: String = "", // this field is save in ksud!!
|
||||
) : Parcelable {
|
||||
enum class Namespace {
|
||||
Inherited,
|
||||
Global,
|
||||
Individual,
|
||||
INHERITED,
|
||||
GLOBAL,
|
||||
INDIVIDUAL,
|
||||
}
|
||||
|
||||
constructor() : this("")
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package me.weishu.kernelsu.profile
|
||||
|
||||
/**
|
||||
* https://cs.android.com/android/platform/superproject/main/+/main:system/core/libcutils/include/private/android_filesystem_config.h
|
||||
* @author weishu
|
||||
* @date 2023/6/3.
|
||||
*/
|
||||
@@ -60,17 +61,55 @@ enum class Groups(val gid: Int, val display: String, val desc: String) {
|
||||
FIREWALL(1048, "firewall", "firewall process"),
|
||||
TRUNKS(1049, "trunks", "trunksd process"),
|
||||
NVRAM(1050, "nvram", "nvram daemon"),
|
||||
DNS_TETHER(1051, "dns_tether", "dns_tether device"),
|
||||
DNS_TETHER_RESERVED(1052, "dns_tether_reserved", "Reserved range for dns_tether"),
|
||||
WEBVIEW_ZYGOTE(1053, "webview_zygote", "zygote process"),
|
||||
WEBVIEW_USER(1054, "webview_user", "webview chromium user"),
|
||||
ETHERNET(1055, "ethernet", "Ethernet"),
|
||||
TOMBSTONED(1056, "tombstoned", "tombstoned process"),
|
||||
GRAPHICS_RW(1057, "graphics_rw", "graphics devices"),
|
||||
DNS(1051, "dns", "DNS resolution daemon (system: netd)"),
|
||||
DNS_TETHER(1052, "dns_tether", "DNS resolution daemon (tether: dnsmasq)"),
|
||||
WEBVIEW_ZYGOTE(1053, "webview_zygote", "WebView zygote process"),
|
||||
VEHICLE_NETWORK(1054, "vehicle_network", "Vehicle network service"),
|
||||
MEDIA_AUDIO(1055, "media_audio", "GID for audio files on internal media storage"),
|
||||
MEDIA_VIDEO(1056, "media_video", "GID for video files on internal media storage"),
|
||||
MEDIA_IMAGE(1057, "media_image", "GID for image files on internal media storage"),
|
||||
TOMBSTONED(1058, "tombstoned", "tombstoned user"),
|
||||
MEDIA_OBB(1059, "media_obb", "GID for OBB files on internal media storage"),
|
||||
ESE(1060, "ese", "embedded secure element (eSE) subsystem"),
|
||||
OTA_UPDATE(1061, "ota_update", "resource tracking UID for OTA updates"),
|
||||
AUTOMOTIVE_EVS(1062, "automotive_evs", "Automotive rear and surround view system"),
|
||||
LOWPAN(1063, "lowpan", "LoWPAN subsystem"),
|
||||
HSM(1064, "lowpan", "hardware security module subsystem"),
|
||||
RESERVED_DISK(1065, "reserved_disk", "GID that has access to reserved disk space"),
|
||||
STATSD(1066, "statsd", "statsd daemon"),
|
||||
INCIDENTD(1067, "incidentd", "incidentd daemon"),
|
||||
SECURE_ELEMENT(1068, "secure_element", "secure element subsystem"),
|
||||
LMKD(1069, "lmkd", "low memory killer daemon"),
|
||||
LLKD(1070, "llkd", "live lock daemon"),
|
||||
IORAPD(1071, "iorapd", "input/output readahead and pin daemon"),
|
||||
GPU_SERVICE(1072, "gpu_service", "GPU service daemon"),
|
||||
NETWORK_STACK(1073, "network_stack", "network stack service"),
|
||||
GSID(1074, "GSID", "GSI service daemon"),
|
||||
FSVERITY_CERT(1075, "fsverity_cert", "fs-verity key ownership in keystore"),
|
||||
CREDSTORE(1076, "credstore", "identity credential manager service"),
|
||||
EXTERNAL_STORAGE(1077, "external_storage", "Full external storage access including USB OTG volumes"),
|
||||
EXT_DATA_RW(1078, "ext_data_rw", "GID for app-private data directories on external storage"),
|
||||
EXT_OBB_RW(1079, "ext_obb_rw", "GID for OBB directories on external storage"),
|
||||
CONTEXT_HUB(1080, "context_hub", "GID for access to the Context Hub"),
|
||||
VIRTUALIZATIONSERVICE(1081, "virtualizationservice", "VirtualizationService daemon"),
|
||||
ARTD(1082, "artd", "ART Service daemon"),
|
||||
UWB(1083, "uwb", "UWB subsystem"),
|
||||
THREAD_NETWORK(1084, "thread_network", "Thread Network subsystem"),
|
||||
DICED(1085, "diced", "Android's DICE daemon"),
|
||||
DMESGD(1086, "dmesgd", "dmesg parsing daemon for kernel report collection"),
|
||||
JC_WEAVER(1087, "jc_weaver", "Javacard Weaver HAL - to manage omapi ARA rules"),
|
||||
JC_STRONGBOX(1088, "jc_strongbox", "Javacard Strongbox HAL - to manage omapi ARA rules"),
|
||||
JC_IDENTITYCRED(1089, "jc_identitycred", "Javacard Identity Cred HAL - to manage omapi ARA rules"),
|
||||
SDK_SANDBOX(1090, "sdk_sandbox", "SDK sandbox virtual UID"),
|
||||
SECURITY_LOG_WRITER(1091, "security_log_writer", "write to security log"),
|
||||
PRNG_SEEDER(1092, "prng_seeder", "PRNG seeder daemon"),
|
||||
|
||||
SHELL(2000, "shell", "adb and debug shell user"),
|
||||
CACHE(2001, "cache", "cache access"),
|
||||
DIAG(2002, "diag", "diagnostics"),
|
||||
DIAG(2002, "diag", "access to diagnostic resources"),
|
||||
|
||||
/* The 3000 series are intended for use as supplemental group id's only.
|
||||
* They indicate special Android capabilities that the kernel is aware of. */
|
||||
NET_BT_ADMIN(3001, "net_bt_admin", "bluetooth: create any socket"),
|
||||
NET_BT(3002, "net_bt", "bluetooth: create sco, rfcomm or l2cap sockets"),
|
||||
INET(3003, "inet", "can create AF_INET and AF_INET6 sockets"),
|
||||
@@ -79,7 +118,11 @@ enum class Groups(val gid: Int, val display: String, val desc: String) {
|
||||
NET_BW_STATS(3006, "net_bw_stats", "read bandwidth statistics"),
|
||||
NET_BW_ACCT(3007, "net_bw_acct", "change bandwidth statistics accounting"),
|
||||
NET_BT_STACK(3008, "net_bt_stack", "access to various bluetooth management functions"),
|
||||
QCOM_DIAG(3009, "qcom_diag", "allow msm specific diag commands"),
|
||||
READPROC(3009, "readproc", "Allow /proc read access"),
|
||||
WAKELOCK(3010, "wakelock", "Allow system wakelock read/write access"),
|
||||
UHID(3011, "uhid", "Allow read/write to /dev/uhid node"),
|
||||
READTRACEFS(3012, "readtracefs", "Allow tracefs read"),
|
||||
|
||||
EVERYBODY(9997, "everybody", "Shared external storage read/write"),
|
||||
MISC(9998, "misc", "Access to misc storage"),
|
||||
NOBODY(9999, "nobody", "Reserved"),
|
||||
|
||||
@@ -74,9 +74,9 @@ fun RootProfileConfig(
|
||||
|
||||
var expanded by remember { mutableStateOf(false) }
|
||||
val currentNamespace = when (profile.namespace) {
|
||||
Natives.Profile.Namespace.Inherited.ordinal -> stringResource(R.string.profile_namespace_inherited)
|
||||
Natives.Profile.Namespace.Global.ordinal -> stringResource(R.string.profile_namespace_global)
|
||||
Natives.Profile.Namespace.Individual.ordinal -> stringResource(R.string.profile_namespace_individual)
|
||||
Natives.Profile.Namespace.INHERITED.ordinal -> stringResource(R.string.profile_namespace_inherited)
|
||||
Natives.Profile.Namespace.GLOBAL.ordinal -> stringResource(R.string.profile_namespace_global)
|
||||
Natives.Profile.Namespace.INDIVIDUAL.ordinal -> stringResource(R.string.profile_namespace_individual)
|
||||
else -> stringResource(R.string.profile_namespace_inherited)
|
||||
}
|
||||
ListItem(headlineContent = {
|
||||
@@ -104,21 +104,21 @@ fun RootProfileConfig(
|
||||
DropdownMenuItem(
|
||||
text = { Text(stringResource(R.string.profile_namespace_inherited)) },
|
||||
onClick = {
|
||||
onProfileChange(profile.copy(namespace = Natives.Profile.Namespace.Inherited.ordinal))
|
||||
onProfileChange(profile.copy(namespace = Natives.Profile.Namespace.INHERITED.ordinal))
|
||||
expanded = false
|
||||
},
|
||||
)
|
||||
DropdownMenuItem(
|
||||
text = { Text(stringResource(R.string.profile_namespace_global)) },
|
||||
onClick = {
|
||||
onProfileChange(profile.copy(namespace = Natives.Profile.Namespace.Global.ordinal))
|
||||
onProfileChange(profile.copy(namespace = Natives.Profile.Namespace.GLOBAL.ordinal))
|
||||
expanded = false
|
||||
},
|
||||
)
|
||||
DropdownMenuItem(
|
||||
text = { Text(stringResource(R.string.profile_namespace_individual)) },
|
||||
onClick = {
|
||||
onProfileChange(profile.copy(namespace = Natives.Profile.Namespace.Individual.ordinal))
|
||||
onProfileChange(profile.copy(namespace = Natives.Profile.Namespace.INDIVIDUAL.ordinal))
|
||||
expanded = false
|
||||
},
|
||||
)
|
||||
@@ -191,7 +191,14 @@ fun GroupsPanel(selected: List<Groups>, closeSelection: (selection: Set<Groups>)
|
||||
var showDialog by remember { mutableStateOf(false) }
|
||||
|
||||
if (showDialog) {
|
||||
val groups = Groups.values()
|
||||
val groups = Groups.values().sortedWith(compareBy<Groups> {
|
||||
when (it) {
|
||||
Groups.ROOT -> 0
|
||||
Groups.SYSTEM -> 1
|
||||
Groups.SHELL -> 2
|
||||
else -> Int.MAX_VALUE
|
||||
}
|
||||
}.then(compareBy { it.name }))
|
||||
val options = groups.map { value ->
|
||||
ListOption(
|
||||
titleText = value.display,
|
||||
@@ -257,7 +264,7 @@ fun CapsPanel(
|
||||
var showDialog by remember { mutableStateOf(false) }
|
||||
|
||||
if (showDialog) {
|
||||
val caps = Capabilities.values()
|
||||
val caps = Capabilities.values().sortedBy { it.name }
|
||||
val options = caps.map { value ->
|
||||
ListOption(
|
||||
titleText = value.display,
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
package me.weishu.kernelsu.ui.component.profile
|
||||
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.filled.ArrowDropDown
|
||||
import androidx.compose.material.icons.filled.ArrowDropUp
|
||||
import androidx.compose.material.icons.filled.Create
|
||||
import androidx.compose.material.icons.filled.ReadMore
|
||||
import androidx.compose.material3.DropdownMenuItem
|
||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||
import androidx.compose.material3.ExposedDropdownMenuBox
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.IconButton
|
||||
import androidx.compose.material3.ListItem
|
||||
import androidx.compose.material3.OutlinedTextField
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.saveable.rememberSaveable
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import me.weishu.kernelsu.Natives
|
||||
import me.weishu.kernelsu.R
|
||||
import me.weishu.kernelsu.ui.util.listAppProfileTemplates
|
||||
import me.weishu.kernelsu.ui.util.setSepolicy
|
||||
import me.weishu.kernelsu.ui.viewmodel.getTemplateInfoById
|
||||
|
||||
/**
|
||||
* @author weishu
|
||||
* @date 2023/10/21.
|
||||
*/
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
fun TemplateConfig(
|
||||
profile: Natives.Profile,
|
||||
onViewTemplate: (id: String) -> Unit = {},
|
||||
onManageTemplate: () -> Unit = {},
|
||||
onProfileChange: (Natives.Profile) -> Unit
|
||||
) {
|
||||
var expanded by remember { mutableStateOf(false) }
|
||||
var template by rememberSaveable {
|
||||
mutableStateOf(profile.rootTemplate ?: "")
|
||||
}
|
||||
val profileTemplates = listAppProfileTemplates()
|
||||
val noTemplates = profileTemplates.isEmpty()
|
||||
|
||||
ListItem(headlineContent = {
|
||||
ExposedDropdownMenuBox(
|
||||
expanded = expanded,
|
||||
onExpandedChange = { expanded = it },
|
||||
) {
|
||||
OutlinedTextField(
|
||||
modifier = Modifier
|
||||
.menuAnchor()
|
||||
.fillMaxWidth(),
|
||||
readOnly = true,
|
||||
label = { Text(stringResource(R.string.profile_template)) },
|
||||
value = template.ifEmpty { "None" },
|
||||
onValueChange = {},
|
||||
trailingIcon = {
|
||||
if (noTemplates) {
|
||||
IconButton(
|
||||
onClick = onManageTemplate
|
||||
) {
|
||||
Icon(Icons.Filled.Create, null)
|
||||
}
|
||||
} else if (expanded) Icon(Icons.Filled.ArrowDropUp, null)
|
||||
else Icon(Icons.Filled.ArrowDropDown, null)
|
||||
},
|
||||
)
|
||||
if (profileTemplates.isEmpty()) {
|
||||
return@ExposedDropdownMenuBox
|
||||
}
|
||||
ExposedDropdownMenu(
|
||||
expanded = expanded,
|
||||
onDismissRequest = { expanded = false }
|
||||
) {
|
||||
profileTemplates.forEach { tid ->
|
||||
val templateInfo =
|
||||
getTemplateInfoById(tid) ?: return@forEach
|
||||
DropdownMenuItem(
|
||||
text = { Text(tid) },
|
||||
onClick = {
|
||||
template = tid
|
||||
if (setSepolicy(tid, templateInfo.rules.joinToString("\n"))) {
|
||||
onProfileChange(
|
||||
profile.copy(
|
||||
rootTemplate = tid,
|
||||
rootUseDefault = false,
|
||||
uid = templateInfo.uid,
|
||||
gid = templateInfo.gid,
|
||||
groups = templateInfo.groups,
|
||||
capabilities = templateInfo.capabilities,
|
||||
context = templateInfo.context,
|
||||
namespace = templateInfo.namespace,
|
||||
)
|
||||
)
|
||||
}
|
||||
expanded = false
|
||||
},
|
||||
trailingIcon = {
|
||||
IconButton(onClick = {
|
||||
onViewTemplate(tid)
|
||||
}) {
|
||||
Icon(Icons.Filled.ReadMore, null)
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -18,19 +18,15 @@ import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.filled.AccountCircle
|
||||
import androidx.compose.material.icons.filled.Android
|
||||
import androidx.compose.material.icons.filled.ArrowBack
|
||||
import androidx.compose.material.icons.filled.ArrowDropDown
|
||||
import androidx.compose.material.icons.filled.ArrowDropUp
|
||||
import androidx.compose.material.icons.filled.Security
|
||||
import androidx.compose.material3.Divider
|
||||
import androidx.compose.material3.DropdownMenu
|
||||
import androidx.compose.material3.DropdownMenuItem
|
||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||
import androidx.compose.material3.ExposedDropdownMenuBox
|
||||
import androidx.compose.material3.FilterChip
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.IconButton
|
||||
import androidx.compose.material3.ListItem
|
||||
import androidx.compose.material3.OutlinedTextField
|
||||
import androidx.compose.material3.Scaffold
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TopAppBar
|
||||
@@ -61,6 +57,9 @@ import me.weishu.kernelsu.R
|
||||
import me.weishu.kernelsu.ui.component.SwitchItem
|
||||
import me.weishu.kernelsu.ui.component.profile.AppProfileConfig
|
||||
import me.weishu.kernelsu.ui.component.profile.RootProfileConfig
|
||||
import me.weishu.kernelsu.ui.component.profile.TemplateConfig
|
||||
import me.weishu.kernelsu.ui.screen.destinations.AppProfileTemplateScreenDestination
|
||||
import me.weishu.kernelsu.ui.screen.destinations.TemplateEditorScreenDestination
|
||||
import me.weishu.kernelsu.ui.util.LocalSnackbarHost
|
||||
import me.weishu.kernelsu.ui.util.forceStopApp
|
||||
import me.weishu.kernelsu.ui.util.getSepolicy
|
||||
@@ -68,6 +67,7 @@ import me.weishu.kernelsu.ui.util.launchApp
|
||||
import me.weishu.kernelsu.ui.util.restartApp
|
||||
import me.weishu.kernelsu.ui.util.setSepolicy
|
||||
import me.weishu.kernelsu.ui.viewmodel.SuperUserViewModel
|
||||
import me.weishu.kernelsu.ui.viewmodel.getTemplateInfoById
|
||||
|
||||
/**
|
||||
* @author weishu
|
||||
@@ -107,9 +107,7 @@ fun AppProfileScreen(
|
||||
appLabel = appInfo.label,
|
||||
appIcon = {
|
||||
AsyncImage(
|
||||
model = ImageRequest.Builder(context)
|
||||
.data(appInfo.packageInfo)
|
||||
.crossfade(true)
|
||||
model = ImageRequest.Builder(context).data(appInfo.packageInfo).crossfade(true)
|
||||
.build(),
|
||||
contentDescription = appInfo.label,
|
||||
modifier = Modifier
|
||||
@@ -119,6 +117,14 @@ fun AppProfileScreen(
|
||||
)
|
||||
},
|
||||
profile = profile,
|
||||
onViewTemplate = {
|
||||
getTemplateInfoById(it)?.let { info ->
|
||||
navigator.navigate(TemplateEditorScreenDestination(info))
|
||||
}
|
||||
},
|
||||
onManageTemplate = {
|
||||
navigator.navigate(AppProfileTemplateScreenDestination())
|
||||
},
|
||||
onProfileChange = {
|
||||
scope.launch {
|
||||
if (it.allowSu && !it.rootUseDefault && it.rules.isNotEmpty()) {
|
||||
@@ -138,7 +144,6 @@ fun AppProfileScreen(
|
||||
}
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
private fun AppProfileInner(
|
||||
modifier: Modifier = Modifier,
|
||||
@@ -146,6 +151,8 @@ private fun AppProfileInner(
|
||||
appLabel: String,
|
||||
appIcon: @Composable () -> Unit,
|
||||
profile: Natives.Profile,
|
||||
onViewTemplate: (id: String) -> Unit = {},
|
||||
onManageTemplate: () -> Unit = {},
|
||||
onProfileChange: (Natives.Profile) -> Unit,
|
||||
) {
|
||||
val isRootGranted = profile.allowSu
|
||||
@@ -179,7 +186,7 @@ private fun AppProfileInner(
|
||||
var mode by remember {
|
||||
mutableStateOf(initialMode)
|
||||
}
|
||||
ProfileBox(mode, false) {
|
||||
ProfileBox(mode, true) {
|
||||
// template mode shouldn't change profile here!
|
||||
if (it == Mode.Default || it == Mode.Custom) {
|
||||
onProfileChange(profile.copy(rootUseDefault = it == Mode.Default))
|
||||
@@ -188,43 +195,12 @@ private fun AppProfileInner(
|
||||
}
|
||||
Crossfade(targetState = mode, label = "") { currentMode ->
|
||||
if (currentMode == Mode.Template) {
|
||||
var expanded by remember { mutableStateOf(false) }
|
||||
val templateNone = "None"
|
||||
var template by rememberSaveable {
|
||||
mutableStateOf(
|
||||
profile.rootTemplate
|
||||
?: templateNone
|
||||
)
|
||||
}
|
||||
ListItem(headlineContent = {
|
||||
ExposedDropdownMenuBox(
|
||||
expanded = expanded,
|
||||
onExpandedChange = { expanded = it },
|
||||
) {
|
||||
OutlinedTextField(
|
||||
modifier = Modifier.menuAnchor(),
|
||||
readOnly = true,
|
||||
label = { Text(stringResource(R.string.profile_template)) },
|
||||
value = template,
|
||||
onValueChange = {
|
||||
if (template != templateNone) {
|
||||
onProfileChange(
|
||||
profile.copy(
|
||||
rootTemplate = it,
|
||||
rootUseDefault = false
|
||||
)
|
||||
)
|
||||
template = it
|
||||
}
|
||||
},
|
||||
trailingIcon = {
|
||||
if (expanded) Icon(Icons.Filled.ArrowDropUp, null)
|
||||
else Icon(Icons.Filled.ArrowDropDown, null)
|
||||
},
|
||||
)
|
||||
// TODO: Template
|
||||
}
|
||||
})
|
||||
TemplateConfig(
|
||||
profile = profile,
|
||||
onViewTemplate = onViewTemplate,
|
||||
onManageTemplate = onManageTemplate,
|
||||
onProfileChange = onProfileChange
|
||||
)
|
||||
} else if (mode == Mode.Custom) {
|
||||
RootProfileConfig(
|
||||
fixedName = true,
|
||||
@@ -254,9 +230,7 @@ private fun AppProfileInner(
|
||||
}
|
||||
|
||||
private enum class Mode(@StringRes private val res: Int) {
|
||||
Default(R.string.profile_default),
|
||||
Template(R.string.profile_template),
|
||||
Custom(R.string.profile_custom);
|
||||
Default(R.string.profile_default), Template(R.string.profile_template), Custom(R.string.profile_custom);
|
||||
|
||||
val text: String
|
||||
@Composable get() = stringResource(res)
|
||||
@@ -292,8 +266,7 @@ private fun ProfileBox(
|
||||
Divider(thickness = Dp.Hairline)
|
||||
ListItem(headlineContent = {
|
||||
Row(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
horizontalArrangement = Arrangement.SpaceEvenly
|
||||
modifier = Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.SpaceEvenly
|
||||
) {
|
||||
FilterChip(
|
||||
selected = mode == Mode.Default,
|
||||
@@ -331,8 +304,7 @@ private fun AppMenuBox(packageName: String, content: @Composable () -> Unit) {
|
||||
touchPoint = it
|
||||
expanded = true
|
||||
}
|
||||
}
|
||||
) {
|
||||
}) {
|
||||
|
||||
content()
|
||||
|
||||
|
||||
@@ -150,6 +150,7 @@ private fun ModuleList(
|
||||
val changelogText = stringResource(R.string.module_changelog)
|
||||
val downloadingText = stringResource(R.string.module_downloading)
|
||||
val startDownloadingText = stringResource(R.string.module_start_downloading)
|
||||
val fetchChangeLogFailed = stringResource(R.string.module_changelog_failed)
|
||||
|
||||
val dialogHost = LocalDialogHost.current
|
||||
val snackBarHost = LocalSnackbarHost.current
|
||||
@@ -161,36 +162,48 @@ private fun ModuleList(
|
||||
downloadUrl: String,
|
||||
fileName: String
|
||||
) {
|
||||
val changelog = dialogHost.withLoading {
|
||||
val changelogResult = dialogHost.withLoading {
|
||||
withContext(Dispatchers.IO) {
|
||||
OkHttpClient().newCall(
|
||||
okhttp3.Request.Builder().url(changelogUrl).build()
|
||||
).execute().body!!.string()
|
||||
runCatching {
|
||||
OkHttpClient().newCall(
|
||||
okhttp3.Request.Builder().url(changelogUrl).build()
|
||||
).execute().body!!.string()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (changelog.isNotEmpty()) {
|
||||
// changelog is not empty, show it and wait for confirm
|
||||
val confirmResult = dialogHost.showConfirm(
|
||||
changelogText,
|
||||
content = changelog,
|
||||
markdown = true,
|
||||
confirm = updateText,
|
||||
)
|
||||
|
||||
if (confirmResult != ConfirmResult.Confirmed) {
|
||||
return
|
||||
val showToast: suspend (String) -> Unit = {msg->
|
||||
withContext(Dispatchers.Main) {
|
||||
Toast.makeText(
|
||||
context,
|
||||
msg,
|
||||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
}
|
||||
}
|
||||
|
||||
withContext(Dispatchers.Main) {
|
||||
Toast.makeText(
|
||||
context,
|
||||
startDownloadingText.format(module.name),
|
||||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
val changelog = changelogResult.getOrElse {
|
||||
showToast(fetchChangeLogFailed.format(it.message))
|
||||
return
|
||||
}.ifBlank {
|
||||
showToast(fetchChangeLogFailed.format(module.name))
|
||||
return
|
||||
}
|
||||
|
||||
// changelog is not empty, show it and wait for confirm
|
||||
val confirmResult = dialogHost.showConfirm(
|
||||
changelogText,
|
||||
content = changelog,
|
||||
markdown = true,
|
||||
confirm = updateText,
|
||||
)
|
||||
|
||||
if (confirmResult != ConfirmResult.Confirmed) {
|
||||
return
|
||||
}
|
||||
|
||||
showToast(startDownloadingText.format(module.name))
|
||||
|
||||
val downloading = downloadingText.format(module.name)
|
||||
withContext(Dispatchers.IO) {
|
||||
download(
|
||||
|
||||
@@ -8,6 +8,7 @@ import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.filled.ArrowBack
|
||||
import androidx.compose.material.icons.filled.BugReport
|
||||
import androidx.compose.material.icons.filled.ContactPage
|
||||
import androidx.compose.material.icons.filled.Fence
|
||||
import androidx.compose.material.icons.filled.RemoveModerator
|
||||
import androidx.compose.material3.*
|
||||
import androidx.compose.runtime.*
|
||||
@@ -27,6 +28,7 @@ import me.weishu.kernelsu.R
|
||||
import me.weishu.kernelsu.ui.component.AboutDialog
|
||||
import me.weishu.kernelsu.ui.component.LoadingDialog
|
||||
import me.weishu.kernelsu.ui.component.SwitchItem
|
||||
import me.weishu.kernelsu.ui.screen.destinations.AppProfileTemplateScreenDestination
|
||||
import me.weishu.kernelsu.ui.util.LocalDialogHost
|
||||
import me.weishu.kernelsu.ui.util.getBugreportFile
|
||||
|
||||
@@ -56,6 +58,16 @@ fun SettingScreen(navigator: DestinationsNavigator) {
|
||||
val scope = rememberCoroutineScope()
|
||||
val dialogHost = LocalDialogHost.current
|
||||
|
||||
val profileTemplate = stringResource(id = R.string.settings_profile_template)
|
||||
ListItem(
|
||||
leadingContent = { Icon(Icons.Filled.Fence, profileTemplate) },
|
||||
headlineContent = { Text(profileTemplate) },
|
||||
supportingContent = { Text(stringResource(id = R.string.settings_profile_template_summary))},
|
||||
modifier = Modifier.clickable {
|
||||
navigator.navigate(AppProfileTemplateScreenDestination)
|
||||
}
|
||||
)
|
||||
|
||||
var umountChecked by rememberSaveable {
|
||||
mutableStateOf(Natives.isDefaultUmountModules())
|
||||
}
|
||||
|
||||
@@ -0,0 +1,255 @@
|
||||
package me.weishu.kernelsu.ui.screen
|
||||
|
||||
import android.widget.Toast
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.ExperimentalLayoutApi
|
||||
import androidx.compose.foundation.layout.FlowRow
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.lazy.LazyColumn
|
||||
import androidx.compose.foundation.lazy.items
|
||||
import androidx.compose.material.ExperimentalMaterialApi
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.filled.Add
|
||||
import androidx.compose.material.icons.filled.ArrowBack
|
||||
import androidx.compose.material.icons.filled.ImportExport
|
||||
import androidx.compose.material.icons.filled.Sync
|
||||
import androidx.compose.material.pullrefresh.PullRefreshIndicator
|
||||
import androidx.compose.material.pullrefresh.pullRefresh
|
||||
import androidx.compose.material.pullrefresh.rememberPullRefreshState
|
||||
import androidx.compose.material3.DropdownMenu
|
||||
import androidx.compose.material3.DropdownMenuItem
|
||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||
import androidx.compose.material3.ExtendedFloatingActionButton
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.IconButton
|
||||
import androidx.compose.material3.ListItem
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Scaffold
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TopAppBar
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.LaunchedEffect
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.rememberCoroutineScope
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.platform.LocalClipboardManager
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.AnnotatedString
|
||||
import androidx.lifecycle.viewmodel.compose.viewModel
|
||||
import com.ramcosta.composedestinations.annotation.Destination
|
||||
import com.ramcosta.composedestinations.navigation.DestinationsNavigator
|
||||
import com.ramcosta.composedestinations.result.ResultRecipient
|
||||
import com.ramcosta.composedestinations.result.getOr
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import me.weishu.kernelsu.R
|
||||
import me.weishu.kernelsu.ui.screen.destinations.TemplateEditorScreenDestination
|
||||
import me.weishu.kernelsu.ui.viewmodel.TemplateViewModel
|
||||
|
||||
/**
|
||||
* @author weishu
|
||||
* @date 2023/10/20.
|
||||
*/
|
||||
|
||||
@OptIn(ExperimentalMaterialApi::class)
|
||||
@Destination
|
||||
@Composable
|
||||
fun AppProfileTemplateScreen(
|
||||
navigator: DestinationsNavigator,
|
||||
resultRecipient: ResultRecipient<TemplateEditorScreenDestination, Boolean>
|
||||
) {
|
||||
val viewModel = viewModel<TemplateViewModel>()
|
||||
val scope = rememberCoroutineScope()
|
||||
|
||||
LaunchedEffect(Unit) {
|
||||
if (viewModel.templateList.isEmpty()) {
|
||||
viewModel.fetchTemplates()
|
||||
}
|
||||
}
|
||||
|
||||
// handle result from TemplateEditorScreen, refresh if needed
|
||||
resultRecipient.onNavResult { result ->
|
||||
if (result.getOr { false }) {
|
||||
scope.launch { viewModel.fetchTemplates() }
|
||||
}
|
||||
}
|
||||
|
||||
Scaffold(
|
||||
topBar = {
|
||||
val clipboardManager = LocalClipboardManager.current
|
||||
val context = LocalContext.current
|
||||
val showToast = fun(msg: String) {
|
||||
scope.launch(Dispatchers.Main) {
|
||||
Toast.makeText(context, msg, Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
TopBar(onBack = { navigator.popBackStack() },
|
||||
onSync = {
|
||||
scope.launch { viewModel.fetchTemplates(true) }
|
||||
},
|
||||
onImport = {
|
||||
clipboardManager.getText()?.text?.let {
|
||||
if (it.isEmpty()) {
|
||||
showToast(context.getString(R.string.app_profile_template_import_empty))
|
||||
return@let
|
||||
}
|
||||
scope.launch {
|
||||
viewModel.importTemplates(
|
||||
it, {
|
||||
showToast(context.getString(R.string.app_profile_template_import_success))
|
||||
viewModel.fetchTemplates(false)
|
||||
},
|
||||
showToast
|
||||
)
|
||||
}
|
||||
}
|
||||
},
|
||||
onExport = {
|
||||
scope.launch {
|
||||
viewModel.exportTemplates(
|
||||
{
|
||||
showToast(context.getString(R.string.app_profile_template_export_empty))
|
||||
}
|
||||
) {
|
||||
clipboardManager.setText(AnnotatedString(it))
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
},
|
||||
floatingActionButton = {
|
||||
ExtendedFloatingActionButton(
|
||||
onClick = {
|
||||
navigator.navigate(
|
||||
TemplateEditorScreenDestination(
|
||||
TemplateViewModel.TemplateInfo(),
|
||||
false
|
||||
)
|
||||
)
|
||||
},
|
||||
icon = { Icon(Icons.Filled.Add, null) },
|
||||
text = { Text(stringResource(id = R.string.app_profile_template_create)) },
|
||||
)
|
||||
},
|
||||
) { innerPadding ->
|
||||
val refreshState = rememberPullRefreshState(
|
||||
refreshing = viewModel.isRefreshing,
|
||||
onRefresh = { scope.launch { viewModel.fetchTemplates() } },
|
||||
)
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.padding(innerPadding)
|
||||
.pullRefresh(refreshState)
|
||||
) {
|
||||
LazyColumn(Modifier.fillMaxSize()) {
|
||||
items(viewModel.templateList, key = { it.id }) { app ->
|
||||
TemplateItem(navigator, app)
|
||||
}
|
||||
}
|
||||
|
||||
PullRefreshIndicator(
|
||||
refreshing = viewModel.isRefreshing,
|
||||
state = refreshState,
|
||||
modifier = Modifier.align(Alignment.TopCenter)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalLayoutApi::class)
|
||||
@Composable
|
||||
private fun TemplateItem(
|
||||
navigator: DestinationsNavigator,
|
||||
template: TemplateViewModel.TemplateInfo
|
||||
) {
|
||||
ListItem(
|
||||
modifier = Modifier
|
||||
.clickable {
|
||||
navigator.navigate(TemplateEditorScreenDestination(template, !template.local))
|
||||
},
|
||||
headlineContent = { Text(template.name) },
|
||||
supportingContent = {
|
||||
Column {
|
||||
Text(
|
||||
text = "${template.id}${if (template.author.isEmpty()) "" else "@${template.author}"}",
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
fontSize = MaterialTheme.typography.bodySmall.fontSize,
|
||||
)
|
||||
Text(template.description)
|
||||
FlowRow {
|
||||
LabelText(label = "UID: ${template.uid}")
|
||||
LabelText(label = "GID: ${template.gid}")
|
||||
LabelText(label = template.context)
|
||||
if (template.local) {
|
||||
LabelText(label = "local")
|
||||
} else {
|
||||
LabelText(label = "remote")
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
private fun TopBar(
|
||||
onBack: () -> Unit,
|
||||
onSync: () -> Unit = {},
|
||||
onImport: () -> Unit = {},
|
||||
onExport: () -> Unit = {}
|
||||
) {
|
||||
TopAppBar(
|
||||
title = {
|
||||
Text(stringResource(R.string.settings_profile_template))
|
||||
},
|
||||
navigationIcon = {
|
||||
IconButton(
|
||||
onClick = onBack
|
||||
) { Icon(Icons.Filled.ArrowBack, contentDescription = null) }
|
||||
},
|
||||
actions = {
|
||||
IconButton(onClick = onSync) {
|
||||
Icon(
|
||||
Icons.Filled.Sync,
|
||||
contentDescription = stringResource(id = R.string.app_profile_template_sync)
|
||||
)
|
||||
}
|
||||
|
||||
var showDropdown by remember { mutableStateOf(false) }
|
||||
IconButton(onClick = {
|
||||
showDropdown = true
|
||||
}) {
|
||||
Icon(
|
||||
imageVector = Icons.Filled.ImportExport,
|
||||
contentDescription = stringResource(id = R.string.app_profile_import_export)
|
||||
)
|
||||
|
||||
DropdownMenu(expanded = showDropdown, onDismissRequest = {
|
||||
showDropdown = false
|
||||
}) {
|
||||
DropdownMenuItem(text = {
|
||||
Text(stringResource(id = R.string.app_profile_import_from_clipboard))
|
||||
}, onClick = {
|
||||
onImport()
|
||||
showDropdown = false
|
||||
})
|
||||
DropdownMenuItem(text = {
|
||||
Text(stringResource(id = R.string.app_profile_export_to_clipboard))
|
||||
}, onClick = {
|
||||
onExport()
|
||||
showDropdown = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,327 @@
|
||||
package me.weishu.kernelsu.ui.screen
|
||||
|
||||
import android.widget.Toast
|
||||
import androidx.activity.compose.BackHandler
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.rememberScrollState
|
||||
import androidx.compose.foundation.text.KeyboardActions
|
||||
import androidx.compose.foundation.text.KeyboardOptions
|
||||
import androidx.compose.foundation.verticalScroll
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.filled.ArrowBack
|
||||
import androidx.compose.material.icons.filled.DeleteForever
|
||||
import androidx.compose.material.icons.filled.Save
|
||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.IconButton
|
||||
import androidx.compose.material3.ListItem
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.OutlinedTextField
|
||||
import androidx.compose.material3.Scaffold
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TopAppBar
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.saveable.rememberSaveable
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.ExperimentalComposeUiApi
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.input.pointer.pointerInteropFilter
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.platform.LocalSoftwareKeyboardController
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.input.ImeAction
|
||||
import androidx.compose.ui.text.input.KeyboardType
|
||||
import com.ramcosta.composedestinations.annotation.Destination
|
||||
import com.ramcosta.composedestinations.result.ResultBackNavigator
|
||||
import me.weishu.kernelsu.Natives
|
||||
import me.weishu.kernelsu.R
|
||||
import me.weishu.kernelsu.profile.Capabilities
|
||||
import me.weishu.kernelsu.profile.Groups
|
||||
import me.weishu.kernelsu.ui.component.profile.RootProfileConfig
|
||||
import me.weishu.kernelsu.ui.util.deleteAppProfileTemplate
|
||||
import me.weishu.kernelsu.ui.util.getAppProfileTemplate
|
||||
import me.weishu.kernelsu.ui.util.setAppProfileTemplate
|
||||
import me.weishu.kernelsu.ui.viewmodel.TemplateViewModel
|
||||
import me.weishu.kernelsu.ui.viewmodel.toJSON
|
||||
import org.json.JSONArray
|
||||
import org.json.JSONObject
|
||||
|
||||
/**
|
||||
* @author weishu
|
||||
* @date 2023/10/20.
|
||||
*/
|
||||
@OptIn(ExperimentalComposeUiApi::class)
|
||||
@Destination
|
||||
@Composable
|
||||
fun TemplateEditorScreen(
|
||||
navigator: ResultBackNavigator<Boolean>,
|
||||
initialTemplate: TemplateViewModel.TemplateInfo,
|
||||
readOnly: Boolean = true,
|
||||
) {
|
||||
|
||||
val isCreation = initialTemplate.id.isBlank()
|
||||
val autoSave = !isCreation
|
||||
|
||||
var template by rememberSaveable {
|
||||
mutableStateOf(initialTemplate)
|
||||
}
|
||||
|
||||
BackHandler {
|
||||
navigator.navigateBack(result = !readOnly)
|
||||
}
|
||||
|
||||
Scaffold(
|
||||
topBar = {
|
||||
val author =
|
||||
if (initialTemplate.author.isNotEmpty()) "@${initialTemplate.author}" else ""
|
||||
val readOnlyHint = if (readOnly) {
|
||||
" - ${stringResource(id = R.string.app_profile_template_readonly)}"
|
||||
} else {
|
||||
""
|
||||
}
|
||||
val titleSummary = "${initialTemplate.id}$author$readOnlyHint"
|
||||
val saveTemplateFailed = stringResource(id = R.string.app_profile_template_save_failed)
|
||||
val context = LocalContext.current
|
||||
|
||||
TopBar(
|
||||
title = if (isCreation) {
|
||||
stringResource(R.string.app_profile_template_create)
|
||||
} else if (readOnly) {
|
||||
stringResource(R.string.app_profile_template_view)
|
||||
} else {
|
||||
stringResource(R.string.app_profile_template_edit)
|
||||
},
|
||||
readOnly = readOnly,
|
||||
summary = titleSummary,
|
||||
onBack = { navigator.navigateBack(result = !readOnly) },
|
||||
onDelete = {
|
||||
if (deleteAppProfileTemplate(template.id)) {
|
||||
navigator.navigateBack(result = true)
|
||||
}
|
||||
},
|
||||
onSave = {
|
||||
if (saveTemplate(template, isCreation)) {
|
||||
navigator.navigateBack(result = true)
|
||||
} else {
|
||||
Toast.makeText(context, saveTemplateFailed, Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
})
|
||||
},
|
||||
) { innerPadding ->
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.padding(innerPadding)
|
||||
.verticalScroll(rememberScrollState())
|
||||
.pointerInteropFilter {
|
||||
// disable click and ripple if readOnly
|
||||
readOnly
|
||||
}
|
||||
) {
|
||||
if (isCreation) {
|
||||
var errorHint by remember {
|
||||
mutableStateOf("")
|
||||
}
|
||||
val idConflictError = stringResource(id = R.string.app_profile_template_id_exist)
|
||||
val idInvalidError = stringResource(id = R.string.app_profile_template_id_invalid)
|
||||
TextEdit(
|
||||
label = stringResource(id = R.string.app_profile_template_id),
|
||||
text = template.id,
|
||||
errorHint = errorHint,
|
||||
isError = errorHint.isNotEmpty()
|
||||
) { value ->
|
||||
errorHint = if (isTemplateExist(value)) {
|
||||
idConflictError
|
||||
} else if (!isValidTemplateId(value)) {
|
||||
idInvalidError
|
||||
} else {
|
||||
""
|
||||
}
|
||||
template = template.copy(id = value)
|
||||
}
|
||||
}
|
||||
|
||||
TextEdit(
|
||||
label = stringResource(id = R.string.app_profile_template_name),
|
||||
text = template.name
|
||||
) { value ->
|
||||
template.copy(name = value).run {
|
||||
if (autoSave) {
|
||||
if (!saveTemplate(this)) {
|
||||
// failed
|
||||
return@run
|
||||
}
|
||||
}
|
||||
template = this
|
||||
}
|
||||
}
|
||||
TextEdit(
|
||||
label = stringResource(id = R.string.app_profile_template_description),
|
||||
text = template.description
|
||||
) { value ->
|
||||
template.copy(description = value).run {
|
||||
if (autoSave) {
|
||||
if (!saveTemplate(this)) {
|
||||
// failed
|
||||
return@run
|
||||
}
|
||||
}
|
||||
template = this
|
||||
}
|
||||
}
|
||||
|
||||
RootProfileConfig(fixedName = true,
|
||||
profile = toNativeProfile(template),
|
||||
onProfileChange = {
|
||||
template.copy(
|
||||
uid = it.uid,
|
||||
gid = it.gid,
|
||||
groups = it.groups,
|
||||
capabilities = it.capabilities,
|
||||
context = it.context,
|
||||
namespace = it.namespace,
|
||||
rules = it.rules.split("\n")
|
||||
).run {
|
||||
if (autoSave) {
|
||||
if (!saveTemplate(this)) {
|
||||
// failed
|
||||
return@run
|
||||
}
|
||||
}
|
||||
template = this
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun toNativeProfile(templateInfo: TemplateViewModel.TemplateInfo): Natives.Profile {
|
||||
return Natives.Profile().copy(rootTemplate = templateInfo.id,
|
||||
uid = templateInfo.uid,
|
||||
gid = templateInfo.gid,
|
||||
groups = templateInfo.groups,
|
||||
capabilities = templateInfo.capabilities,
|
||||
context = templateInfo.context,
|
||||
namespace = templateInfo.namespace,
|
||||
rules = templateInfo.rules.joinToString("\n").ifBlank { "" })
|
||||
}
|
||||
|
||||
fun isTemplateValid(template: TemplateViewModel.TemplateInfo): Boolean {
|
||||
if (template.id.isBlank()) {
|
||||
return false
|
||||
}
|
||||
|
||||
if (!isValidTemplateId(template.id)) {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
fun saveTemplate(template: TemplateViewModel.TemplateInfo, isCreation: Boolean = false): Boolean {
|
||||
if (!isTemplateValid(template)) {
|
||||
return false
|
||||
}
|
||||
|
||||
if (isCreation && isTemplateExist(template.id)) {
|
||||
return false
|
||||
}
|
||||
|
||||
val json = template.toJSON()
|
||||
json.put("local", true)
|
||||
return setAppProfileTemplate(template.id, json.toString())
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
private fun TopBar(
|
||||
title: String,
|
||||
readOnly: Boolean,
|
||||
summary: String = "",
|
||||
onBack: () -> Unit,
|
||||
onDelete: () -> Unit = {},
|
||||
onSave: () -> Unit = {}
|
||||
) {
|
||||
TopAppBar(title = {
|
||||
Column {
|
||||
Text(title)
|
||||
if (summary.isNotBlank()) {
|
||||
Text(
|
||||
text = summary,
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
)
|
||||
}
|
||||
}
|
||||
}, navigationIcon = {
|
||||
IconButton(
|
||||
onClick = onBack
|
||||
) { Icon(Icons.Filled.ArrowBack, contentDescription = null) }
|
||||
}, actions = {
|
||||
if (readOnly) {
|
||||
return@TopAppBar
|
||||
}
|
||||
IconButton(onClick = onDelete) {
|
||||
Icon(
|
||||
Icons.Filled.DeleteForever,
|
||||
contentDescription = stringResource(id = R.string.app_profile_template_delete)
|
||||
)
|
||||
}
|
||||
IconButton(onClick = onSave) {
|
||||
Icon(
|
||||
imageVector = Icons.Filled.Save,
|
||||
contentDescription = stringResource(id = R.string.app_profile_template_save)
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalComposeUiApi::class)
|
||||
@Composable
|
||||
private fun TextEdit(
|
||||
label: String,
|
||||
text: String,
|
||||
errorHint: String = "",
|
||||
isError: Boolean = false,
|
||||
onValueChange: (String) -> Unit = {}
|
||||
) {
|
||||
ListItem(headlineContent = {
|
||||
val keyboardController = LocalSoftwareKeyboardController.current
|
||||
OutlinedTextField(
|
||||
value = text,
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
label = { Text(label) },
|
||||
suffix =
|
||||
if (errorHint.isNotBlank()) {
|
||||
{
|
||||
Text(
|
||||
text = if (isError) errorHint else "",
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
color = MaterialTheme.colorScheme.error
|
||||
)
|
||||
}
|
||||
} else {
|
||||
null
|
||||
},
|
||||
isError = isError,
|
||||
keyboardOptions = KeyboardOptions(
|
||||
keyboardType = KeyboardType.Ascii, imeAction = ImeAction.Next
|
||||
),
|
||||
keyboardActions = KeyboardActions(onDone = {
|
||||
keyboardController?.hide()
|
||||
}),
|
||||
onValueChange = onValueChange
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
private fun isValidTemplateId(id: String): Boolean {
|
||||
return Regex("""^([A-Za-z]{1}[A-Za-z\d_]*\.)*[A-Za-z][A-Za-z\d_]*$""").matches(id)
|
||||
}
|
||||
|
||||
private fun isTemplateExist(id: String): Boolean {
|
||||
return getAppProfileTemplate(id).isNotBlank()
|
||||
}
|
||||
@@ -91,7 +91,12 @@ fun uninstallModule(id: String): Boolean {
|
||||
return result
|
||||
}
|
||||
|
||||
fun installModule(uri: Uri, onFinish: (Boolean) -> Unit, onStdout: (String) -> Unit, onStderr: (String) -> Unit): Boolean {
|
||||
fun installModule(
|
||||
uri: Uri,
|
||||
onFinish: (Boolean) -> Unit,
|
||||
onStdout: (String) -> Unit,
|
||||
onStderr: (String) -> Unit
|
||||
): Boolean {
|
||||
val resolver = ksuApp.contentResolver
|
||||
with(resolver.openInputStream(uri)) {
|
||||
val file = File(ksuApp.cacheDir, "module.zip")
|
||||
@@ -115,7 +120,8 @@ fun installModule(uri: Uri, onFinish: (Boolean) -> Unit, onStdout: (String) -> U
|
||||
}
|
||||
|
||||
val result =
|
||||
shell.newJob().add("${getKsuDaemonPath()} $cmd").to(stdoutCallback, stderrCallback).exec()
|
||||
shell.newJob().add("${getKsuDaemonPath()} $cmd").to(stdoutCallback, stderrCallback)
|
||||
.exec()
|
||||
Log.i("KernelSU", "install module $uri result: $result")
|
||||
|
||||
file.delete()
|
||||
@@ -153,14 +159,16 @@ fun isSepolicyValid(rules: String?): Boolean {
|
||||
}
|
||||
val shell = getRootShell()
|
||||
val result =
|
||||
shell.newJob().add("${getKsuDaemonPath()} sepolicy check '$rules'").to(ArrayList(), null).exec()
|
||||
shell.newJob().add("${getKsuDaemonPath()} sepolicy check '$rules'").to(ArrayList(), null)
|
||||
.exec()
|
||||
return result.isSuccess
|
||||
}
|
||||
|
||||
fun getSepolicy(pkg: String): String {
|
||||
val shell = getRootShell()
|
||||
val result =
|
||||
shell.newJob().add("${getKsuDaemonPath()} profile get-sepolicy $pkg").to(ArrayList(), null).exec()
|
||||
shell.newJob().add("${getKsuDaemonPath()} profile get-sepolicy $pkg").to(ArrayList(), null)
|
||||
.exec()
|
||||
Log.i(TAG, "code: ${result.code}, out: ${result.out}, err: ${result.err}")
|
||||
return result.out.joinToString("\n")
|
||||
}
|
||||
@@ -168,11 +176,39 @@ fun getSepolicy(pkg: String): String {
|
||||
fun setSepolicy(pkg: String, rules: String): Boolean {
|
||||
val shell = getRootShell()
|
||||
val result =
|
||||
shell.newJob().add("${getKsuDaemonPath()} profile set-sepolicy $pkg '$rules'").to(ArrayList(), null).exec()
|
||||
shell.newJob().add("${getKsuDaemonPath()} profile set-sepolicy $pkg '$rules'")
|
||||
.to(ArrayList(), null).exec()
|
||||
Log.i(TAG, "set sepolicy result: ${result.code}")
|
||||
return result.isSuccess
|
||||
}
|
||||
|
||||
fun listAppProfileTemplates(): List<String> {
|
||||
val shell = getRootShell()
|
||||
return shell.newJob().add("${getKsuDaemonPath()} profile list-templates").to(ArrayList(), null)
|
||||
.exec().out
|
||||
}
|
||||
|
||||
fun getAppProfileTemplate(id: String): String {
|
||||
val shell = getRootShell()
|
||||
return shell.newJob().add("${getKsuDaemonPath()} profile get-template '${id}'")
|
||||
.to(ArrayList(), null)
|
||||
.exec().out.joinToString("\n")
|
||||
}
|
||||
|
||||
fun setAppProfileTemplate(id: String, template: String): Boolean {
|
||||
val shell = getRootShell()
|
||||
return shell.newJob().add("${getKsuDaemonPath()} profile set-template '${id}' '${template}'")
|
||||
.to(ArrayList(), null)
|
||||
.exec().isSuccess
|
||||
}
|
||||
|
||||
fun deleteAppProfileTemplate(id: String): Boolean {
|
||||
val shell = getRootShell()
|
||||
return shell.newJob().add("${getKsuDaemonPath()} profile delete-template '${id}'")
|
||||
.to(ArrayList(), null)
|
||||
.exec().isSuccess
|
||||
}
|
||||
|
||||
fun forceStopApp(packageName: String) {
|
||||
val shell = getRootShell()
|
||||
val result = shell.newJob().add("am force-stop $packageName").exec()
|
||||
@@ -182,7 +218,8 @@ fun forceStopApp(packageName: String) {
|
||||
fun launchApp(packageName: String) {
|
||||
|
||||
val shell = getRootShell()
|
||||
val result = shell.newJob().add("monkey -p $packageName -c android.intent.category.LAUNCHER 1").exec()
|
||||
val result =
|
||||
shell.newJob().add("monkey -p $packageName -c android.intent.category.LAUNCHER 1").exec()
|
||||
Log.i(TAG, "launch $packageName result: $result")
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,9 @@ fun getBugreportFile(context: Context): File {
|
||||
val appListFile = File(bugreportDir, "packages.txt")
|
||||
val propFile = File(bugreportDir, "props.txt")
|
||||
val allowListFile = File(bugreportDir, "allowlist.bin")
|
||||
val procModules = File(bugreportDir, "proc_modules.txt")
|
||||
val bootConfig = File(bugreportDir, "boot_config.txt")
|
||||
val kernelConfig = File(bugreportDir, "defconfig.gz")
|
||||
|
||||
val shell = getRootShell()
|
||||
|
||||
@@ -47,8 +50,11 @@ fun getBugreportFile(context: Context): File {
|
||||
shell.newJob().add("cp /data/system/packages.list ${appListFile.absolutePath}").exec()
|
||||
shell.newJob().add("getprop > ${propFile.absolutePath}").exec()
|
||||
shell.newJob().add("cp /data/adb/ksu/.allowlist ${allowListFile.absolutePath}").exec()
|
||||
shell.newJob().add("cp /proc/modules ${procModules.absolutePath}").exec()
|
||||
shell.newJob().add("cp /proc/bootconfig ${bootConfig.absolutePath}").exec()
|
||||
shell.newJob().add("cp /proc/config.gz ${kernelConfig.absolutePath}").exec()
|
||||
|
||||
val selinux = ShellUtils.fastCmd(shell, "getenforce");
|
||||
val selinux = ShellUtils.fastCmd(shell, "getenforce")
|
||||
|
||||
// basic information
|
||||
val buildInfo = File(bugreportDir, "basic.txt")
|
||||
|
||||
@@ -0,0 +1,314 @@
|
||||
package me.weishu.kernelsu.ui.viewmodel
|
||||
|
||||
import android.os.Parcelable
|
||||
import android.util.Log
|
||||
import androidx.compose.runtime.derivedStateOf
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.lifecycle.ViewModel
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.withContext
|
||||
import kotlinx.parcelize.Parcelize
|
||||
import me.weishu.kernelsu.Natives
|
||||
import me.weishu.kernelsu.profile.Capabilities
|
||||
import me.weishu.kernelsu.profile.Groups
|
||||
import me.weishu.kernelsu.ui.util.getAppProfileTemplate
|
||||
import me.weishu.kernelsu.ui.util.listAppProfileTemplates
|
||||
import me.weishu.kernelsu.ui.util.setAppProfileTemplate
|
||||
import okhttp3.OkHttpClient
|
||||
import okhttp3.Request
|
||||
import org.json.JSONArray
|
||||
import org.json.JSONObject
|
||||
import java.text.Collator
|
||||
import java.util.Locale
|
||||
|
||||
/**
|
||||
* @author weishu
|
||||
* @date 2023/10/20.
|
||||
*/
|
||||
const val TEMPLATE_INDEX_URL = "https://kernelsu.org/templates/index.json"
|
||||
const val TEMPLATE_URL = "https://kernelsu.org/templates/%s"
|
||||
|
||||
const val TAG = "TemplateViewModel"
|
||||
|
||||
class TemplateViewModel : ViewModel() {
|
||||
companion object {
|
||||
|
||||
private var templates by mutableStateOf<List<TemplateInfo>>(emptyList())
|
||||
}
|
||||
|
||||
@Parcelize
|
||||
data class TemplateInfo(
|
||||
val id: String = "",
|
||||
val name: String = "",
|
||||
val description: String = "",
|
||||
val author: String = "",
|
||||
val local: Boolean = true,
|
||||
|
||||
val namespace: Int = Natives.Profile.Namespace.INHERITED.ordinal,
|
||||
val uid: Int = Natives.ROOT_UID,
|
||||
val gid: Int = Natives.ROOT_GID,
|
||||
val groups: List<Int> = mutableListOf(),
|
||||
val capabilities: List<Int> = mutableListOf(),
|
||||
val context: String = Natives.KERNEL_SU_DOMAIN,
|
||||
val rules: List<String> = mutableListOf(),
|
||||
) : Parcelable
|
||||
|
||||
var isRefreshing by mutableStateOf(false)
|
||||
private set
|
||||
|
||||
val templateList by derivedStateOf {
|
||||
val comparator = compareBy(TemplateInfo::local).reversed().then(
|
||||
compareBy(
|
||||
Collator.getInstance(Locale.getDefault()), TemplateInfo::id
|
||||
)
|
||||
)
|
||||
templates.sortedWith(comparator).apply {
|
||||
isRefreshing = false
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun fetchTemplates(sync: Boolean = false) {
|
||||
isRefreshing = true
|
||||
withContext(Dispatchers.IO) {
|
||||
val localTemplateIds = listAppProfileTemplates()
|
||||
Log.i(TAG, "localTemplateIds: $localTemplateIds")
|
||||
if (localTemplateIds.isEmpty() || sync) {
|
||||
// if no templates, fetch remote templates
|
||||
fetchRemoteTemplates()
|
||||
}
|
||||
|
||||
// fetch templates again
|
||||
templates = listAppProfileTemplates().mapNotNull(::getTemplateInfoById)
|
||||
|
||||
isRefreshing = false
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun importTemplates(
|
||||
templates: String,
|
||||
onSuccess: suspend () -> Unit,
|
||||
onFailure: suspend (String) -> Unit
|
||||
) {
|
||||
withContext(Dispatchers.IO) {
|
||||
runCatching {
|
||||
JSONArray(templates)
|
||||
}.getOrElse {
|
||||
runCatching {
|
||||
val json = JSONObject(templates)
|
||||
JSONArray().apply { put(json) }
|
||||
}.getOrElse {
|
||||
onFailure("invalid templates: $templates")
|
||||
return@withContext
|
||||
}
|
||||
}.let {
|
||||
0.until(it.length()).forEach { i ->
|
||||
runCatching {
|
||||
val template = it.getJSONObject(i)
|
||||
val id = template.getString("id")
|
||||
template.put("local", true)
|
||||
setAppProfileTemplate(id, template.toString())
|
||||
}.onFailure { e ->
|
||||
Log.e(TAG, "ignore invalid template: $it", e)
|
||||
}
|
||||
}
|
||||
onSuccess()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun exportTemplates(onTemplateEmpty: () -> Unit, callback: (String) -> Unit) {
|
||||
withContext(Dispatchers.IO) {
|
||||
val templates = listAppProfileTemplates().mapNotNull(::getTemplateInfoById).filter {
|
||||
it.local
|
||||
}
|
||||
templates.ifEmpty {
|
||||
onTemplateEmpty()
|
||||
return@withContext
|
||||
}
|
||||
JSONArray(templates.map {
|
||||
it.toJSON()
|
||||
}).toString().let(callback)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun fetchRemoteTemplates() {
|
||||
runCatching {
|
||||
OkHttpClient().newCall(
|
||||
Request.Builder().url(TEMPLATE_INDEX_URL).build()
|
||||
).execute().use { response ->
|
||||
if (!response.isSuccessful) {
|
||||
return
|
||||
}
|
||||
val remoteTemplateIds = JSONArray(response.body!!.string())
|
||||
Log.i(TAG, "fetchRemoteTemplates: $remoteTemplateIds")
|
||||
0.until(remoteTemplateIds.length()).forEach { i ->
|
||||
val id = remoteTemplateIds.getString(i)
|
||||
val templateJson = OkHttpClient().newCall(
|
||||
Request.Builder().url(TEMPLATE_URL.format(id)).build()
|
||||
).runCatching {
|
||||
execute().use { response ->
|
||||
if (!response.isSuccessful) {
|
||||
return@forEach
|
||||
}
|
||||
response.body!!.string()
|
||||
}
|
||||
}.getOrNull() ?: return@forEach
|
||||
Log.i(TAG, "template: $templateJson")
|
||||
|
||||
// validate remote template
|
||||
runCatching {
|
||||
val json = JSONObject(templateJson)
|
||||
fromJSON(json)?.let {
|
||||
// force local template
|
||||
json.put("local", false)
|
||||
setAppProfileTemplate(id, json.toString())
|
||||
}
|
||||
}.onFailure {
|
||||
Log.e(TAG, "ignore invalid template: $it", it)
|
||||
return@forEach
|
||||
}
|
||||
}
|
||||
}
|
||||
}.onFailure { Log.e(TAG, "fetchRemoteTemplates: $it", it) }
|
||||
}
|
||||
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
private fun <T, R> JSONArray.mapCatching(
|
||||
transform: (T) -> R, onFail: (Throwable) -> Unit
|
||||
): List<R> {
|
||||
return List(length()) { i -> get(i) as T }.mapNotNull { element ->
|
||||
runCatching {
|
||||
transform(element)
|
||||
}.onFailure(onFail).getOrNull()
|
||||
}
|
||||
}
|
||||
|
||||
private inline fun <reified T : Enum<T>> getEnumOrdinals(
|
||||
jsonArray: JSONArray?, enumClass: Class<T>
|
||||
): List<T> {
|
||||
return jsonArray?.mapCatching<String, T>({ name ->
|
||||
enumValueOf(name.uppercase())
|
||||
}, {
|
||||
Log.e(TAG, "ignore invalid enum ${enumClass.simpleName}: $it", it)
|
||||
}).orEmpty()
|
||||
}
|
||||
|
||||
fun getTemplateInfoById(id: String): TemplateViewModel.TemplateInfo? {
|
||||
return runCatching {
|
||||
fromJSON(JSONObject(getAppProfileTemplate(id)))
|
||||
}.onFailure {
|
||||
Log.e(TAG, "ignore invalid template: $it", it)
|
||||
}.getOrNull()
|
||||
}
|
||||
|
||||
private fun getLocaleString(json: JSONObject, key: String): String {
|
||||
val fallback = json.getString(key)
|
||||
val locale = Locale.getDefault()
|
||||
val localeKey = "${locale.language}_${locale.country}"
|
||||
json.optJSONObject("locales")?.let {
|
||||
it.optJSONObject(localeKey)?.let { json->
|
||||
return json.optString(key, fallback)
|
||||
}
|
||||
}
|
||||
return fallback
|
||||
}
|
||||
|
||||
private fun fromJSON(templateJson: JSONObject): TemplateViewModel.TemplateInfo? {
|
||||
return runCatching {
|
||||
val groupsJsonArray = templateJson.optJSONArray("groups")
|
||||
val capabilitiesJsonArray = templateJson.optJSONArray("capabilities")
|
||||
val context = templateJson.optString("context").takeIf { it.isNotEmpty() }
|
||||
?: Natives.KERNEL_SU_DOMAIN;
|
||||
val namespace = templateJson.optString("namespace").takeIf { it.isNotEmpty() }
|
||||
?: Natives.Profile.Namespace.INHERITED.name
|
||||
|
||||
val rulesJsonArray = templateJson.optJSONArray("rules")
|
||||
val templateInfo = TemplateViewModel.TemplateInfo(
|
||||
id = templateJson.getString("id"),
|
||||
name = getLocaleString(templateJson, "name"),
|
||||
description = getLocaleString(templateJson, "description"),
|
||||
author = templateJson.optString("author"),
|
||||
local = templateJson.optBoolean("local"),
|
||||
namespace = Natives.Profile.Namespace.valueOf(
|
||||
namespace.uppercase()
|
||||
).ordinal,
|
||||
uid = templateJson.optInt("uid", Natives.ROOT_UID),
|
||||
gid = templateJson.optInt("gid", Natives.ROOT_GID),
|
||||
groups = getEnumOrdinals(groupsJsonArray, Groups::class.java).map { it.gid },
|
||||
capabilities = getEnumOrdinals(
|
||||
capabilitiesJsonArray, Capabilities::class.java
|
||||
).map { it.cap },
|
||||
context = context,
|
||||
rules = rulesJsonArray?.mapCatching<String, String>({ it }, {
|
||||
Log.e(TAG, "ignore invalid rule: $it", it)
|
||||
}).orEmpty()
|
||||
)
|
||||
templateInfo
|
||||
}.onFailure {
|
||||
Log.e(TAG, "ignore invalid template: $it", it)
|
||||
}.getOrNull()
|
||||
}
|
||||
|
||||
fun TemplateViewModel.TemplateInfo.toJSON(): JSONObject {
|
||||
val template = this
|
||||
return JSONObject().apply {
|
||||
|
||||
put("id", template.id)
|
||||
put("name", template.name.ifBlank { template.id })
|
||||
put("description", template.description.ifBlank { template.id })
|
||||
if (template.author.isNotEmpty()) {
|
||||
put("author", template.author)
|
||||
}
|
||||
put("namespace", Natives.Profile.Namespace.values()[template.namespace].name)
|
||||
put("uid", template.uid)
|
||||
put("gid", template.gid)
|
||||
|
||||
if (template.groups.isNotEmpty()) {
|
||||
put("groups", JSONArray(
|
||||
Groups.values().filter {
|
||||
template.groups.contains(it.gid)
|
||||
}.map {
|
||||
it.name
|
||||
}
|
||||
))
|
||||
}
|
||||
|
||||
if (template.capabilities.isNotEmpty()) {
|
||||
put("capabilities", JSONArray(
|
||||
Capabilities.values().filter {
|
||||
template.capabilities.contains(it.cap)
|
||||
}.map {
|
||||
it.name
|
||||
}
|
||||
))
|
||||
}
|
||||
|
||||
if (template.context.isNotEmpty()) {
|
||||
put("context", template.context)
|
||||
}
|
||||
|
||||
if (template.rules.isNotEmpty()) {
|
||||
put("rules", JSONArray(template.rules))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Suppress("unused")
|
||||
fun generateTemplates() {
|
||||
val templateJson = JSONObject()
|
||||
templateJson.put("id", "com.example")
|
||||
templateJson.put("name", "Example")
|
||||
templateJson.put("description", "This is an example template")
|
||||
templateJson.put("local", true)
|
||||
templateJson.put("namespace", Natives.Profile.Namespace.INHERITED.name)
|
||||
templateJson.put("uid", 0)
|
||||
templateJson.put("gid", 0)
|
||||
|
||||
templateJson.put("groups", JSONArray().apply { put(Groups.INET.name) })
|
||||
templateJson.put("capabilities", JSONArray().apply { put(Capabilities.CAP_NET_RAW.name) })
|
||||
templateJson.put("context", "u:r:su:s0")
|
||||
Log.i(TAG, "$templateJson")
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
<string name="home_click_to_install">إضغط للتثبيت</string>
|
||||
<string name="home_working">يعمل</string>
|
||||
<string name="home_working_version">الإصدار: %d</string>
|
||||
<string name="home_superuser_count">المستخدمين الخارقين: %d</string>
|
||||
<string name="home_superuser_count">مستخدمين الجذر: %d</string>
|
||||
<string name="home_module_count">الوحدات: %d</string>
|
||||
<string name="home_unsupported">غير مدعوم</string>
|
||||
<string name="home_unsupported_reason">KernelSU يدعم GKI kernels فقط</string>
|
||||
@@ -20,7 +20,7 @@
|
||||
<string name="superuser">مستخدم خارق</string>
|
||||
<string name="module_failed_to_enable">فشل في تمكين الوحدة: %s</string>
|
||||
<string name="module_failed_to_disable">فشل تعطيل الوحدة : %s</string>
|
||||
<string name="module_empty">لا توجد وحدة مثبتة</string>
|
||||
<string name="module_empty">لا توجد وحدات مثبتة</string>
|
||||
<string name="module">الوحدات</string>
|
||||
<string name="uninstall">إلغاء التثبيت</string>
|
||||
<string name="module_install">تثبيت الوحدة</string>
|
||||
@@ -34,7 +34,7 @@
|
||||
<string name="reboot_edl">إعادة تشغيل إلى وضع EDL</string>
|
||||
<string name="about">من نحن</string>
|
||||
<string name="module_uninstall_confirm">هل أنت متأكد أنك تريد إلغاء تثبيت الوحدة %s ?</string>
|
||||
<string name="module_uninstall_success">تم إلغاء التثبيت %s</string>
|
||||
<string name="module_uninstall_success">تم إلغاء تثبيتها %s</string>
|
||||
<string name="module_uninstall_failed">فشل إلغاء التثبيت: %s</string>
|
||||
<string name="module_version">الإصدار</string>
|
||||
<string name="module_author">المطور</string>
|
||||
@@ -80,4 +80,26 @@
|
||||
<string name="profile_name">اسم الملف الشخصي</string>
|
||||
<string name="require_kernel_version">إصدار KernelSU الحالي %d منخفض جدًا بحيث لا يعمل المدير بشكل صحيح. الرجاء الترقية إلى الإصدار %d أو أعلى!</string>
|
||||
<string name="module_changelog">سجل التغييرات</string>
|
||||
<string name="app_profile_template_import_success">تم الاستيراد بنجاح</string>
|
||||
<string name="app_profile_export_to_clipboard">تصدير إلى الحافظة</string>
|
||||
<string name="app_profile_template_export_empty">لا يمكن العثور على القالب المحلي للتصدير!</string>
|
||||
<string name="app_profile_template_id_exist">معرف القالب موجود بالفعل!</string>
|
||||
<string name="app_profile_import_from_clipboard">استيراد من الحافظة</string>
|
||||
<string name="module_changelog_failed">فشل في جلب سجل التغيير: %s</string>
|
||||
<string name="app_profile_template_name">الاسم</string>
|
||||
<string name="app_profile_template_id_invalid">معرف القالب غير صالح</string>
|
||||
<string name="app_profile_template_sync">مزامنة القوالب عبر الإنترنت</string>
|
||||
<string name="app_profile_template_create">إنشاء قالب</string>
|
||||
<string name="app_profile_template_readonly">للقراءة فقط</string>
|
||||
<string name="app_profile_import_export">استيراد / تصدير</string>
|
||||
<string name="app_profile_template_save_failed">فشل في حفظ القالب</string>
|
||||
<string name="app_profile_template_edit">تحرير القالب</string>
|
||||
<string name="app_profile_template_id">المعرف</string>
|
||||
<string name="settings_profile_template">قالب ملف تعريف التطبيق</string>
|
||||
<string name="app_profile_template_description">الوصف</string>
|
||||
<string name="app_profile_template_save">حفظ</string>
|
||||
<string name="settings_profile_template_summary">إدارة القالب المحلي وعبر الإنترنت لملف تعريف التطبيق</string>
|
||||
<string name="app_profile_template_delete">حذف</string>
|
||||
<string name="app_profile_template_import_empty">الحافظة فارغة!</string>
|
||||
<string name="app_profile_template_view">عرض القالب</string>
|
||||
</resources>
|
||||
@@ -31,7 +31,7 @@
|
||||
<string name="selinux_status_permissive">পারমিসিভ</string>
|
||||
<string name="module_failed_to_disable">মোডিউল ডিসেবল করা যায়নি: %s</string>
|
||||
<string name="module_empty">কোনো মোডিউল ইন্সটল করা নেই</string>
|
||||
<string name="home_working_version">ভারসন: %d</string>
|
||||
<string name="home_working_version">সংস্করণ: %d</string>
|
||||
<string name="home_superuser_count">সুপার ইউজার: %d</string>
|
||||
<string name="profile_namespace">নেইম স্পেস মাউন্ট</string>
|
||||
<string name="profile_namespace_inherited">ইনহেরিটেড</string>
|
||||
|
||||
@@ -8,15 +8,15 @@
|
||||
<string name="home_superuser_count">সুপার ইউজার: %d</string>
|
||||
<string name="home_module_count">মডিউল: %d</string>
|
||||
<string name="home_unsupported">অসমর্থিত</string>
|
||||
<string name="home_unsupported_reason">কার্নেলএসইউ শুধুমাত্র জিকেআই কার্নেল সমর্থন করে</string>
|
||||
<string name="home_unsupported_reason">KernelSU শুধুমাত্র GKI কার্নেল সমর্থন করে</string>
|
||||
<string name="home_kernel">কার্নেল</string>
|
||||
<string name="home_manager_version">ম্যানেজার সংস্করণ</string>
|
||||
<string name="home_fingerprint">ফিঙ্গারপ্রিন্ট</string>
|
||||
<string name="home_selinux_status">সেলিনাক্স স্ট্যাটাস</string>
|
||||
<string name="home_selinux_status">SELinux স্টেটাস</string>
|
||||
<string name="selinux_status_disabled">ডিজেবল</string>
|
||||
<string name="selinux_status_enforcing">এনফোর্সিং</string>
|
||||
<string name="selinux_status_enforcing">কার্যকর</string>
|
||||
<string name="selinux_status_permissive">অনুমতিমূলক</string>
|
||||
<string name="selinux_status_unknown">অপরিচিত</string>
|
||||
<string name="selinux_status_unknown">অজানা</string>
|
||||
<string name="superuser">সুপার ইউজার</string>
|
||||
<string name="module_failed_to_enable">মডিউল সক্ষম করতে ব্যর্থ হয়েছে: %s</string>
|
||||
<string name="module_failed_to_disable">মডিউল নিষ্ক্রিয় করতে ব্যর্থ হয়েছে: %s</string>
|
||||
@@ -63,4 +63,5 @@
|
||||
<string name="profile_namespace_global">গ্লোবাল</string>
|
||||
<string name="profile_namespace_individual">আলাদাভাবে</string>
|
||||
<string name="profile_umount_modules">আনমাউন্ট মোডিউল</string>
|
||||
<string name="require_kernel_version">ম্যানেজার সঠিকভাবে কাজ করার জন্য বর্তমান KernelSU সংস্করণ %d খুবই কম। অনুগ্রহ করে %d বা উচ্চতর সংস্করণে আপগ্রেড করুন!</string>
|
||||
</resources>
|
||||
@@ -5,7 +5,7 @@
|
||||
<string name="selinux_status_permissive">Permissiv</string>
|
||||
<string name="home_working">Funktioniert</string>
|
||||
<string name="home_working_version">Version: %d</string>
|
||||
<string name="superuser">Superuser</string>
|
||||
<string name="superuser">SuperUser</string>
|
||||
<string name="home_click_to_install">Tippen zum Installieren</string>
|
||||
<string name="home_superuser_count">Superuser: %d</string>
|
||||
<string name="selinux_status_unknown">Unbekannt</string>
|
||||
@@ -47,7 +47,7 @@
|
||||
<string name="selinux_status_disabled">Deaktiviert</string>
|
||||
<string name="module_failed_to_enable">Modulaktivierung fehlgeschlagen: %s</string>
|
||||
<string name="module_failed_to_disable">Moduldeaktivierung fehlgeschlagen: %s</string>
|
||||
<string name="module_empty">Kein Modul installiert</string>
|
||||
<string name="module_empty">Keine Module installiert</string>
|
||||
<string name="module">Modul</string>
|
||||
<string name="uninstall">Deinstallieren</string>
|
||||
<string name="install">Installieren</string>
|
||||
@@ -80,4 +80,26 @@
|
||||
<string name="module_uninstall_failed">Deinstallation fehlgeschlagen: %s</string>
|
||||
<string name="require_kernel_version">Die aktuelle Kernel-Version %d ist zu alt für diese Manager-Version. Bitte auf Version %d oder höher upgraden!</string>
|
||||
<string name="module_changelog">Änderungsprotokoll</string>
|
||||
<string name="app_profile_template_import_success">erfolgreich importiert!</string>
|
||||
<string name="app_profile_export_to_clipboard">in Zwischenablage exportieren</string>
|
||||
<string name="app_profile_template_export_empty">Kann lokale Vorlage nicht finden!</string>
|
||||
<string name="app_profile_template_id_exist">Vorlagen ID existiert bereits!</string>
|
||||
<string name="app_profile_import_from_clipboard">aus Zwischenablage importieren</string>
|
||||
<string name="module_changelog_failed">Konnte Changelog nicht laden: %s</string>
|
||||
<string name="app_profile_template_name">Name</string>
|
||||
<string name="app_profile_template_id_invalid">ungültige Vorlagen id</string>
|
||||
<string name="app_profile_template_sync">Online Vorlagen synchronisieren</string>
|
||||
<string name="app_profile_template_create">Erstelle Vorlage</string>
|
||||
<string name="app_profile_template_readonly">Nur-Lesen</string>
|
||||
<string name="app_profile_import_export">Import/Export</string>
|
||||
<string name="app_profile_template_save_failed">Fehler beim speichern</string>
|
||||
<string name="app_profile_template_edit">Bearbeite Vorlage</string>
|
||||
<string name="app_profile_template_id">id</string>
|
||||
<string name="settings_profile_template">App Profil Template</string>
|
||||
<string name="app_profile_template_description">Beschreibung</string>
|
||||
<string name="app_profile_template_save">Speichern</string>
|
||||
<string name="settings_profile_template_summary">verwalte lokale und online Profil Vorlagen</string>
|
||||
<string name="app_profile_template_delete">Löschen</string>
|
||||
<string name="app_profile_template_import_empty">Zwischenablage ist leer!</string>
|
||||
<string name="app_profile_template_view">Vorlage ansehen</string>
|
||||
</resources>
|
||||
@@ -2,22 +2,22 @@
|
||||
<resources>
|
||||
<string name="home">Inicio</string>
|
||||
<string name="home_not_installed">No instalado</string>
|
||||
<string name="home_click_to_install">Haga clic para instalar</string>
|
||||
<string name="home_working">Activo</string>
|
||||
<string name="home_click_to_install">Toca para instalar</string>
|
||||
<string name="home_working">Funcionando</string>
|
||||
<string name="home_working_version">Versión: %d</string>
|
||||
<string name="home_superuser_count">Superusuarios: %d</string>
|
||||
<string name="home_module_count">Módulos: %d</string>
|
||||
<string name="home_unsupported">No soportado</string>
|
||||
<string name="home_unsupported_reason">Por el momento, KernelSU solo es compatible con kernels genéricos (GKIs)</string>
|
||||
<string name="home_kernel">Versión del kernel</string>
|
||||
<string name="home_manager_version">Versión del manager</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>
|
||||
<!-- It may be better to leave SELinux statuses untranslated -->
|
||||
<string name="selinux_status_disabled">Disabled</string>
|
||||
<string name="selinux_status_enforcing">Enforcing</string>
|
||||
<string name="selinux_status_permissive">Permissive</string>
|
||||
<string name="selinux_status_unknown">Unknown</string>
|
||||
<string name="selinux_status_disabled">Desactivado</string>
|
||||
<string name="selinux_status_enforcing">Enforcing de SELinux</string>
|
||||
<string name="selinux_status_permissive">Permisivo</string>
|
||||
<string name="selinux_status_unknown">Desconocido</string>
|
||||
<string name="superuser">Superusuario</string>
|
||||
<string name="module_failed_to_enable">No se pudo habilitar el módulo \"%s\"</string>
|
||||
<string name="module_failed_to_disable">No se pudo deshabilitar el módulo \"%s\"</string>
|
||||
@@ -28,36 +28,36 @@
|
||||
<string name="install">Instalar</string>
|
||||
<string name="reboot">Reiniciar</string>
|
||||
<string name="settings">Ajustes</string>
|
||||
<string name="reboot_userspace">Reinicio suave</string>
|
||||
<string name="reboot_recovery">Reiniciar en modo recovery</string>
|
||||
<string name="reboot_bootloader">Reiniciar en modo bootloader</string>
|
||||
<string name="reboot_download">Reiniciar en modo download</string>
|
||||
<string name="reboot_userspace">Reinicio minimo</string>
|
||||
<string name="reboot_recovery">Reiniciar en modo de recuperación</string>
|
||||
<string name="reboot_bootloader">Reiniciar en modo de arranque</string>
|
||||
<string name="reboot_download">Reiniciar en modo Download</string>
|
||||
<string name="reboot_edl">Reiniciar en modo EDL</string>
|
||||
<string name="about">Acerca de</string>
|
||||
<string name="module_uninstall_confirm">¿Estás seguro de que quieres desinstalar el módulo \"%s\"?</string>
|
||||
<string name="module_uninstall_success">\"%s\" desinstalado</string>
|
||||
<string name="module_uninstall_success">\"%s\" esta desinstalado</string>
|
||||
<string name="module_uninstall_failed">No se pudo desinstalar \"%s\"</string>
|
||||
<string name="module_version">Versión</string>
|
||||
<string name="module_author">Autor</string>
|
||||
<string name="module_overlay_fs_not_available">El módulo no puede funcionar ya que OverlayFS no está disponible!</string>
|
||||
<string name="refresh">Recargar</string>
|
||||
<string name="show_system_apps">Mostrar apps del sistema</string>
|
||||
<string name="hide_system_apps">Ocultar apps del sistema</string>
|
||||
<string name="send_log">Enviar registro</string>
|
||||
<string name="show_system_apps">Mostrar applicaciones del sistema</string>
|
||||
<string name="hide_system_apps">Ocultar applicaciones del sistema</string>
|
||||
<string name="send_log">Enviar registro de informe</string>
|
||||
<string name="safe_mode">Modo seguro</string>
|
||||
<string name="reboot_to_apply">Reiniciar para aplicar cambios</string>
|
||||
<string name="module_magisk_conflict">Se deshabilitaron los módulos ya que entran en conflicto con Magisk!</string>
|
||||
<string name="home_learn_kernelsu">Descubre KernelSU</string>
|
||||
<string name="reboot_to_apply">Reinicia para aplicar cambios</string>
|
||||
<string name="module_magisk_conflict">Se deshabilitaron los módulos ya que entran en conflicto con los de Magisk!</string>
|
||||
<string name="home_learn_kernelsu">Aprende KernelSU</string>
|
||||
<string name="home_learn_kernelsu_url">https://kernelsu.org/guide/what-is-kernelsu.html</string>
|
||||
<string name="home_click_to_learn_kernelsu">Descubre cómo instalar KernelSU y utilizar módulos</string>
|
||||
<string name="home_support_title">Apóyanos</string>
|
||||
<string name="home_support_content">KernelSU es y siempre será, libre y de código abierto. De todas formas, puedes mostrarnos tu apoyo mediante una donación.</string>
|
||||
<string name="about_source_code"><![CDATA[Ver código fuente en %1$s<br/>Únete a nuestro canal de %2$s]]></string>
|
||||
<string name="about_source_code">Mirar el código en %1$s<br/>Únete a nuestro canal de %2$s</string>
|
||||
<string name="profile_default">Predeterminado</string>
|
||||
<string name="profile_template">Plantilla</string>
|
||||
<string name="profile_custom">Personalizado</string>
|
||||
<string name="profile_name">Nombre de perfil</string>
|
||||
<string name="profile_namespace">Modo de montaje del espacio de nombres</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>
|
||||
@@ -65,20 +65,42 @@
|
||||
<string name="profile_capabilities">Capacidades</string>
|
||||
<string name="profile_selinux_context">Contexto de SELinux</string>
|
||||
<string name="profile_umount_modules">Desmontar módulos</string>
|
||||
<string name="failed_to_update_app_profile">No se pudo actualizar el perfil de la app para %s</string>
|
||||
<string name="failed_to_update_app_profile">No se pudo actualizar el perfil de la applicación para %s</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 \"Desmontar módulos\" en los perfiles de las aplicaciones. Si la habilitas, se desharán todas las modificaciones al sistema hechas por el módulo para las apps que no tengan un perfil establecido.</string>
|
||||
<string name="settings_umount_modules_default_summary">El valor global predeterminado para \"Desmontar módulos\" en los perfiles de las aplicaciones. Si la habilitas, se desharán todas las modificaciones al sistema hechas por el módulo para las applicaciones que no tengan un perfil establecido.</string>
|
||||
<string name="profile_umount_modules_summary">Si habilitas esta opción, KernelSU podrá restaurar cualquier archivo modificado por los módulos para esta app.</string>
|
||||
<string name="profile_selinux_domain">Dominio</string>
|
||||
<string name="profile_selinux_rules">Reglas</string>
|
||||
<string name="module_update">Actualizar</string>
|
||||
<string name="module_downloading">Descargando módulo: \"%s\"</string>
|
||||
<string name="module_start_downloading">Iniciar descarga: %s</string>
|
||||
<string name="new_version_available">Nueva versión: %s está disponible, haga clic para actualizar</string>
|
||||
<string name="launch_app">Lanzar Aplicacion</string>
|
||||
<string name="new_version_available">Nueva versión: %s está disponible, toque para actualizar</string>
|
||||
<string name="launch_app">Abrir Aplicacion</string>
|
||||
<string name="force_stop_app">Forzar cierre de la aplicacion</string>
|
||||
<string name="restart_app">Reiniciar aplicacion</string>
|
||||
<string name="failed_to_update_sepolicy">Falló al actualizar reglas de SEpolicy por: %s</string>
|
||||
<string name="require_kernel_version">La versión actual de KernelSU %d es demasiado baja para que el gestor funcione correctamente. ¡Por favor actualiza a la versión %d o superior!</string>
|
||||
<string name="module_changelog">Registro de cambios</string>
|
||||
<string name="app_profile_template_import_success">Importado con exíto</string>
|
||||
<string name="app_profile_export_to_clipboard">Exportar a portapapeles</string>
|
||||
<string name="app_profile_template_export_empty">No se puede encontrar plantilla local para exportar!</string>
|
||||
<string name="app_profile_template_id_exist">Ya existe un ID de la plantilla!</string>
|
||||
<string name="app_profile_import_from_clipboard">Importar desde portapapeles</string>
|
||||
<string name="module_changelog_failed">Error en obtener los registros de cambios: %s</string>
|
||||
<string name="app_profile_template_name">Nombre</string>
|
||||
<string name="app_profile_template_id_invalid">ID de la plantilla es invalido</string>
|
||||
<string name="app_profile_template_sync">Sincronizar plantillas en linea</string>
|
||||
<string name="app_profile_template_create">Crear plantilla</string>
|
||||
<string name="app_profile_template_readonly">sololectura</string>
|
||||
<string name="app_profile_import_export">Importar/Exportar</string>
|
||||
<string name="app_profile_template_save_failed">Fallo en guardar plantilla</string>
|
||||
<string name="app_profile_template_edit">Editar plantilla</string>
|
||||
<string name="app_profile_template_id">id</string>
|
||||
<string name="settings_profile_template">Plantilla del perfil de la aplicacion</string>
|
||||
<string name="app_profile_template_description">Descripción</string>
|
||||
<string name="app_profile_template_save">Guardar</string>
|
||||
<string name="settings_profile_template_summary">Administrar las plantillas locales y de en linea del perfil de la aplicacion</string>
|
||||
<string name="app_profile_template_delete">Eliminar</string>
|
||||
<string name="app_profile_template_import_empty">El portapapeles esta vacio!</string>
|
||||
<string name="app_profile_template_view">Ver plantilla</string>
|
||||
</resources>
|
||||
@@ -34,7 +34,7 @@
|
||||
<string name="reboot_recovery">Redémarrer en mode récupération</string>
|
||||
<string name="reboot_edl">Redémarrer en mode EDL</string>
|
||||
<string name="about">À propos</string>
|
||||
<string name="module_uninstall_success">%s désinstallé</string>
|
||||
<string name="module_uninstall_success">%s est désinstallé</string>
|
||||
<string name="reboot_download">Redémarrer en mode téléchargement</string>
|
||||
<string name="module_author">Auteur</string>
|
||||
<string name="module_uninstall_confirm">Êtes-vous sûr(e) de vouloir désinstaller le module %s \?</string>
|
||||
@@ -44,7 +44,7 @@
|
||||
<string name="show_system_apps">Afficher les applications système</string>
|
||||
<string name="hide_system_apps">Masquer les applications système</string>
|
||||
<string name="safe_mode">Mode sans échec</string>
|
||||
<string name="send_log">Envoyer les logs</string>
|
||||
<string name="send_log">Rapport de journal</string>
|
||||
<string name="reboot_to_apply">Redémarrez pour appliquer les modifications</string>
|
||||
<string name="module_magisk_conflict">Les modules sont désactivés car ils sont en conflit avec ceux de Magisk !</string>
|
||||
<string name="home_learn_kernelsu_url">https://kernelsu.org/guide/what-is-kernelsu.html</string>
|
||||
@@ -74,10 +74,33 @@
|
||||
<string name="module_update">Mettre à jour</string>
|
||||
<string name="module_downloading">Téléchargement du module : %s</string>
|
||||
<string name="launch_app">Lancer</string>
|
||||
<string name="new_version_available">Nouvelle version : la %s est disponible, appuyez ici pour la télécharger</string>
|
||||
<string name="new_version_available">La version %s est disponible, appuyez ici pour mettre à jour</string>
|
||||
<string name="module_start_downloading">Début du téléchargement de : %s</string>
|
||||
<string name="force_stop_app">Forcer l\'arrêt</string>
|
||||
<string name="restart_app">Relancer l\'application</string>
|
||||
<string name="failed_to_update_sepolicy">Échec de la mise à jour des règles de SELinux pour : %s</string>
|
||||
<string name="require_kernel_version">La version actuelle (%d) de KernelSU est trop ancienne pour que le gestionnaire fonctionne correctement. Veuillez passer à la version %d ou à une version supérieure !</string>
|
||||
<string name="app_profile_template_import_success">Importation réussie</string>
|
||||
<string name="app_profile_export_to_clipboard">Exporter vers le presse-papiers</string>
|
||||
<string name="app_profile_template_export_empty">Impossible de trouver un modèle local à exporter !</string>
|
||||
<string name="app_profile_template_id_exist">L\'id du modèle existe déjà !</string>
|
||||
<string name="module_changelog">Journal des modifications</string>
|
||||
<string name="app_profile_import_from_clipboard">Importer à partir du presse-papiers</string>
|
||||
<string name="module_changelog_failed">Échec de récupération du journal des modifications : %s</string>
|
||||
<string name="app_profile_template_name">Nom</string>
|
||||
<string name="app_profile_template_id_invalid">id de modèle invalide</string>
|
||||
<string name="app_profile_template_sync">Synchroniser les modèles en ligne</string>
|
||||
<string name="app_profile_template_create">Créer un modèle</string>
|
||||
<string name="app_profile_template_readonly">en lecture seule</string>
|
||||
<string name="app_profile_import_export">Importer/exporter</string>
|
||||
<string name="app_profile_template_save_failed">Échec de l\'enregistrement du modèle</string>
|
||||
<string name="app_profile_template_edit">Modifier le modèle</string>
|
||||
<string name="app_profile_template_id">id</string>
|
||||
<string name="settings_profile_template">Modèles de profils d\'application</string>
|
||||
<string name="app_profile_template_description">Description</string>
|
||||
<string name="app_profile_template_save">Enregistrer</string>
|
||||
<string name="settings_profile_template_summary">Gérer les modèles de profils d\'application locaux et en ligne</string>
|
||||
<string name="app_profile_template_delete">Supprimer</string>
|
||||
<string name="app_profile_template_import_empty">Le presse-papiers est vide !</string>
|
||||
<string name="app_profile_template_view">Voir le modèle</string>
|
||||
</resources>
|
||||
@@ -54,7 +54,7 @@
|
||||
<string name="selinux_status_enforcing">Érvényesítés</string>
|
||||
<string name="selinux_status_permissive">Megengedő</string>
|
||||
<string name="selinux_status_unknown">Ismeretlen</string>
|
||||
<string name="superuser">Superuser</string>
|
||||
<string name="superuser">Super user</string>
|
||||
<string name="module_failed_to_enable">Nem sikerült engedélyezni a következő modult: %s</string>
|
||||
<string name="module_failed_to_disable">Nem sikerült letiltani a következő modulokat: %s</string>
|
||||
<string name="module_empty">Nincs modul telepítve</string>
|
||||
@@ -67,16 +67,39 @@
|
||||
<string name="reboot_userspace">Android felület újraindítása</string>
|
||||
<string name="reboot_recovery">Újraindítás recovery-módba</string>
|
||||
<string name="reboot_bootloader">Újraindítás bootloader-módba</string>
|
||||
<string name="module_uninstall_success">%s eltávolítva</string>
|
||||
<string name="module_uninstall_success">%s törölve</string>
|
||||
<string name="module_version">Verzió</string>
|
||||
<string name="send_log">Fejlesztői napló küldése</string>
|
||||
<string name="send_log">Napló küldése</string>
|
||||
<string name="reboot_to_apply">Indítsd újra a készüléket hogy érvényesítsd a változást</string>
|
||||
<string name="home_support_content">A KernelSU ingyenes és nyílt forráskódú és mindig is az lesz. Te viszont meg tudod mutatni azt, hogy törődsz ennek a projektnek a sorsával egy adomány formájában.</string>
|
||||
<string name="profile_namespace_global">Globális</string>
|
||||
<string name="profile_umount_modules">Unmountold a modulokat</string>
|
||||
<string name="failed_to_update_app_profile">Nem sikerült frissíteni az App Profilt ehhez %s</string>
|
||||
<string name="settings_umount_modules_default_summary">A „Modulok csatlakoztatása” globális alapértelmezett értéke az alkalmazásprofilokban. Ha engedélyezve van, eltávolítja a rendszer összes modul-módosítását azoknál az alkalmazásoknál, amelyeknek nincs beállított profilja.</string>
|
||||
<string name="new_version_available">Új verzió: %s elérhető, kattints a letöltéséhez</string>
|
||||
<string name="new_version_available">Új verzió: %s elérhető, kattints a frissítéshez</string>
|
||||
<string name="failed_to_update_sepolicy">Nem sikerült frissíteni a SELinux szabályait a következőhöz: %s</string>
|
||||
<string name="require_kernel_version">A jelenlegi KernelSU verzió %d túlságosan elavult. Kérlek frissíts a %d verzióra vagy újabbra!</string>
|
||||
<string name="app_profile_template_import_success">Sikeresen importálva</string>
|
||||
<string name="app_profile_export_to_clipboard">Exportálás a vágólapból</string>
|
||||
<string name="app_profile_template_export_empty">A helyi sablon nem található az exportáláshoz!</string>
|
||||
<string name="app_profile_template_id_exist">A sablon ID már létezik!</string>
|
||||
<string name="module_changelog">Változások</string>
|
||||
<string name="app_profile_import_from_clipboard">Importálás a vágólapból</string>
|
||||
<string name="module_changelog_failed">A változásnapló lekérése nem sikerült: %s</string>
|
||||
<string name="app_profile_template_name">Név</string>
|
||||
<string name="app_profile_template_id_invalid">Hibás sablon ID</string>
|
||||
<string name="app_profile_template_sync">Online sablonok szinkronizálása</string>
|
||||
<string name="app_profile_template_create">Sablon készítése</string>
|
||||
<string name="app_profile_template_readonly">csak olvasható</string>
|
||||
<string name="app_profile_import_export">Import/Export</string>
|
||||
<string name="app_profile_template_save_failed">A sablon mentése sikertelen</string>
|
||||
<string name="app_profile_template_edit">Sablon szerkesztése</string>
|
||||
<string name="app_profile_template_id">id</string>
|
||||
<string name="settings_profile_template">Alkalmazásprofil sablon</string>
|
||||
<string name="app_profile_template_description">Leírás</string>
|
||||
<string name="app_profile_template_save">Mentés</string>
|
||||
<string name="settings_profile_template_summary">Az alkalmazásprofil helyi és online sablon kezelése</string>
|
||||
<string name="app_profile_template_delete">Törlés</string>
|
||||
<string name="app_profile_template_import_empty">A vágólap üres!</string>
|
||||
<string name="app_profile_template_view">Sablon megnézése</string>
|
||||
</resources>
|
||||
@@ -5,19 +5,19 @@
|
||||
<string name="home_click_to_install">Klik untuk memasang</string>
|
||||
<string name="home_working">Bekerja</string>
|
||||
<string name="home_working_version">Versi: %d</string>
|
||||
<string name="home_superuser_count">Superusers: %d</string>
|
||||
<string name="home_superuser_count">Superuser: %d</string>
|
||||
<string name="home_module_count">Modul: %d</string>
|
||||
<string name="home_unsupported">Tidak didukung</string>
|
||||
<string name="home_unsupported_reason">KernelSU hanya mendukung kernel GKI saat ini</string>
|
||||
<string name="home_unsupported_reason">KernelSU saat ini hanya mendukung kernel GKI</string>
|
||||
<string name="home_kernel">Kernel</string>
|
||||
<string name="home_manager_version">Versi Manager</string>
|
||||
<string name="home_fingerprint">Sidik jari</string>
|
||||
<string name="home_selinux_status">Status SELinux</string>
|
||||
<string name="selinux_status_disabled">Dinonaktifkan</string>
|
||||
<string name="selinux_status_enforcing">Enforcing</string>
|
||||
<string name="selinux_status_permissive">Permasif</string>
|
||||
<string name="selinux_status_permissive">Permissive</string>
|
||||
<string name="selinux_status_unknown">Tidak dikenal</string>
|
||||
<string name="superuser">Superuser</string>
|
||||
<string name="superuser">SuperUser</string>
|
||||
<string name="module_failed_to_enable">Gagal mengaktifkan modul: %s</string>
|
||||
<string name="module_failed_to_disable">Gagal menonaktifkan modul: %s</string>
|
||||
<string name="module_empty">Tidak ada modul yang terpasang</string>
|
||||
@@ -34,7 +34,7 @@
|
||||
<string name="reboot_edl">Mulai ulang ke EDL</string>
|
||||
<string name="about">Tentang</string>
|
||||
<string name="module_uninstall_confirm">Apakah Anda yakin ingin mencopot modul %s?</string>
|
||||
<string name="module_uninstall_success">%s Tercopot</string>
|
||||
<string name="module_uninstall_success">%s Telah dicopot</string>
|
||||
<string name="module_uninstall_failed">Gagal untuk mencopot: %s</string>
|
||||
<string name="module_version">Versi</string>
|
||||
<string name="module_author">Pembuat</string>
|
||||
@@ -42,7 +42,7 @@
|
||||
<string name="refresh">Segarkan</string>
|
||||
<string name="show_system_apps">Tampilkan apl sistem</string>
|
||||
<string name="hide_system_apps">Sembunyikan apl sistem</string>
|
||||
<string name="send_log">Kirim Log</string>
|
||||
<string name="send_log">Laporkan Log</string>
|
||||
<string name="safe_mode">Mode aman</string>
|
||||
<string name="reboot_to_apply">Mulai ulang untuk menerapkan</string>
|
||||
<string name="module_magisk_conflict">Modul dinonaktifkan karena bertentangan dengan Magisk!</string>
|
||||
@@ -81,4 +81,26 @@
|
||||
<string name="failed_to_update_sepolicy">Gagal memperbarui aturan SELinux untuk: %s</string>
|
||||
<string name="require_kernel_version">Versi KernelSU saat ini %d terlalu rendah bagi manajer untuk dapat berfungsi dengan baik. Harap tingkatkan ke versi %d atau yang lebih tinggi!</string>
|
||||
<string name="module_changelog">Catatan Perubahan</string>
|
||||
<string name="app_profile_template_import_success">Berhasil diimpor</string>
|
||||
<string name="app_profile_export_to_clipboard">Expor ke clipboard</string>
|
||||
<string name="app_profile_template_export_empty">Tidak dapat menemukan template lokal untuk di expor!</string>
|
||||
<string name="app_profile_template_id_exist">Id template telah ada sebelumnya!</string>
|
||||
<string name="app_profile_import_from_clipboard">Impor dari clipboard</string>
|
||||
<string name="module_changelog_failed">Gagal mengambil Changelog: %s</string>
|
||||
<string name="app_profile_template_name">Nama</string>
|
||||
<string name="app_profile_template_id_invalid">Id template tidak valid</string>
|
||||
<string name="app_profile_template_sync">Sinkronkan template online</string>
|
||||
<string name="app_profile_template_create">Buat Template</string>
|
||||
<string name="app_profile_import_export">Impor/Expor</string>
|
||||
<string name="app_profile_template_save_failed">Gagal untuk menyimpan template</string>
|
||||
<string name="app_profile_template_edit">Edit Templat</string>
|
||||
<string name="app_profile_template_id">id</string>
|
||||
<string name="settings_profile_template">Template Profil Aplikasi</string>
|
||||
<string name="app_profile_template_description">Deskripsi</string>
|
||||
<string name="app_profile_template_save">Simpan</string>
|
||||
<string name="settings_profile_template_summary">Atur template lokal dan online Profil Aplikasi</string>
|
||||
<string name="app_profile_template_delete">Hapus</string>
|
||||
<string name="app_profile_template_import_empty">Clipboard kosong!</string>
|
||||
<string name="app_profile_template_view">Lihat Template</string>
|
||||
<string name="app_profile_template_readonly">Hanya baca</string>
|
||||
</resources>
|
||||
@@ -39,7 +39,7 @@
|
||||
<string name="module_version">Versione</string>
|
||||
<string name="module_author">Autore</string>
|
||||
<string name="module_overlay_fs_not_available">overlayfs non è disponibile, il modulo non può funzionare!</string>
|
||||
<string name="refresh">Aggiorna</string>
|
||||
<string name="refresh">Ricarica</string>
|
||||
<string name="show_system_apps">Mostra app di sistema</string>
|
||||
<string name="hide_system_apps">Nascondi app di sistema</string>
|
||||
<string name="send_log">Invia log</string>
|
||||
@@ -71,7 +71,7 @@
|
||||
<string name="profile_selinux_rules">Regole</string>
|
||||
<string name="module_downloading">Sto scaricando il modulo: %s</string>
|
||||
<string name="module_start_downloading">Inizia a scaricare:%s</string>
|
||||
<string name="new_version_available">Nuova versione: %s disponibile, tocca per scaricare</string>
|
||||
<string name="new_version_available">Nuova versione: %s disponibile, tocca per aggiornare</string>
|
||||
<string name="force_stop_app">Arresto forzato</string>
|
||||
<string name="restart_app">Riavvia</string>
|
||||
<string name="failed_to_update_sepolicy">Aggiornamento regole SELinux per %s fallito</string>
|
||||
@@ -79,4 +79,5 @@
|
||||
<string name="profile_selinux_domain">Dominio</string>
|
||||
<string name="settings_umount_modules_default_summary">Il valore predefinito per \"Scollega moduli\" in Profili App. Se attivato, rimuoverà tutte le modifiche al sistema da parte dei moduli per le applicazioni che non hanno un profilo impostato.</string>
|
||||
<string name="require_kernel_version">La versione attualmente installata di KernelSU (%d) è troppo vecchia ed il gestore non può funzionare correttamente. Si prega di aggiornare alla versione %d o successiva!</string>
|
||||
<string name="module_changelog">Registro aggiornamenti</string>
|
||||
</resources>
|
||||
@@ -31,10 +31,10 @@
|
||||
<string name="reboot_recovery">リカバリーへ再起動</string>
|
||||
<string name="reboot_bootloader">ブートローダー へ再起動</string>
|
||||
<string name="reboot_download">ダウンロードモードへ再起動</string>
|
||||
<string name="reboot_edl">EDLへ再起動</string>
|
||||
<string name="reboot_edl">EDL へ再起動</string>
|
||||
<string name="about">アプリについて</string>
|
||||
<string name="module_uninstall_confirm">モジュール %s をアンインストールしますか?</string>
|
||||
<string name="module_uninstall_success">%sをアンインストールしました</string>
|
||||
<string name="module_uninstall_confirm">モジュール %s をアンインストールしますか?</string>
|
||||
<string name="module_uninstall_success">%s はアンインストールされました</string>
|
||||
<string name="module_uninstall_failed">アンインストールに失敗: %s</string>
|
||||
<string name="module_version">バージョン</string>
|
||||
<string name="module_author">制作者</string>
|
||||
@@ -45,7 +45,7 @@
|
||||
<string name="send_log">ログを送信</string>
|
||||
<string name="safe_mode">セーフモード</string>
|
||||
<string name="reboot_to_apply">再起動すると有効化されます</string>
|
||||
<string name="module_magisk_conflict">Magisk と競合しているためモジュールは無効になっています!</string>
|
||||
<string name="module_magisk_conflict">Magisk と競合しているためモジュールは無効になっています!</string>
|
||||
<string name="home_learn_kernelsu">KernelSU の詳細</string>
|
||||
<string name="home_learn_kernelsu_url">https://kernelsu.org/ja_JP/guide/what-is-kernelsu.html</string>
|
||||
<string name="home_click_to_learn_kernelsu">KernelSU のインストール方法やモジュールの使い方はこちら</string>
|
||||
@@ -64,12 +64,12 @@
|
||||
<string name="profile_umount_modules">モジュールのアンマウント</string>
|
||||
<string name="profile_groups">グループ</string>
|
||||
<string name="profile_selinux_context">SELinux コンテキスト</string>
|
||||
<string name="failed_to_update_app_profile">%sのアプリのプロファイルの更新をできませでした</string>
|
||||
<string name="failed_to_update_app_profile">%s のアプリのプロファイルの更新をできませでした</string>
|
||||
<string name="profile_selinux_domain">ドメイン</string>
|
||||
<string name="profile_selinux_rules">ルール</string>
|
||||
<string name="new_version_available">新しいバージョン: %s が利用可能です。タップしてダウンロード</string>
|
||||
<string name="module_update">アップデート</string>
|
||||
<string name="module_start_downloading">ダウンロードを開始:%s</string>
|
||||
<string name="module_start_downloading">ダウンロードを開始: %s</string>
|
||||
<string name="launch_app">起動</string>
|
||||
<string name="force_stop_app">強制停止</string>
|
||||
<string name="restart_app">再起動</string>
|
||||
@@ -78,7 +78,29 @@
|
||||
<string name="module_downloading">モジュールをダウンロード中: %s</string>
|
||||
<string name="profile_umount_modules_summary">このオプションを有効にすると、KernelSU はこのアプリのモジュールによって変更されたファイルを復元できるようになります。</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="require_kernel_version">現在の KernelSU バージョン %d はマネージャーが適切に機能するには低すぎます。 バージョン %d 以降にアップグレードしてください!</string>
|
||||
<string name="module_changelog">変更履歴</string>
|
||||
<string name="app_profile_template_import_success">インポート成功</string>
|
||||
<string name="app_profile_export_to_clipboard">クリップボードからエクスポート</string>
|
||||
<string name="app_profile_template_export_empty">エクスポートするローカル テンプレートが見つかりません!</string>
|
||||
<string name="app_profile_template_id_exist">テンプレート id はすでに存在します!</string>
|
||||
<string name="app_profile_import_from_clipboard">クリップボードからインポート</string>
|
||||
<string name="module_changelog_failed">変更ログの取得に失敗しました: %s</string>
|
||||
<string name="app_profile_template_name">名前</string>
|
||||
<string name="app_profile_template_id_invalid">無効なテンプレート id</string>
|
||||
<string name="app_profile_template_sync">オンラインテンプレートの同期</string>
|
||||
<string name="app_profile_template_create">テンプレートの作成</string>
|
||||
<string name="app_profile_template_readonly">読み取り専用</string>
|
||||
<string name="app_profile_import_export">インポート/エクスポート</string>
|
||||
<string name="app_profile_template_save_failed">テンプレートの保存に失敗しました</string>
|
||||
<string name="app_profile_template_edit">テンプレートの編集</string>
|
||||
<string name="app_profile_template_id">id</string>
|
||||
<string name="settings_profile_template">アプリプロファイルのテンプレート</string>
|
||||
<string name="app_profile_template_description">説明</string>
|
||||
<string name="app_profile_template_save">保存</string>
|
||||
<string name="settings_profile_template_summary">アプリプロファイルのローカルおよびオンラインテンプレートを管理する</string>
|
||||
<string name="app_profile_template_delete">消去</string>
|
||||
<string name="app_profile_template_import_empty">クリップボードが空です!</string>
|
||||
<string name="app_profile_template_view">テンプレートを表示</string>
|
||||
</resources>
|
||||
37
manager/app/src/main/res/values-ms/strings.xml
Normal file
37
manager/app/src/main/res/values-ms/strings.xml
Normal file
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="selinux_status_unknown">Tidak Diketahui</string>
|
||||
<string name="selinux_status_disabled">Lumpuhkan</string>
|
||||
<string name="selinux_status_permissive">Permisif</string>
|
||||
<string name="reboot_download">Mulakan semula ke Download</string>
|
||||
<string name="module_failed_to_enable">Modul tidak berjaya Diaktifkan:%s</string>
|
||||
<string name="reboot_edl">Mulakan semula ke EDL</string>
|
||||
<string name="home_superuser_count">Superusers%d</string>
|
||||
<string name="home_module_count">Modul%d</string>
|
||||
<string name="selinux_status_enforcing">Enforcing</string>
|
||||
<string name="home_fingerprint">Cap Jari</string>
|
||||
<string name="reboot_recovery">Mulakan semula ke Recovery</string>
|
||||
<string name="reboot_userspace">Soft reboot</string>
|
||||
<string name="uninstall">Padam</string>
|
||||
<string name="module_install">Pasang</string>
|
||||
<string name="home_click_to_install">Tekan untuk memasang</string>
|
||||
<string name="module">Modul</string>
|
||||
<string name="about">Tentang</string>
|
||||
<string name="home_working_version">Versi%d</string>
|
||||
<string name="reboot">Mulakan semula</string>
|
||||
<string name="home_unsupported_reason">KernelSU ketika ini hanya menyokong kernel GKI</string>
|
||||
<string name="home_selinux_status">Status SELinux</string>
|
||||
<string name="home_unsupported">Tidak Disokong</string>
|
||||
<string name="home">Layar Utama</string>
|
||||
<string name="module_uninstall_confirm">Apakah anda pasti ingin membuang modul %s\?</string>
|
||||
<string name="superuser">SuperUser</string>
|
||||
<string name="settings">Tetapan</string>
|
||||
<string name="home_working">Berjalan</string>
|
||||
<string name="module_failed_to_disable">Gagal mematikan modul:%s</string>
|
||||
<string name="module_empty">Tiada modul dipasang</string>
|
||||
<string name="install">Pasang</string>
|
||||
<string name="home_kernel">Kernel</string>
|
||||
<string name="home_not_installed">Tidak terpasang</string>
|
||||
<string name="reboot_bootloader">Mulakan semula ke bootloader</string>
|
||||
<string name="home_manager_version">Versi Manager</string>
|
||||
</resources>
|
||||
@@ -17,11 +17,11 @@
|
||||
<string name="selinux_status_enforcing">Execução</string>
|
||||
<string name="selinux_status_permissive">Permissivo</string>
|
||||
<string name="selinux_status_unknown">Desconhecido</string>
|
||||
<string name="superuser">Superusuário</string>
|
||||
<string name="superuser">SuperUsuário</string>
|
||||
<string name="module_failed_to_enable">Falha ao ativar o módulo: %s</string>
|
||||
<string name="module_failed_to_disable">Falha ao desativar o módulo: %s</string>
|
||||
<string name="module_empty">Nenhum módulo instalado</string>
|
||||
<string name="module">Módulos</string>
|
||||
<string name="module">Módulo</string>
|
||||
<string name="uninstall">Desinstalar</string>
|
||||
<string name="module_install">Instalar</string>
|
||||
<string name="install">Instalar</string>
|
||||
@@ -34,7 +34,7 @@
|
||||
<string name="reboot_edl">Reiniciar em modo EDL</string>
|
||||
<string name="about">Sobre</string>
|
||||
<string name="module_uninstall_confirm">Tem certeza de que deseja desinstalar o módulo %s?</string>
|
||||
<string name="module_uninstall_success">%s desinstalado</string>
|
||||
<string name="module_uninstall_success">%s foi desinstalado</string>
|
||||
<string name="module_uninstall_failed">Falha ao desinstalar: %s</string>
|
||||
<string name="module_version">Versão</string>
|
||||
<string name="module_author">Autor</string>
|
||||
@@ -42,13 +42,13 @@
|
||||
<string name="refresh">Atualizar</string>
|
||||
<string name="show_system_apps">Mostrar apps do sistema</string>
|
||||
<string name="hide_system_apps">Ocultar apps do sistema</string>
|
||||
<string name="send_log">Enviar Log</string>
|
||||
<string name="send_log">Reportar registrto</string>
|
||||
<string name="safe_mode">Modo de segurança</string>
|
||||
<string name="reboot_to_apply">Reinicie para entrar em vigor</string>
|
||||
<string name="module_magisk_conflict">Os módulos estão desativados porque estão em conflito com os do Magisk!</string>
|
||||
<string name="home_learn_kernelsu">Leia mais sobre o KernelSU</string>
|
||||
<string name="home_learn_kernelsu_url">https://kernelsu.org/guide/what-is-kernelsu.html</string>
|
||||
<string name="home_click_to_learn_kernelsu">Aprenda a instalar o KernelSU e usar os módulos</string>
|
||||
<string name="home_learn_kernelsu_url">https://kernelsu.org/pt_BR/guide/what-is-kernelsu.html</string>
|
||||
<string name="home_click_to_learn_kernelsu">Aprenda como instalar o KernelSU e usar módulos</string>
|
||||
<string name="home_support_title">Apoie-nos</string>
|
||||
<string name="home_support_content">KernelSU sempre foi e sempre será, gratuito e de código aberto. No entanto, você pode agradecer enviando uma pequena doação.</string>
|
||||
<string name="about_source_code"><![CDATA[Veja o código-fonte no %1$s<br/>Junte-se ao nosso canal do %2$s]]></string>
|
||||
@@ -64,10 +64,10 @@
|
||||
<string name="profile_groups">Grupos</string>
|
||||
<string name="profile_capabilities">Capacidades</string>
|
||||
<string name="profile_selinux_context">Contexto do SELinux</string>
|
||||
<string name="profile_umount_modules">Módulos não montados</string>
|
||||
<string name="profile_umount_modules">Desmontar módulos</string>
|
||||
<string name="failed_to_update_app_profile">Falha ao atualizar o Perfil do Aplicativo para %s</string>
|
||||
<string name="settings_umount_modules_default">Não montar módulos por padrão</string>
|
||||
<string name="settings_umount_modules_default_summary">O valor padrão global para \"Módulos não montados\" em Perfis de Aplicativos. Se ativado, removerá todas as modificações do módulo do sistema para apps que não possuem um Perfil definido.</string>
|
||||
<string name="settings_umount_modules_default">Desmontar módulos por padrão</string>
|
||||
<string name="settings_umount_modules_default_summary">O valor padrão global para \"Desmontar módulos\" em Perfis de Aplicativos. Se ativado, ele removerá todas as modificações do módulo no sistema para apps que não possuem um Perfil definido.</string>
|
||||
<string name="profile_umount_modules_summary">Ativar esta opção permitirá que o KernelSU restaure quaisquer arquivos modificados pelos módulos para este app.</string>
|
||||
<string name="profile_selinux_domain">Domínio</string>
|
||||
<string name="profile_selinux_rules">Regras</string>
|
||||
@@ -81,4 +81,26 @@
|
||||
<string name="failed_to_update_sepolicy">Falha ao atualizar as regras do SELinux para: %s</string>
|
||||
<string name="require_kernel_version">A versão atual do KernelSU %d é muito baixa para o gerenciador funcionar corretamente. Por favor, atualize para a versão %d ou superior!</string>
|
||||
<string name="module_changelog">Registro de alterações</string>
|
||||
<string name="app_profile_template_import_success">Importado com sucesso</string>
|
||||
<string name="app_profile_export_to_clipboard">Exportar para a área de transferência</string>
|
||||
<string name="app_profile_template_export_empty">Não foi possível encontrar o modelo local para exportar!</string>
|
||||
<string name="app_profile_template_id_exist">o ID do modelo já existe!</string>
|
||||
<string name="app_profile_import_from_clipboard">Importar da área de transferência</string>
|
||||
<string name="module_changelog_failed">Falha ao buscar o registro de alterações: %s</string>
|
||||
<string name="app_profile_template_name">Nome</string>
|
||||
<string name="app_profile_template_id_invalid">ID do modelo inválido</string>
|
||||
<string name="app_profile_template_sync">Sincronizar modelos online</string>
|
||||
<string name="app_profile_template_create">Criar modelo</string>
|
||||
<string name="app_profile_template_readonly">somente leitura</string>
|
||||
<string name="app_profile_import_export">Importar/Exportar</string>
|
||||
<string name="app_profile_template_save_failed">Falha ao salvar o modelo</string>
|
||||
<string name="app_profile_template_edit">Editar modelo</string>
|
||||
<string name="app_profile_template_id">ID</string>
|
||||
<string name="settings_profile_template">Modelo do Perfil do Aplicativo</string>
|
||||
<string name="app_profile_template_description">Descrição</string>
|
||||
<string name="app_profile_template_save">Salvar</string>
|
||||
<string name="settings_profile_template_summary">Gerenciar modelo local e online do Perfil do Aplicativo</string>
|
||||
<string name="app_profile_template_delete">Excluir</string>
|
||||
<string name="app_profile_template_import_empty">A área de transferência está vazia!</string>
|
||||
<string name="app_profile_template_view">Ver modelo</string>
|
||||
</resources>
|
||||
@@ -17,7 +17,7 @@
|
||||
<string name="selinux_status_enforcing">Obligatoriu</string>
|
||||
<string name="selinux_status_permissive">Permisiv</string>
|
||||
<string name="selinux_status_unknown">Necunoscut</string>
|
||||
<string name="superuser">Super-utilizator</string>
|
||||
<string name="superuser">Super-Utilizator</string>
|
||||
<string name="module_failed_to_enable">Activarea modulului %s a eșuat</string>
|
||||
<string name="module_failed_to_disable">Dezactivarea modulului %s a eșuat</string>
|
||||
<string name="module_empty">Niciun modul instalat</string>
|
||||
@@ -42,7 +42,7 @@
|
||||
<string name="refresh">Reîmprospătează</string>
|
||||
<string name="show_system_apps">Arată aplicațiile de sistem</string>
|
||||
<string name="hide_system_apps">Ascunde aplicațiile de sistem</string>
|
||||
<string name="send_log">Trimite jurnal</string>
|
||||
<string name="send_log">Raportează jurnal</string>
|
||||
<string name="safe_mode">Mod sigur</string>
|
||||
<string name="reboot_to_apply">Repornește pentru ca modificările să intre în vigoare</string>
|
||||
<string name="module_magisk_conflict">Modulele sunt dezactivate deoarece sunt în conflict cu cele ale Magisk-ului!</string>
|
||||
@@ -80,4 +80,26 @@
|
||||
<string name="restart_app">Repornește</string>
|
||||
<string name="require_kernel_version">Versiunea actuală a KernelSU %d este prea mică pentru ca managerul să funcționeze corect. Actualizează la versiunea %d sau o versiune superioară!</string>
|
||||
<string name="module_changelog">Jurnalul modificărilor</string>
|
||||
<string name="app_profile_template_import_success">Importat cu succes</string>
|
||||
<string name="app_profile_export_to_clipboard">Export în clipboard</string>
|
||||
<string name="app_profile_template_export_empty">Nu există șabloane locale de exportat!</string>
|
||||
<string name="app_profile_template_id_exist">ID-ul șablonului există deja!</string>
|
||||
<string name="app_profile_import_from_clipboard">Import din clipboard</string>
|
||||
<string name="module_changelog_failed">Preluarea jurnalului de modificări a eșuat: %s</string>
|
||||
<string name="app_profile_template_name">Nume</string>
|
||||
<string name="app_profile_template_id_invalid">ID șablon nevalid</string>
|
||||
<string name="app_profile_template_sync">Sincronizează șabloanele online</string>
|
||||
<string name="app_profile_template_create">Creează un șablon</string>
|
||||
<string name="app_profile_template_readonly">doar citire</string>
|
||||
<string name="app_profile_import_export">Import/Export</string>
|
||||
<string name="app_profile_template_save_failed">Nu s-a salvat șablonul</string>
|
||||
<string name="app_profile_template_edit">Editează șablonul</string>
|
||||
<string name="app_profile_template_id">ID</string>
|
||||
<string name="settings_profile_template">Șablon de profil al aplicației</string>
|
||||
<string name="app_profile_template_description">Descriere</string>
|
||||
<string name="app_profile_template_save">Salvează</string>
|
||||
<string name="settings_profile_template_summary">Gestionează șablonul local și online al Profilului aplicației</string>
|
||||
<string name="app_profile_template_delete">Șterge</string>
|
||||
<string name="app_profile_template_import_empty">Clipboard-ul este gol!</string>
|
||||
<string name="app_profile_template_view">Vizualizare șablon</string>
|
||||
</resources>
|
||||
@@ -5,7 +5,7 @@
|
||||
<string name="home_click_to_install">Нажмите, чтобы установить</string>
|
||||
<string name="home_working">Работает</string>
|
||||
<string name="home_working_version">Версия: %d</string>
|
||||
<string name="home_superuser_count">Superusers: %d</string>
|
||||
<string name="home_superuser_count">Суперпользователи: %d</string>
|
||||
<!--Don't translate this string!-->
|
||||
<string name="home_module_count">Модули: %d</string>
|
||||
<string name="home_unsupported">Не поддерживается</string>
|
||||
@@ -18,7 +18,7 @@
|
||||
<string name="selinux_status_enforcing">Принудительный</string>
|
||||
<string name="selinux_status_permissive">Разрешающий</string>
|
||||
<string name="selinux_status_unknown">Неизвестно</string>
|
||||
<string name="superuser">Superuser</string>
|
||||
<string name="superuser">Суперпользователь</string>
|
||||
<!--Don't translate this string!-->
|
||||
<string name="module_failed_to_enable">Не удалось включить модуль: %s</string>
|
||||
<string name="module_failed_to_disable">Не удалось отключить модуль: %s</string>
|
||||
@@ -41,7 +41,7 @@
|
||||
<string name="module_version">Версия</string>
|
||||
<string name="module_author">Автор</string>
|
||||
<string name="module_overlay_fs_not_available">overlayfs недоступен, модуль не может работать!</string>
|
||||
<string name="refresh">Обновить</string>
|
||||
<string name="refresh">Обновить страницу</string>
|
||||
<string name="show_system_apps">Показать системные приложения</string>
|
||||
<string name="hide_system_apps">Скрыть системные приложения</string>
|
||||
<string name="send_log">Отправить лог</string>
|
||||
@@ -84,4 +84,26 @@
|
||||
<string name="restart_app">Перезапустить</string>
|
||||
<string name="require_kernel_version">Текущая версия KernelSU %d слишком низкая для правильной работы менеджера. Пожалуйста, обновите до версии %d или выше!</string>
|
||||
<string name="module_changelog">Список изменений</string>
|
||||
<string name="app_profile_template_import_success">Успешный импорт</string>
|
||||
<string name="app_profile_export_to_clipboard">Экспортировать в буфер обмена</string>
|
||||
<string name="app_profile_template_export_empty">Нет локальных шаблонов для экспорта!</string>
|
||||
<string name="app_profile_template_id_exist">Шаблон с таким id уже существует!</string>
|
||||
<string name="app_profile_import_from_clipboard">Импортировать из буфера обмена</string>
|
||||
<string name="module_changelog_failed">Не удалось получить список изменений: %s</string>
|
||||
<string name="app_profile_template_name">Название</string>
|
||||
<string name="app_profile_template_id_invalid">Неверный id шаблона</string>
|
||||
<string name="app_profile_template_sync">Синхронизировать онлайн-шаблоны</string>
|
||||
<string name="app_profile_template_create">Создать шаблон</string>
|
||||
<string name="app_profile_template_readonly">только чтение</string>
|
||||
<string name="app_profile_import_export">Импорт/Экспорт</string>
|
||||
<string name="app_profile_template_save_failed">Не удалось сохранить шаблон</string>
|
||||
<string name="app_profile_template_edit">Редактирование шаблона</string>
|
||||
<string name="app_profile_template_id">Идентификационный номер</string>
|
||||
<string name="settings_profile_template">Шаблон профиля приложения</string>
|
||||
<string name="app_profile_template_description">Описание</string>
|
||||
<string name="app_profile_template_save">Сохранить</string>
|
||||
<string name="settings_profile_template_summary">Управление локальным и онлайн-шаблоном профиля приложения</string>
|
||||
<string name="app_profile_template_delete">Удалить</string>
|
||||
<string name="app_profile_template_import_empty">Буфер обмена пуст!</string>
|
||||
<string name="app_profile_template_view">Просмотр шаблона</string>
|
||||
</resources>
|
||||
@@ -2,7 +2,9 @@
|
||||
<resources>
|
||||
<string name="home_superuser_count">Superkorisnici</string>
|
||||
<string name="home_module_count">Moduli: %d</string>
|
||||
<string name="home_click_to_install">Kliknite da instalirate</string>
|
||||
<string name="home">дом</string>
|
||||
<string name="home_not_installed">Nije instalirano</string>
|
||||
<string name="home_click_to_install">Додирните да бисте инсталирали</string>
|
||||
<string name="home">Почетна</string>
|
||||
<string name="home_not_installed">Није инсталирано</string>
|
||||
<string name="home_working_version">Верзија: %d</string>
|
||||
<string name="home_working">Ради</string>
|
||||
</resources>
|
||||
@@ -42,7 +42,7 @@
|
||||
<string name="show_system_apps">แสดงแอประบบ</string>
|
||||
<string name="hide_system_apps">ซ่อนแอประบบ</string>
|
||||
<string name="refresh">รีเฟรช</string>
|
||||
<string name="send_log">ส่ง Log</string>
|
||||
<string name="send_log">ส่งรายงาน Log</string>
|
||||
<string name="safe_mode">โหมดปลอดภัย</string>
|
||||
<string name="reboot_to_apply">รีบูตเพื่อให้มีผล</string>
|
||||
<string name="module_magisk_conflict">โมดูลถูกปิดใช้งานเนื่องจากขัดแย้งกับ Magisk!</string>
|
||||
@@ -80,4 +80,26 @@
|
||||
<string name="failed_to_update_sepolicy">ไม่สามารถอัปเดตกฎ SElinux สำหรับ: %s ได้</string>
|
||||
<string name="require_kernel_version">KernelSU เวอร์ชั่น %d ต่ำเกินไป ทำให้ตัวจัดการไม่สามารถใช้งานได้อย่างถูกต้อง โปรดอัปเกรดเป็นเวอร์ชั่น %d หรือที่สูงกว่า!</string>
|
||||
<string name="module_changelog">บันทึกการเปลี่ยนแปลง</string>
|
||||
<string name="app_profile_template_import_success">นำเข้าเสร็จสิ้น</string>
|
||||
<string name="app_profile_export_to_clipboard">ส่งออกไปยังคลิปบอร์ด</string>
|
||||
<string name="app_profile_template_export_empty">ไม่พบเทมเพลตในเครื่องที่จะส่งออก!</string>
|
||||
<string name="app_profile_template_id_exist">มีไอดีเทมเพลตนี้อยู่แล้ว!</string>
|
||||
<string name="app_profile_import_from_clipboard">นำเข้าจากคลิปบอร์ด</string>
|
||||
<string name="app_profile_template_name">ชื่อ</string>
|
||||
<string name="app_profile_template_id_invalid">ไอดีเทมเพลตไม่ถูกต้อง</string>
|
||||
<string name="app_profile_template_sync">ซิงค์เทมเพลตออนไลน์</string>
|
||||
<string name="app_profile_template_create">สร้างเทมเพลต</string>
|
||||
<string name="app_profile_template_readonly">อ่านเท่านั้น</string>
|
||||
<string name="app_profile_import_export">นำเข้า/ส่งออก</string>
|
||||
<string name="app_profile_template_save_failed">ไม่สามารถบันทึกเทมเพลต</string>
|
||||
<string name="app_profile_template_edit">แก้ไขเทมเพลต</string>
|
||||
<string name="app_profile_template_id">ไอดี</string>
|
||||
<string name="settings_profile_template">เทมเพลตโปรไฟล์แอป</string>
|
||||
<string name="app_profile_template_description">คำอธิบาย</string>
|
||||
<string name="app_profile_template_save">บันทึก</string>
|
||||
<string name="settings_profile_template_summary">จัดการเทมเพลตโปรไฟล์แอปในเครื่องและเทมเพลตออนไลน์</string>
|
||||
<string name="app_profile_template_delete">ลบ</string>
|
||||
<string name="app_profile_template_import_empty">คลิปบอร์ดว่างเปล่า!</string>
|
||||
<string name="app_profile_template_view">ดูเทมเพลต</string>
|
||||
<string name="module_changelog_failed">ดึงข้อมูลบันทึกการเปลี่ยนแปลงล้มเหลว: %s</string>
|
||||
</resources>
|
||||
@@ -1,21 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="home">Ana menü</string>
|
||||
<string name="home_not_installed">Yüklü değil</string>
|
||||
<string name="home_click_to_install">Yüklemek için tıkla</string>
|
||||
<string name="app_name" translatable="false">KernelSU</string>
|
||||
<string name="home">Ana Sayfa</string>
|
||||
<string name="home_not_installed">Yüklenmedi</string>
|
||||
<string name="home_click_to_install">Yüklemek için tıklayın</string>
|
||||
<string name="home_working">Çalışıyor</string>
|
||||
<string name="home_working_version">Sürüm: %d</string>
|
||||
<string name="home_superuser_count">Süper kullanıcılar: %d</string>
|
||||
<string name="home_superuser_count">Süper kullanıcı: %d</string>
|
||||
<string name="home_module_count">Modüller: %d</string>
|
||||
<string name="home_unsupported">Desteklenmiyor</string>
|
||||
<string name="home_unsupported_reason">KernelSU şu an yalnızca GKI çekirdeklerini destekliyor</string>
|
||||
<string name="home_kernel">Kernel</string>
|
||||
<string name="home_manager_version">Yönetici Sürümü</string>
|
||||
<string name="home_fingerprint">Parmak İzi</string>
|
||||
<string name="home_selinux_status">SELinux Durumu</string>
|
||||
<string name="home_unsupported_reason">KernelSU şu an sadece GKI çekirdeklerini destekliyor</string>
|
||||
<string name="home_kernel">Çekirdek</string>
|
||||
<string name="home_manager_version">Uygulama sürümü</string>
|
||||
<string name="home_fingerprint">Parmak izi</string>
|
||||
<string name="home_selinux_status">SELinux durumu</string>
|
||||
<string name="selinux_status_disabled">Devre dışı</string>
|
||||
<string name="selinux_status_enforcing">Enforcing</string>
|
||||
<string name="selinux_status_permissive">Permissive</string>
|
||||
<string name="selinux_status_enforcing">Etkin (Enforcing)</string>
|
||||
<string name="selinux_status_permissive">Serbest (Permissive)</string>
|
||||
<string name="selinux_status_unknown">Bilinmiyor</string>
|
||||
<string name="superuser">Süper kullanıcı</string>
|
||||
<string name="module_failed_to_enable">Modül etkinleştirilemedi: %s</string>
|
||||
@@ -28,33 +29,33 @@
|
||||
<string name="reboot">Cihazı yeniden başlat</string>
|
||||
<string name="settings">Ayarlar</string>
|
||||
<string name="reboot_userspace">Hızlı yeniden başlat</string>
|
||||
<string name="reboot_recovery">Kurtarma modunda başlat</string>
|
||||
<string name="reboot_bootloader">Bootloader modunda başlat</string>
|
||||
<string name="reboot_download">İndirme modunda başlat</string>
|
||||
<string name="reboot_edl">EDL modunda başlat</string>
|
||||
<string name="reboot_recovery">Kurtarma modunda yeniden başlat</string>
|
||||
<string name="reboot_bootloader">Önyükleyici modunda yeniden başlat</string>
|
||||
<string name="reboot_download">İndirme modunda yeniden başlat</string>
|
||||
<string name="reboot_edl">EDL modunda yeniden başlat</string>
|
||||
<string name="about">Hakkında</string>
|
||||
<string name="module_uninstall_confirm">%s modülünü kaldırmak istediğinizden emin misiniz?</string>
|
||||
<string name="module_uninstall_success">%s kaldırıldı</string>
|
||||
<string name="module_uninstall_failed">%s kaldırılamadı</string>
|
||||
<string name="module_uninstall_failed">Kaldırma başarısız: %s</string>
|
||||
<string name="module_version">Sürüm</string>
|
||||
<string name="module_author">Geliştirici</string>
|
||||
<string name="module_overlay_fs_not_available">overlayfs mevcut değil, modül çalışamaz!</string>
|
||||
<string name="module_overlay_fs_not_available">Overlayfs mevcut değil, modül çalışamaz!</string>
|
||||
<string name="refresh">Yenile</string>
|
||||
<string name="show_system_apps">Sistem uygulamalarını göster</string>
|
||||
<string name="hide_system_apps">Sistem uygulamalarını gizle</string>
|
||||
<string name="send_log">Log gönder</string>
|
||||
<string name="send_log">Günlük raporu gönder</string>
|
||||
<string name="safe_mode">Güvenli mod</string>
|
||||
<string name="reboot_to_apply">Değişiklilerin kaydedilmesi için cihazı yeniden başlat</string>
|
||||
<string name="module_magisk_conflict">Modüller Magisk ile çakıştığı için devre dışı bırakıldı!</string>
|
||||
<string name="home_learn_kernelsu">KernelSU\'yu öğren</string>
|
||||
<string name="reboot_to_apply">Değişikliklerin uygulanması için cihazı yeniden başlat</string>
|
||||
<string name="module_magisk_conflict">Modüller, Magisk ile çakıştığı için devre dışı bırakıldı!</string>
|
||||
<string name="home_learn_kernelsu">KernelSU\'yu öğrenin</string>
|
||||
<string name="home_learn_kernelsu_url">https://kernelsu.org/guide/what-is-kernelsu.html</string>
|
||||
<string name="home_click_to_learn_kernelsu">KernelSU\'yu nasıl kuracağınızı ve modülleri nasıl kullanacağınızı öğrenin</string>
|
||||
<string name="home_support_title">Bizi destekle</string>
|
||||
<string name="home_support_content">KernelSU ücretsiz ve açık kaynaktır ve her zaman öyle kalacaktır. Ancak bağış yaparak bize değer verdiğinizi gösterebilirsiniz.</string>
|
||||
<string name="about_source_code"><![CDATA[%1$s kaynak kodunu görüntüle<br/>%2$s kanalımıza katılın]]></string>
|
||||
<string name="profile">Uygulama profili</string>
|
||||
<string name="home_click_to_learn_kernelsu">KernelSU\'nun nasıl kurulacağını ve modüllerin nasıl kullanılacağını öğrenin</string>
|
||||
<string name="home_support_title">Bizi destekleyin</string>
|
||||
<string name="home_support_content">KernelSU ücretsiz ve açık kaynaklı bir yazılımdır ve her zaman öyle kalacaktır. Ancak, bize bağış yaparak destek olduğunuzu gösterebilirsiniz.</string>
|
||||
<string name="about_source_code"><![CDATA[Kaynak kodunu görüntüle: %1$s<br/>%2$s kanalımıza katılın]]></string>
|
||||
<string name="profile" translatable="false">Uygulama profili</string>
|
||||
<string name="profile_default">Varsayılan</string>
|
||||
<string name="profile_template">Örnek</string>
|
||||
<string name="profile_template">Şablon</string>
|
||||
<string name="profile_custom">Özel</string>
|
||||
<string name="profile_name">Profil adı</string>
|
||||
<string name="profile_namespace">Ad alanını bağla</string>
|
||||
@@ -62,23 +63,45 @@
|
||||
<string name="profile_namespace_global">Küresel</string>
|
||||
<string name="profile_namespace_individual">Bireysel</string>
|
||||
<string name="profile_groups">Gruplar</string>
|
||||
<string name="profile_capabilities">Yetkiler</string>
|
||||
<string name="profile_capabilities">Yetkinlikler</string>
|
||||
<string name="profile_selinux_context">SELinux içeriği</string>
|
||||
<string name="profile_umount_modules">Modüllerin bağlantısını kes</string>
|
||||
<string name="failed_to_update_app_profile">%s için uygulama profili güncellenemedi.</string>
|
||||
<string name="settings_umount_modules_default">Varsayılan olarak modüllerin bağlantısını kesin</string>
|
||||
<string name="settings_umount_modules_default_summary">Uygulama profillerindeki \"Modüllerin bağlantısını kes\" seçeneği için varsayılan değer. Etkinleştirilirse, profil ayarı yapılmamış uygulamalar için modüllerin sistemde yaptığı tüm değişiklikler kaldırılacaktır.</string>
|
||||
<string name="profile_umount_modules_summary">Bu seçeneğin etkinleştirilmesi ile, bu uygulama için modüller tarafından değiştirilen tüm dosyaların KernelSU tarafından geri alınmasına izin verilecektir.</string>
|
||||
<string name="profile_selinux_domain">Ad alanı</string>
|
||||
<string name="require_kernel_version">Mevcut KernelSU sürümü %d, yöneticinin düzgün çalışabilmesi için çok düşük. Lütfen %d veya daha yüksek bir sürüme güncelleyin!</string>
|
||||
<string name="settings_umount_modules_default">Varsayılan olarak modüllerin bağlantısını kes</string>
|
||||
<string name="settings_umount_modules_default_summary">Uygulamalar için \"Modüllerin bağlantısını kes\" seçeneği için varsayılan değer. Etkinleştirilirse, profil ayarı yapılmamış uygulamalar için modüllerin sistemde yaptığı tüm değişiklikler kaldırılacaktır.</string>
|
||||
<string name="profile_umount_modules_summary">Bu seçeneği etkinleştirmek, KernelSU\'nun bu uygulama için modüller tarafından değiştirilen dosyaları geri yüklemesine izin verir.</string>
|
||||
<string name="profile_selinux_domain">İsim alanı</string>
|
||||
<string name="profile_selinux_rules">Kurallar</string>
|
||||
<string name="module_update">Güncelle</string>
|
||||
<string name="module_downloading">Modül indiriliyor: %s</string>
|
||||
<string name="module_start_downloading">İndirme başladı: %s</string>
|
||||
<string name="new_version_available">Yeni sürüm: %s mevcut, güncellemek için tıklayın</string>
|
||||
<string name="launch_app">Uygulamayı çalıştır</string>
|
||||
<string name="launch_app">Uygulamayı başlat</string>
|
||||
<string name="force_stop_app">Uygulamayı durmaya zorla</string>
|
||||
<string name="restart_app">Uygulamayı yeniden başlat</string>
|
||||
<string name="failed_to_update_sepolicy">%s için SELinux kuralları güncellenemedi</string>
|
||||
<string name="require_kernel_version">Mevcut KernelSU sürümü %d, yöneticinin düzgün çalışması için çok düşük. Lütfen %d veya daha yüksek bir sürüme yükseltin!</string>
|
||||
<string name="module_changelog">Değişiklik listesi</string>
|
||||
<string name="failed_to_update_sepolicy">SELinux kuralları güncellenemedi: %s</string>
|
||||
<string name="module_changelog">Değişiklik geçmişi</string>
|
||||
<string name="settings_profile_template">Uygulama profili şablonu</string>
|
||||
<string name="settings_profile_template_summary">Yerel ve çevrimiçi uygulama profil şablonlarını yönetin</string>
|
||||
<string name="app_profile_template_create">Şablon oluştur</string>
|
||||
<string name="app_profile_template_edit">Şablonu düzenle</string>
|
||||
<string name="app_profile_template_id">Kimlik</string>
|
||||
<string name="app_profile_template_id_invalid">Geçersiz şablon kimliği</string>
|
||||
<string name="app_profile_template_name">İsim</string>
|
||||
<string name="app_profile_template_description">Açıklama</string>
|
||||
<string name="app_profile_template_save">Kaydet</string>
|
||||
<string name="app_profile_template_delete">Sil</string>
|
||||
<string name="app_profile_template_view">Şablonu görüntüle</string>
|
||||
<string name="app_profile_template_readonly">Salt okunur</string>
|
||||
<string name="app_profile_template_id_exist">Şablon kimliği zaten mevcut!</string>
|
||||
<string name="app_profile_import_export">İçe aktar/Dışa aktar</string>
|
||||
<string name="app_profile_import_from_clipboard">Panodan içe aktar</string>
|
||||
<string name="app_profile_export_to_clipboard">Panodan dışa aktar</string>
|
||||
<string name="app_profile_template_export_empty">Dışa aktarmak için yerel şablon bulunamadı!</string>
|
||||
<string name="app_profile_template_import_success">Başarıyla içe aktarıldı</string>
|
||||
<string name="app_profile_template_sync">Çevrimiçi şablonları senkronize et</string>
|
||||
<string name="app_profile_template_save_failed">Şablon kaydedilemedi</string>
|
||||
<string name="app_profile_template_import_empty">Pano boş!</string>
|
||||
<string name="module_changelog_failed">Değişiklik geçmişi alınamadı: %s</string>
|
||||
</resources>
|
||||
@@ -8,7 +8,7 @@
|
||||
<string name="home_superuser_count">Суперкористувачі: %d</string>
|
||||
<string name="home_module_count">Модулі: %d</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_manager_version">Версія менеджера</string>
|
||||
<string name="home_fingerprint">Відбиток</string>
|
||||
@@ -39,10 +39,10 @@
|
||||
<string name="module_version">Версія</string>
|
||||
<string name="module_author">Автор</string>
|
||||
<string name="module_overlay_fs_not_available">overlayfs не доступний, модуль не може працювати!</string>
|
||||
<string name="refresh">освіжати(Оновити)</string>
|
||||
<string name="refresh">Освіжати(Оновити)</string>
|
||||
<string name="show_system_apps">Показати системні додатки</string>
|
||||
<string name="hide_system_apps">Сховати системні додатки</string>
|
||||
<string name="send_log">Надіслати лог</string>
|
||||
<string name="send_log">Надіслати логи</string>
|
||||
<string name="safe_mode">Безпечний режим</string>
|
||||
<string name="reboot_to_apply">Перезавантажте, щоб застосувати</string>
|
||||
<string name="module_magisk_conflict">Модулі вимкнено, оскільки вони конфліктують із модулями Magisk!</string>
|
||||
@@ -57,7 +57,7 @@
|
||||
<string name="profile_template">Шаблон</string>
|
||||
<string name="profile_custom">Власний</string>
|
||||
<string name="profile_name">Назва профілю</string>
|
||||
<string name="profile_namespace">Монтування простору імен</string>
|
||||
<string name="profile_namespace">Змонтувати простір імен</string>
|
||||
<string name="profile_namespace_inherited">Наслідуваний</string>
|
||||
<string name="profile_namespace_global">Глобальний</string>
|
||||
<string name="profile_namespace_individual">Індивідуальний</string>
|
||||
@@ -81,4 +81,26 @@
|
||||
<string name="failed_to_update_sepolicy">Не вдалося оновити правила SELinux для: %s</string>
|
||||
<string name="module_changelog">Журнал змін</string>
|
||||
<string name="require_kernel_version">Поточна версія KernelSU %d занадто низька, щоб менеджер міг працювати належним чином. Будь ласка, оновіть до версії %d або вище!</string>
|
||||
<string name="app_profile_template_import_success">Успішно імпортовано</string>
|
||||
<string name="app_profile_export_to_clipboard">Експортувати в буфер обміну</string>
|
||||
<string name="app_profile_template_export_empty">Неможливо знайти локальні шаблони для експорту!</string>
|
||||
<string name="app_profile_template_id_exist">Шаблон з таким ідентифікатором вже існує!</string>
|
||||
<string name="app_profile_import_from_clipboard">Імпортувати з буферу обміну</string>
|
||||
<string name="module_changelog_failed">Невдача при завантаженні списку змін: %s</string>
|
||||
<string name="app_profile_template_name">Ім\'я</string>
|
||||
<string name="app_profile_template_id_invalid">Невірний ідентифікатор шаблону</string>
|
||||
<string name="app_profile_template_sync">Синхронізувати мережеві шаблони</string>
|
||||
<string name="app_profile_template_create">Створити шаблон</string>
|
||||
<string name="app_profile_template_readonly">Тільки читання</string>
|
||||
<string name="app_profile_import_export">Імпорт/Експорт</string>
|
||||
<string name="app_profile_template_save_failed">Помилка при збереженні шаблону</string>
|
||||
<string name="app_profile_template_edit">Редагувати шаблон</string>
|
||||
<string name="app_profile_template_id">Ідентифікатор</string>
|
||||
<string name="settings_profile_template">Шаблон Профілю Додатку</string>
|
||||
<string name="app_profile_template_description">Опис</string>
|
||||
<string name="app_profile_template_save">Зберегти</string>
|
||||
<string name="settings_profile_template_summary">Керувати локальними та мережевими шаблонами профілів додатків</string>
|
||||
<string name="app_profile_template_delete">Видалити</string>
|
||||
<string name="app_profile_template_import_empty">Буфер обміну пустий!</string>
|
||||
<string name="app_profile_template_view">Переглянути шаблон</string>
|
||||
</resources>
|
||||
@@ -13,7 +13,7 @@
|
||||
<string name="module_update">Cập nhật</string>
|
||||
<string name="module_downloading">Đang tải xuống mô-đun: %s</string>
|
||||
<string name="module_start_downloading">Bắt đầu tải xuống: %s</string>
|
||||
<string name="new_version_available">Đã có phiên bản mới: %s, nhấn để tải xuống</string>
|
||||
<string name="new_version_available">Phiên bản mới: %s đã có, bấm để nâng cấp</string>
|
||||
<string name="home_learn_kernelsu">Tìm hiểu KernelSU</string>
|
||||
<string name="home_click_to_learn_kernelsu">Tìm hiểu cách cài đặt KernelSU và sử dụng các mô-đun</string>
|
||||
<string name="home_support_title">Hỗ trợ chúng tôi</string>
|
||||
@@ -37,7 +37,7 @@
|
||||
<string name="selinux_status_enforcing">Thực thi</string>
|
||||
<string name="selinux_status_permissive">Cho phép</string>
|
||||
<string name="selinux_status_unknown">Không rõ</string>
|
||||
<string name="superuser">Superuser</string>
|
||||
<string name="superuser">SuperUser</string>
|
||||
<string name="module_failed_to_enable">Không thể kích hoạt mô-đun: %s</string>
|
||||
<string name="module_failed_to_disable">Không thể vô hiệu hóa mô-đun: %s</string>
|
||||
<string name="module_empty">Chưa có mô-đun nào được cài đặt</string>
|
||||
@@ -53,7 +53,7 @@
|
||||
<string name="reboot_download">Khởi động lại vào Download Mode</string>
|
||||
<string name="reboot_edl">Khởi động lại vào EDL</string>
|
||||
<string name="about">Về ứng dụng</string>
|
||||
<string name="module_uninstall_success">%s đã được gỡ cài đặt</string>
|
||||
<string name="module_uninstall_success">%s được gỡ cài đặt</string>
|
||||
<string name="module_uninstall_failed">Lỗi khi gỡ cài đặt: %s</string>
|
||||
<string name="module_version">Phiên bản</string>
|
||||
<string name="module_author">Tác giả</string>
|
||||
@@ -80,4 +80,25 @@
|
||||
<string name="profile_selinux_context">SELinux context</string>
|
||||
<string name="profile_umount_modules">Ngắt mô-đun</string>
|
||||
<string name="require_kernel_version">KernelSU phiên bản %d quá thấp để trình quản lý hoạt động, hãy cập nhật lên %d hoặc mới hơn!</string>
|
||||
<string name="app_profile_template_import_success">Đã nhập thành công</string>
|
||||
<string name="app_profile_export_to_clipboard">Xuất từ khay nhớ tạm</string>
|
||||
<string name="app_profile_template_export_empty">Không thể tìm thấy mẫu cục bộ để xuất!</string>
|
||||
<string name="app_profile_template_id_exist">id bản mẫu đã tồn tại!</string>
|
||||
<string name="module_changelog">Nhật ký thay đổi</string>
|
||||
<string name="app_profile_import_from_clipboard">Nhập từ khay nhớ tạm</string>
|
||||
<string name="module_changelog_failed">Tìm nạp nhật ký thay đổi không thành công: %s</string>
|
||||
<string name="app_profile_template_name">Tên</string>
|
||||
<string name="app_profile_template_id_invalid">Id mẫu không hợp lệ</string>
|
||||
<string name="app_profile_template_sync">Đồng bộ hóa các mẫu trực tuyến</string>
|
||||
<string name="app_profile_template_create">Tạo Bản Mẫu</string>
|
||||
<string name="app_profile_import_export">Nhập/Xuất</string>
|
||||
<string name="app_profile_template_save_failed">Không lưu được mẫu</string>
|
||||
<string name="app_profile_template_edit">Sửa Bản Mẫu</string>
|
||||
<string name="settings_profile_template">Mẫu Hồ Sơ Ứng Dụng</string>
|
||||
<string name="app_profile_template_description">Mô tả</string>
|
||||
<string name="app_profile_template_save">Lưu</string>
|
||||
<string name="settings_profile_template_summary">Quản lý mẫu Hồ sơ Ứng dụng cục bộ và trực tuyến</string>
|
||||
<string name="app_profile_template_delete">Xóa</string>
|
||||
<string name="app_profile_template_import_empty">Bảng tạm trống!</string>
|
||||
<string name="app_profile_template_view">Xem Bản Mẫu</string>
|
||||
</resources>
|
||||
@@ -80,4 +80,26 @@
|
||||
<string name="restart_app">重新启动</string>
|
||||
<string name="failed_to_update_sepolicy">为:%s 更新翻译失败</string>
|
||||
<string name="module_changelog">更新日志</string>
|
||||
<string name="settings_profile_template">App Profile 模版</string>
|
||||
<string name="settings_profile_template_summary">管理本地和在线的 App Profile 模版</string>
|
||||
<string name="app_profile_template_create">创建模版</string>
|
||||
<string name="app_profile_template_edit">编辑模版</string>
|
||||
<string name="app_profile_template_id">模版 id</string>
|
||||
<string name="app_profile_template_id_invalid">模版 id 不合法</string>
|
||||
<string name="app_profile_template_name">名字</string>
|
||||
<string name="app_profile_template_description">描述</string>
|
||||
<string name="app_profile_template_save">保存</string>
|
||||
<string name="app_profile_template_delete">删除</string>
|
||||
<string name="app_profile_template_view">查看模版</string>
|
||||
<string name="app_profile_template_readonly">只读</string>
|
||||
<string name="app_profile_template_id_exist">模版 id 已存在!</string>
|
||||
<string name="app_profile_import_export">导入/导出</string>
|
||||
<string name="app_profile_import_from_clipboard">从剪切板导入</string>
|
||||
<string name="app_profile_export_to_clipboard">导出到剪切板</string>
|
||||
<string name="app_profile_template_export_empty">没有本地模版可以导出!</string>
|
||||
<string name="app_profile_template_import_success">导入成功!</string>
|
||||
<string name="app_profile_template_sync">同步在线规则</string>
|
||||
<string name="app_profile_template_save_failed">模版保存失败!</string>
|
||||
<string name="app_profile_template_import_empty">剪切板为空!</string>
|
||||
<string name="module_changelog_failed">获取更新日志失败:%s</string>
|
||||
</resources>
|
||||
@@ -74,9 +74,32 @@
|
||||
<string name="settings_umount_modules_default">預設卸載模組</string>
|
||||
<string name="module_downloading">正在下載模組:%s</string>
|
||||
<string name="module_start_downloading">開始下載:%s</string>
|
||||
<string name="new_version_available">新版本:%s 已可供使用,按一下以下載</string>
|
||||
<string name="new_version_available">新版本:%s 已可供使用,按一下以升級</string>
|
||||
<string name="launch_app">啟動</string>
|
||||
<string name="force_stop_app">強制停止</string>
|
||||
<string name="restart_app">重新啟動</string>
|
||||
<string name="failed_to_update_sepolicy">無法為 %s 更新 SELinux 規則</string>
|
||||
</resources>
|
||||
<string name="module_changelog">日志</string>
|
||||
<string name="app_profile_template_import_success">導出成功</string>
|
||||
<string name="app_profile_export_to_clipboard">導出到剪貼板</string>
|
||||
<string name="app_profile_template_export_empty">沒有本地模板可以導出!</string>
|
||||
<string name="app_profile_template_id_exist">模板id已存在!</string>
|
||||
<string name="app_profile_import_from_clipboard">從剪貼板導入</string>
|
||||
<string name="module_changelog_failed">獲取更新日誌失敗:%s</string>
|
||||
<string name="app_profile_template_name">名字</string>
|
||||
<string name="app_profile_template_id_invalid">模板id不合法</string>
|
||||
<string name="app_profile_template_sync">同步在線規則</string>
|
||||
<string name="app_profile_template_create">創建模板</string>
|
||||
<string name="app_profile_template_readonly">只讀</string>
|
||||
<string name="app_profile_import_export">導入/導出</string>
|
||||
<string name="app_profile_template_save_failed">模板保存失敗</string>
|
||||
<string name="app_profile_template_edit">編輯模板</string>
|
||||
<string name="app_profile_template_id">模板id</string>
|
||||
<string name="settings_profile_template">App Profile模板</string>
|
||||
<string name="app_profile_template_description">描述</string>
|
||||
<string name="app_profile_template_save">保存</string>
|
||||
<string name="settings_profile_template_summary">管理本地和在線的App Profile模板</string>
|
||||
<string name="app_profile_template_delete">刪除</string>
|
||||
<string name="app_profile_template_import_empty">剪貼板爲空!</string>
|
||||
<string name="app_profile_template_view">查看模板</string>
|
||||
</resources>
|
||||
@@ -80,4 +80,10 @@
|
||||
<string name="force_stop_app">強制停止</string>
|
||||
<string name="failed_to_update_sepolicy">無法為 %s 更新 SELinux</string>
|
||||
<string name="module_changelog">變更記錄</string>
|
||||
<string name="app_profile_template_id_invalid">模板 id 不合法</string>
|
||||
<string name="app_profile_template_create">創建模板</string>
|
||||
<string name="app_profile_template_edit">編輯模板</string>
|
||||
<string name="app_profile_template_id">模板 id</string>
|
||||
<string name="settings_profile_template">App Profile 模板</string>
|
||||
<string name="settings_profile_template_summary">管理本地和在線的App Profile模板</string>
|
||||
</resources>
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name" translatable="false">KernelSU</string>
|
||||
|
||||
<string name="home">Home</string>
|
||||
<string name="home_not_installed">Not installed</string>
|
||||
<string name="home_click_to_install">Click to install</string>
|
||||
@@ -10,21 +10,18 @@
|
||||
<string name="home_module_count">Modules: %d</string>
|
||||
<string name="home_unsupported">Unsupported</string>
|
||||
<string name="home_unsupported_reason">KernelSU only supports GKI kernels now</string>
|
||||
|
||||
<string name="home_kernel">Kernel</string>
|
||||
<string name="home_manager_version">Manager Version</string>
|
||||
<string name="home_fingerprint">Fingerprint</string>
|
||||
|
||||
<string name="home_selinux_status">SELinux status</string>
|
||||
<string name="selinux_status_disabled">Disabled</string>
|
||||
<string name="selinux_status_enforcing">Enforcing</string>
|
||||
<string name="selinux_status_permissive">Permissive</string>
|
||||
<string name="selinux_status_unknown">Unknown</string>
|
||||
<string name="superuser">Superuser</string>
|
||||
<string name="superuser">SuperUser</string>
|
||||
<string name="module_failed_to_enable">Failed to enable module: %s</string>
|
||||
<string name="module_failed_to_disable">Failed to disable module: %s</string>
|
||||
<string name="module_empty">No module installed</string>
|
||||
|
||||
<string name="module_empty">No installed modules</string>
|
||||
<string name="module">Module</string>
|
||||
<string name="uninstall">Uninstall</string>
|
||||
<string name="module_install">Install</string>
|
||||
@@ -38,7 +35,7 @@
|
||||
<string name="reboot_edl">Reboot to EDL</string>
|
||||
<string name="about">About</string>
|
||||
<string name="module_uninstall_confirm">Are you sure you want to uninstall module %s?</string>
|
||||
<string name="module_uninstall_success">%s uninstalled</string>
|
||||
<string name="module_uninstall_success">%s is uninstalled</string>
|
||||
<string name="module_uninstall_failed">Failed to uninstall: %s</string>
|
||||
<string name="module_version">Version</string>
|
||||
<string name="module_author">Author</string>
|
||||
@@ -46,7 +43,7 @@
|
||||
<string name="refresh">Refresh</string>
|
||||
<string name="show_system_apps">Show system apps</string>
|
||||
<string name="hide_system_apps">Hide system apps</string>
|
||||
<string name="send_log">Send Log</string>
|
||||
<string name="send_log">Report Log</string>
|
||||
<string name="safe_mode">Safe mode</string>
|
||||
<string name="reboot_to_apply">Reboot to take effect</string>
|
||||
<string name="module_magisk_conflict">Modules are disabled because it is conflict with Magisk\'s!</string>
|
||||
@@ -85,4 +82,26 @@
|
||||
<string name="restart_app">Restart</string>
|
||||
<string name="failed_to_update_sepolicy">Failed to update SELinux rules for: %s</string>
|
||||
<string name="module_changelog">Changelog</string>
|
||||
<string name="settings_profile_template">App Profile Template</string>
|
||||
<string name="settings_profile_template_summary">Manage local and online template of App Profile</string>
|
||||
<string name="app_profile_template_create">Create Template</string>
|
||||
<string name="app_profile_template_edit">Edit Template</string>
|
||||
<string name="app_profile_template_id">id</string>
|
||||
<string name="app_profile_template_id_invalid">Invalid template id</string>
|
||||
<string name="app_profile_template_name">Name</string>
|
||||
<string name="app_profile_template_description">Description</string>
|
||||
<string name="app_profile_template_save">Save</string>
|
||||
<string name="app_profile_template_delete">Delete</string>
|
||||
<string name="app_profile_template_view">View Template</string>
|
||||
<string name="app_profile_template_readonly">readonly</string>
|
||||
<string name="app_profile_template_id_exist">template id already exists!</string>
|
||||
<string name="app_profile_import_export">Import/Export</string>
|
||||
<string name="app_profile_import_from_clipboard">Import from clipboard</string>
|
||||
<string name="app_profile_export_to_clipboard">Export to clipboard</string>
|
||||
<string name="app_profile_template_export_empty">Can not find local template to export!</string>
|
||||
<string name="app_profile_template_import_success">Imported successfully</string>
|
||||
<string name="app_profile_template_sync">Sync online templates</string>
|
||||
<string name="app_profile_template_save_failed">Failed to save template</string>
|
||||
<string name="app_profile_template_import_empty">Clipboard is empty!</string>
|
||||
<string name="module_changelog_failed">Fetch changelog failed: %s</string>
|
||||
</resources>
|
||||
|
||||
@@ -7,7 +7,7 @@ lifecycle = "2.6.1"
|
||||
accompanist = "0.30.1"
|
||||
navigation = "2.6.0"
|
||||
compose-destination = "1.9.42-beta"
|
||||
libsu = "5.0.5"
|
||||
libsu = "5.2.1"
|
||||
sheets-compose-dialogs = "1.2.0"
|
||||
markdown = "4.6.2"
|
||||
|
||||
|
||||
85
scripts/allowlist.bt
Normal file
85
scripts/allowlist.bt
Normal file
@@ -0,0 +1,85 @@
|
||||
// Define constants as per the provided structure.
|
||||
#define KSU_MAX_PACKAGE_NAME 256
|
||||
#define KSU_MAX_GROUPS 32
|
||||
#define KSU_SELINUX_DOMAIN 64
|
||||
|
||||
// Define the root_profile structure with padding for 64-bit alignment.
|
||||
struct root_profile {
|
||||
int uid;
|
||||
int gid;
|
||||
|
||||
int groups_count;
|
||||
int groups[KSU_MAX_GROUPS];
|
||||
char padding1[4]; // Padding for 64-bit alignment.
|
||||
|
||||
struct {
|
||||
uint64 effective;
|
||||
uint64 permitted;
|
||||
uint64 inheritable;
|
||||
} capabilities;
|
||||
|
||||
char selinux_domain[KSU_SELINUX_DOMAIN];
|
||||
|
||||
int namespaces;
|
||||
char padding2[4]; // Padding for 64-bit alignment.
|
||||
};
|
||||
|
||||
// Define the non_root_profile structure with padding for 64-bit alignment.
|
||||
struct non_root_profile {
|
||||
byte umount_modules;
|
||||
char padding[7]; // Padding to make the total size a multiple of 8.
|
||||
};
|
||||
|
||||
// Define the rp_config structure with padding for 64-bit alignment.
|
||||
struct rp_config_t {
|
||||
byte use_default;
|
||||
char padding[7]; // Padding to make the total size a multiple of 8.
|
||||
char template_name[KSU_MAX_PACKAGE_NAME];
|
||||
|
||||
struct root_profile profile;
|
||||
};
|
||||
|
||||
// Define the nrp_config structure with padding for 64-bit alignment.
|
||||
struct nrp_config_t {
|
||||
byte use_default;
|
||||
char padding[7]; // Padding to make the total size a multiple of 8.
|
||||
|
||||
struct non_root_profile profile;
|
||||
};
|
||||
|
||||
// Define the main app_profile structure
|
||||
typedef struct {
|
||||
uint32 version;
|
||||
char key[KSU_MAX_PACKAGE_NAME];
|
||||
int32 current_uid;
|
||||
int64 allow_su;
|
||||
|
||||
// Based on allow_su, decide which profile to use
|
||||
if (allow_su != 0) {
|
||||
rp_config_t rp_config;
|
||||
} else {
|
||||
nrp_config_t nrp_config;
|
||||
}
|
||||
|
||||
} app_profile;
|
||||
|
||||
// Define the file header with magic number and version
|
||||
typedef struct {
|
||||
uint32 magic;
|
||||
uint32 version;
|
||||
} file_header;
|
||||
|
||||
// Main entry for parsing the file
|
||||
file_header header;
|
||||
|
||||
if (header.magic != 0x7f4b5355) {
|
||||
Printf("Invalid file magic number.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
FSeek(8); // Skip the header
|
||||
|
||||
// Continually read app_profile instances until end of file
|
||||
while (!FEof()) {
|
||||
app_profile profile;
|
||||
}
|
||||
@@ -1,101 +1,101 @@
|
||||
import os
|
||||
import sys
|
||||
import asyncio
|
||||
import telegram
|
||||
from telegram import helpers
|
||||
|
||||
|
||||
BOT_TOKEN = os.environ.get("BOT_TOKEN")
|
||||
CHAT_ID = os.environ.get("CHAT_ID")
|
||||
CACHE_CHAT_ID = os.environ.get("CACHE_CHAT_ID")
|
||||
MESSAGE_THREAD_ID = os.environ.get("MESSAGE_THREAD_ID")
|
||||
COMMIT_URL = os.environ.get("COMMIT_URL")
|
||||
COMMIT_MESSAGE = os.environ.get("COMMIT_MESSAGE")
|
||||
RUN_URL = os.environ.get("RUN_URL")
|
||||
TITLE = os.environ.get("TITLE")
|
||||
VERSION = os.environ.get("VERSION")
|
||||
MSG_TEMPLATE = """
|
||||
*{title}*
|
||||
\#ci\_{version}
|
||||
```
|
||||
{commit_message}
|
||||
```
|
||||
[Commit]({commit_url})
|
||||
[Workflow run]({run_url})
|
||||
""".strip()
|
||||
|
||||
|
||||
def get_caption():
|
||||
msg = MSG_TEMPLATE.format(
|
||||
title=helpers.escape_markdown(TITLE, 2),
|
||||
version=helpers.escape_markdown(VERSION, 2),
|
||||
commit_message=helpers.escape_markdown(COMMIT_MESSAGE, 2, telegram.MessageEntity.PRE),
|
||||
commit_url=helpers.escape_markdown(COMMIT_URL, 2, telegram.MessageEntity.TEXT_LINK),
|
||||
run_url=helpers.escape_markdown(RUN_URL, 2, telegram.MessageEntity.TEXT_LINK)
|
||||
)
|
||||
if len(msg) > telegram.constants.MessageLimit.CAPTION_LENGTH:
|
||||
return COMMIT_URL
|
||||
return msg
|
||||
|
||||
|
||||
def check_environ():
|
||||
if BOT_TOKEN is None:
|
||||
print("[-] Invalid BOT_TOKEN")
|
||||
exit(1)
|
||||
if CHAT_ID is None:
|
||||
print("[-] Invalid CHAT_ID")
|
||||
exit(1)
|
||||
if CACHE_CHAT_ID is None:
|
||||
print("[-] Invalid CACHE_CHAT_ID")
|
||||
exit(1)
|
||||
if COMMIT_URL is None:
|
||||
print("[-] Invalid COMMIT_URL")
|
||||
exit(1)
|
||||
if COMMIT_MESSAGE is None:
|
||||
print("[-] Invalid COMMIT_MESSAGE")
|
||||
exit(1)
|
||||
if RUN_URL is None:
|
||||
print("[-] Invalid RUN_URL")
|
||||
exit(1)
|
||||
if TITLE is None:
|
||||
print("[-] Invalid TITLE")
|
||||
exit(1)
|
||||
if VERSION is None:
|
||||
print("[-] Invalid VERSION")
|
||||
exit(1)
|
||||
|
||||
|
||||
async def main():
|
||||
print("[+] Uploading to telegram")
|
||||
check_environ()
|
||||
print("[+] Files:", sys.argv[1:])
|
||||
bot = telegram.Bot(BOT_TOKEN)
|
||||
files = []
|
||||
paths = sys.argv[1:]
|
||||
caption = get_caption()
|
||||
print("[+] Caption: ")
|
||||
print("---")
|
||||
print(caption)
|
||||
print("---")
|
||||
for one in paths:
|
||||
if not os.path.exists(one):
|
||||
print("[-] File not exist: " + one)
|
||||
continue
|
||||
print("[+] Upload: " + one)
|
||||
msg = await bot.send_document(CACHE_CHAT_ID, one, write_timeout=60, connect_timeout=30)
|
||||
if one == paths[-1]:
|
||||
files.append(telegram.InputMediaDocument(msg.document,
|
||||
caption=caption,
|
||||
parse_mode=telegram.constants.ParseMode.MARKDOWN_V2))
|
||||
else:
|
||||
files.append(telegram.InputMediaDocument(msg.document))
|
||||
await bot.delete_message(CACHE_CHAT_ID, msg.message_id)
|
||||
print("[+] Sending")
|
||||
await bot.send_media_group(CHAT_ID, files, message_thread_id=MESSAGE_THREAD_ID)
|
||||
print("[+] Done!")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
loops = asyncio.new_event_loop()
|
||||
loops.run_until_complete(asyncio.wait([main()]))
|
||||
|
||||
import asyncio
|
||||
import os
|
||||
import sys
|
||||
from telethon import TelegramClient
|
||||
from telethon.tl.functions.help import GetConfigRequest
|
||||
|
||||
API_ID = 611335
|
||||
API_HASH = "d524b414d21f4d37f08684c1df41ac9c"
|
||||
|
||||
|
||||
BOT_TOKEN = os.environ.get("BOT_TOKEN")
|
||||
CHAT_ID = os.environ.get("CHAT_ID")
|
||||
MESSAGE_THREAD_ID = os.environ.get("MESSAGE_THREAD_ID")
|
||||
COMMIT_URL = os.environ.get("COMMIT_URL")
|
||||
COMMIT_MESSAGE = os.environ.get("COMMIT_MESSAGE")
|
||||
RUN_URL = os.environ.get("RUN_URL")
|
||||
TITLE = os.environ.get("TITLE")
|
||||
VERSION = os.environ.get("VERSION")
|
||||
MSG_TEMPLATE = """
|
||||
**{title}**
|
||||
#ci_{version}
|
||||
```
|
||||
{commit_message}
|
||||
```
|
||||
[Commit]({commit_url})
|
||||
[Workflow run]({run_url})
|
||||
""".strip()
|
||||
|
||||
|
||||
def get_caption():
|
||||
msg = MSG_TEMPLATE.format(
|
||||
title=TITLE,
|
||||
version=VERSION,
|
||||
commit_message=COMMIT_MESSAGE,
|
||||
commit_url=COMMIT_URL,
|
||||
run_url=RUN_URL,
|
||||
)
|
||||
if len(msg) > 1024:
|
||||
return COMMIT_URL
|
||||
return msg
|
||||
|
||||
|
||||
def check_environ():
|
||||
global CHAT_ID, MESSAGE_THREAD_ID
|
||||
if BOT_TOKEN is None:
|
||||
print("[-] Invalid BOT_TOKEN")
|
||||
exit(1)
|
||||
if CHAT_ID is None:
|
||||
print("[-] Invalid CHAT_ID")
|
||||
exit(1)
|
||||
else:
|
||||
CHAT_ID = int(CHAT_ID)
|
||||
if COMMIT_URL is None:
|
||||
print("[-] Invalid COMMIT_URL")
|
||||
exit(1)
|
||||
if COMMIT_MESSAGE is None:
|
||||
print("[-] Invalid COMMIT_MESSAGE")
|
||||
exit(1)
|
||||
if RUN_URL is None:
|
||||
print("[-] Invalid RUN_URL")
|
||||
exit(1)
|
||||
if TITLE is None:
|
||||
print("[-] Invalid TITLE")
|
||||
exit(1)
|
||||
if VERSION is None:
|
||||
print("[-] Invalid VERSION")
|
||||
exit(1)
|
||||
if MESSAGE_THREAD_ID is None:
|
||||
print("[-] Invaild MESSAGE_THREAD_ID")
|
||||
exit(1)
|
||||
else:
|
||||
MESSAGE_THREAD_ID = int(MESSAGE_THREAD_ID)
|
||||
|
||||
|
||||
async def main():
|
||||
print("[+] Uploading to telegram")
|
||||
check_environ()
|
||||
files = sys.argv[1:]
|
||||
print("[+] Files:", files)
|
||||
if len(files) <= 0:
|
||||
print("[-] No files to upload")
|
||||
exit(1)
|
||||
print("[+] Logging in Telegram with bot")
|
||||
script_dir = os.path.dirname(os.path.abspath(sys.argv[0]))
|
||||
session_dir = os.path.join(script_dir, "ksubot.session")
|
||||
async with await TelegramClient(session=session_dir, api_id=API_ID, api_hash=API_HASH).start(bot_token=BOT_TOKEN) as bot:
|
||||
caption = [""] * len(files)
|
||||
caption[-1] = get_caption()
|
||||
print("[+] Caption: ")
|
||||
print("---")
|
||||
print(caption)
|
||||
print("---")
|
||||
print("[+] Sending")
|
||||
await bot.send_file(entity=CHAT_ID, file=files, caption=caption, reply_to=MESSAGE_THREAD_ID, parse_mode="markdown")
|
||||
print("[+] Done!")
|
||||
|
||||
if __name__ == "__main__":
|
||||
try:
|
||||
asyncio.run(main())
|
||||
except Exception as e:
|
||||
print(f"[-] An error occurred: {e}")
|
||||
264
userspace/ksud/Cargo.lock
generated
264
userspace/ksud/Cargo.lock
generated
@@ -127,7 +127,7 @@ version = "0.60.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "062dddbc1ba4aca46de6338e2bf87771414c335f7b2f2036e8f3e9befebf88e6"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"bitflags 1.3.2",
|
||||
"cexpr",
|
||||
"clang-sys",
|
||||
"lazy_static",
|
||||
@@ -146,6 +146,12 @@ version = "1.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
|
||||
|
||||
[[package]]
|
||||
name = "bitflags"
|
||||
version = "2.4.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07"
|
||||
|
||||
[[package]]
|
||||
name = "block-buffer"
|
||||
version = "0.10.3"
|
||||
@@ -256,7 +262,7 @@ version = "4.1.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f13b9c79b5d1dd500d20ef541215a6423c75829ef43117e1b4d17fd8af0b5d76"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"bitflags 1.3.2",
|
||||
"clap_derive",
|
||||
"clap_lex",
|
||||
"is-terminal",
|
||||
@@ -497,69 +503,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91"
|
||||
|
||||
[[package]]
|
||||
name = "encoding"
|
||||
version = "0.2.33"
|
||||
name = "encoding_rs"
|
||||
version = "0.8.33"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6b0d943856b990d12d3b55b359144ff341533e516d94098b1d3fc1ac666d36ec"
|
||||
checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1"
|
||||
dependencies = [
|
||||
"encoding-index-japanese",
|
||||
"encoding-index-korean",
|
||||
"encoding-index-simpchinese",
|
||||
"encoding-index-singlebyte",
|
||||
"encoding-index-tradchinese",
|
||||
"cfg-if",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "encoding-index-japanese"
|
||||
version = "1.20141219.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "04e8b2ff42e9a05335dbf8b5c6f7567e5591d0d916ccef4e0b1710d32a0d0c91"
|
||||
dependencies = [
|
||||
"encoding_index_tests",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "encoding-index-korean"
|
||||
version = "1.20141219.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4dc33fb8e6bcba213fe2f14275f0963fd16f0a02c878e3095ecfdf5bee529d81"
|
||||
dependencies = [
|
||||
"encoding_index_tests",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "encoding-index-simpchinese"
|
||||
version = "1.20141219.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d87a7194909b9118fc707194baa434a4e3b0fb6a5a757c73c3adb07aa25031f7"
|
||||
dependencies = [
|
||||
"encoding_index_tests",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "encoding-index-singlebyte"
|
||||
version = "1.20141219.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3351d5acffb224af9ca265f435b859c7c01537c0849754d3db3fdf2bfe2ae84a"
|
||||
dependencies = [
|
||||
"encoding_index_tests",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "encoding-index-tradchinese"
|
||||
version = "1.20141219.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fd0e20d5688ce3cab59eb3ef3a2083a5c77bf496cb798dc6fcdb75f323890c18"
|
||||
dependencies = [
|
||||
"encoding_index_tests",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "encoding_index_tests"
|
||||
version = "0.1.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a246d82be1c9d791c5dfde9a2bd045fc3cbba3fa2b11ad558f27d01712f00569"
|
||||
|
||||
[[package]]
|
||||
name = "env_logger"
|
||||
version = "0.10.0"
|
||||
@@ -584,6 +535,16 @@ dependencies = [
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "errno"
|
||||
version = "0.3.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ac3e13f66a2f95e32a39eaa81f6b95d42878ca0e1db0c7543723dfe12557e860"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"windows-sys 0.48.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "errno-dragonfly"
|
||||
version = "0.1.2"
|
||||
@@ -600,8 +561,8 @@ version = "1.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1b59f8a77817ff1b795adafc535941bdf664184f5f95e0b6d1d77dd6d12815dc"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"errno",
|
||||
"bitflags 1.3.2",
|
||||
"errno 0.2.8",
|
||||
"libc",
|
||||
]
|
||||
|
||||
@@ -687,6 +648,15 @@ dependencies = [
|
||||
"digest",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "home"
|
||||
version = "0.5.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb"
|
||||
dependencies = [
|
||||
"windows-sys 0.48.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "humansize"
|
||||
version = "2.1.3"
|
||||
@@ -778,7 +748,7 @@ checksum = "28dfb6c8100ccc63462345b67d1bbc3679177c75ee4bf59bf29c8b1d110b8189"
|
||||
dependencies = [
|
||||
"hermit-abi",
|
||||
"io-lifetimes",
|
||||
"rustix",
|
||||
"rustix 0.36.7",
|
||||
"windows-sys 0.42.0",
|
||||
]
|
||||
|
||||
@@ -799,11 +769,11 @@ checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440"
|
||||
|
||||
[[package]]
|
||||
name = "java-properties"
|
||||
version = "1.4.1"
|
||||
version = "2.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e1904d8654a1ef51034d02d5a9411b50bf91bea15b0ab644ae179d1325976263"
|
||||
checksum = "37bf6f484471c451f2b51eabd9e66b3fa7274550c5ec4b6c3d6070840945117f"
|
||||
dependencies = [
|
||||
"encoding",
|
||||
"encoding_rs",
|
||||
"lazy_static",
|
||||
"regex",
|
||||
]
|
||||
@@ -846,7 +816,7 @@ dependencies = [
|
||||
"clap",
|
||||
"const_format",
|
||||
"derive-new",
|
||||
"encoding",
|
||||
"encoding_rs",
|
||||
"env_logger",
|
||||
"extattr",
|
||||
"getopts",
|
||||
@@ -884,9 +854,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
|
||||
|
||||
[[package]]
|
||||
name = "libc"
|
||||
version = "0.2.139"
|
||||
version = "0.2.149"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79"
|
||||
checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b"
|
||||
|
||||
[[package]]
|
||||
name = "libflate"
|
||||
@@ -939,6 +909,12 @@ version = "0.1.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4"
|
||||
|
||||
[[package]]
|
||||
name = "linux-raw-sys"
|
||||
version = "0.4.10"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f"
|
||||
|
||||
[[package]]
|
||||
name = "log"
|
||||
version = "0.4.17"
|
||||
@@ -954,7 +930,7 @@ version = "0.5.0"
|
||||
source = "git+https://github.com/tiann/loopdev?branch=loopfix#b6ca5e3ea163f66239f6a835874fe231b2a9286f"
|
||||
dependencies = [
|
||||
"bindgen",
|
||||
"errno",
|
||||
"errno 0.2.8",
|
||||
"libc",
|
||||
]
|
||||
|
||||
@@ -1142,17 +1118,28 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "procfs"
|
||||
version = "0.15.1"
|
||||
version = "0.16.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "943ca7f9f29bab5844ecd8fdb3992c5969b6622bb9609b9502fef9b4310e3f1f"
|
||||
checksum = "731e0d9356b0c25f16f33b5be79b1c57b562f141ebfcdb0ad8ac2c13a24293b4"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"byteorder",
|
||||
"bitflags 2.4.1",
|
||||
"chrono",
|
||||
"flate2",
|
||||
"hex",
|
||||
"lazy_static",
|
||||
"rustix",
|
||||
"procfs-core",
|
||||
"rustix 0.38.21",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "procfs-core"
|
||||
version = "0.16.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2d3554923a69f4ce04c4a754260c338f505ce22642d3830e049a399fc2059a29"
|
||||
dependencies = [
|
||||
"bitflags 2.4.1",
|
||||
"chrono",
|
||||
"hex",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1301,14 +1288,27 @@ version = "0.36.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d4fdebc4b395b7fbb9ab11e462e20ed9051e7b16e42d24042c776eca0ac81b03"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"errno",
|
||||
"bitflags 1.3.2",
|
||||
"errno 0.2.8",
|
||||
"io-lifetimes",
|
||||
"libc",
|
||||
"linux-raw-sys",
|
||||
"linux-raw-sys 0.1.4",
|
||||
"windows-sys 0.42.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustix"
|
||||
version = "0.38.21"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2b426b0506e5d50a7d8dafcf2e81471400deb602392c7dd110815afb4eaf02a3"
|
||||
dependencies = [
|
||||
"bitflags 2.4.1",
|
||||
"errno 0.3.5",
|
||||
"libc",
|
||||
"linux-raw-sys 0.4.10",
|
||||
"windows-sys 0.48.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ryu"
|
||||
version = "1.0.12"
|
||||
@@ -1444,7 +1444,7 @@ name = "sys-mount"
|
||||
version = "2.0.2"
|
||||
source = "git+https://github.com/tiann/sys-mount?branch=loopfix#c7c4048e4a4ffdf8b108a85956363a75f2c554f0"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"bitflags 1.3.2",
|
||||
"libc",
|
||||
"loopdev",
|
||||
"smart-default",
|
||||
@@ -1661,13 +1661,15 @@ checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d"
|
||||
|
||||
[[package]]
|
||||
name = "which"
|
||||
version = "4.4.0"
|
||||
version = "5.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269"
|
||||
checksum = "9bf3ea8596f3a0dd5980b46430f2058dfe2c36a27ccfbb1845d6fbfcd9ba6e14"
|
||||
dependencies = [
|
||||
"either",
|
||||
"libc",
|
||||
"home",
|
||||
"once_cell",
|
||||
"rustix 0.38.21",
|
||||
"windows-sys 0.48.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1707,13 +1709,13 @@ version = "0.42.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7"
|
||||
dependencies = [
|
||||
"windows_aarch64_gnullvm",
|
||||
"windows_aarch64_msvc",
|
||||
"windows_i686_gnu",
|
||||
"windows_i686_msvc",
|
||||
"windows_x86_64_gnu",
|
||||
"windows_x86_64_gnullvm",
|
||||
"windows_x86_64_msvc",
|
||||
"windows_aarch64_gnullvm 0.42.1",
|
||||
"windows_aarch64_msvc 0.42.1",
|
||||
"windows_i686_gnu 0.42.1",
|
||||
"windows_i686_msvc 0.42.1",
|
||||
"windows_x86_64_gnu 0.42.1",
|
||||
"windows_x86_64_gnullvm 0.42.1",
|
||||
"windows_x86_64_msvc 0.42.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1722,7 +1724,16 @@ version = "0.45.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0"
|
||||
dependencies = [
|
||||
"windows-targets",
|
||||
"windows-targets 0.42.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-sys"
|
||||
version = "0.48.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9"
|
||||
dependencies = [
|
||||
"windows-targets 0.48.5",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1731,13 +1742,28 @@ version = "0.42.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8e2522491fbfcd58cc84d47aeb2958948c4b8982e9a2d8a2a35bbaed431390e7"
|
||||
dependencies = [
|
||||
"windows_aarch64_gnullvm",
|
||||
"windows_aarch64_msvc",
|
||||
"windows_i686_gnu",
|
||||
"windows_i686_msvc",
|
||||
"windows_x86_64_gnu",
|
||||
"windows_x86_64_gnullvm",
|
||||
"windows_x86_64_msvc",
|
||||
"windows_aarch64_gnullvm 0.42.1",
|
||||
"windows_aarch64_msvc 0.42.1",
|
||||
"windows_i686_gnu 0.42.1",
|
||||
"windows_i686_msvc 0.42.1",
|
||||
"windows_x86_64_gnu 0.42.1",
|
||||
"windows_x86_64_gnullvm 0.42.1",
|
||||
"windows_x86_64_msvc 0.42.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-targets"
|
||||
version = "0.48.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c"
|
||||
dependencies = [
|
||||
"windows_aarch64_gnullvm 0.48.5",
|
||||
"windows_aarch64_msvc 0.48.5",
|
||||
"windows_i686_gnu 0.48.5",
|
||||
"windows_i686_msvc 0.48.5",
|
||||
"windows_x86_64_gnu 0.48.5",
|
||||
"windows_x86_64_gnullvm 0.48.5",
|
||||
"windows_x86_64_msvc 0.48.5",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1746,42 +1772,84 @@ version = "0.42.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608"
|
||||
|
||||
[[package]]
|
||||
name = "windows_aarch64_gnullvm"
|
||||
version = "0.48.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8"
|
||||
|
||||
[[package]]
|
||||
name = "windows_aarch64_msvc"
|
||||
version = "0.42.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7"
|
||||
|
||||
[[package]]
|
||||
name = "windows_aarch64_msvc"
|
||||
version = "0.48.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_gnu"
|
||||
version = "0.42.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_gnu"
|
||||
version = "0.48.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_msvc"
|
||||
version = "0.42.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_msvc"
|
||||
version = "0.48.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_gnu"
|
||||
version = "0.42.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_gnu"
|
||||
version = "0.48.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_gnullvm"
|
||||
version = "0.42.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_gnullvm"
|
||||
version = "0.48.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_msvc"
|
||||
version = "0.42.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_msvc"
|
||||
version = "0.48.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
|
||||
|
||||
[[package]]
|
||||
name = "zip"
|
||||
version = "0.5.13"
|
||||
|
||||
@@ -7,39 +7,39 @@ rust-version = "1.65"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
anyhow = "1.0.68"
|
||||
clap = { version = "4.0.32", features = ["derive"] }
|
||||
const_format = "0.2.30"
|
||||
zip = "0.6.3"
|
||||
zip-extensions = "0.6.1"
|
||||
java-properties = "1.4.1"
|
||||
log = "0.4.17"
|
||||
env_logger = "0.10.0"
|
||||
serde = { version = "1.0" }
|
||||
serde_json = "1.0"
|
||||
regex = "1.5.4"
|
||||
encoding = "0.2.33"
|
||||
retry = "2.0.0"
|
||||
humansize = "2.0.0"
|
||||
anyhow = "1"
|
||||
clap = { version = "4", features = ["derive"] }
|
||||
const_format = "0.2"
|
||||
zip = "0.6"
|
||||
zip-extensions = "0.6"
|
||||
java-properties = "2.0.0"
|
||||
log = "0.4"
|
||||
env_logger = "0.10"
|
||||
serde = { version = "1" }
|
||||
serde_json = "1"
|
||||
regex = "1"
|
||||
encoding_rs = "0.8"
|
||||
retry = "2"
|
||||
humansize = "2"
|
||||
libc = "0.2"
|
||||
extattr = "1.0.0"
|
||||
jwalk = "0.8.1"
|
||||
is_executable = "1.0.1"
|
||||
extattr = "1"
|
||||
jwalk = "0.8"
|
||||
is_executable = "1"
|
||||
nom = "7"
|
||||
derive-new = "0.5"
|
||||
rust-embed = { version = "6.4.2", features = [
|
||||
rust-embed = { version = "6", features = [
|
||||
"debug-embed",
|
||||
"compression", # must clean build after updating binaries
|
||||
] }
|
||||
which = "4.2.2"
|
||||
getopts = "0.2.21"
|
||||
sha256 = "1.4.0"
|
||||
which = "5"
|
||||
getopts = "0.2"
|
||||
sha256 = "1"
|
||||
|
||||
[target.'cfg(any(target_os = "android", target_os = "linux"))'.dependencies]
|
||||
sys-mount = { git = "https://github.com/tiann/sys-mount", branch = "loopfix" }
|
||||
# some android specific dependencies which compiles under unix are also listed here for convenience of coding
|
||||
android-properties = { version = "0.2.2", features = ["bionic-deprecated"] }
|
||||
procfs = "0.15"
|
||||
procfs = "0.16"
|
||||
|
||||
[target.'cfg(target_os = "android")'.dependencies]
|
||||
android_logger = "0.13"
|
||||
|
||||
Binary file not shown.
BIN
userspace/ksud/bin/x86_64/busybox
Normal file → Executable file
BIN
userspace/ksud/bin/x86_64/busybox
Normal file → Executable file
Binary file not shown.
@@ -81,13 +81,10 @@ pub fn get_apk_signature(apk: &str) -> Result<(u32, String)> {
|
||||
}
|
||||
|
||||
if v3_signing_exist || v3_1_signing_exist {
|
||||
return Err(anyhow::anyhow!(
|
||||
"Unexpected v3 signature found!",
|
||||
));
|
||||
return Err(anyhow::anyhow!("Unexpected v3 signature found!",));
|
||||
}
|
||||
|
||||
v2_signing.ok_or(anyhow::anyhow!("No signature found!"))
|
||||
|
||||
}
|
||||
|
||||
fn calc_cert_sha256(
|
||||
|
||||
@@ -148,20 +148,26 @@ enum Profile {
|
||||
policy: String,
|
||||
},
|
||||
|
||||
/// get template of <package-name>
|
||||
/// get template of <id>
|
||||
GetTemplate {
|
||||
/// package name
|
||||
package: String,
|
||||
/// template id
|
||||
id: String,
|
||||
},
|
||||
|
||||
/// set template of <package-name> to <template>
|
||||
/// set template of <id> to <template string>
|
||||
SetTemplate {
|
||||
/// package name
|
||||
package: String,
|
||||
/// template
|
||||
/// template id
|
||||
id: String,
|
||||
/// template string
|
||||
template: String,
|
||||
},
|
||||
|
||||
/// delete template of <id>
|
||||
DeleteTemplate {
|
||||
/// template id
|
||||
id: String,
|
||||
},
|
||||
|
||||
/// list all templates
|
||||
ListTemplates,
|
||||
}
|
||||
@@ -217,10 +223,9 @@ pub fn run() -> Result<()> {
|
||||
Profile::SetSepolicy { package, policy } => {
|
||||
crate::profile::set_sepolicy(package, policy)
|
||||
}
|
||||
Profile::GetTemplate { package } => crate::profile::get_template(package),
|
||||
Profile::SetTemplate { package, template } => {
|
||||
crate::profile::set_template(package, template)
|
||||
}
|
||||
Profile::GetTemplate { id } => crate::profile::get_template(id),
|
||||
Profile::SetTemplate { id, template } => crate::profile::set_template(id, template),
|
||||
Profile::DeleteTemplate { id } => crate::profile::delete_template(id),
|
||||
Profile::ListTemplates => crate::profile::list_templates(),
|
||||
},
|
||||
|
||||
|
||||
@@ -25,6 +25,8 @@ pub const MODULE_UPDATE_TMP_IMG: &str = concatcp!(WORKING_DIR, "update_tmp.img")
|
||||
// warning: this directory should not change, or you need to change the code in module_installer.sh!!!
|
||||
pub const MODULE_UPDATE_TMP_DIR: &str = concatcp!(ADB_DIR, "modules_update/");
|
||||
|
||||
pub const TEMP_DIR: &str = "/debug_ramdisk/";
|
||||
|
||||
pub const DISABLE_FILE_NAME: &str = "disable";
|
||||
pub const UPDATE_FILE_NAME: &str = "update";
|
||||
pub const REMOVE_FILE_NAME: &str = "remove";
|
||||
|
||||
@@ -178,6 +178,11 @@ pub fn on_post_data_fs() -> Result<()> {
|
||||
warn!("apply root profile sepolicy failed: {}", e);
|
||||
}
|
||||
|
||||
// mount temp dir
|
||||
if let Err(e) = mount::mount_tmpfs(defs::TEMP_DIR) {
|
||||
warn!("do temp dir mount failed: {}", e);
|
||||
}
|
||||
|
||||
// exec modules post-fs-data scripts
|
||||
// TODO: Add timeout
|
||||
if let Err(e) = crate::module::exec_stage_script("post-fs-data", true) {
|
||||
|
||||
@@ -27,11 +27,11 @@ grep_cmdline() {
|
||||
}
|
||||
|
||||
grep_prop() {
|
||||
local REGEX="s/^$1=//p"
|
||||
local REGEX="s/$1=//p"
|
||||
shift
|
||||
local FILES=$@
|
||||
[ -z "$FILES" ] && FILES='/system/build.prop'
|
||||
cat $FILES 2>/dev/null | dos2unix | sed -n "$REGEX" | head -n 1
|
||||
cat $FILES 2>/dev/null | dos2unix | sed -n "$REGEX" | head -n 1 | xargs
|
||||
}
|
||||
|
||||
grep_get_prop() {
|
||||
|
||||
@@ -344,7 +344,7 @@ fn _install_module(zip: &str) -> Result<()> {
|
||||
zip_extract_file_to_memory(&zip_path, &entry_path, &mut buffer)?;
|
||||
|
||||
let mut module_prop = HashMap::new();
|
||||
PropertiesIter::new_with_encoding(Cursor::new(buffer), encoding::all::UTF_8).read_into(
|
||||
PropertiesIter::new_with_encoding(Cursor::new(buffer), encoding_rs::UTF_8).read_into(
|
||||
|k, v| {
|
||||
module_prop.insert(k, v);
|
||||
},
|
||||
@@ -354,6 +354,7 @@ fn _install_module(zip: &str) -> Result<()> {
|
||||
let Some(module_id) = module_prop.get("id") else {
|
||||
bail!("module id not found in module.prop!");
|
||||
};
|
||||
let module_id = module_id.trim();
|
||||
|
||||
let modules_img = Path::new(defs::MODULE_IMG);
|
||||
let modules_update_img = Path::new(defs::MODULE_UPDATE_IMG);
|
||||
@@ -558,12 +559,13 @@ pub fn uninstall_module(id: &str) -> Result<()> {
|
||||
}
|
||||
let content = std::fs::read(module_prop)?;
|
||||
let mut module_id: String = String::new();
|
||||
PropertiesIter::new_with_encoding(Cursor::new(content), encoding::all::UTF_8)
|
||||
.read_into(|k, v| {
|
||||
PropertiesIter::new_with_encoding(Cursor::new(content), encoding_rs::UTF_8).read_into(
|
||||
|k, v| {
|
||||
if k.eq("id") {
|
||||
module_id = v;
|
||||
}
|
||||
})?;
|
||||
},
|
||||
)?;
|
||||
if module_id.eq(mid) {
|
||||
let remove_file = path.join(defs::REMOVE_FILE_NAME);
|
||||
File::create(remove_file).with_context(|| "Failed to create remove file.")?;
|
||||
@@ -656,13 +658,13 @@ fn _list_modules(path: &str) -> Vec<HashMap<String, String>> {
|
||||
continue;
|
||||
};
|
||||
let mut module_prop_map: HashMap<String, String> = HashMap::new();
|
||||
let encoding = encoding::all::UTF_8;
|
||||
let encoding = encoding_rs::UTF_8;
|
||||
let result =
|
||||
PropertiesIter::new_with_encoding(Cursor::new(content), encoding).read_into(|k, v| {
|
||||
module_prop_map.insert(k, v);
|
||||
});
|
||||
|
||||
if module_prop_map["id"].is_empty() {
|
||||
if !module_prop_map.contains_key("id") || module_prop_map["id"].is_empty() {
|
||||
if let Some(id) = entry.file_name().to_str() {
|
||||
info!("Use dir name as module id: {}", id);
|
||||
module_prop_map.insert("id".to_owned(), id.to_owned());
|
||||
|
||||
@@ -161,6 +161,16 @@ fn mount_overlayfs(
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(any(target_os = "linux", target_os = "android"))]
|
||||
pub fn mount_tmpfs(dest: impl AsRef<Path>) -> Result<()> {
|
||||
info!("mount tmpfs on {}", dest.as_ref().display());
|
||||
Mount::builder()
|
||||
.fstype(FilesystemType::from("tmpfs"))
|
||||
.mount(KSU_OVERLAY_SOURCE, dest.as_ref())
|
||||
.with_context(|| format!("mount tmpfs on {} failed", dest.as_ref().display()))?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(any(target_os = "linux", target_os = "android"))]
|
||||
fn bind_mount(from: impl AsRef<Path>, to: impl AsRef<Path>) -> Result<()> {
|
||||
info!(
|
||||
@@ -230,6 +240,7 @@ pub fn mount_overlay(root: &String, module_roots: &Vec<String>) -> Result<()> {
|
||||
.mountinfo()
|
||||
.with_context(|| "get mountinfo")?;
|
||||
let mut mount_seq = mounts
|
||||
.0
|
||||
.iter()
|
||||
.filter(|m| {
|
||||
m.mount_point.starts_with(root) && !Path::new(&root).starts_with(&m.mount_point)
|
||||
@@ -275,3 +286,8 @@ pub fn umount_dir(_src: &str) -> Result<()> {
|
||||
pub fn mount_overlay(_dest: &String, _lower_dirs: &Vec<String>) -> Result<()> {
|
||||
unimplemented!()
|
||||
}
|
||||
|
||||
#[cfg(not(any(target_os = "linux", target_os = "android")))]
|
||||
pub fn mount_tmpfs(_dest: impl AsRef<Path>) -> Result<()> {
|
||||
unimplemented!()
|
||||
}
|
||||
|
||||
@@ -18,22 +18,32 @@ pub fn get_sepolicy(pkg: String) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn set_template(name: String, template: String) -> Result<()> {
|
||||
// ksud doesn't guarteen the correctness of template, it just save
|
||||
pub fn set_template(id: String, template: String) -> Result<()> {
|
||||
ensure_dir_exists(defs::PROFILE_TEMPLATE_DIR)?;
|
||||
let template_file = Path::new(defs::PROFILE_TEMPLATE_DIR).join(name);
|
||||
let template_file = Path::new(defs::PROFILE_TEMPLATE_DIR).join(id);
|
||||
std::fs::write(template_file, template)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn get_template(name: String) -> Result<()> {
|
||||
let template_file = Path::new(defs::PROFILE_TEMPLATE_DIR).join(name);
|
||||
pub fn get_template(id: String) -> Result<()> {
|
||||
let template_file = Path::new(defs::PROFILE_TEMPLATE_DIR).join(id);
|
||||
let template = std::fs::read_to_string(template_file)?;
|
||||
println!("{template}");
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn delete_template(id: String) -> Result<()> {
|
||||
let template_file = Path::new(defs::PROFILE_TEMPLATE_DIR).join(id);
|
||||
std::fs::remove_file(template_file)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn list_templates() -> Result<()> {
|
||||
let templates = std::fs::read_dir(defs::PROFILE_TEMPLATE_DIR)?;
|
||||
let templates = std::fs::read_dir(defs::PROFILE_TEMPLATE_DIR);
|
||||
let Ok(templates) = templates else {
|
||||
return Ok(());
|
||||
};
|
||||
for template in templates {
|
||||
let template = template?;
|
||||
let template = template.file_name();
|
||||
|
||||
@@ -1,13 +1,24 @@
|
||||
|
||||
|
||||
import { createRequire } from 'module'
|
||||
import { defineConfig } from 'vitepress'
|
||||
import { defineConfig, SiteConfig } from 'vitepress'
|
||||
import locales from './locales'
|
||||
|
||||
const require = createRequire(import.meta.url)
|
||||
const pkg = require('vitepress/package.json')
|
||||
import { readdir, writeFile } from 'fs/promises'
|
||||
import { resolve } from 'path'
|
||||
|
||||
export default defineConfig( {
|
||||
title: 'KernelSU',
|
||||
locales: locales.locales
|
||||
})
|
||||
locales: locales.locales,
|
||||
sitemap: {
|
||||
hostname: 'https://kernelsu.org'
|
||||
},
|
||||
buildEnd: async (config: SiteConfig) => {
|
||||
const templateDir = resolve(config.outDir, 'templates');
|
||||
const templateList = resolve(templateDir, "index.json");
|
||||
let files = [];
|
||||
try {
|
||||
files = await readdir(templateDir);
|
||||
files = files.filter(file => !file.startsWith('.'));
|
||||
} catch(e) {
|
||||
// ignore
|
||||
}
|
||||
await writeFile(templateList, JSON.stringify(files));
|
||||
}
|
||||
})
|
||||
|
||||
@@ -36,7 +36,6 @@ export default defineConfig({
|
||||
function nav() {
|
||||
return [
|
||||
{ text: 'Guide', link: '/guide/what-is-kernelsu' },
|
||||
{ text: 'Github', link: 'https://github.com/tiann/KernelSU' }
|
||||
]
|
||||
}
|
||||
|
||||
@@ -46,6 +45,7 @@ function sidebarGuide() {
|
||||
text: 'Guide',
|
||||
items: [
|
||||
{ text: 'What is KernelSU?', link: '/guide/what-is-kernelsu' },
|
||||
{ text: 'Difference with Magisk', link: '/guide/difference-with-magisk' },
|
||||
{ text: 'Installation', link: '/guide/installation' },
|
||||
{ text: 'How to build?', link: '/guide/how-to-build' },
|
||||
{ text: 'Intergrate for non-GKI devices', link: '/guide/how-to-integrate-for-non-gki'},
|
||||
@@ -58,4 +58,4 @@ function sidebarGuide() {
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,6 @@ export default defineConfig({
|
||||
function nav() {
|
||||
return [
|
||||
{ text: 'Petunjuk', link: '/id_ID/guide/what-is-kernelsu' },
|
||||
{ text: 'Github', link: 'https://github.com/tiann/KernelSU' }
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,6 @@ export default defineConfig({
|
||||
function nav() {
|
||||
return [
|
||||
{ text: 'ガイド', link: '/ja_JP/guide/what-is-kernelsu' },
|
||||
{ text: 'Github', link: 'https://github.com/tiann/KernelSU' }
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,6 @@ export default defineConfig({
|
||||
function nav() {
|
||||
return [
|
||||
{ text: 'Guia', link: '/pt_BR/guide/what-is-kernelsu' },
|
||||
{ text: 'Github', link: 'https://github.com/tiann/KernelSU' }
|
||||
]
|
||||
}
|
||||
|
||||
@@ -46,6 +45,7 @@ function sidebarGuide() {
|
||||
text: 'Guia',
|
||||
items: [
|
||||
{ text: 'O que é KernelSU?', link: '/pt_BR/guide/what-is-kernelsu' },
|
||||
{ text: 'Diferença com Magisk', link: '/pt_BR/guide/difference-with-magisk' },
|
||||
{ text: 'Instalação', link: '/pt_BR/guide/installation' },
|
||||
{ text: 'Como construir?', link: '/pt_BR/guide/how-to-build' },
|
||||
{ text: 'Integração para dispositivos não GKI', link: '/pt_BR/guide/how-to-integrate-for-non-gki'},
|
||||
|
||||
@@ -36,7 +36,6 @@ export default defineConfig({
|
||||
function nav() {
|
||||
return [
|
||||
{ text: 'Руководство', link: '/ru_RU/guide/what-is-kernelsu' },
|
||||
{ text: 'Github', link: 'https://github.com/tiann/KernelSU' }
|
||||
]
|
||||
}
|
||||
|
||||
@@ -58,4 +57,4 @@ function sidebarGuide() {
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,6 @@ export default defineConfig({
|
||||
function nav() {
|
||||
return [
|
||||
{ text: 'Hướng Dẫn', link: '/vi_VN/guide/what-is-kernelsu' },
|
||||
{ text: 'Github', link: 'https://github.com/tiann/KernelSU' }
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,6 @@ export default defineConfig({
|
||||
function nav() {
|
||||
return [
|
||||
{ text: '指南', link: '/zh_CN/guide/what-is-kernelsu' },
|
||||
{ text: 'Github', link: 'https://github.com/tiann/KernelSU' }
|
||||
]
|
||||
}
|
||||
|
||||
@@ -58,4 +57,4 @@ function sidebarGuide() {
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,6 @@ export default defineConfig({
|
||||
function nav() {
|
||||
return [
|
||||
{ text: '指南', link: '/zh_TW/guide/what-is-kernelsu' },
|
||||
{ text: 'Github', link: 'https://github.com/tiann/KernelSU' }
|
||||
]
|
||||
}
|
||||
|
||||
@@ -57,4 +56,4 @@ function sidebarGuide() {
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,9 +20,9 @@ Before understanding the differences, you need to know how to differentiate whet
|
||||
Here are some differences:
|
||||
|
||||
- KernelSU modules cannot be installed in Recovery mode.
|
||||
- KernelSU modules do not have built-in support for Zygisk (but you can use Zygisk modules through [ZygiskOnKernelSU](https://github.com/Dr-TSNG/ZygiskOnKernelSU).
|
||||
- KernelSU modules do not have built-in support for Zygisk (but you can use Zygisk modules through [ZygiskNext](https://github.com/Dr-TSNG/ZygiskNext).
|
||||
- The method for replacing or deleting files in KernelSU modules is completely different from Magisk. KernelSU does not support the `.replace` method. Instead, you need to create a same-named file with `mknod filename c 0 0` to delete the corresponding file.
|
||||
- The directories for BusyBox are different. The built-in BusyBox in KernelSU is located in `/data/adb/ksu/bin/busybox`, while in Magisk it is in `/data/adb/magisk/busybox`. **Note that this is an internal behavior of KernelSU and may change in the future!**
|
||||
- KernelSU does not support `.replace` files; however, KernelSU supports the `REMOVE` and `REPLACE` variable to remove or replace files and folders.
|
||||
- KernelSU adds `boot-completed` stage to run some scripts on boot completed.
|
||||
- KernelSU adds `boot-completed` stage to run some scripts on boot completed.
|
||||
- KernelSU adds `post-mount` stage to run some scripts after mounting overlayfs
|
||||
|
||||
@@ -12,15 +12,15 @@ Certainly, yes.
|
||||
|
||||
## Does KernelSU support modules?
|
||||
|
||||
Yes, But it is in early version, it may be buggy. Please wait for it to be stable :)
|
||||
Yes, check [Module Page](module.md) please.
|
||||
|
||||
## Does KernelSU support Xposed?
|
||||
|
||||
Yes, [Dreamland](https://github.com/canyie/Dreamland) and [TaiChi](https://taichi.cool) work now. For LSPosed, you can make it work by [Zygisk on KernelSU](https://github.com/Dr-TSNG/ZygiskOnKernelSU)
|
||||
Yes, you can use LSPosed on [ZygiskNext](https://github.com/Dr-TSNG/ZygiskNext)
|
||||
|
||||
## Does KernelSU support Zygisk?
|
||||
|
||||
KernelSU has no builtin Zygisk support, but you can use [Zygisk on KernelSU](https://github.com/Dr-TSNG/ZygiskOnKernelSU) instead.
|
||||
KernelSU has no builtin Zygisk support, but you can use [ZygiskNext](https://github.com/Dr-TSNG/ZygiskNext) instead.
|
||||
|
||||
## Is KernelSU compatible with Magisk?
|
||||
|
||||
@@ -49,19 +49,20 @@ It is possible, KernelSU is backported to kernel 4.14 now, for older kernel, you
|
||||
|
||||
## How to integrate KernelSU for old kernel?
|
||||
|
||||
Please refer [guide](how-to-integrate-for-non-gki)
|
||||
Please refer [Guide](how-to-integrate-for-non-gki)
|
||||
|
||||
## Why my Android version is 13, and the kernel shows "android12-5.10"?
|
||||
|
||||
The Kernel version has nothing to do with Android version, if you need to flash kernel, always use the kernel version, Android version is not so important.
|
||||
|
||||
## Is there any --mount-master/global mount namespace in KernelSU?
|
||||
|
||||
There isn't now(maybe in the future), But there are many ways to switch to global mount namespace manully, such as:
|
||||
|
||||
1. `nsenter -t 1 -m sh` to get a shell in global mount namespace.
|
||||
2. Add `nsenter --mount=/proc/1/ns/mnt` to the command you want to execute, then the command is executed in global mount namespace. KernelSU is also [using this way](https://github.com/tiann/KernelSU/blob/77056a710073d7a5f7ee38f9e77c9fd0b3256576/manager/app/src/main/java/me/weishu/kernelsu/ui/util/KsuCli.kt#L115)
|
||||
|
||||
## I am GKI1.0, can i use this?
|
||||
|
||||
GKI1 is completely different from GKI2, you must compile kernel by yourself.
|
||||
|
||||
## How can i make `/system` RW?
|
||||
|
||||
We do not recommend you to modify the system partition directly. You should use the [module](module.md) to modify it systemlessly. If you insist on doing this, check [magisk_overlayfs](https://github.com/HuskyDG/magic_overlayfs).
|
||||
|
||||
## Can KernelSU modify hosts? How can i use AdAway?
|
||||
|
||||
Of course. But KernelSU doesn't have builtin hosts support, you can install [systemless-hosts](https://github.com/symbuzzer/systemless-hosts-KernelSU-module) to do it.
|
||||
|
||||
@@ -44,22 +44,20 @@ tools/bazel build --config=fast //common:kernel_aarch64_dist
|
||||
|
||||
If you can build the kernel successfully, then build KernelSU is so easy, Select any one run in Kernel source root dir:
|
||||
|
||||
- Latest tag(stable)
|
||||
::: code-group
|
||||
|
||||
```sh
|
||||
```sh[Latest tag(stable)]
|
||||
curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -
|
||||
```
|
||||
|
||||
- main branch(dev)
|
||||
|
||||
```sh
|
||||
```sh[ main branch(dev)]
|
||||
curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s main
|
||||
```
|
||||
|
||||
- Select tag(Such as v0.5.2)
|
||||
|
||||
```sh
|
||||
```sh[Select tag(Such as v0.5.2)]
|
||||
curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s v0.5.2
|
||||
```
|
||||
|
||||
:::
|
||||
|
||||
And then rebuild the kernel and you will get a kernel image with KernelSU!
|
||||
|
||||
@@ -46,27 +46,27 @@ If kprobe does not work in your kernel (may be an upstream or kernel bug below 4
|
||||
|
||||
First, add KernelSU to your kernel source tree:
|
||||
|
||||
- Latest tag(stable)
|
||||
::: code-group
|
||||
|
||||
```sh
|
||||
```sh[Latest tag(stable)]
|
||||
curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -
|
||||
```
|
||||
|
||||
- main branch(dev)
|
||||
|
||||
```sh
|
||||
```sh[ main branch(dev)]
|
||||
curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s main
|
||||
```
|
||||
|
||||
- Select tag(Such as v0.5.2)
|
||||
|
||||
```sh
|
||||
```sh[Select tag(Such as v0.5.2)]
|
||||
curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s v0.5.2
|
||||
```
|
||||
|
||||
:::
|
||||
|
||||
Then, add KernelSU calls to the kernel source, here is a patch to refer:
|
||||
|
||||
```diff
|
||||
::: code-group
|
||||
|
||||
```diff[exec.c]
|
||||
diff --git a/fs/exec.c b/fs/exec.c
|
||||
index ac59664eaecf..bdd585e1d2cc 100644
|
||||
--- a/fs/exec.c
|
||||
@@ -91,7 +91,8 @@ index ac59664eaecf..bdd585e1d2cc 100644
|
||||
+ ksu_handle_execveat_sucompat(&fd, &filename, &argv, &envp, &flags);
|
||||
return __do_execve_file(fd, filename, argv, envp, flags, NULL);
|
||||
}
|
||||
|
||||
```
|
||||
```diff[open.c]
|
||||
diff --git a/fs/open.c b/fs/open.c
|
||||
index 05036d819197..965b84d486b8 100644
|
||||
--- a/fs/open.c
|
||||
@@ -109,10 +110,20 @@ index 05036d819197..965b84d486b8 100644
|
||||
*/
|
||||
long do_faccessat(int dfd, const char __user *filename, int mode)
|
||||
{
|
||||
+ ksu_handle_faccessat(&dfd, &filename, &mode, NULL);
|
||||
const struct cred *old_cred;
|
||||
struct cred *override_cred;
|
||||
struct path path;
|
||||
struct inode *inode;
|
||||
struct vfsmount *mnt;
|
||||
int res;
|
||||
unsigned int lookup_flags = LOOKUP_FOLLOW;
|
||||
|
||||
+ ksu_handle_faccessat(&dfd, &filename, &mode, NULL);
|
||||
|
||||
if (mode & ~S_IRWXO) /* where's F_OK, X_OK, W_OK, R_OK? */
|
||||
return -EINVAL;
|
||||
```
|
||||
```diff[read_write.c]
|
||||
diff --git a/fs/read_write.c b/fs/read_write.c
|
||||
index 650fc7e0f3a6..55be193913b6 100644
|
||||
--- a/fs/read_write.c
|
||||
@@ -134,6 +145,8 @@ index 650fc7e0f3a6..55be193913b6 100644
|
||||
if (!(file->f_mode & FMODE_READ))
|
||||
return -EBADF;
|
||||
if (!(file->f_mode & FMODE_CAN_READ))
|
||||
```
|
||||
```diff[stat.c]
|
||||
diff --git a/fs/stat.c b/fs/stat.c
|
||||
index 376543199b5a..82adcef03ecc 100644
|
||||
--- a/fs/stat.c
|
||||
@@ -157,6 +170,8 @@ index 376543199b5a..82adcef03ecc 100644
|
||||
return -EINVAL;
|
||||
```
|
||||
|
||||
:::
|
||||
|
||||
You should find the four functions in kernel source:
|
||||
|
||||
1. do_faccessat, usually in `fs/open.c`
|
||||
@@ -249,3 +264,7 @@ index 45306f9ef247..815091ebfca4 100755
|
||||
```
|
||||
|
||||
Finally, build your kernel again, KernelSU should work well.
|
||||
|
||||
:::info Entering safe mode accidiently?
|
||||
If you use manual integration and do not disable `CONFIG_KPROBES`, then the user may trigger safe mode by pressing the volume down button after booting! Therefore if using manual integration you need to disable `CONFIG_KPROBES`!
|
||||
:::
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
## Check if your device is supported
|
||||
|
||||
Download KernelSU manager APP from [GitHub Releases](https://github.com/tiann/KernelSU/releases) or [Coolapk market](https://www.coolapk.com/apk/me.weishu.kernelsu), and install it to your device:
|
||||
Download KernelSU manager APP from [GitHub Releases](https://github.com/tiann/KernelSU/releases) and install it to your device:
|
||||
|
||||
- If the app shows `Unsupported`, it means **You should compile the kernel yourself**, KernelSU won't and never provide a boot image for you to flash.
|
||||
- If the app shows `Not installed`, then your devices is officially supported by KernelSU.
|
||||
@@ -43,6 +43,12 @@ w .x .y -zzz -k -something
|
||||
Note that the SubLevel in the kernel version is not part of the KMI! That means that `5.10.101-android12-9-g30979850fc20` has the same KMI as `5.10.137-android12-9-g30979850fc20`!
|
||||
:::
|
||||
|
||||
### Security patch level {#security-patch-level}
|
||||
|
||||
Newer Android devices may have anti-rollback mechanisms in place that do not allow flashing a boot image with an old security patch level. For example, if your device kernel is `5.10.101-android12-9-g30979850fc20`, its security patch is `2023-11`; even if you flash the kernel consistent with the kernel KMI, if the security patch level is older than `2023- 11`(such as `2023-06`), then it may cause bootloop.
|
||||
|
||||
Therefore, kernels with latest security patch levels are preferred while maintaining KMI consistency.
|
||||
|
||||
### Kernel version vs. Android version
|
||||
|
||||
Please note: **Kernel version and Android version are not necessarily the same!**
|
||||
@@ -53,51 +59,22 @@ If you find that your kernel version is `android12-5.10.101`, but your Android s
|
||||
|
||||
There are several installation methods for KernelSU, each suitable for a different scenario, so please choose as needed.
|
||||
|
||||
1. Install with custom Recovery (e.g. TWRP)
|
||||
2. Install with a kernel flash app, such as Franco Kernel Manager
|
||||
3. Install with fastboot using the boot.img provided by KernelSU
|
||||
4. Repair the boot.img manually and install it
|
||||
|
||||
## Install with custom Recovery
|
||||
|
||||
Prerequisite: Your device must have a custom Recovery, such as TWRP; if not or only official Recovery is available, use another method.
|
||||
|
||||
Step:
|
||||
|
||||
1. From the [Release page](https://github.com/tiann/KernelSU/releases) of KernelSU, download the zip package starting with AnyKernel3 that matches your phone version; for example, the phone kernel version is `android12-5.10. 66`, then you should download the file `AnyKernel3-android12-5.10.66_yyyy-MM.zip` (where `yyyy` is the year and `MM` is the month).
|
||||
2. Reboot the phone into TWRP.
|
||||
3. Use adb to put AnyKernel3-*.zip into the phone /sdcard and choose to install it in the TWRP GUI; or you can directly `adb sideload AnyKernel-*.zip` to install.
|
||||
|
||||
PS. This method is suitable for any installation (not limited to initial installation or subsequent upgrades), as long as you use TWRP.
|
||||
|
||||
## Install with Kernel Flasher
|
||||
|
||||
Prerequisite: Your device must be rooted. For example, you have installed Magisk to get root, or you have installed an old version of KernelSU and need to upgrade to another version of KernelSU; if your device is not rooted, please try other methods.
|
||||
|
||||
Step:
|
||||
|
||||
1. Download the AnyKernel3 zip; refer to the section *Installing with Custom Recovery* for downloading instructions.
|
||||
2. Open the Kernel Flash App and use the provided AnyKernel3 zip to flash.
|
||||
|
||||
If you haven't used the Kernel flash App before, the following are the more popular ones.
|
||||
|
||||
1. [Kernel Flasher](https://github.com/capntrips/KernelFlasher/releases)
|
||||
2. [Franco Kernel Manager](https://play.google.com/store/apps/details?id=com.franco.kernel)
|
||||
3. [Ex Kernel Manager](https://play.google.com/store/apps/details?id=flar2.exkernelmanager)
|
||||
|
||||
PS. This method is more convenient when upgrading KernelSU and can be done without a computer (backup first!). .
|
||||
1. Install with fastboot using the boot.img provided by KernelSU
|
||||
2. Install with a kernel flash app, such as KernelFlasher
|
||||
3. Repair the boot.img manually and install it
|
||||
4. Install with custom Recovery (e.g. TWRP)
|
||||
|
||||
## Install with boot.img provided by KernelSU
|
||||
|
||||
This method does not require you to have TWRP, nor does it require your phone to have root privileges; it is suitable for your first installation of KernelSU.
|
||||
If your device's `boot.img` uses a commonly used compression format, you can use the GKI images provided by KernelSU to flash it directly. It does not require TWRP or self-patching the image.
|
||||
|
||||
### Find proper boot.img
|
||||
|
||||
KernelSU provides a generic boot.img for GKI devices and you should flush the boot.img to the boot partition of the device.
|
||||
|
||||
You can download boot.img from [GitHub Release](https://github.com/tiann/KernelSU/releases), please note that you should use the correct version of boot.img. For example, if your device displays the kernel `android12-5.10.101` , you need to download `android-5.10.101_yyyy-MM.boot-<format>.img`. (Keep KMI consistent!)
|
||||
You can download boot.img from [GitHub Release](https://github.com/tiann/KernelSU/releases), please note that you should use the correct version of boot.img. If you don't know which file to download, please carefully read the description of [KMI](#kmi) and [Security Patch Level](#security-patch-level) in this document.
|
||||
|
||||
Where `<format>` refers to the kernel compression format of your official boot.img, please check the kernel compression format of your original boot.img, you should use the correct format, e.g. `lz4`, `gz`; if you use an incorrect compression format, you may encounter bootloop.
|
||||
Normally, there are three boot files in different formats under the same KMI and security patch level. They are all the same except for the kernel compression format. Please check the kernel compression format of your original boot.img. You should use the correct format, such as `lz4`, `gz`; if you use an incorrect compression format, you may encounter bootloop after flashing boot.
|
||||
|
||||
::: info
|
||||
1. You can use magiskboot to get the compression format of your original boot; of course you can also ask other, more experienced kids with the same model as your device. Also, the compression format of the kernel usually does not change, so if you boot successfully with a certain compression format, you can try that format later.
|
||||
@@ -125,16 +102,38 @@ After flashing is complete, you should reboot your device:
|
||||
fastboot reboot
|
||||
```
|
||||
|
||||
## Install with Kernel Flasher
|
||||
|
||||
Step:
|
||||
|
||||
1. Download the AnyKernel3 zip. If you don't know which file to download, please carefully read the description of [KMI](#kmi) and [Security Patch Level](#security-patch-level) in this document.
|
||||
2. Open the Kernel Flash App (grant necessary root permissions) and use the provided AnyKernel3 zip to flash.
|
||||
|
||||
This way requires the kernel flash App to have root permissions. You can use the following methods to achieve this:
|
||||
|
||||
1. Your device has rooted. For example, you have installed KernelSU and want to upgrade to the latest version, or you have rooted through other methods (such as Magisk).
|
||||
2. If your phone is not rooted, but the phone supports the temporary boot method of `fastboot boot boot.img`, you can use the GKI image provided by KernelSU to temporarily boot your device, obtain temporary root permissions, and then use the kernel flash Flash the writer to obtain permanent root privileges.
|
||||
|
||||
1. [Kernel Flasher](https://github.com/capntrips/KernelFlasher/releases)
|
||||
2. [Franco Kernel Manager](https://play.google.com/store/apps/details?id=com.franco.kernel)
|
||||
3. [Ex Kernel Manager](https://play.google.com/store/apps/details?id=flar2.exkernelmanager)
|
||||
|
||||
PS. This method is more convenient when upgrading KernelSU and can be done without a computer (backup first!). .
|
||||
|
||||
## Patch boot.img manually
|
||||
|
||||
For some devices, the boot.img format is not so common, such as not `lz4`, `gz` and uncompressed; the most typical is Pixel, its boot.img format is `lz4_legacy` compressed, ramdisk may be `gz` may also be `lz4_legacy` compression; at this time, if you directly flash the boot.img provided by KernelSU, the phone may not be able to boot; at this time, you can manually patch the boot.img to achieve.
|
||||
|
||||
There are generally two patch methods:
|
||||
It's always recommended to use `magiskboot` to patch images, there are two ways:
|
||||
|
||||
1. [Android-Image-Kitchen](https://forum.xda-developers.com/t/tool-android-image-kitchen-unpack-repack-kernel-ramdisk-win-android-linux-mac.2073775/)
|
||||
2. [magiskboot](https://github.com/topjohnwu/Magisk/releases)
|
||||
1. [magiskboot](https://github.com/topjohnwu/Magisk/releases)
|
||||
2. [magiskboot_build](https://github.com/ookiineko/magiskboot_build/releases/tag/last-ci)
|
||||
|
||||
Among them, Android-Image-Kitchen is suitable for operation on PC, and magiskboot needs the cooperation of mobile phone.
|
||||
The official build of `magiskboot` can only run on Android devices, if you want to run it on PC, you can try the second one.
|
||||
|
||||
::: tip
|
||||
Android-Image-Kitchen is not recommended now, because it doesn't handle the boot metadata(such as security patch level) correctly, thus it may not work on some devices.
|
||||
:::
|
||||
|
||||
### Preparation
|
||||
|
||||
@@ -142,15 +141,7 @@ Among them, Android-Image-Kitchen is suitable for operation on PC, and magiskboo
|
||||
2. Download the AnyKernel3 zip file provided by KernelSU that matches the KMI version of your device (you can refer to the *Install with custom Recovery*).
|
||||
3. Unpack the AnyKernel3 package and get the `Image` file, which is the kernel file of KernelSU.
|
||||
|
||||
### Using Android-Image-Kitchen
|
||||
|
||||
1. Download Android-Image-Kitchen to your computer.
|
||||
2. Put stock boot.img to Android-Image-Kitchen's root folder.
|
||||
3. Execute `./unpackimg.sh boot.img` at root directory of Android-Image-Kitchen, this command would unpack boot.img and you will get some files.
|
||||
4. Replace `boot.img-kernel` in the `split_img` directory with the `Image` you extracted from AnyKernel3 (note the name change to boot.img-kernel).
|
||||
5. Execute `./repackimg.sh` at root directory of 在 Android-Image-Kitchen; And you will get a file named `image-new.img`; Flash this boot.img by fastboot(Refer to the previous section).
|
||||
|
||||
### Using magiskboot
|
||||
### Using magiskboot on Android devices {#using-magiskboot-on-Android-devices}
|
||||
|
||||
1. Download latest Magisk from [Release Page](https://github.com/topjohnwu/Magisk/releases)
|
||||
2. Rename Magisk-*.apk to Magisk-vesion.zip and unzip it.
|
||||
@@ -161,9 +152,36 @@ Among them, Android-Image-Kitchen is suitable for operation on PC, and magiskboo
|
||||
7. Replace `kernel` with `Image`: `mv -f Image kernel`
|
||||
8. Execute `./magiskboot repack boot.img` to repack boot img, and you will get a `new-boot.img` file, flash this file to device by fastboot.
|
||||
|
||||
### Using magiskboot on Windows/macOS/Linux PC{#using-magiskboot-on-PC}
|
||||
|
||||
1. Download proper `magiskboot` for your OS from [magiskboot_build](https://github.com/ookiineko/magiskboot_build/releases/tag/last-ci)
|
||||
2. Prepare stock boot.img and Image in your PC.
|
||||
3. `chmod +x magiskboot`
|
||||
4. Enter the proper directory, execute `./magiskboot unpack boot.img` to unpack `boot.img`, you will get a `kernel` file, this is your stock kernel.
|
||||
5. Replace `kernel` with `Image`: `mv -f Image kernel`
|
||||
6. Execute `./magiskboot repack boot.img` to repack boot img, and you will get a `new-boot.img` file, flash this file to device by fastboot.
|
||||
|
||||
::: info
|
||||
Official `magiskboot` can run `Linux` device normally, if you are a Linux user, you can use official build.
|
||||
:::
|
||||
|
||||
## Install with custom Recovery
|
||||
|
||||
Prerequisite: Your device must have a custom Recovery, such as TWRP; if not or only official Recovery is available, use another method.
|
||||
|
||||
Step:
|
||||
|
||||
1. From the [Release page](https://github.com/tiann/KernelSU/releases) of KernelSU, download the zip package starting with AnyKernel3 that matches your phone version; for example, the phone kernel version is `android12-5.10. 66`, then you should download the file `AnyKernel3-android12-5.10.66_yyyy-MM.zip` (where `yyyy` is the year and `MM` is the month).
|
||||
2. Reboot the phone into TWRP.
|
||||
3. Use adb to put AnyKernel3-*.zip into the phone /sdcard and choose to install it in the TWRP GUI; or you can directly `adb sideload AnyKernel-*.zip` to install.
|
||||
|
||||
PS. This method is suitable for any installation (not limited to initial installation or subsequent upgrades), as long as you use TWRP.
|
||||
|
||||
## Other methods
|
||||
|
||||
In fact, all these installation methods have only one main idea, which is to **replace the original kernel for the one provided by KernelSU**; as long as this can be achieved, it can be installed; for example, the following are other possible methods.
|
||||
|
||||
1. First install Magisk, get root privileges through Magisk and then use the kernel flasher to flash in the AnyKernel zip from KernelSU.
|
||||
2. Use some flashing toolkit on PCs to flash in the kernel provided KernelSU.
|
||||
|
||||
But if it doesn't work, please try `magiskboot` way.
|
||||
@@ -79,7 +79,7 @@ A KernelSU module is a folder placed in `/data/adb/modules` with the structure b
|
||||
```
|
||||
|
||||
::: tip difference with Magisk
|
||||
KernelSU does not have built-in support for Zygisk, so there is no content related to Zygisk in the module. However, you can use [ZygiskOnKernelSU](https://github.com/Dr-TSNG/ZygiskOnKernelSU) to support Zygisk modules. In this case, the content of the Zygisk module is identical to that supported by Magisk.
|
||||
KernelSU does not have built-in support for Zygisk, so there is no content related to Zygisk in the module. However, you can use [ZygiskNext](https://github.com/Dr-TSNG/ZygiskNext) to support Zygisk modules. In this case, the content of the Zygisk module is identical to that supported by Magisk.
|
||||
:::
|
||||
|
||||
### module.prop
|
||||
|
||||
@@ -20,7 +20,7 @@ Sebelum memahami perbedaannya, Anda perlu mengetahui cara membedakan apakah modu
|
||||
Berikut beberapa perbedaannya:
|
||||
|
||||
- Modul KernelSU tidak dapat diinstal dalam mode Pemulihan.
|
||||
- Modul KernelSU tidak memiliki dukungan bawaan untuk Zygisk (tetapi Anda dapat menggunakan modul Zygisk melalui [ZygiskOnKernelSU](https://github.com/Dr-TSNG/ZygiskOnKernelSU).
|
||||
- Modul KernelSU tidak memiliki dukungan bawaan untuk Zygisk (tetapi Anda dapat menggunakan modul Zygisk melalui [ZygiskNext](https://github.com/Dr-TSNG/ZygiskNext).
|
||||
- Metode untuk mengganti atau menghapus file dalam modul KernelSU sama sekali berbeda dari Magisk. KernelSU tidak mendukung metode `.replace`. Sebagai gantinya, Anda perlu membuat file dengan nama yang sama dengan `mknod filename c 0 0` untuk menghapus file terkait.
|
||||
- Direktori untuk BusyBox berbeda. BusyBox bawaan di KernelSU terletak di `/data/adb/ksu/bin/busybox`, sedangkan di Magisk terletak di `/data/adb/magisk/busybox`. **Perhatikan bahwa ini adalah perilaku internal KernelSU dan dapat berubah di masa mendatang!**
|
||||
- KernelSU tidak mendukung file `.replace`; namun, KernelSU mendukung variabel `REMOVE` dan `REPLACE` untuk menghapus atau mengganti file dan folder.
|
||||
|
||||
@@ -86,7 +86,8 @@ index ac59664eaecf..bdd585e1d2cc 100644
|
||||
+ ksu_handle_execveat_sucompat(&fd, &filename, &argv, &envp, &flags);
|
||||
return __do_execve_file(fd, filename, argv, envp, flags, NULL);
|
||||
}
|
||||
|
||||
```
|
||||
```diff
|
||||
diff --git a/fs/open.c b/fs/open.c
|
||||
index 05036d819197..965b84d486b8 100644
|
||||
--- a/fs/open.c
|
||||
@@ -104,10 +105,20 @@ index 05036d819197..965b84d486b8 100644
|
||||
*/
|
||||
long do_faccessat(int dfd, const char __user *filename, int mode)
|
||||
{
|
||||
+ ksu_handle_faccessat(&dfd, &filename, &mode, NULL);
|
||||
const struct cred *old_cred;
|
||||
struct cred *override_cred;
|
||||
struct path path;
|
||||
struct inode *inode;
|
||||
struct vfsmount *mnt;
|
||||
int res;
|
||||
unsigned int lookup_flags = LOOKUP_FOLLOW;
|
||||
|
||||
+ ksu_handle_faccessat(&dfd, &filename, &mode, NULL);
|
||||
|
||||
if (mode & ~S_IRWXO) /* where's F_OK, X_OK, W_OK, R_OK? */
|
||||
return -EINVAL;
|
||||
```
|
||||
```diff
|
||||
diff --git a/fs/read_write.c b/fs/read_write.c
|
||||
index 650fc7e0f3a6..55be193913b6 100644
|
||||
--- a/fs/read_write.c
|
||||
@@ -129,6 +140,8 @@ index 650fc7e0f3a6..55be193913b6 100644
|
||||
if (!(file->f_mode & FMODE_READ))
|
||||
return -EBADF;
|
||||
if (!(file->f_mode & FMODE_CAN_READ))
|
||||
```
|
||||
```diff
|
||||
diff --git a/fs/stat.c b/fs/stat.c
|
||||
index 376543199b5a..82adcef03ecc 100644
|
||||
--- a/fs/stat.c
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
## Periksa apakah perangkat Anda didukung
|
||||
|
||||
Unduh aplikasi manajer KernelSU dari [github releases](https://github.com/tiann/KernelSU/releases) atau [github actions](https://github.com/tiann/KernelSU/actions/workflows/build-manager.yml), lalu instal aplikasi ke perangkat dan buka aplikasi:
|
||||
Unduh aplikasi manajer KernelSU dari [github releases](https://github.com/tiann/KernelSU/releases), lalu instal aplikasi ke perangkat dan buka aplikasi:
|
||||
|
||||
- Jika aplikasi menunjukkan `Unsupported`, itu berarti **Anda harus mengkompilasi kernel sendiri**, KernelSU tidak akan dan tidak pernah menyediakan boot image untuk Anda flash.
|
||||
- Jika aplikasi menunjukkan `Not installed`, maka perangkat Anda secara resmi didukung oleh KernelSU.
|
||||
|
||||
@@ -77,7 +77,7 @@ Modul KernelSU adalah folder yang ditempatkan di `/data/adb/modules` dengan stru
|
||||
```
|
||||
|
||||
::: perbedaan tip dengan Magisk
|
||||
KernelSU tidak memiliki dukungan bawaan untuk Zygisk, jadi tidak ada konten terkait Zygisk dalam modul. Namun, Anda dapat menggunakan [ZygiskOnKernelSU](https://github.com/Dr-TSNG/ZygiskOnKernelSU) untuk mendukung modul Zygisk. Dalam hal ini, konten modul Zygisk identik dengan yang didukung oleh Magisk.
|
||||
KernelSU tidak memiliki dukungan bawaan untuk Zygisk, jadi tidak ada konten terkait Zygisk dalam modul. Namun, Anda dapat menggunakan [ZygiskNext](https://github.com/Dr-TSNG/ZygiskNext) untuk mendukung modul Zygisk. Dalam hal ini, konten modul Zygisk identik dengan yang didukung oleh Magisk.
|
||||
:::
|
||||
|
||||
### module.prop
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user