Skip to content

Commit 02dc65d

Browse files
authored
Merge branch 'master' into module-rc
2 parents 599e67e + e472db5 commit 02dc65d

198 files changed

Lines changed: 5077 additions & 4560 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/actions/setup/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ runs:
4545
env:
4646
SCCACHE_DIRECT: false
4747
SCCACHE_DIR: ${{ github.workspace }}/.sccache
48-
SCCACHE_CACHE_SIZE: 2G
48+
SCCACHE_CACHE_SIZE: ${{ inputs.is-asset-build == 'true' && '2G' || '300M' }}
4949
SCCACHE_IDLE_TIMEOUT: 0
5050
run: |
5151
bash $GITHUB_ACTION_PATH/sccache.sh
@@ -70,7 +70,7 @@ runs:
7070
.gradle/caches
7171
.gradle/wrapper
7272
!.gradle/caches/build-cache-*
73-
key: gradle-cache-${{ hashFiles('gradle/**') }}
73+
key: gradle-cache-${{ hashFiles('app/gradle/**') }}
7474
restore-keys: gradle-cache-
7575

7676
- name: Restore Gradle dependencies

.github/workflows/build.yml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@ on:
66
paths:
77
- "app/**"
88
- "native/**"
9-
- "buildSrc/**"
109
- "build.py"
11-
- "gradle.properties"
12-
- "gradle/libs.versions.toml"
1310
- ".github/workflows/build.yml"
1411
pull_request:
1512
branches: [master]
@@ -39,7 +36,7 @@ jobs:
3936
run: ./build.py -v all
4037

4138
- name: Stop gradle daemon
42-
run: ./gradlew --stop
39+
run: ./app/gradlew --stop
4340

4441
- name: Upload build artifact
4542
uses: actions/upload-artifact@v4
@@ -75,7 +72,7 @@ jobs:
7572
run: python build.py -v -c .github/ci.prop all
7673

7774
- name: Stop gradle daemon
78-
run: ./gradlew --stop
75+
run: ./app/gradlew --stop
7976

8077
avd-test:
8178
name: Test API ${{ matrix.version }} (x86_64)
@@ -85,12 +82,10 @@ jobs:
8582
strategy:
8683
fail-fast: false
8784
matrix:
88-
version: [23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35]
85+
version: [23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, "36.0-CANARY"]
8986
type: [""]
9087
include:
91-
- version: 36
92-
type: "google_apis"
93-
- version: 36
88+
- version: "36.0-CANARY"
9489
type: "google_apis_ps16k"
9590

9691
steps:
@@ -113,7 +108,7 @@ jobs:
113108
timeout-minutes: 10
114109
env:
115110
AVD_TEST_LOG: 1
116-
run: scripts/avd_test.sh ${{ matrix.version }} ${{ matrix.type }}
111+
run: scripts/avd.sh test ${{ matrix.version }} ${{ matrix.type }}
117112

118113
- name: Upload logs on error
119114
if: ${{ failure() }}
@@ -155,7 +150,7 @@ jobs:
155150
env:
156151
FORCE_32_BIT: 1
157152
AVD_TEST_LOG: 1
158-
run: scripts/avd_test.sh ${{ matrix.version }}
153+
run: scripts/avd.sh test ${{ matrix.version }}
159154

160155
- name: Upload logs on error
161156
if: ${{ failure() }}
@@ -197,7 +192,7 @@ jobs:
197192
198193
- name: Run Cuttlefish test
199194
timeout-minutes: 10
200-
run: su $USER -c 'scripts/cuttlefish.sh test'
195+
run: sudo -E -u $USER scripts/cuttlefish.sh test
201196

202197
- name: Upload logs on error
203198
if: ${{ failure() }}

.gitignore

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,13 @@ out
22
*.zip
33
*.jks
44
*.apk
5+
*.log
56
/config.prop
67
/notes.md
7-
/update.sh
8-
/app/dict.txt
98

109
# Built binaries
1110
native/out
1211

13-
# Android Studio / Gradle
12+
# Android Studio
1413
*.iml
15-
.gradle
1614
.idea
17-
.kotlin
18-
/local.properties
19-
/build
20-
/captures

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010
[submodule "libcxx"]
1111
path = native/src/external/libcxx
1212
url = https://github.com/topjohnwu/libcxx.git
13-
[submodule "zopfli"]
14-
path = native/src/external/zopfli
15-
url = https://github.com/google/zopfli.git
1613
[submodule "cxx-rs"]
1714
path = native/src/external/cxx-rs
1815
url = https://github.com/topjohnwu/cxx.git

README.MD

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,7 @@ Some highlight features:
1616

1717
## Downloads
1818

19-
[Github](https://github.com/topjohnwu/Magisk/) is the only source where you can get official Magisk information and downloads.
20-
21-
Click the icon below to download Magisk apk.
22-
23-
[![](https://img.shields.io/badge/Magisk-v28.1-blue)](https://github.com/topjohnwu/Magisk/releases/tag/v28.1)
24-
[![](https://img.shields.io/badge/Magisk%20Beta-v28.1-blue)](https://github.com/topjohnwu/Magisk/releases/tag/v28.1)
25-
[![](https://img.shields.io/badge/Magisk-Canary-red)](https://github.com/topjohnwu/Magisk/releases/tag/canary-28104)
19+
[Github](https://github.com/topjohnwu/Magisk/releases) is the only source where you can get official Magisk information and downloads.
2620

2721
## Useful Links
2822

app/.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/dict.txt
2+
3+
# Gradle
4+
.gradle
5+
.kotlin
6+
/local.properties
7+
/build

app/apk/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ android {
3535
}
3636

3737
dependencies {
38-
implementation(project(":app:core"))
38+
implementation(project(":core"))
3939
coreLibraryDesugaring(libs.jdk.libs)
4040

4141
implementation(libs.indeterminate.checkbox)

app/apk/src/main/java/com/topjohnwu/magisk/databinding/DataBindingAdapters.kt

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import androidx.core.widget.ImageViewCompat
2424
import androidx.databinding.BindingAdapter
2525
import androidx.databinding.InverseBindingAdapter
2626
import androidx.databinding.InverseBindingListener
27+
import androidx.databinding.InverseMethod
2728
import androidx.interpolator.view.animation.FastOutSlowInInterpolator
2829
import androidx.recyclerview.widget.DividerItemDecoration
2930
import androidx.recyclerview.widget.GridLayoutManager
@@ -33,9 +34,11 @@ import androidx.recyclerview.widget.StaggeredGridLayoutManager
3334
import com.google.android.material.button.MaterialButton
3435
import com.google.android.material.card.MaterialCardView
3536
import com.google.android.material.chip.Chip
37+
import com.google.android.material.slider.Slider
3638
import com.google.android.material.textfield.TextInputLayout
3739
import com.topjohnwu.magisk.R
3840
import com.topjohnwu.magisk.core.di.ServiceLocator
41+
import com.topjohnwu.magisk.core.model.su.SuPolicy
3942
import com.topjohnwu.magisk.utils.TextHolder
4043
import com.topjohnwu.superuser.internal.UiThreadHandler
4144
import com.topjohnwu.widget.IndeterminateCheckBox
@@ -306,3 +309,38 @@ fun TextView.setText(text: TextHolder) {
306309
fun Spinner.setAdapter(items: Array<Any>, layoutRes: Int) {
307310
adapter = ArrayAdapter(context, layoutRes, items)
308311
}
312+
313+
@BindingAdapter("labelFormatter")
314+
fun Slider.setLabelFormatter(formatter: (Float) -> Int) {
315+
setLabelFormatter { value -> resources.getString(formatter(value)) }
316+
}
317+
318+
@InverseBindingAdapter(attribute = "android:value")
319+
fun Slider.getValueBinding() = value
320+
321+
@BindingAdapter("android:valueAttrChanged")
322+
fun Slider.setListener(attrChange: InverseBindingListener) {
323+
addOnSliderTouchListener(object : Slider.OnSliderTouchListener {
324+
override fun onStartTrackingTouch(slider: Slider) = Unit
325+
override fun onStopTrackingTouch(slider: Slider) = attrChange.onChange()
326+
})
327+
}
328+
329+
@InverseMethod("sliderValueToPolicy")
330+
fun policyToSliderValue(policy: Int): Float {
331+
return when (policy) {
332+
SuPolicy.DENY -> 1f
333+
SuPolicy.RESTRICT -> 2f
334+
SuPolicy.ALLOW -> 3f
335+
else -> 1f
336+
}
337+
}
338+
339+
fun sliderValueToPolicy(value: Float): Int {
340+
return when (value) {
341+
1f -> SuPolicy.DENY
342+
2f -> SuPolicy.RESTRICT
343+
3f -> SuPolicy.ALLOW
344+
else -> SuPolicy.DENY
345+
}
346+
}

app/apk/src/main/java/com/topjohnwu/magisk/dialog/ManagerInstallDialog.kt

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,17 @@ package com.topjohnwu.magisk.dialog
33
import com.topjohnwu.magisk.core.AppContext
44
import com.topjohnwu.magisk.core.Info
55
import com.topjohnwu.magisk.core.R
6-
import com.topjohnwu.magisk.core.di.ServiceLocator
76
import com.topjohnwu.magisk.core.download.DownloadEngine
87
import com.topjohnwu.magisk.core.download.Subject
98
import com.topjohnwu.magisk.view.MagiskDialog
109
import java.io.File
1110

1211
class ManagerInstallDialog : MarkDownDialog() {
1312

14-
private val svc get() = ServiceLocator.networkService
15-
1613
override suspend fun getMarkdownText(): String {
17-
val text = svc.fetchString(Info.remote.magisk.note)
14+
val text = Info.update.note
1815
// Cache the changelog
19-
AppContext.cacheDir.listFiles { _, name -> name.endsWith(".md") }.orEmpty().forEach {
20-
it.delete()
21-
}
22-
File(AppContext.cacheDir, "${Info.remote.magisk.versionCode}.md").writeText(text)
16+
File(AppContext.cacheDir, "${Info.update.versionCode}.md").writeText(text)
2317
return text
2418
}
2519

app/apk/src/main/java/com/topjohnwu/magisk/ui/home/HomeViewModel.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,16 +91,15 @@ class HomeViewModel(
9191

9292
override suspend fun doLoadWork() {
9393
appState = State.LOADING
94-
Info.getRemote(svc)?.apply {
94+
Info.fetchUpdate(svc)?.apply {
9595
appState = when {
96-
BuildConfig.APP_VERSION_CODE < magisk.versionCode -> State.OUTDATED
96+
BuildConfig.APP_VERSION_CODE < versionCode -> State.OUTDATED
9797
else -> State.UP_TO_DATE
9898
}
9999

100100
val isDebug = Config.updateChannel == Config.Value.DEBUG_CHANNEL
101101
managerRemoteVersion =
102-
("${magisk.version} (${magisk.versionCode})" +
103-
if (isDebug) " (D)" else "").asText()
102+
("$version (${versionCode})" + if (isDebug) " (D)" else "").asText()
104103
} ?: run {
105104
appState = State.INVALID
106105
managerRemoteVersion = CoreR.string.not_available.asText()

0 commit comments

Comments
 (0)