mirror of
https://github.com/topjohnwu/Magisk
synced 2025-11-19 17:13:34 +01:00
Compare commits
364 Commits
v27.0
...
canary-281
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
47cc532d96 | ||
|
|
218327f92b | ||
|
|
4eae66a1a7 | ||
|
|
b09ceeb43c | ||
|
|
4fb539c110 | ||
|
|
849b284da5 | ||
|
|
895b5f6cbf | ||
|
|
cb3d4ea514 | ||
|
|
0d89a2a97d | ||
|
|
3ca5913055 | ||
|
|
df6b808f49 | ||
|
|
09c7ac754b | ||
|
|
805da67c23 | ||
|
|
3c6889505b | ||
|
|
c8e9ce7627 | ||
|
|
837c679a31 | ||
|
|
06616659b8 | ||
|
|
a34c04f999 | ||
|
|
da43ac89a0 | ||
|
|
830fc758b9 | ||
|
|
0f3cfef278 | ||
|
|
b32d7bfafd | ||
|
|
c0899f2939 | ||
|
|
082330808f | ||
|
|
024da05888 | ||
|
|
377b6d0cc2 | ||
|
|
c661009b31 | ||
|
|
613f2d31c5 | ||
|
|
7dbb973db5 | ||
|
|
f4502f8be8 | ||
|
|
455b13b83c | ||
|
|
8b98709743 | ||
|
|
1b12f45f39 | ||
|
|
a5cad532ff | ||
|
|
070719db50 | ||
|
|
28cccdf7aa | ||
|
|
b7e0986a5c | ||
|
|
da709745dd | ||
|
|
8b6771d487 | ||
|
|
e1b847fbc5 | ||
|
|
7188de1205 | ||
|
|
44fb7dbcbe | ||
|
|
8086b5933c | ||
|
|
7f675f4bf7 | ||
|
|
5e6b53e0da | ||
|
|
5b29fefc65 | ||
|
|
16a168535d | ||
|
|
33f70f8f6d | ||
|
|
4f18a66d73 | ||
|
|
250dc16007 | ||
|
|
7af273e047 | ||
|
|
e381aebaa0 | ||
|
|
45d91c9658 | ||
|
|
4a9158f667 | ||
|
|
0d9ee89e7f | ||
|
|
abaff72304 | ||
|
|
b828e2d0b2 | ||
|
|
53d7cbc11b | ||
|
|
310be7ab47 | ||
|
|
60894e458f | ||
|
|
fbebb6ac10 | ||
|
|
a9f8c20703 | ||
|
|
ae0b15d197 | ||
|
|
869aa62328 | ||
|
|
dcd3bc58a3 | ||
|
|
a82f17c594 | ||
|
|
b38fd1ca5f | ||
|
|
8e82113bce | ||
|
|
f723ef153b | ||
|
|
1dc723fb6d | ||
|
|
8f271c2575 | ||
|
|
7cf56b4406 | ||
|
|
c2eb603957 | ||
|
|
e6bd2ff60f | ||
|
|
5604074eba | ||
|
|
3f061c1a1e | ||
|
|
55e78a7b1a | ||
|
|
000f1d6041 | ||
|
|
2cbec20238 | ||
|
|
4b724c7257 | ||
|
|
ab04c6ab39 | ||
|
|
821a6c6954 | ||
|
|
5f27a62221 | ||
|
|
c76cc4c6bd | ||
|
|
52b75c53b6 | ||
|
|
9db2e99086 | ||
|
|
e9e2ecf2dd | ||
|
|
9a9e617c35 | ||
|
|
3a0becc783 | ||
|
|
1f974cb220 | ||
|
|
1db80228e8 | ||
|
|
838e1e254d | ||
|
|
554eda8fe1 | ||
|
|
2bdc047c4d | ||
|
|
e64f59ce5b | ||
|
|
b8140ad4e6 | ||
|
|
5a55483698 | ||
|
|
2d341863f5 | ||
|
|
278046becb | ||
|
|
5c0497354f | ||
|
|
98c258df93 | ||
|
|
c578cccfd5 | ||
|
|
07835a3e0e | ||
|
|
09131aca89 | ||
|
|
9ce998a6df | ||
|
|
ca36b42d79 | ||
|
|
37df39ec37 | ||
|
|
1701361a73 | ||
|
|
4c14ae33f5 | ||
|
|
d4a9ef7b7f | ||
|
|
1539cfe888 | ||
|
|
9093be1329 | ||
|
|
606d076251 | ||
|
|
46a34e19bc | ||
|
|
5ac7dc0b37 | ||
|
|
3b27de3715 | ||
|
|
939bfac920 | ||
|
|
f601bf12d5 | ||
|
|
0495468d02 | ||
|
|
300a2a242c | ||
|
|
33aebb5976 | ||
|
|
b3d6809c0b | ||
|
|
461f7e9f89 | ||
|
|
9cc50b20d8 | ||
|
|
f488e9df8f | ||
|
|
0dc596e206 | ||
|
|
c3bf03190b | ||
|
|
021ae891a9 | ||
|
|
9c03514eb1 | ||
|
|
eb74b266e1 | ||
|
|
80eb6ff25a | ||
|
|
7b81e2d2d1 | ||
|
|
a8789073f1 | ||
|
|
c8fe0f5524 | ||
|
|
d33b077a13 | ||
|
|
2282365cf8 | ||
|
|
9a00b7b942 | ||
|
|
d54baadbed | ||
|
|
0869a90fe3 | ||
|
|
2754b1dcf8 | ||
|
|
0db6314661 | ||
|
|
b5d2ef18e8 | ||
|
|
6e22476acc | ||
|
|
b26db8cee6 | ||
|
|
33cb39c8af | ||
|
|
f247759a6e | ||
|
|
de7e5bdfe7 | ||
|
|
53a8ba8cfe | ||
|
|
f2d057baba | ||
|
|
93bcf2cd25 | ||
|
|
6d82515cfc | ||
|
|
a177d3b022 | ||
|
|
92b2e06e57 | ||
|
|
f919bb0e99 | ||
|
|
054971e899 | ||
|
|
93c3d36452 | ||
|
|
4c38af994d | ||
|
|
bbb8efe92c | ||
|
|
659dd09723 | ||
|
|
4931825912 | ||
|
|
ef81cdab4f | ||
|
|
7c0b25cad9 | ||
|
|
b38ab2a7d6 | ||
|
|
a97191052b | ||
|
|
2963d4ca9e | ||
|
|
6aab856de7 | ||
|
|
94d1c66f8a | ||
|
|
7ff4d7608e | ||
|
|
46ef915c83 | ||
|
|
63b0a0d96b | ||
|
|
ea4cabdfc5 | ||
|
|
0185ddf577 | ||
|
|
ddae568741 | ||
|
|
fcb7ebb090 | ||
|
|
8d446fcc16 | ||
|
|
881d3b5221 | ||
|
|
fe9ec3bc6d | ||
|
|
480198dcd0 | ||
|
|
4ab7bc0d97 | ||
|
|
7173693d1b | ||
|
|
6b81716440 | ||
|
|
88e8e15607 | ||
|
|
69181a6b72 | ||
|
|
b11b81122a | ||
|
|
648e3ee36b | ||
|
|
724b94f320 | ||
|
|
a6e65f9a7e | ||
|
|
af5c4d09c4 | ||
|
|
872394cb58 | ||
|
|
fcbbe9a22e | ||
|
|
b168163ef0 | ||
|
|
3e38b8fed1 | ||
|
|
f90c548f27 | ||
|
|
c981c40218 | ||
|
|
dcbf37c5e8 | ||
|
|
300b233a27 | ||
|
|
e32cd03d0b | ||
|
|
a07b9315a5 | ||
|
|
e9694c6195 | ||
|
|
4a2a37c87a | ||
|
|
7dca5b831a | ||
|
|
be5ff68140 | ||
|
|
59f40d5fe5 | ||
|
|
1fbd053a42 | ||
|
|
966c6314f8 | ||
|
|
c92204c724 | ||
|
|
bb9947d4d2 | ||
|
|
7c8cdb4ad6 | ||
|
|
bd7f9c9e46 | ||
|
|
9a33a4dfe2 | ||
|
|
47e918bc92 | ||
|
|
c194168d9b | ||
|
|
cacc60b1ac | ||
|
|
52063b3652 | ||
|
|
85a4eaff59 | ||
|
|
45fa1fce70 | ||
|
|
2112c916f5 | ||
|
|
d6e159bff9 | ||
|
|
2f710a564f | ||
|
|
27cfc4945c | ||
|
|
7cdada92c8 | ||
|
|
8f1e57d4f9 | ||
|
|
8178666b49 | ||
|
|
313532dcaa | ||
|
|
2f8f3dc266 | ||
|
|
df6ada5ce3 | ||
|
|
a89b9e6af1 | ||
|
|
23ed275614 | ||
|
|
cfd1e0cf22 | ||
|
|
eb400f19b1 | ||
|
|
19f15f16f6 | ||
|
|
e158cfddfa | ||
|
|
d0cf93a08d | ||
|
|
08ad0e74dd | ||
|
|
722374a024 | ||
|
|
c6f0762510 | ||
|
|
941a363c5a | ||
|
|
2afcdc64a0 | ||
|
|
3c66c4bbc5 | ||
|
|
9f5cd5e1cc | ||
|
|
a35f2bb73b | ||
|
|
6cf00130f4 | ||
|
|
6c27ba6b88 | ||
|
|
dd3b9980e7 | ||
|
|
02e189a029 | ||
|
|
72b8d12ee4 | ||
|
|
eed03080c1 | ||
|
|
090cb4b0f9 | ||
|
|
6f2c76b898 | ||
|
|
f61827cbec | ||
|
|
3f2264f2c7 | ||
|
|
c1cadf4bdc | ||
|
|
0e56991369 | ||
|
|
4dc1c59040 | ||
|
|
33b7b8b297 | ||
|
|
e6af5ed460 | ||
|
|
b678afa4b6 | ||
|
|
4bac2df4e7 | ||
|
|
50416eee09 | ||
|
|
73cf501d33 | ||
|
|
d2b7907bed | ||
|
|
99d5dd5ea8 | ||
|
|
5fdb841fa8 | ||
|
|
7c88484d64 | ||
|
|
b22b6a4204 | ||
|
|
2a3d34c812 | ||
|
|
c50ee722a1 | ||
|
|
ffc1e38e48 | ||
|
|
6219d5fcbf | ||
|
|
2e4440b702 | ||
|
|
0d9ec0931b | ||
|
|
60e8415369 | ||
|
|
652a26d5d9 | ||
|
|
f57839379a | ||
|
|
36bd00a046 | ||
|
|
fb5ee86615 | ||
|
|
30bf5c8448 | ||
|
|
2051836a73 | ||
|
|
2cb0af1ff3 | ||
|
|
a1b6568226 | ||
|
|
1eddbfd72c | ||
|
|
21ed095601 | ||
|
|
000a2e4d59 | ||
|
|
7abe635de9 | ||
|
|
9a008c17ba | ||
|
|
08dbf728a4 | ||
|
|
4670f762d3 | ||
|
|
efa49567fa | ||
|
|
0ffc4527a7 | ||
|
|
dd9d43be96 | ||
|
|
865fca71a5 | ||
|
|
6b4baa3bcd | ||
|
|
a9ee2d7d18 | ||
|
|
d654b9cb97 | ||
|
|
4d2921e742 | ||
|
|
ecc74d45d1 | ||
|
|
5de597f079 | ||
|
|
156b0e67ca | ||
|
|
10069215f4 | ||
|
|
92b305a389 | ||
|
|
d20b30c771 | ||
|
|
83209b21ff | ||
|
|
81658d45f7 | ||
|
|
c951b208a1 | ||
|
|
050a073771 | ||
|
|
21d374214f | ||
|
|
19ea25a9d0 | ||
|
|
dbf6e40dfe | ||
|
|
d56f4fbc90 | ||
|
|
73c3d741a7 | ||
|
|
2b5fc75127 | ||
|
|
991802ab82 | ||
|
|
7f6b5305ba | ||
|
|
825c6c4316 | ||
|
|
f00408c793 | ||
|
|
a6ff3672af | ||
|
|
2290ddeb89 | ||
|
|
74af79ad03 | ||
|
|
b6c24a3a8a | ||
|
|
a8c2ae223a | ||
|
|
953d44302c | ||
|
|
24e46a5971 | ||
|
|
b1297c4192 | ||
|
|
9ae328fd84 | ||
|
|
625a1d6f44 | ||
|
|
987e5f5413 | ||
|
|
715284b70d | ||
|
|
62fc7868ac | ||
|
|
1a70796339 | ||
|
|
af6965eefa | ||
|
|
8f7d2e38f7 | ||
|
|
be433fa667 | ||
|
|
0ccd6e7381 | ||
|
|
907bbbda41 | ||
|
|
4393bc077d | ||
|
|
365b373480 | ||
|
|
47e6dd286d | ||
|
|
0dbaf52566 | ||
|
|
66f49dfab5 | ||
|
|
f8967e9274 | ||
|
|
a4f008fde5 | ||
|
|
e9980c778b | ||
|
|
06b6fb0c33 | ||
|
|
38cb3d4105 | ||
|
|
db99caf258 | ||
|
|
39dbffadfe | ||
|
|
b7505c3c9c | ||
|
|
3185e5a7ca | ||
|
|
e0cbe28711 | ||
|
|
66cee19cea | ||
|
|
2ec29ade79 | ||
|
|
c865d4e187 | ||
|
|
a42a0a53ce | ||
|
|
6d79de7d71 | ||
|
|
7e9abe6e90 | ||
|
|
4d5510be4f | ||
|
|
b04e1394c0 | ||
|
|
2aa923191e | ||
|
|
4bf1c74164 | ||
|
|
472c7878b2 | ||
|
|
38ad871e33 | ||
|
|
c5d34670c4 | ||
|
|
154121f3dd | ||
|
|
3d91a561fe |
94
.github/actions/setup/action.yml
vendored
94
.github/actions/setup/action.yml
vendored
@@ -1,44 +1,100 @@
|
|||||||
name: Magisk Setup
|
name: Magisk Setup
|
||||||
|
inputs:
|
||||||
|
is-asset-build:
|
||||||
|
required: false
|
||||||
|
default: false
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
- name: Set up JDK 17
|
- name: Set up JDK 21
|
||||||
uses: actions/setup-java@v4
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
distribution: "temurin"
|
distribution: "temurin"
|
||||||
java-version: "17"
|
java-version: "21"
|
||||||
|
|
||||||
- name: Set up Python 3
|
- name: Set up Python 3
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: "3.x"
|
python-version: "3.x"
|
||||||
|
|
||||||
- name: Set up sccache
|
- name: Install GNU make
|
||||||
uses: hendrikmuhs/ccache-action@v1.2
|
if: runner.os == 'macOS'
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
brew install make
|
||||||
|
echo 'GNUMAKE=gmake' >> "$GITHUB_ENV"
|
||||||
|
|
||||||
|
- name: Cache sccache
|
||||||
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
variant: sccache
|
path: .sccache
|
||||||
key: ${{ runner.os }}-${{ github.sha }}
|
key: sccache-${{ runner.os }}-${{ github.sha }}
|
||||||
restore-keys: ${{ runner.os }}
|
restore-keys: sccache-${{ runner.os }}-
|
||||||
max-size: 10000M
|
|
||||||
|
- name: Set up sccache
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
SCCACHE_DIRECT: false
|
||||||
|
SCCACHE_DIR: ${{ github.workspace }}/.sccache
|
||||||
|
SCCACHE_CACHE_SIZE: 2G
|
||||||
|
SCCACHE_IDLE_TIMEOUT: 0
|
||||||
|
run: |
|
||||||
|
bash $GITHUB_ACTION_PATH/sccache.sh
|
||||||
|
sccache --start-server
|
||||||
|
sccache -z
|
||||||
|
|
||||||
|
- name: Show sccache stats
|
||||||
|
uses: gacts/run-and-post-run@v1
|
||||||
|
with:
|
||||||
|
run: sccache -s
|
||||||
|
post: sccache -s
|
||||||
|
|
||||||
|
- name: Set GRADLE_USER_HOME
|
||||||
|
shell: bash
|
||||||
|
run: echo "GRADLE_USER_HOME=$GITHUB_WORKSPACE/.gradle" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
- name: Cache Gradle dependencies
|
- name: Cache Gradle dependencies
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
|
if: inputs.is-asset-build == 'true'
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
~/.gradle/caches
|
.gradle/caches
|
||||||
~/.gradle/wrapper
|
.gradle/wrapper
|
||||||
!~/.gradle/caches/build-cache-*
|
!.gradle/caches/build-cache-*
|
||||||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
|
key: gradle-cache-${{ hashFiles('gradle/**') }}
|
||||||
restore-keys: ${{ runner.os }}-gradle-
|
restore-keys: gradle-cache-
|
||||||
|
|
||||||
- name: Cache build cache
|
- name: Restore Gradle dependencies
|
||||||
uses: actions/cache@v4
|
uses: actions/cache/restore@v4
|
||||||
|
if: inputs.is-asset-build == 'false'
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
~/.gradle/caches/build-cache-*
|
.gradle/caches
|
||||||
key: ${{ runner.os }}-build-cache-${{ github.sha }}
|
.gradle/wrapper
|
||||||
restore-keys: ${{ runner.os }}-build-cache-
|
!.gradle/caches/build-cache-*
|
||||||
|
key: gradle-cache-${{ hashFiles('gradle/**') }}
|
||||||
|
restore-keys: gradle-cache-
|
||||||
|
enableCrossOsArchive: true
|
||||||
|
|
||||||
|
- name: Cache Gradle build cache
|
||||||
|
uses: actions/cache@v4
|
||||||
|
if: inputs.is-asset-build == 'true'
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
.gradle/caches/build-cache-*
|
||||||
|
key: gradle-build-cache-${{ github.sha }}
|
||||||
|
restore-keys: gradle-build-cache-
|
||||||
|
|
||||||
|
- name: Restore Gradle build cache
|
||||||
|
uses: actions/cache/restore@v4
|
||||||
|
if: inputs.is-asset-build == 'false'
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
.gradle/caches/build-cache-*
|
||||||
|
key: gradle-build-cache-${{ github.sha }}
|
||||||
|
restore-keys: gradle-build-cache-
|
||||||
|
enableCrossOsArchive: true
|
||||||
|
|
||||||
- name: Set up NDK
|
- name: Set up NDK
|
||||||
run: python build.py -v ndk
|
|
||||||
shell: bash
|
shell: bash
|
||||||
|
run: python build.py -v ndk
|
||||||
|
|||||||
25
.github/actions/setup/sccache.sh
vendored
Executable file
25
.github/actions/setup/sccache.sh
vendored
Executable file
@@ -0,0 +1,25 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Get latest sccache version
|
||||||
|
get_sccache_ver() {
|
||||||
|
curl -sL 'https://api.github.com/repos/mozilla/sccache/releases/latest' | jq -r .name
|
||||||
|
}
|
||||||
|
|
||||||
|
# $1=variant
|
||||||
|
# $2=install_dir
|
||||||
|
# $3=exe
|
||||||
|
install_from_gh() {
|
||||||
|
local ver=$(curl -sL 'https://api.github.com/repos/mozilla/sccache/releases/latest' | jq -r .name)
|
||||||
|
local url="https://github.com/mozilla/sccache/releases/download/${ver}/sccache-${ver}-$1.tar.gz"
|
||||||
|
local dest="$2/$3"
|
||||||
|
curl -L "$url" | tar xz -O --wildcards "*/$3" > $dest
|
||||||
|
chmod +x $dest
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ $RUNNER_OS = "macOS" ]; then
|
||||||
|
brew install sccache
|
||||||
|
elif [ $RUNNER_OS = "Linux" ]; then
|
||||||
|
install_from_gh x86_64-unknown-linux-musl /usr/local/bin sccache
|
||||||
|
elif [ $RUNNER_OS = "Windows" ]; then
|
||||||
|
install_from_gh x86_64-pc-windows-msvc $USERPROFILE/.cargo/bin sccache.exe
|
||||||
|
fi
|
||||||
1
.github/ci.prop
vendored
Normal file
1
.github/ci.prop
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
abiList=arm64-v8a
|
||||||
136
.github/workflows/build.yml
vendored
136
.github/workflows/build.yml
vendored
@@ -6,7 +6,6 @@ on:
|
|||||||
paths:
|
paths:
|
||||||
- "app/**"
|
- "app/**"
|
||||||
- "native/**"
|
- "native/**"
|
||||||
- "stub/**"
|
|
||||||
- "buildSrc/**"
|
- "buildSrc/**"
|
||||||
- "build.py"
|
- "build.py"
|
||||||
- "gradle.properties"
|
- "gradle.properties"
|
||||||
@@ -18,9 +17,7 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Build Magisk artifacts
|
name: Build Magisk artifacts
|
||||||
runs-on: ubuntu-latest
|
runs-on: macos-14
|
||||||
env:
|
|
||||||
SCCACHE_DIRECT: false
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
steps:
|
steps:
|
||||||
@@ -28,10 +25,11 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: "recursive"
|
submodules: "recursive"
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Setup environment
|
- name: Setup environment
|
||||||
uses: ./.github/actions/setup
|
uses: ./.github/actions/setup
|
||||||
|
with:
|
||||||
|
is-asset-build: true
|
||||||
|
|
||||||
- name: Build release
|
- name: Build release
|
||||||
run: ./build.py -vr all
|
run: ./build.py -vr all
|
||||||
@@ -53,53 +51,47 @@ jobs:
|
|||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ github.sha }}-symbols
|
name: ${{ github.sha }}-symbols
|
||||||
path: app/build/outputs
|
path: app/apk/build/outputs
|
||||||
compression-level: 9
|
compression-level: 9
|
||||||
|
|
||||||
test-build:
|
test-build:
|
||||||
name: Test building on ${{ matrix.os }}
|
name: Test building on ${{ matrix.os }}
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
env:
|
|
||||||
SCCACHE_DIRECT: false
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [windows-latest, macos-14]
|
os: [windows-latest, ubuntu-latest]
|
||||||
steps:
|
steps:
|
||||||
- name: Check out
|
- name: Check out
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: "recursive"
|
submodules: "recursive"
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Setup environment
|
- name: Setup environment
|
||||||
uses: ./.github/actions/setup
|
uses: ./.github/actions/setup
|
||||||
|
|
||||||
- name: Build debug
|
- name: Test build
|
||||||
run: python build.py -v all
|
run: python build.py -v -c .github/ci.prop all
|
||||||
|
|
||||||
- name: Stop gradle daemon
|
- name: Stop gradle daemon
|
||||||
run: ./gradlew --stop
|
run: ./gradlew --stop
|
||||||
|
|
||||||
test:
|
avd-test:
|
||||||
name: Test on API ${{ matrix.api }}
|
name: Test API ${{ matrix.version }} (x86_64)
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: build
|
needs: build
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
api: [23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34]
|
version: [23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35]
|
||||||
|
type: [""]
|
||||||
|
include:
|
||||||
|
- version: "Baklava"
|
||||||
|
type: "google_apis"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Check out
|
- name: Check out
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Set up Python 3
|
|
||||||
uses: actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
python-version: "3.x"
|
|
||||||
|
|
||||||
- name: Download build artifacts
|
- name: Download build artifacts
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
@@ -113,5 +105,101 @@ jobs:
|
|||||||
sudo udevadm control --reload-rules
|
sudo udevadm control --reload-rules
|
||||||
sudo udevadm trigger --name-match=kvm
|
sudo udevadm trigger --name-match=kvm
|
||||||
|
|
||||||
- name: AVD test
|
- name: Run AVD test
|
||||||
run: scripts/avd_test.sh ${{ matrix.api }}
|
timeout-minutes: 10
|
||||||
|
env:
|
||||||
|
AVD_TEST_LOG: 1
|
||||||
|
run: scripts/avd_test.sh ${{ matrix.version }} ${{ matrix.type }}
|
||||||
|
|
||||||
|
- name: Upload logs on error
|
||||||
|
if: ${{ failure() }}
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: "avd-logs-${{ matrix.version }}"
|
||||||
|
path: |
|
||||||
|
kernel.log
|
||||||
|
logcat.log
|
||||||
|
|
||||||
|
avd-test-32:
|
||||||
|
name: Test API ${{ matrix.version }} (x86)
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: build
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
version: [23, 24, 25, 26, 27, 28, 29, 30]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Check out
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Download build artifacts
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: ${{ github.sha }}
|
||||||
|
path: out
|
||||||
|
|
||||||
|
- name: Enable KVM group perms
|
||||||
|
run: |
|
||||||
|
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
|
||||||
|
sudo udevadm control --reload-rules
|
||||||
|
sudo udevadm trigger --name-match=kvm
|
||||||
|
|
||||||
|
- name: Run AVD test
|
||||||
|
timeout-minutes: 10
|
||||||
|
env:
|
||||||
|
FORCE_32_BIT: 1
|
||||||
|
AVD_TEST_LOG: 1
|
||||||
|
run: scripts/avd_test.sh ${{ matrix.version }}
|
||||||
|
|
||||||
|
- name: Upload logs on error
|
||||||
|
if: ${{ failure() }}
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: "avd32-logs-${{ matrix.version }}"
|
||||||
|
path: |
|
||||||
|
kernel.log
|
||||||
|
logcat.log
|
||||||
|
|
||||||
|
cf_test:
|
||||||
|
name: Test ${{ matrix.device }}
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
needs: build
|
||||||
|
env:
|
||||||
|
CF_HOME: /home/runner/aosp_cf_phone
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- branch: "aosp-main"
|
||||||
|
device: "aosp_cf_x86_64_phone"
|
||||||
|
- branch: "aosp-main-throttled"
|
||||||
|
device: "aosp_cf_x86_64_phone_pgagnostic"
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Check out
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Download build artifacts
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: ${{ github.sha }}
|
||||||
|
path: out
|
||||||
|
|
||||||
|
- name: Setup Cuttlefish environment
|
||||||
|
run: |
|
||||||
|
scripts/cuttlefish.sh setup
|
||||||
|
scripts/cuttlefish.sh download ${{ matrix.branch }} ${{ matrix.device }}
|
||||||
|
|
||||||
|
- name: Run Cuttlefish test
|
||||||
|
timeout-minutes: 10
|
||||||
|
run: su $USER -c 'scripts/cuttlefish.sh test'
|
||||||
|
|
||||||
|
- name: Upload logs on error
|
||||||
|
if: ${{ failure() }}
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: "cvd-logs-${{ matrix.device }}"
|
||||||
|
path: |
|
||||||
|
/home/runner/aosp_cf_phone/cuttlefish/instances/cvd-1/logs
|
||||||
|
/home/runner/aosp_cf_phone/cuttlefish/instances/cvd-1/cuttlefish_config.json
|
||||||
|
|||||||
6
.gitignore
vendored
6
.gitignore
vendored
@@ -3,8 +3,9 @@ out
|
|||||||
*.jks
|
*.jks
|
||||||
*.apk
|
*.apk
|
||||||
/config.prop
|
/config.prop
|
||||||
|
/notes.md
|
||||||
/update.sh
|
/update.sh
|
||||||
/dict.txt
|
/app/dict.txt
|
||||||
|
|
||||||
# Built binaries
|
# Built binaries
|
||||||
native/out
|
native/out
|
||||||
@@ -12,7 +13,8 @@ native/out
|
|||||||
# Android Studio / Gradle
|
# Android Studio / Gradle
|
||||||
*.iml
|
*.iml
|
||||||
.gradle
|
.gradle
|
||||||
|
.idea
|
||||||
|
.kotlin
|
||||||
/local.properties
|
/local.properties
|
||||||
/.idea
|
|
||||||
/build
|
/build
|
||||||
/captures
|
/captures
|
||||||
|
|||||||
9
.gitmodules
vendored
9
.gitmodules
vendored
@@ -1,9 +1,6 @@
|
|||||||
[submodule "selinux"]
|
[submodule "selinux"]
|
||||||
path = native/src/external/selinux
|
path = native/src/external/selinux
|
||||||
url = https://github.com/topjohnwu/selinux.git
|
url = https://github.com/topjohnwu/selinux.git
|
||||||
[submodule "busybox"]
|
|
||||||
path = native/src/external/busybox
|
|
||||||
url = https://github.com/topjohnwu/ndk-busybox.git
|
|
||||||
[submodule "lz4"]
|
[submodule "lz4"]
|
||||||
path = native/src/external/lz4
|
path = native/src/external/lz4
|
||||||
url = https://github.com/lz4/lz4.git
|
url = https://github.com/lz4/lz4.git
|
||||||
@@ -13,9 +10,6 @@
|
|||||||
[submodule "xz"]
|
[submodule "xz"]
|
||||||
path = native/src/external/xz
|
path = native/src/external/xz
|
||||||
url = https://github.com/xz-mirror/xz.git
|
url = https://github.com/xz-mirror/xz.git
|
||||||
[submodule "pcre"]
|
|
||||||
path = native/src/external/pcre
|
|
||||||
url = https://android.googlesource.com/platform/external/pcre
|
|
||||||
[submodule "libcxx"]
|
[submodule "libcxx"]
|
||||||
path = native/src/external/libcxx
|
path = native/src/external/libcxx
|
||||||
url = https://github.com/topjohnwu/libcxx.git
|
url = https://github.com/topjohnwu/libcxx.git
|
||||||
@@ -34,6 +28,9 @@
|
|||||||
[submodule "system_properties"]
|
[submodule "system_properties"]
|
||||||
path = native/src/external/system_properties
|
path = native/src/external/system_properties
|
||||||
url = https://github.com/topjohnwu/system_properties.git
|
url = https://github.com/topjohnwu/system_properties.git
|
||||||
|
[submodule "crt0"]
|
||||||
|
path = native/src/external/crt0
|
||||||
|
url = https://github.com/topjohnwu/crt0.git
|
||||||
[submodule "termux-elf-cleaner"]
|
[submodule "termux-elf-cleaner"]
|
||||||
path = tools/termux-elf-cleaner
|
path = tools/termux-elf-cleaner
|
||||||
url = https://github.com/termux/termux-elf-cleaner.git
|
url = https://github.com/termux/termux-elf-cleaner.git
|
||||||
|
|||||||
14
README.MD
14
README.MD
@@ -18,16 +18,18 @@ Some highlight features:
|
|||||||
|
|
||||||
[Github](https://github.com/topjohnwu/Magisk/) is the only source where you can get official Magisk information and downloads.
|
[Github](https://github.com/topjohnwu/Magisk/) is the only source where you can get official Magisk information and downloads.
|
||||||
|
|
||||||
[](https://github.com/topjohnwu/Magisk/releases/tag/v26.4)
|
Click the icon below to download Magisk apk.
|
||||||
[](https://github.com/topjohnwu/Magisk/releases/tag/v26.4)
|
|
||||||
[](https://raw.githubusercontent.com/topjohnwu/magisk-files/canary/app-release.apk)
|
[](https://github.com/topjohnwu/Magisk/releases/tag/v28.1)
|
||||||
[](https://raw.githubusercontent.com/topjohnwu/magisk-files/canary/app-debug.apk)
|
[](https://github.com/topjohnwu/Magisk/releases/tag/v28.1)
|
||||||
|
[](https://github.com/topjohnwu/Magisk/releases/tag/canary-28101)
|
||||||
|
|
||||||
## Useful Links
|
## Useful Links
|
||||||
|
|
||||||
- [Installation Instruction](https://topjohnwu.github.io/Magisk/install.html)
|
- [Installation Instruction](https://topjohnwu.github.io/Magisk/install.html)
|
||||||
- [Building and Development](https://topjohnwu.github.io/Magisk/build.html)
|
- [Building and Development](https://topjohnwu.github.io/Magisk/build.html)
|
||||||
- [Magisk Documentation](https://topjohnwu.github.io/Magisk/)
|
- [Magisk Documentation](https://topjohnwu.github.io/Magisk/)
|
||||||
|
- [Zygisk module sample](https://github.com/topjohnwu/zygisk-module-sample)
|
||||||
|
|
||||||
## Bug Reports
|
## Bug Reports
|
||||||
|
|
||||||
@@ -41,8 +43,8 @@ For Magisk app crashes, record and upload the logcat when the crash occurs.
|
|||||||
|
|
||||||
Default string resources for the Magisk app and its stub APK are located here:
|
Default string resources for the Magisk app and its stub APK are located here:
|
||||||
|
|
||||||
- `app/src/main/res/values/strings.xml`
|
- `app/core/src/main/res/values/strings.xml`
|
||||||
- `stub/src/main/res/values/strings.xml`
|
- `app/stub/src/main/res/values/strings.xml`
|
||||||
|
|
||||||
Translate each and place them in the respective locations (`[module]/src/main/res/values-[lang]/strings.xml`).
|
Translate each and place them in the respective locations (`[module]/src/main/res/values-[lang]/strings.xml`).
|
||||||
|
|
||||||
|
|||||||
11
app/.gitignore
vendored
11
app/.gitignore
vendored
@@ -1,11 +0,0 @@
|
|||||||
*.iml
|
|
||||||
.gradle
|
|
||||||
/local.properties
|
|
||||||
.idea/
|
|
||||||
/build
|
|
||||||
*.hprof
|
|
||||||
.externalNativeBuild/
|
|
||||||
*.apk
|
|
||||||
src/*/assets
|
|
||||||
src/*/jniLibs
|
|
||||||
src/*/resources
|
|
||||||
1
app/apk/.gitignore
vendored
Normal file
1
app/apk/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
/build
|
||||||
59
app/apk/build.gradle.kts
Normal file
59
app/apk/build.gradle.kts
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
plugins {
|
||||||
|
id("com.android.application")
|
||||||
|
kotlin("android")
|
||||||
|
kotlin("plugin.parcelize")
|
||||||
|
kotlin("kapt")
|
||||||
|
id("androidx.navigation.safeargs.kotlin")
|
||||||
|
}
|
||||||
|
|
||||||
|
setupMainApk()
|
||||||
|
|
||||||
|
kapt {
|
||||||
|
correctErrorTypes = true
|
||||||
|
useBuildCache = true
|
||||||
|
mapDiagnosticLocations = true
|
||||||
|
javacOptions {
|
||||||
|
option("-Xmaxerrs", "1000")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
buildFeatures {
|
||||||
|
dataBinding = true
|
||||||
|
}
|
||||||
|
|
||||||
|
compileOptions {
|
||||||
|
isCoreLibraryDesugaringEnabled = true
|
||||||
|
}
|
||||||
|
|
||||||
|
buildTypes {
|
||||||
|
release {
|
||||||
|
isMinifyEnabled = true
|
||||||
|
isShrinkResources = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation(project(":app:core"))
|
||||||
|
coreLibraryDesugaring(libs.jdk.libs)
|
||||||
|
|
||||||
|
implementation(libs.indeterminate.checkbox)
|
||||||
|
implementation(libs.rikka.layoutinflater)
|
||||||
|
implementation(libs.rikka.insets)
|
||||||
|
implementation(libs.rikka.recyclerview)
|
||||||
|
|
||||||
|
implementation(libs.navigation.fragment.ktx)
|
||||||
|
implementation(libs.navigation.ui.ktx)
|
||||||
|
|
||||||
|
implementation(libs.constraintlayout)
|
||||||
|
implementation(libs.swiperefreshlayout)
|
||||||
|
implementation(libs.recyclerview)
|
||||||
|
implementation(libs.transition)
|
||||||
|
implementation(libs.fragment.ktx)
|
||||||
|
implementation(libs.appcompat)
|
||||||
|
implementation(libs.material)
|
||||||
|
|
||||||
|
// Make sure kapt runs with a proper kotlin-stdlib
|
||||||
|
kapt(kotlin("stdlib"))
|
||||||
|
}
|
||||||
33
app/apk/src/main/AndroidManifest.xml
Normal file
33
app/apk/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
|
||||||
|
<application android:localeConfig="@xml/locale_config">
|
||||||
|
<activity
|
||||||
|
android:name=".ui.MainActivity"
|
||||||
|
android:exported="true"
|
||||||
|
android:theme="@style/SplashTheme">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.APPLICATION_PREFERENCES" />
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".ui.surequest.SuRequestActivity"
|
||||||
|
android:directBootAware="true"
|
||||||
|
android:exported="false"
|
||||||
|
android:taskAffinity=""
|
||||||
|
tools:ignore="AppLinkUrlError">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
</application>
|
||||||
|
|
||||||
|
</manifest>
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
package com.topjohnwu.magisk.arch
|
package com.topjohnwu.magisk.arch
|
||||||
|
|
||||||
import android.Manifest.permission.*
|
import android.Manifest.permission.POST_NOTIFICATIONS
|
||||||
|
import android.Manifest.permission.REQUEST_INSTALL_PACKAGES
|
||||||
|
import android.Manifest.permission.WRITE_EXTERNAL_STORAGE
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import androidx.databinding.PropertyChangeRegistry
|
import androidx.databinding.PropertyChangeRegistry
|
||||||
@@ -8,7 +10,7 @@ import androidx.lifecycle.LiveData
|
|||||||
import androidx.lifecycle.MutableLiveData
|
import androidx.lifecycle.MutableLiveData
|
||||||
import androidx.lifecycle.ViewModel
|
import androidx.lifecycle.ViewModel
|
||||||
import androidx.navigation.NavDirections
|
import androidx.navigation.NavDirections
|
||||||
import com.topjohnwu.magisk.R
|
import com.topjohnwu.magisk.core.R
|
||||||
import com.topjohnwu.magisk.databinding.ObservableHost
|
import com.topjohnwu.magisk.databinding.ObservableHost
|
||||||
import com.topjohnwu.magisk.events.BackPressEvent
|
import com.topjohnwu.magisk.events.BackPressEvent
|
||||||
import com.topjohnwu.magisk.events.DialogBuilder
|
import com.topjohnwu.magisk.events.DialogBuilder
|
||||||
@@ -1,11 +1,13 @@
|
|||||||
package com.topjohnwu.magisk.arch
|
package com.topjohnwu.magisk.arch
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
import android.content.res.Resources
|
import android.content.res.Resources
|
||||||
import android.graphics.Color
|
import android.graphics.Color
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.appcompat.app.AppCompatDelegate
|
import androidx.appcompat.app.AppCompatDelegate
|
||||||
import androidx.core.content.res.use
|
import androidx.core.content.res.use
|
||||||
import androidx.core.view.WindowCompat
|
import androidx.core.view.WindowCompat
|
||||||
@@ -18,14 +20,20 @@ import com.google.android.material.snackbar.Snackbar
|
|||||||
import com.topjohnwu.magisk.BR
|
import com.topjohnwu.magisk.BR
|
||||||
import com.topjohnwu.magisk.R
|
import com.topjohnwu.magisk.R
|
||||||
import com.topjohnwu.magisk.core.Config
|
import com.topjohnwu.magisk.core.Config
|
||||||
import com.topjohnwu.magisk.core.base.BaseActivity
|
import com.topjohnwu.magisk.core.base.ActivityExtension
|
||||||
|
import com.topjohnwu.magisk.core.base.IActivityExtension
|
||||||
|
import com.topjohnwu.magisk.core.isRunningAsStub
|
||||||
|
import com.topjohnwu.magisk.core.ktx.reflectField
|
||||||
|
import com.topjohnwu.magisk.core.wrap
|
||||||
import rikka.insets.WindowInsetsHelper
|
import rikka.insets.WindowInsetsHelper
|
||||||
import rikka.layoutinflater.view.LayoutInflaterFactory
|
import rikka.layoutinflater.view.LayoutInflaterFactory
|
||||||
|
|
||||||
abstract class UIActivity<Binding : ViewDataBinding> : BaseActivity(), ViewModelHolder {
|
abstract class UIActivity<Binding : ViewDataBinding>
|
||||||
|
: AppCompatActivity(), ViewModelHolder, IActivityExtension {
|
||||||
|
|
||||||
protected lateinit var binding: Binding
|
protected lateinit var binding: Binding
|
||||||
protected abstract val layoutRes: Int
|
protected abstract val layoutRes: Int
|
||||||
|
override val extension = ActivityExtension(this)
|
||||||
|
|
||||||
protected val binded get() = ::binding.isInitialized
|
protected val binded get() = ::binding.isInitialized
|
||||||
|
|
||||||
@@ -36,10 +44,23 @@ abstract class UIActivity<Binding : ViewDataBinding> : BaseActivity(), ViewModel
|
|||||||
AppCompatDelegate.setDefaultNightMode(Config.darkTheme)
|
AppCompatDelegate.setDefaultNightMode(Config.darkTheme)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun attachBaseContext(base: Context) {
|
||||||
|
super.attachBaseContext(base.wrap())
|
||||||
|
}
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
layoutInflater.factory2 = LayoutInflaterFactory(delegate)
|
layoutInflater.factory2 = LayoutInflaterFactory(delegate)
|
||||||
.addOnViewCreatedListener(WindowInsetsHelper.LISTENER)
|
.addOnViewCreatedListener(WindowInsetsHelper.LISTENER)
|
||||||
|
|
||||||
|
extension.onCreate(savedInstanceState)
|
||||||
|
if (isRunningAsStub) {
|
||||||
|
// Overwrite private members to avoid nasty "false" stack traces being logged
|
||||||
|
val delegate = delegate
|
||||||
|
val clz = delegate.javaClass
|
||||||
|
clz.reflectField("mActivityHandlesConfigFlagsChecked").set(delegate, true)
|
||||||
|
clz.reflectField("mActivityHandlesConfigFlags").set(delegate, 0)
|
||||||
|
}
|
||||||
|
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
|
|
||||||
startObserveLiveData()
|
startObserveLiveData()
|
||||||
@@ -70,6 +91,11 @@ abstract class UIActivity<Binding : ViewDataBinding> : BaseActivity(), ViewModel
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onSaveInstanceState(outState: Bundle) {
|
||||||
|
super.onSaveInstanceState(outState)
|
||||||
|
extension.onSaveInstanceState(outState)
|
||||||
|
}
|
||||||
|
|
||||||
fun setContentView() {
|
fun setContentView() {
|
||||||
binding = DataBindingUtil.setContentView<Binding>(this, layoutRes).also {
|
binding = DataBindingUtil.setContentView<Binding>(this, layoutRes).also {
|
||||||
it.setVariable(BR.viewModel, viewModel)
|
it.setVariable(BR.viewModel, viewModel)
|
||||||
@@ -8,7 +8,12 @@ import android.text.Spanned
|
|||||||
import android.util.TypedValue
|
import android.util.TypedValue
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.widget.*
|
import android.widget.ArrayAdapter
|
||||||
|
import android.widget.Button
|
||||||
|
import android.widget.ImageView
|
||||||
|
import android.widget.ProgressBar
|
||||||
|
import android.widget.Spinner
|
||||||
|
import android.widget.TextView
|
||||||
import androidx.annotation.DrawableRes
|
import androidx.annotation.DrawableRes
|
||||||
import androidx.appcompat.widget.Toolbar
|
import androidx.appcompat.widget.Toolbar
|
||||||
import androidx.cardview.widget.CardView
|
import androidx.cardview.widget.CardView
|
||||||
@@ -20,7 +25,11 @@ import androidx.databinding.BindingAdapter
|
|||||||
import androidx.databinding.InverseBindingAdapter
|
import androidx.databinding.InverseBindingAdapter
|
||||||
import androidx.databinding.InverseBindingListener
|
import androidx.databinding.InverseBindingListener
|
||||||
import androidx.interpolator.view.animation.FastOutSlowInInterpolator
|
import androidx.interpolator.view.animation.FastOutSlowInInterpolator
|
||||||
import androidx.recyclerview.widget.*
|
import androidx.recyclerview.widget.DividerItemDecoration
|
||||||
|
import androidx.recyclerview.widget.GridLayoutManager
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
|
import androidx.recyclerview.widget.StaggeredGridLayoutManager
|
||||||
import com.google.android.material.button.MaterialButton
|
import com.google.android.material.button.MaterialButton
|
||||||
import com.google.android.material.card.MaterialCardView
|
import com.google.android.material.card.MaterialCardView
|
||||||
import com.google.android.material.chip.Chip
|
import com.google.android.material.chip.Chip
|
||||||
@@ -3,7 +3,7 @@ package com.topjohnwu.magisk.databinding
|
|||||||
import androidx.databinding.ListChangeRegistry
|
import androidx.databinding.ListChangeRegistry
|
||||||
import androidx.databinding.ObservableList
|
import androidx.databinding.ObservableList
|
||||||
import androidx.databinding.ObservableList.OnListChangedCallback
|
import androidx.databinding.ObservableList.OnListChangedCallback
|
||||||
import java.util.*
|
import java.util.AbstractList
|
||||||
|
|
||||||
@Suppress("UNCHECKED_CAST")
|
@Suppress("UNCHECKED_CAST")
|
||||||
class MergeObservableList<T> : AbstractList<T>(), ObservableList<T> {
|
class MergeObservableList<T> : AbstractList<T>(), ObservableList<T> {
|
||||||
@@ -7,26 +7,27 @@ import com.topjohnwu.magisk.arch.UIActivity
|
|||||||
import com.topjohnwu.magisk.core.Config
|
import com.topjohnwu.magisk.core.Config
|
||||||
import com.topjohnwu.magisk.events.DialogBuilder
|
import com.topjohnwu.magisk.events.DialogBuilder
|
||||||
import com.topjohnwu.magisk.view.MagiskDialog
|
import com.topjohnwu.magisk.view.MagiskDialog
|
||||||
|
import com.topjohnwu.magisk.core.R as CoreR
|
||||||
|
|
||||||
class DarkThemeDialog : DialogBuilder {
|
class DarkThemeDialog : DialogBuilder {
|
||||||
|
|
||||||
override fun build(dialog: MagiskDialog) {
|
override fun build(dialog: MagiskDialog) {
|
||||||
val activity = dialog.ownerActivity!!
|
val activity = dialog.ownerActivity!!
|
||||||
dialog.apply {
|
dialog.apply {
|
||||||
setTitle(R.string.settings_dark_mode_title)
|
setTitle(CoreR.string.settings_dark_mode_title)
|
||||||
setMessage(R.string.settings_dark_mode_message)
|
setMessage(CoreR.string.settings_dark_mode_message)
|
||||||
setButton(MagiskDialog.ButtonType.POSITIVE) {
|
setButton(MagiskDialog.ButtonType.POSITIVE) {
|
||||||
text = R.string.settings_dark_mode_light
|
text = CoreR.string.settings_dark_mode_light
|
||||||
icon = R.drawable.ic_day
|
icon = R.drawable.ic_day
|
||||||
onClick { selectTheme(AppCompatDelegate.MODE_NIGHT_NO, activity) }
|
onClick { selectTheme(AppCompatDelegate.MODE_NIGHT_NO, activity) }
|
||||||
}
|
}
|
||||||
setButton(MagiskDialog.ButtonType.NEUTRAL) {
|
setButton(MagiskDialog.ButtonType.NEUTRAL) {
|
||||||
text = R.string.settings_dark_mode_system
|
text = CoreR.string.settings_dark_mode_system
|
||||||
icon = R.drawable.ic_day_night
|
icon = R.drawable.ic_day_night
|
||||||
onClick { selectTheme(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM, activity) }
|
onClick { selectTheme(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM, activity) }
|
||||||
}
|
}
|
||||||
setButton(MagiskDialog.ButtonType.NEGATIVE) {
|
setButton(MagiskDialog.ButtonType.NEGATIVE) {
|
||||||
text = R.string.settings_dark_mode_dark
|
text = CoreR.string.settings_dark_mode_dark
|
||||||
icon = R.drawable.ic_night
|
icon = R.drawable.ic_night
|
||||||
onClick { selectTheme(AppCompatDelegate.MODE_NIGHT_YES, activity) }
|
onClick { selectTheme(AppCompatDelegate.MODE_NIGHT_YES, activity) }
|
||||||
}
|
}
|
||||||
@@ -1,14 +1,18 @@
|
|||||||
package com.topjohnwu.magisk.dialog
|
package com.topjohnwu.magisk.dialog
|
||||||
|
|
||||||
|
import android.widget.Toast
|
||||||
|
import androidx.core.os.postDelayed
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
import com.topjohnwu.magisk.BuildConfig
|
import com.topjohnwu.magisk.core.BuildConfig
|
||||||
import com.topjohnwu.magisk.R
|
|
||||||
import com.topjohnwu.magisk.core.Info
|
import com.topjohnwu.magisk.core.Info
|
||||||
import com.topjohnwu.magisk.core.base.BaseActivity
|
import com.topjohnwu.magisk.core.R
|
||||||
|
import com.topjohnwu.magisk.core.ktx.reboot
|
||||||
|
import com.topjohnwu.magisk.core.ktx.toast
|
||||||
import com.topjohnwu.magisk.core.tasks.MagiskInstaller
|
import com.topjohnwu.magisk.core.tasks.MagiskInstaller
|
||||||
import com.topjohnwu.magisk.events.DialogBuilder
|
import com.topjohnwu.magisk.events.DialogBuilder
|
||||||
import com.topjohnwu.magisk.ui.home.HomeViewModel
|
import com.topjohnwu.magisk.ui.home.HomeViewModel
|
||||||
import com.topjohnwu.magisk.view.MagiskDialog
|
import com.topjohnwu.magisk.view.MagiskDialog
|
||||||
|
import com.topjohnwu.superuser.internal.UiThreadHandler
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
|
||||||
class EnvFixDialog(private val vm: HomeViewModel, private val code: Int) : DialogBuilder {
|
class EnvFixDialog(private val vm: HomeViewModel, private val code: Int) : DialogBuilder {
|
||||||
@@ -27,10 +31,16 @@ class EnvFixDialog(private val vm: HomeViewModel, private val code: Int) : Dialo
|
|||||||
resetButtons()
|
resetButtons()
|
||||||
setCancelable(false)
|
setCancelable(false)
|
||||||
}
|
}
|
||||||
(dialog.ownerActivity as BaseActivity).lifecycleScope.launch {
|
dialog.activity.lifecycleScope.launch {
|
||||||
MagiskInstaller.FixEnv {
|
MagiskInstaller.FixEnv().exec { success ->
|
||||||
dialog.dismiss()
|
dialog.dismiss()
|
||||||
}.exec()
|
context.toast(
|
||||||
|
if (success) R.string.reboot_delay_toast else R.string.setup_fail,
|
||||||
|
Toast.LENGTH_LONG
|
||||||
|
)
|
||||||
|
if (success)
|
||||||
|
UiThreadHandler.handler.postDelayed(5000) { reboot() }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -40,8 +50,8 @@ class EnvFixDialog(private val vm: HomeViewModel, private val code: Int) : Dialo
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (code == 2 || // No rules block, module policy not loaded
|
if (code == 2 || // No rules block, module policy not loaded
|
||||||
Info.env.versionCode != BuildConfig.VERSION_CODE ||
|
Info.env.versionCode != BuildConfig.APP_VERSION_CODE ||
|
||||||
Info.env.versionString != BuildConfig.VERSION_NAME) {
|
Info.env.versionString != BuildConfig.APP_VERSION_NAME) {
|
||||||
dialog.setMessage(R.string.env_full_fix_msg)
|
dialog.setMessage(R.string.env_full_fix_msg)
|
||||||
dialog.setButton(MagiskDialog.ButtonType.POSITIVE) {
|
dialog.setButton(MagiskDialog.ButtonType.POSITIVE) {
|
||||||
text = android.R.string.ok
|
text = android.R.string.ok
|
||||||
@@ -2,8 +2,8 @@ package com.topjohnwu.magisk.dialog
|
|||||||
|
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import com.topjohnwu.magisk.MainDirections
|
import com.topjohnwu.magisk.MainDirections
|
||||||
import com.topjohnwu.magisk.R
|
|
||||||
import com.topjohnwu.magisk.core.Const
|
import com.topjohnwu.magisk.core.Const
|
||||||
|
import com.topjohnwu.magisk.core.R
|
||||||
import com.topjohnwu.magisk.events.DialogBuilder
|
import com.topjohnwu.magisk.events.DialogBuilder
|
||||||
import com.topjohnwu.magisk.ui.module.ModuleViewModel
|
import com.topjohnwu.magisk.ui.module.ModuleViewModel
|
||||||
import com.topjohnwu.magisk.view.MagiskDialog
|
import com.topjohnwu.magisk.view.MagiskDialog
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
package com.topjohnwu.magisk.dialog
|
package com.topjohnwu.magisk.dialog
|
||||||
|
|
||||||
import com.topjohnwu.magisk.R
|
import com.topjohnwu.magisk.core.AppContext
|
||||||
import com.topjohnwu.magisk.core.Info
|
import com.topjohnwu.magisk.core.Info
|
||||||
import com.topjohnwu.magisk.core.di.AppContext
|
import com.topjohnwu.magisk.core.R
|
||||||
import com.topjohnwu.magisk.core.di.ServiceLocator
|
import com.topjohnwu.magisk.core.di.ServiceLocator
|
||||||
import com.topjohnwu.magisk.core.download.DownloadService
|
import com.topjohnwu.magisk.core.download.DownloadEngine
|
||||||
import com.topjohnwu.magisk.core.download.Subject
|
import com.topjohnwu.magisk.core.download.Subject
|
||||||
import com.topjohnwu.magisk.view.MagiskDialog
|
import com.topjohnwu.magisk.view.MagiskDialog
|
||||||
import java.io.File
|
import java.io.File
|
||||||
@@ -29,7 +29,7 @@ class ManagerInstallDialog : MarkDownDialog() {
|
|||||||
setCancelable(true)
|
setCancelable(true)
|
||||||
setButton(MagiskDialog.ButtonType.POSITIVE) {
|
setButton(MagiskDialog.ButtonType.POSITIVE) {
|
||||||
text = R.string.install
|
text = R.string.install
|
||||||
onClick { DownloadService.start(activity, Subject.App()) }
|
onClick { DownloadEngine.startWithActivity(activity, Subject.App()) }
|
||||||
}
|
}
|
||||||
setButton(MagiskDialog.ButtonType.NEGATIVE) {
|
setButton(MagiskDialog.ButtonType.NEGATIVE) {
|
||||||
text = android.R.string.cancel
|
text = android.R.string.cancel
|
||||||
@@ -13,6 +13,7 @@ import kotlinx.coroutines.launch
|
|||||||
import kotlinx.coroutines.withContext
|
import kotlinx.coroutines.withContext
|
||||||
import timber.log.Timber
|
import timber.log.Timber
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
|
import com.topjohnwu.magisk.core.R as CoreR
|
||||||
|
|
||||||
abstract class MarkDownDialog : DialogBuilder {
|
abstract class MarkDownDialog : DialogBuilder {
|
||||||
|
|
||||||
@@ -30,7 +31,7 @@ abstract class MarkDownDialog : DialogBuilder {
|
|||||||
ServiceLocator.markwon.setMarkdown(tv, text)
|
ServiceLocator.markwon.setMarkdown(tv, text)
|
||||||
} catch (e: IOException) {
|
} catch (e: IOException) {
|
||||||
Timber.e(e)
|
Timber.e(e)
|
||||||
tv.setText(R.string.download_file_error)
|
tv.setText(CoreR.string.download_file_error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,12 +1,15 @@
|
|||||||
package com.topjohnwu.magisk.dialog
|
package com.topjohnwu.magisk.dialog
|
||||||
|
|
||||||
import com.topjohnwu.magisk.R
|
import android.content.Context
|
||||||
|
import com.topjohnwu.magisk.core.R
|
||||||
import com.topjohnwu.magisk.core.di.ServiceLocator
|
import com.topjohnwu.magisk.core.di.ServiceLocator
|
||||||
import com.topjohnwu.magisk.core.download.Action
|
import com.topjohnwu.magisk.core.download.DownloadEngine
|
||||||
import com.topjohnwu.magisk.core.download.DownloadService
|
|
||||||
import com.topjohnwu.magisk.core.download.Subject
|
import com.topjohnwu.magisk.core.download.Subject
|
||||||
import com.topjohnwu.magisk.core.model.module.OnlineModule
|
import com.topjohnwu.magisk.core.model.module.OnlineModule
|
||||||
|
import com.topjohnwu.magisk.ui.flash.FlashFragment
|
||||||
import com.topjohnwu.magisk.view.MagiskDialog
|
import com.topjohnwu.magisk.view.MagiskDialog
|
||||||
|
import com.topjohnwu.magisk.view.Notifications
|
||||||
|
import kotlinx.parcelize.Parcelize
|
||||||
|
|
||||||
class OnlineModuleInstallDialog(private val item: OnlineModule) : MarkDownDialog() {
|
class OnlineModuleInstallDialog(private val item: OnlineModule) : MarkDownDialog() {
|
||||||
|
|
||||||
@@ -17,14 +20,21 @@ class OnlineModuleInstallDialog(private val item: OnlineModule) : MarkDownDialog
|
|||||||
return if (str.length > 1000) str.substring(0, 1000) else str
|
return if (str.length > 1000) str.substring(0, 1000) else str
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Parcelize
|
||||||
|
class Module(
|
||||||
|
override val module: OnlineModule,
|
||||||
|
override val autoLaunch: Boolean,
|
||||||
|
override val notifyId: Int = Notifications.nextId()
|
||||||
|
) : Subject.Module() {
|
||||||
|
override fun pendingIntent(context: Context) = FlashFragment.installIntent(context, file)
|
||||||
|
}
|
||||||
|
|
||||||
override fun build(dialog: MagiskDialog) {
|
override fun build(dialog: MagiskDialog) {
|
||||||
super.build(dialog)
|
super.build(dialog)
|
||||||
dialog.apply {
|
dialog.apply {
|
||||||
|
|
||||||
fun download(install: Boolean) {
|
fun download(install: Boolean) {
|
||||||
val action = if (install) Action.Flash else Action.Download
|
DownloadEngine.startWithActivity(activity, Module(item, install))
|
||||||
val subject = Subject.Module(item, action)
|
|
||||||
DownloadService.start(activity, subject)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
val title = context.getString(R.string.repo_install_title,
|
val title = context.getString(R.string.repo_install_title,
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
package com.topjohnwu.magisk.dialog
|
package com.topjohnwu.magisk.dialog
|
||||||
|
|
||||||
import com.topjohnwu.magisk.R
|
import com.topjohnwu.magisk.core.R
|
||||||
import com.topjohnwu.magisk.events.DialogBuilder
|
import com.topjohnwu.magisk.events.DialogBuilder
|
||||||
import com.topjohnwu.magisk.view.MagiskDialog
|
import com.topjohnwu.magisk.view.MagiskDialog
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
package com.topjohnwu.magisk.dialog
|
package com.topjohnwu.magisk.dialog
|
||||||
|
|
||||||
import com.topjohnwu.magisk.R
|
import com.topjohnwu.magisk.core.R
|
||||||
import com.topjohnwu.magisk.events.DialogBuilder
|
import com.topjohnwu.magisk.events.DialogBuilder
|
||||||
import com.topjohnwu.magisk.view.MagiskDialog
|
import com.topjohnwu.magisk.view.MagiskDialog
|
||||||
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user