mirror of
				https://github.com/topjohnwu/Magisk
				synced 2025-10-31 10:40:52 +01:00 
			
		
		
		
	Compare commits
	
		
			297 Commits
		
	
	
		
			v27.0
			...
			canary-270
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | 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 | 
							
								
								
									
										90
									
								
								.github/actions/setup/action.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										90
									
								
								.github/actions/setup/action.yml
									
									
									
									
										vendored
									
									
								
							| @@ -1,4 +1,8 @@ | ||||
| name: Magisk Setup | ||||
| inputs: | ||||
|   is-asset-build: | ||||
|     required: false | ||||
|     default: false | ||||
| runs: | ||||
|   using: "composite" | ||||
|   steps: | ||||
| @@ -13,32 +17,84 @@ runs: | ||||
|       with: | ||||
|         python-version: "3.x" | ||||
|  | ||||
|     - name: Set up sccache | ||||
|       uses: hendrikmuhs/ccache-action@v1.2 | ||||
|     - name: Install GNU make | ||||
|       if: runner.os == 'macOS' | ||||
|       shell: bash | ||||
|       run: | | ||||
|         brew install make | ||||
|         echo 'GNUMAKE=gmake' >> "$GITHUB_ENV" | ||||
|  | ||||
|     - name: Cache sccache | ||||
|       uses: actions/cache@v4 | ||||
|       with: | ||||
|         variant: sccache | ||||
|         key: ${{ runner.os }}-${{ github.sha }} | ||||
|         restore-keys: ${{ runner.os }} | ||||
|         max-size: 10000M | ||||
|         path: .sccache | ||||
|         key: sccache-${{ runner.os }}-${{ github.sha }} | ||||
|         restore-keys: sccache-${{ runner.os }}- | ||||
|  | ||||
|     - 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 | ||||
|       uses: actions/cache@v4 | ||||
|       if: inputs.is-asset-build == 'true' | ||||
|       with: | ||||
|         path: | | ||||
|           ~/.gradle/caches | ||||
|           ~/.gradle/wrapper | ||||
|           !~/.gradle/caches/build-cache-* | ||||
|         key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }} | ||||
|         restore-keys: ${{ runner.os }}-gradle- | ||||
|           .gradle/caches | ||||
|           .gradle/wrapper | ||||
|           !.gradle/caches/build-cache-* | ||||
|         key: gradle-cache-${{ hashFiles('gradle/**') }} | ||||
|         restore-keys: gradle-cache- | ||||
|  | ||||
|     - name: Cache build cache | ||||
|       uses: actions/cache@v4 | ||||
|     - name: Restore Gradle dependencies | ||||
|       uses: actions/cache/restore@v4 | ||||
|       if: inputs.is-asset-build == 'false' | ||||
|       with: | ||||
|         path: | | ||||
|           ~/.gradle/caches/build-cache-* | ||||
|         key: ${{ runner.os }}-build-cache-${{ github.sha }} | ||||
|         restore-keys: ${{ runner.os }}-build-cache- | ||||
|           .gradle/caches | ||||
|           .gradle/wrapper | ||||
|           !.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 | ||||
|       run: python build.py -v ndk | ||||
|       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: | ||||
|       - "app/**" | ||||
|       - "native/**" | ||||
|       - "stub/**" | ||||
|       - "buildSrc/**" | ||||
|       - "build.py" | ||||
|       - "gradle.properties" | ||||
| @@ -18,9 +17,7 @@ on: | ||||
| jobs: | ||||
|   build: | ||||
|     name: Build Magisk artifacts | ||||
|     runs-on: ubuntu-latest | ||||
|     env: | ||||
|       SCCACHE_DIRECT: false | ||||
|     runs-on: macos-14 | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|     steps: | ||||
| @@ -28,10 +25,11 @@ jobs: | ||||
|         uses: actions/checkout@v4 | ||||
|         with: | ||||
|           submodules: "recursive" | ||||
|           fetch-depth: 0 | ||||
|  | ||||
|       - name: Setup environment | ||||
|         uses: ./.github/actions/setup | ||||
|         with: | ||||
|           is-asset-build: true | ||||
|  | ||||
|       - name: Build release | ||||
|         run: ./build.py -vr all | ||||
| @@ -53,53 +51,47 @@ jobs: | ||||
|         uses: actions/upload-artifact@v4 | ||||
|         with: | ||||
|           name: ${{ github.sha }}-symbols | ||||
|           path: app/build/outputs | ||||
|           path: app/apk/build/outputs | ||||
|           compression-level: 9 | ||||
|  | ||||
|   test-build: | ||||
|     name: Test building on ${{ matrix.os }} | ||||
|     runs-on: ${{ matrix.os }} | ||||
|     env: | ||||
|       SCCACHE_DIRECT: false | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         os: [windows-latest, macos-14] | ||||
|         os: [windows-latest, ubuntu-latest] | ||||
|     steps: | ||||
|       - name: Check out | ||||
|         uses: actions/checkout@v4 | ||||
|         with: | ||||
|           submodules: "recursive" | ||||
|           fetch-depth: 0 | ||||
|  | ||||
|       - name: Setup environment | ||||
|         uses: ./.github/actions/setup | ||||
|  | ||||
|       - name: Build debug | ||||
|         run: python build.py -v all | ||||
|       - name: Test build | ||||
|         run: python build.py -v -c .github/ci.prop all | ||||
|  | ||||
|       - name: Stop gradle daemon | ||||
|         run: ./gradlew --stop | ||||
|  | ||||
|   test: | ||||
|     name: Test on API ${{ matrix.api }} | ||||
|   avd-test: | ||||
|     name: Test API ${{ matrix.version }} (x86_64) | ||||
|     runs-on: ubuntu-latest | ||||
|     needs: build | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       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] | ||||
|         type: [""] | ||||
|         include: | ||||
|           - version: 35 | ||||
|             type: "google_apis" | ||||
|  | ||||
|     steps: | ||||
|       - name: Check out | ||||
|         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 | ||||
|         uses: actions/download-artifact@v4 | ||||
| @@ -113,5 +105,101 @@ jobs: | ||||
|           sudo udevadm control --reload-rules | ||||
|           sudo udevadm trigger --name-match=kvm | ||||
|  | ||||
|       - name: AVD test | ||||
|         run: scripts/avd_test.sh ${{ matrix.api }} | ||||
|       - name: Run AVD test | ||||
|         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 | ||||
|   | ||||
							
								
								
									
										5
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										5
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -3,8 +3,9 @@ out | ||||
| *.jks | ||||
| *.apk | ||||
| /config.prop | ||||
| /notes.md | ||||
| /update.sh | ||||
| /dict.txt | ||||
| /app/dict.txt | ||||
|  | ||||
| # Built binaries | ||||
| native/out | ||||
| @@ -12,7 +13,7 @@ native/out | ||||
| # Android Studio / Gradle | ||||
| *.iml | ||||
| .gradle | ||||
| .idea | ||||
| /local.properties | ||||
| /.idea | ||||
| /build | ||||
| /captures | ||||
|   | ||||
							
								
								
									
										9
									
								
								.gitmodules
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										9
									
								
								.gitmodules
									
									
									
									
										vendored
									
									
								
							| @@ -1,9 +1,6 @@ | ||||
| [submodule "selinux"] | ||||
| 	path = native/src/external/selinux | ||||
| 	url = https://github.com/topjohnwu/selinux.git | ||||
| [submodule "busybox"] | ||||
| 	path = native/src/external/busybox | ||||
| 	url = https://github.com/topjohnwu/ndk-busybox.git | ||||
| [submodule "lz4"] | ||||
| 	path = native/src/external/lz4 | ||||
| 	url = https://github.com/lz4/lz4.git | ||||
| @@ -13,9 +10,6 @@ | ||||
| [submodule "xz"] | ||||
| 	path = native/src/external/xz | ||||
| 	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"] | ||||
| 	path = native/src/external/libcxx | ||||
| 	url = https://github.com/topjohnwu/libcxx.git | ||||
| @@ -34,6 +28,9 @@ | ||||
| [submodule "system_properties"] | ||||
| 	path = native/src/external/system_properties | ||||
| 	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"] | ||||
| 	path = tools/termux-elf-cleaner | ||||
| 	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. | ||||
|  | ||||
| [](https://github.com/topjohnwu/Magisk/releases/tag/v26.4) | ||||
| [](https://github.com/topjohnwu/Magisk/releases/tag/v26.4) | ||||
| [](https://raw.githubusercontent.com/topjohnwu/magisk-files/canary/app-release.apk) | ||||
| [](https://raw.githubusercontent.com/topjohnwu/magisk-files/canary/app-debug.apk) | ||||
| Click the icon below to download Magisk apk. | ||||
|  | ||||
| [](https://github.com/topjohnwu/Magisk/releases/tag/v27.0) | ||||
| [](https://github.com/topjohnwu/Magisk/releases/tag/v27.0) | ||||
| [](https://github.com/topjohnwu/Magisk/releases/tag/canary-27007) | ||||
|  | ||||
| ## Useful Links | ||||
|  | ||||
| - [Installation Instruction](https://topjohnwu.github.io/Magisk/install.html) | ||||
| - [Building and Development](https://topjohnwu.github.io/Magisk/build.html) | ||||
| - [Magisk Documentation](https://topjohnwu.github.io/Magisk/) | ||||
| - [Zygisk module sample](https://github.com/topjohnwu/zygisk-module-sample) | ||||
|  | ||||
| ## 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: | ||||
|  | ||||
| - `app/src/main/res/values/strings.xml` | ||||
| - `stub/src/main/res/values/strings.xml` | ||||
| - `app/core/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`). | ||||
|  | ||||
|   | ||||
							
								
								
									
										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 | ||||
							
								
								
									
										68
									
								
								app/apk/build.gradle.kts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										68
									
								
								app/apk/build.gradle.kts
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,68 @@ | ||||
| plugins { | ||||
|     id("com.android.application") | ||||
|     kotlin("android") | ||||
|     kotlin("plugin.parcelize") | ||||
|     kotlin("kapt") | ||||
|     id("androidx.navigation.safeargs.kotlin") | ||||
| } | ||||
|  | ||||
| setupAppCommon() | ||||
|  | ||||
| kapt { | ||||
|     correctErrorTypes = true | ||||
|     useBuildCache = true | ||||
|     mapDiagnosticLocations = true | ||||
|     javacOptions { | ||||
|         option("-Xmaxerrs", 1000) | ||||
|     } | ||||
| } | ||||
|  | ||||
| android { | ||||
|     namespace = "com.topjohnwu.magisk" | ||||
|  | ||||
|     defaultConfig { | ||||
|         applicationId = "com.topjohnwu.magisk" | ||||
|         vectorDrawables.useSupportLibrary = true | ||||
|         versionName = Config.version | ||||
|         versionCode = Config.versionCode | ||||
|         ndk { | ||||
|             abiFilters += listOf("armeabi-v7a", "arm64-v8a", "x86", "x86_64", "riscv64") | ||||
|             debugSymbolLevel = "FULL" | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     buildTypes { | ||||
|         release { | ||||
|             isMinifyEnabled = true | ||||
|             isShrinkResources = true | ||||
|             proguardFiles("proguard-rules.pro") | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     buildFeatures { | ||||
|         dataBinding = true | ||||
|     } | ||||
| } | ||||
|  | ||||
| dependencies { | ||||
|     implementation(project(":app:core")) | ||||
|  | ||||
|     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 | ||||
|  | ||||
| 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.os.Bundle | ||||
| import androidx.databinding.PropertyChangeRegistry | ||||
| @@ -8,7 +10,7 @@ import androidx.lifecycle.LiveData | ||||
| import androidx.lifecycle.MutableLiveData | ||||
| import androidx.lifecycle.ViewModel | ||||
| 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.events.BackPressEvent | ||||
| import com.topjohnwu.magisk.events.DialogBuilder | ||||
| @@ -1,11 +1,13 @@ | ||||
| package com.topjohnwu.magisk.arch | ||||
|  | ||||
| import android.content.Context | ||||
| import android.content.res.Resources | ||||
| import android.graphics.Color | ||||
| import android.os.Build | ||||
| import android.os.Bundle | ||||
| import android.view.View | ||||
| import android.view.ViewGroup | ||||
| import androidx.appcompat.app.AppCompatActivity | ||||
| import androidx.appcompat.app.AppCompatDelegate | ||||
| import androidx.core.content.res.use | ||||
| 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.R | ||||
| 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.layoutinflater.view.LayoutInflaterFactory | ||||
|  | ||||
| abstract class UIActivity<Binding : ViewDataBinding> : BaseActivity(), ViewModelHolder { | ||||
| abstract class UIActivity<Binding : ViewDataBinding> | ||||
|     : AppCompatActivity(), ViewModelHolder, IActivityExtension { | ||||
|  | ||||
|     protected lateinit var binding: Binding | ||||
|     protected abstract val layoutRes: Int | ||||
|     override val extension = ActivityExtension(this) | ||||
|  | ||||
|     protected val binded get() = ::binding.isInitialized | ||||
|  | ||||
| @@ -36,10 +44,23 @@ abstract class UIActivity<Binding : ViewDataBinding> : BaseActivity(), ViewModel | ||||
|         AppCompatDelegate.setDefaultNightMode(Config.darkTheme) | ||||
|     } | ||||
|  | ||||
|     override fun attachBaseContext(base: Context) { | ||||
|         super.attachBaseContext(base.wrap()) | ||||
|     } | ||||
|  | ||||
|     override fun onCreate(savedInstanceState: Bundle?) { | ||||
|         layoutInflater.factory2 = LayoutInflaterFactory(delegate) | ||||
|             .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) | ||||
|  | ||||
|         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() { | ||||
|         binding = DataBindingUtil.setContentView<Binding>(this, layoutRes).also { | ||||
|             it.setVariable(BR.viewModel, viewModel) | ||||
| @@ -8,7 +8,12 @@ import android.text.Spanned | ||||
| import android.util.TypedValue | ||||
| import android.view.View | ||||
| 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.appcompat.widget.Toolbar | ||||
| import androidx.cardview.widget.CardView | ||||
| @@ -20,7 +25,11 @@ import androidx.databinding.BindingAdapter | ||||
| import androidx.databinding.InverseBindingAdapter | ||||
| import androidx.databinding.InverseBindingListener | ||||
| 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.card.MaterialCardView | ||||
| import com.google.android.material.chip.Chip | ||||
| @@ -3,7 +3,7 @@ package com.topjohnwu.magisk.databinding | ||||
| import androidx.databinding.ListChangeRegistry | ||||
| import androidx.databinding.ObservableList | ||||
| import androidx.databinding.ObservableList.OnListChangedCallback | ||||
| import java.util.* | ||||
| import java.util.AbstractList | ||||
|  | ||||
| @Suppress("UNCHECKED_CAST") | ||||
| 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.events.DialogBuilder | ||||
| import com.topjohnwu.magisk.view.MagiskDialog | ||||
| import com.topjohnwu.magisk.core.R as CoreR | ||||
|  | ||||
| class DarkThemeDialog : DialogBuilder { | ||||
|  | ||||
|     override fun build(dialog: MagiskDialog) { | ||||
|         val activity = dialog.ownerActivity!! | ||||
|         dialog.apply { | ||||
|             setTitle(R.string.settings_dark_mode_title) | ||||
|             setMessage(R.string.settings_dark_mode_message) | ||||
|             setTitle(CoreR.string.settings_dark_mode_title) | ||||
|             setMessage(CoreR.string.settings_dark_mode_message) | ||||
|             setButton(MagiskDialog.ButtonType.POSITIVE) { | ||||
|                 text = R.string.settings_dark_mode_light | ||||
|                 text = CoreR.string.settings_dark_mode_light | ||||
|                 icon = R.drawable.ic_day | ||||
|                 onClick { selectTheme(AppCompatDelegate.MODE_NIGHT_NO, activity) } | ||||
|             } | ||||
|             setButton(MagiskDialog.ButtonType.NEUTRAL) { | ||||
|                 text = R.string.settings_dark_mode_system | ||||
|                 text = CoreR.string.settings_dark_mode_system | ||||
|                 icon = R.drawable.ic_day_night | ||||
|                 onClick { selectTheme(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM, activity) } | ||||
|             } | ||||
|             setButton(MagiskDialog.ButtonType.NEGATIVE) { | ||||
|                 text = R.string.settings_dark_mode_dark | ||||
|                 text = CoreR.string.settings_dark_mode_dark | ||||
|                 icon = R.drawable.ic_night | ||||
|                 onClick { selectTheme(AppCompatDelegate.MODE_NIGHT_YES, activity) } | ||||
|             } | ||||
| @@ -1,10 +1,9 @@ | ||||
| package com.topjohnwu.magisk.dialog | ||||
|  | ||||
| import androidx.lifecycle.lifecycleScope | ||||
| import com.topjohnwu.magisk.BuildConfig | ||||
| import com.topjohnwu.magisk.R | ||||
| import com.topjohnwu.magisk.core.BuildConfig | ||||
| import com.topjohnwu.magisk.core.Info | ||||
| import com.topjohnwu.magisk.core.base.BaseActivity | ||||
| import com.topjohnwu.magisk.core.R | ||||
| import com.topjohnwu.magisk.core.tasks.MagiskInstaller | ||||
| import com.topjohnwu.magisk.events.DialogBuilder | ||||
| import com.topjohnwu.magisk.ui.home.HomeViewModel | ||||
| @@ -27,7 +26,7 @@ class EnvFixDialog(private val vm: HomeViewModel, private val code: Int) : Dialo | ||||
|                         resetButtons() | ||||
|                         setCancelable(false) | ||||
|                     } | ||||
|                     (dialog.ownerActivity as BaseActivity).lifecycleScope.launch { | ||||
|                     dialog.activity.lifecycleScope.launch { | ||||
|                         MagiskInstaller.FixEnv { | ||||
|                             dialog.dismiss() | ||||
|                         }.exec() | ||||
| @@ -40,8 +39,8 @@ class EnvFixDialog(private val vm: HomeViewModel, private val code: Int) : Dialo | ||||
|         } | ||||
|  | ||||
|         if (code == 2 || // No rules block, module policy not loaded | ||||
|             Info.env.versionCode != BuildConfig.VERSION_CODE || | ||||
|             Info.env.versionString != BuildConfig.VERSION_NAME) { | ||||
|             Info.env.versionCode != BuildConfig.APP_VERSION_CODE || | ||||
|             Info.env.versionString != BuildConfig.APP_VERSION_NAME) { | ||||
|             dialog.setMessage(R.string.env_full_fix_msg) | ||||
|             dialog.setButton(MagiskDialog.ButtonType.POSITIVE) { | ||||
|                 text = android.R.string.ok | ||||
| @@ -2,8 +2,8 @@ package com.topjohnwu.magisk.dialog | ||||
|  | ||||
| import android.net.Uri | ||||
| import com.topjohnwu.magisk.MainDirections | ||||
| import com.topjohnwu.magisk.R | ||||
| import com.topjohnwu.magisk.core.Const | ||||
| import com.topjohnwu.magisk.core.R | ||||
| import com.topjohnwu.magisk.events.DialogBuilder | ||||
| import com.topjohnwu.magisk.ui.module.ModuleViewModel | ||||
| import com.topjohnwu.magisk.view.MagiskDialog | ||||
| @@ -1,10 +1,10 @@ | ||||
| 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.di.AppContext | ||||
| import com.topjohnwu.magisk.core.R | ||||
| 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.view.MagiskDialog | ||||
| import java.io.File | ||||
| @@ -29,7 +29,7 @@ class ManagerInstallDialog : MarkDownDialog() { | ||||
|             setCancelable(true) | ||||
|             setButton(MagiskDialog.ButtonType.POSITIVE) { | ||||
|                 text = R.string.install | ||||
|                 onClick { DownloadService.start(activity, Subject.App()) } | ||||
|                 onClick { DownloadEngine.startWithActivity(activity, Subject.App()) } | ||||
|             } | ||||
|             setButton(MagiskDialog.ButtonType.NEGATIVE) { | ||||
|                 text = android.R.string.cancel | ||||
| @@ -13,6 +13,7 @@ import kotlinx.coroutines.launch | ||||
| import kotlinx.coroutines.withContext | ||||
| import timber.log.Timber | ||||
| import java.io.IOException | ||||
| import com.topjohnwu.magisk.core.R as CoreR | ||||
|  | ||||
| abstract class MarkDownDialog : DialogBuilder { | ||||
|  | ||||
| @@ -30,7 +31,7 @@ abstract class MarkDownDialog : DialogBuilder { | ||||
|                     ServiceLocator.markwon.setMarkdown(tv, text) | ||||
|                 } catch (e: IOException) { | ||||
|                     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 | ||||
|  | ||||
| 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.download.Action | ||||
| 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.model.module.OnlineModule | ||||
| import com.topjohnwu.magisk.ui.flash.FlashFragment | ||||
| import com.topjohnwu.magisk.view.MagiskDialog | ||||
| import com.topjohnwu.magisk.view.Notifications | ||||
| import kotlinx.parcelize.Parcelize | ||||
|  | ||||
| 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 | ||||
|     } | ||||
|  | ||||
|     @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) { | ||||
|         super.build(dialog) | ||||
|         dialog.apply { | ||||
|  | ||||
|             fun download(install: Boolean) { | ||||
|                 val action = if (install) Action.Flash else Action.Download | ||||
|                 val subject = Subject.Module(item, action) | ||||
|                 DownloadService.start(activity, subject) | ||||
|                 DownloadEngine.startWithActivity(activity, Module(item, install)) | ||||
|             } | ||||
|  | ||||
|             val title = context.getString(R.string.repo_install_title, | ||||
| @@ -1,6 +1,6 @@ | ||||
| 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.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