mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-02-20 07:28:29 +00:00
Fix pre 21 support
This commit is contained in:
parent
9cc91b30b3
commit
ccb55205e6
@ -38,7 +38,7 @@ withContext(Dispatchers.Default) {
|
|||||||
add("pt-BR")
|
add("pt-BR")
|
||||||
|
|
||||||
// Then add all supported locales
|
// Then add all supported locales
|
||||||
addAll(res.assets.locales)
|
addAll(Resources.getSystem().assets.locales)
|
||||||
}.map {
|
}.map {
|
||||||
it.langTagToLocale()
|
it.langTagToLocale()
|
||||||
}.distinctBy {
|
}.distinctBy {
|
||||||
|
@ -51,7 +51,7 @@ fun String.langTagToLocale(): Locale {
|
|||||||
if (Build.VERSION.SDK_INT >= 21) {
|
if (Build.VERSION.SDK_INT >= 21) {
|
||||||
return Locale.forLanguageTag(this)
|
return Locale.forLanguageTag(this)
|
||||||
} else {
|
} else {
|
||||||
val tok = split("-".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray()
|
val tok = split("[-_]".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray()
|
||||||
if (tok.isEmpty()) {
|
if (tok.isEmpty()) {
|
||||||
return Locale("")
|
return Locale("")
|
||||||
}
|
}
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<shape android:shape="rectangle">
|
<shape android:shape="rectangle">
|
||||||
<solid android:color="?colorSecondary" />
|
<solid android:color="@android:color/black" />
|
||||||
<corners android:bottomLeftRadius="2dp" android:bottomRightRadius="2dp" />
|
<corners android:bottomLeftRadius="2dp" android:bottomRightRadius="2dp" />
|
||||||
</shape>
|
</shape>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
</selector>
|
</selector>
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
|
|
||||||
<item>
|
<item>
|
||||||
<shape android:shape="rectangle">
|
<shape android:shape="rectangle">
|
||||||
<solid android:color="?colorSecondary" />
|
<solid android:color="@android:color/black" />
|
||||||
<corners android:topLeftRadius="2dp" android:topRightRadius="2dp" />
|
<corners android:topLeftRadius="2dp" android:topRightRadius="2dp" />
|
||||||
</shape>
|
</shape>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
</selector>
|
</selector>
|
||||||
|
@ -29,14 +29,15 @@
|
|||||||
tools:layout_gravity="center"
|
tools:layout_gravity="center"
|
||||||
tools:minHeight="?listPreferredItemHeightSmall">
|
tools:minHeight="?listPreferredItemHeightSmall">
|
||||||
|
|
||||||
<View
|
<ImageView
|
||||||
android:id="@+id/track_top"
|
android:id="@+id/track_top"
|
||||||
invisible="@{isTop}"
|
invisible="@{isTop}"
|
||||||
android:layout_width="2dp"
|
android:layout_width="2dp"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_marginBottom="2dp"
|
android:layout_marginBottom="2dp"
|
||||||
android:alpha=".3"
|
android:alpha=".3"
|
||||||
android:background="@drawable/bg_line_bottom_rounded"
|
app:tint="?colorSecondary"
|
||||||
|
app:srcCompat="@drawable/bg_line_bottom_rounded"
|
||||||
app:layout_constraintBottom_toTopOf="@+id/track_bullet"
|
app:layout_constraintBottom_toTopOf="@+id/track_bullet"
|
||||||
app:layout_constraintEnd_toEndOf="@+id/track_bullet"
|
app:layout_constraintEnd_toEndOf="@+id/track_bullet"
|
||||||
app:layout_constraintStart_toStartOf="@+id/track_bullet"
|
app:layout_constraintStart_toStartOf="@+id/track_bullet"
|
||||||
@ -54,14 +55,15 @@
|
|||||||
app:tint="@color/color_primary_error_transient"
|
app:tint="@color/color_primary_error_transient"
|
||||||
tools:srcCompat="@drawable/ic_check_md2" />
|
tools:srcCompat="@drawable/ic_check_md2" />
|
||||||
|
|
||||||
<View
|
<ImageView
|
||||||
android:id="@+id/track_bottom"
|
android:id="@+id/track_bottom"
|
||||||
invisible="@{isBottom}"
|
invisible="@{isBottom}"
|
||||||
android:layout_width="2dp"
|
android:layout_width="2dp"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_marginTop="2dp"
|
android:layout_marginTop="2dp"
|
||||||
android:alpha=".3"
|
android:alpha=".3"
|
||||||
android:background="@drawable/bg_line_top_rounded"
|
app:tint="?colorSecondary"
|
||||||
|
app:srcCompat="@drawable/bg_line_top_rounded"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="@+id/track_bullet"
|
app:layout_constraintEnd_toEndOf="@+id/track_bullet"
|
||||||
app:layout_constraintStart_toStartOf="@+id/track_bullet"
|
app:layout_constraintStart_toStartOf="@+id/track_bullet"
|
||||||
|
@ -145,7 +145,7 @@ static void exec_cmd(const char *action, vector<Extra> &data,
|
|||||||
|
|
||||||
// Finally, fallback to start activity with component name
|
// Finally, fallback to start activity with component name
|
||||||
args[4] = "-n";
|
args[4] = "-n";
|
||||||
sprintf(target, "%s/a.m", info->str[SU_MANAGER].data());
|
sprintf(target, "%s/.ui.surequest.SuRequestActivity", info->str[SU_MANAGER].data());
|
||||||
exec.fd = -2;
|
exec.fd = -2;
|
||||||
exec.fork = fork_dont_care;
|
exec.fork = fork_dont_care;
|
||||||
exec_command(exec);
|
exec_command(exec);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user