Skip to content

Commit

Permalink
legacy Shizuku actually won't run on Android 10+ due to the getUsers …
Browse files Browse the repository at this point in the history
…change
  • Loading branch information
RikkaW committed Mar 30, 2020
1 parent 55c4af5 commit 788aa7f
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public static Locale getLocale() {
}

public static boolean isStartServiceV2() {
return !BuildUtils.atLeastR() && !getPreferences().getBoolean(NO_V2, false);
return !BuildUtils.atLeastQ() && !getPreferences().getBoolean(NO_V2, false);
}

public static boolean isKeepSuContext() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class HomeViewModel : ViewModel() {
private fun load(): ServiceStatus {
var v2Status: ShizukuState = ShizukuState.createUnknown()
val status = ServiceStatus()
if (!BuildUtils.atLeastR()) {
if (!BuildUtils.atLeastQ()) {
status.v2Status = ShizukuLegacy.ShizukuClient.getState().also { v2Status = it }
}
if (ShizukuService.getBinder() == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ abstract class AuthorizationActivity : AppActivity() {
}

fun getLegacyServerState(): ShizukuLegacy.ShizukuState {
if (BuildUtils.atLeastR()) {
if (BuildUtils.atLeastQ()) {
return ShizukuLegacy.ShizukuState.createUnknown()
}

Expand All @@ -42,7 +42,7 @@ abstract class AuthorizationActivity : AppActivity() {
}

fun checkNotLegacyOnApi30(): Boolean {
if (!isV3 && BuildUtils.atLeastR()) {
if (!isV3 && BuildUtils.atLeastQ()) {
val componentName = callingActivity ?: return false
val label = try {
packageManager.getApplicationInfo(componentName.packageName, 0).loadLabel(packageManager)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class AppsViewModel : SharedViewModel() {
var count = 0
for (pi in AuthorizationManager.getPackages(PackageManager.GET_META_DATA)) {
if (BuildConfig.APPLICATION_ID == pi.packageName) continue
if (BuildUtils.atLeastR() && pi?.applicationInfo?.metaData?.getBoolean("moe.shizuku.client.V3_SUPPORT") != true) continue
if (BuildUtils.atLeastQ() && pi?.applicationInfo?.metaData?.getBoolean("moe.shizuku.client.V3_SUPPORT") != true) continue
list.add(pi)
if (AuthorizationManager.granted(pi.packageName, pi.applicationInfo.uid)) count++
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ class SettingsFragment : PreferenceFragment() {
keepSuContextPreference = findPreference(KEY_KEEP_SU_CONTEXT) as SwitchPreference
startupPreference = findPreference("startup") as PreferenceCategory

noV2Preference.isVisible = !BuildUtils.atLeastR()
noV2Preference.isVisible = !BuildUtils.atLeastQ()
keepSuContextPreference.isVisible = false
startupPreference.isVisible = !BuildUtils.atLeastR()
startupPreference.isVisible = !BuildUtils.atLeastQ()

val viewModel = SharedViewModelProviders.of(this).get(AppsViewModel::class.java)
viewModel.packages.observe(this) {
Expand Down
2 changes: 1 addition & 1 deletion manager/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<string name="auth_cannot_connect">无法连接至核心服务,请确认其正在运行。</string>
<string name="auth_legacy_not_support_title">%1$s 不支持现代 Shizuku</string>
<string name="auth_legacy_not_support_message"><![CDATA[
旧式 Shizuku 已于 2019 年 3 月被弃用。此外,它无法在 Android 11 及更高版本运行。<p>请要求 <b>%1$s</b> 的开发者进行更新。
旧式 Shizuku 已于 2019 年 3 月被弃用。此外,它无法在 Android 10 及更高版本运行。<p>请要求 <b>%1$s</b> 的开发者进行更新。
]]></string>
<string name="authorized_apps_manage">应用管理</string>
<plurals name="authorized_apps_count">
Expand Down
2 changes: 1 addition & 1 deletion manager/src/main/res/values-zh-rTW/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<string name="auth_cannot_connect">無法連線至核心服務,請確認其正在執行。</string>
<string name="auth_legacy_not_support_title">%1$s 不支援現代 Shizuku</string>
<string name="auth_legacy_not_support_message"><![CDATA[
舊式 Shizuku 已於 2019 年 3 月被棄用。此外,它無法在 Android 11 及更高版本執行。<p>請要求 <b>%1$s</b> 的開發者進行更新。
舊式 Shizuku 已於 2019 年 3 月被棄用。此外,它無法在 Android 10 及更高版本執行。<p>請要求 <b>%1$s</b> 的開發者進行更新。
]]></string>
<string name="authorized_apps_manage">應用程式管理</string>
<plurals name="authorized_apps_count">
Expand Down
2 changes: 1 addition & 1 deletion manager/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<string name="auth_cannot_connect">Can\'t connect to core service, please check if it is running.</string>
<string name="auth_legacy_not_support_title">%1$s does not support modern Shizuku</string>
<string name="auth_legacy_not_support_message"><![CDATA[
Legacy Shizuku has been deprecated since March 2019. Also, it won\'t run on Android 11 and above.<p>Please ask the developer of <b>%1$s</b> to update.
Legacy Shizuku has been deprecated since March 2019. Also, it won\'t run on Android 10 and above.<p>Please ask the developer of <b>%1$s</b> to update.
]]></string>
<string name="authorized_apps_manage">Application management</string>
<plurals name="authorized_apps_count">
Expand Down

0 comments on commit 788aa7f

Please sign in to comment.