Skip to content

Commit c601751

Browse files
authored
Merge pull request #47 from KieronQuinn/1.5
1.5
2 parents 4fc0a8a + 62de229 commit c601751

File tree

16 files changed

+116
-75
lines changed

16 files changed

+116
-75
lines changed

.idea/modules.xml

-12
This file was deleted.

Controls/src/main/java/com/android/systemui/broadcast/UserBroadcastDispatcher.kt

+1
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ open class UserBroadcastDispatcher(
9898
bgHandler.obtainMessage(MSG_UNREGISTER_RECEIVER, receiver).sendToTarget()
9999
}
100100

101+
@SuppressLint("RestrictedApi")
101102
private fun handleRegisterReceiver(receiverData: ReceiverData) {
102103
Preconditions.checkState(bgHandler.looper.isCurrentThread,
103104
"This method should only be called from BG thread")

Controls/src/main/res/values-it/strings.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<!-- Device Controls setup, title [CHAR LIMIT=50] -->
1010
<string name="quick_controls_setup_title">Configura i controlli smart</string>
1111
<!-- Device Controls setup, subtitle [CHAR LIMIT=100] -->
12-
<string name="quick_controls_subtitle">Aggiungi controlli smart dei dispositivi connessi</string>
12+
<string name="quick_controls_setup_subtitle">Aggiungi controlli smart dei dispositivi connessi</string>
1313

1414
<!-- Controls management providers screen title [CHAR LIMIT=60]-->
1515
<string name="controls_providers_title">Scegli app per aggiungere i controlli</string>

QuickAccessWallet/src/main/java/com/android/systemui/plugin/globalactions/wallet/WalletPanelViewController.java

+6-2
Original file line numberDiff line numberDiff line change
@@ -197,16 +197,20 @@ public void onWalletCardsRetrieved(GetWalletCardsResponse response) {
197197
return;
198198
}
199199
List<WalletCard> walletCards = response.getWalletCards();
200-
if(walletCards.size() == 0) return;
201200

202201
ArrayList<WalletCardViewInfo> data = new ArrayList<>(walletCards.size());
203202
for (WalletCard card : walletCards) {
204203
data.add(new QAWalletCardViewInfo(card));
205204
}
206205

207-
mDefaultCardId = data.get(response.getSelectedIndex()).getCardId();
206+
if(walletCards.isEmpty()){
207+
mDefaultCardId = null;
208+
}else {
209+
mDefaultCardId = data.get(response.getSelectedIndex()).getCardId();
210+
}
208211

209212
mWalletLoyaltyCardCallback.getMethod().invoke(data, () -> {
213+
if(data.size() == 0) return;
210214
//Make sure we're still attached
211215
if(mWalletView.isAttachedToWindow()) {
212216
setupWalletView(data, response);

QuickAccessWallet/src/main/res/layout/wallet_view.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
1919
android:layout_width="match_parent"
2020
android:layout_height="wrap_content"
21+
xmlns:app="http://schemas.android.com/apk/res-auto"
2122
android:clipChildren="false">
2223

2324
<LinearLayout
@@ -50,7 +51,7 @@
5051
android:layout_width="@dimen/wallet_menu_btn_size"
5152
android:layout_height="@dimen/wallet_menu_btn_size"
5253
android:padding="12dp"
53-
android:tint="@android:color/white"
54+
app:tint="@android:color/white"
5455
android:contentDescription="@string/accessibility_menu"
5556
android:background="?android:attr/selectableItemBackgroundBorderless"
5657
android:theme="@style/Wallet.Theme" />

app/build.gradle

+9-9
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ plugins {
77
id 'com.google.android.gms.oss-licenses-plugin'
88
}
99

10-
def version = '1.4.2'
10+
def version = '1.5'
1111

1212
android {
1313
compileSdk 31
@@ -16,7 +16,7 @@ android {
1616
applicationId "com.kieronquinn.app.classicpowermenu"
1717
minSdk 30
1818
targetSdk 31
19-
versionCode 142
19+
versionCode 150
2020
versionName version
2121

2222
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@@ -72,21 +72,21 @@ dependencies {
7272

7373
//AndroidX
7474
def lifecycle_version = "2.4.1"
75-
implementation 'androidx.core:core-ktx:1.7.0'
76-
implementation 'androidx.appcompat:appcompat:1.4.1'
75+
implementation 'androidx.core:core-ktx:1.8.0'
76+
implementation 'androidx.appcompat:appcompat:1.4.2'
7777
implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle_version"
7878
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
7979
implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycle_version"
8080
implementation "androidx.lifecycle:lifecycle-process:$lifecycle_version"
8181
implementation "androidx.lifecycle:lifecycle-service:$lifecycle_version"
82-
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
82+
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
8383
implementation 'androidx.work:work-runtime-ktx:2.7.1'
84-
implementation "androidx.core:core-splashscreen:1.0.0-beta01"
84+
implementation "androidx.core:core-splashscreen:1.0.0-rc01"
8585
implementation "androidx.navigation:navigation-fragment-ktx:$nav_version"
8686
implementation "androidx.navigation:navigation-ui-ktx:$nav_version"
8787

8888
//Material
89-
implementation 'com.google.android.material:material:1.5.0'
89+
implementation 'com.google.android.material:material:1.6.1'
9090

9191
//Monet
9292
implementation 'com.github.KieronQuinn:MonetCompat:0.4.1'
@@ -117,7 +117,7 @@ dependencies {
117117
implementation 'com.journeyapps:zxing-android-embedded:4.1.0@aar'
118118

119119
//libsu for root operations
120-
def libsuVersion = '3.2.1'
120+
def libsuVersion = '4.0.3'
121121
implementation "com.github.topjohnwu.libsu:core:${libsuVersion}"
122122
implementation "com.github.topjohnwu.libsu:service:${libsuVersion}"
123123
implementation "com.github.topjohnwu.libsu:io:${libsuVersion}"
@@ -138,7 +138,7 @@ dependencies {
138138

139139
//Other third party
140140
implementation 'org.lsposed.hiddenapibypass:hiddenapibypass:4.3'
141-
implementation 'com.airbnb.android:lottie:4.2.2'
141+
implementation 'com.airbnb.android:lottie:5.0.3'
142142
implementation 'com.jakewharton:process-phoenix:2.1.2'
143143
implementation 'me.saket:better-link-movement-method:2.2.0'
144144
implementation "io.noties.markwon:core:4.6.2"

app/release/output-metadata.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
"type": "SINGLE",
1212
"filters": [],
1313
"attributes": [],
14-
"versionCode": 140,
15-
"versionName": "1.4",
14+
"versionCode": 150,
15+
"versionName": "1.5",
1616
"outputFile": "app-release.apk"
1717
}
1818
],

app/src/main/java/com/kieronquinn/app/classicpowermenu/components/xposed/Xposed.kt

+3-2
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,9 @@ class Xposed: IXposedHookLoadPackage, ServiceConnection {
9696

9797
XposedBridge.hookMethod(showMethod, object: XC_MethodHook() {
9898
override fun beforeHookedMethod(param: MethodHookParam) {
99-
val keyguardShowing = param.args[0]
100-
val deviceProvisioned = param.args[1]
99+
val showingIndex = param.args.indexOfFirst { it is Boolean }
100+
val keyguardShowing = param.args[showingIndex]
101+
val deviceProvisioned = param.args[showingIndex + 1]
101102
mKeyguardShowing.set(param.thisObject, keyguardShowing)
102103
mDeviceProvisioned.set(param.thisObject, deviceProvisioned)
103104
if(handleShow(param)){

app/src/main/java/com/kieronquinn/app/classicpowermenu/ui/screens/settings/main/SettingsMainFragment.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class SettingsMainFragment : SettingsSwitchedFragment(), AutoExpandOnRotate, Pro
102102
SettingsItem.AboutSetting(
103103
R.drawable.ic_about,
104104
getString(R.string.settings_about, BuildConfig.VERSION_NAME),
105-
getText(R.string.settings_about_desc),
105+
getString(R.string.settings_about_desc, getString(R.string.settings_about_translators)),
106106
tripleTapAction = viewModel::onAboutTripleTapped
107107
)
108108
)

app/src/main/java/com/kieronquinn/app/classicpowermenu/utils/extensions/Extensions+IActivityManager.kt

+59-35
Original file line numberDiff line numberDiff line change
@@ -13,48 +13,72 @@ import androidx.core.os.BuildCompat
1313
/**
1414
* Handles differences between calls on Android 11 and 12+
1515
*/
16+
@SuppressLint("UnsafeOptInUsageError")
1617
fun IActivityManager.broadcastIntentWithFeatureCompat(
1718
thread: IApplicationThread,
1819
attributionTag: String?,
1920
intent: Intent,
2021
intentType: String?,
2122
identifier: Int
2223
) {
23-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
24-
broadcastIntentWithFeature(
25-
thread,
26-
attributionTag,
27-
intent,
28-
intentType,
29-
null,
30-
Activity.RESULT_OK,
31-
null,
32-
null,
33-
null,
34-
null,
35-
-1,
36-
null,
37-
false,
38-
false,
39-
identifier
40-
)
41-
} else {
42-
broadcastIntentWithFeature(
43-
thread,
44-
attributionTag,
45-
intent,
46-
intentType,
47-
null,
48-
Activity.RESULT_OK,
49-
null,
50-
null,
51-
null,
52-
-1,
53-
null,
54-
false,
55-
false,
56-
identifier
57-
)
24+
when {
25+
BuildCompat.isAtLeastT() -> {
26+
broadcastIntentWithFeature(
27+
thread,
28+
attributionTag,
29+
intent,
30+
intentType,
31+
null,
32+
Activity.RESULT_OK,
33+
null,
34+
null,
35+
null,
36+
null,
37+
null,
38+
-1,
39+
null,
40+
false,
41+
false,
42+
identifier
43+
)
44+
}
45+
Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> {
46+
broadcastIntentWithFeature(
47+
thread,
48+
attributionTag,
49+
intent,
50+
intentType,
51+
null,
52+
Activity.RESULT_OK,
53+
null,
54+
null,
55+
null,
56+
null,
57+
-1,
58+
null,
59+
false,
60+
false,
61+
identifier
62+
)
63+
}
64+
else -> {
65+
broadcastIntentWithFeature(
66+
thread,
67+
attributionTag,
68+
intent,
69+
intentType,
70+
null,
71+
Activity.RESULT_OK,
72+
null,
73+
null,
74+
null,
75+
-1,
76+
null,
77+
false,
78+
false,
79+
identifier
80+
)
81+
}
5882
}
5983
}
6084

app/src/main/res/values-it/strings.xml

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<resources>
2+
<resources xmlns:tools="http://schemas.android.com/tools">
33

44
<string name="app_name">Classic Power Menu</string>
55
<string name="strapline">Menù di avvio alternativo</string>
@@ -45,10 +45,11 @@
4545
<string name="reboot_safemode_title">Riavvia in modalità provvisoria</string>
4646
<string name="wallet_code_open_in_pay">Apri in Google Pay</string>
4747

48-
<string name="settings">Impostazioni</string>
48+
<string name="settings" tools:ignore="ExtraTranslation">Impostazioni</string>
4949
<string name="settings_about">Classic Power Menu v%1s</string>
5050
<string name="settings_about_desc">"Creato da Kieron Quinn / Quinny899 @ XDA
51-
Immagini aggiuntive di Rohith R Krishnan e Austin Andrews"</string>
51+
Immagini aggiuntive di Rohith R Krishnan e Austin Andrews"%1s</string>
52+
<string name="settings_about_translators">Traduttrici:\nGiapponese: C0unt-zero\nItaliano: Vladi69\nCinese: wushidi and Ketal</string>
5253
<string name="settings_about_faq">Domande frequenti</string>
5354
<string name="settings_about_header">Info</string>
5455
<string name="settings_accessibility_warning">Servizio di accessibilità non abilitato</string>
@@ -127,7 +128,7 @@ Immagini aggiuntive di Rohith R Krishnan e Austin Andrews"</string>
127128
<string name="bs_update_download_failed">Scaricamento fallito</string>
128129
<string name="update_notification_channel_description">Mostra notifica quando l\'app controlla la presenza di aggiornamenti una volta al giorno</string>
129130
<string name="update_notification_channel_title">Notifiche aggiornamento</string>
130-
<string name="update_notification_content" formatted="false">È disponibile un aggiornamento per Classic Power Menu (%1s a %1s)</string>
131+
<string name="update_notification_content">È disponibile un aggiornamento per Classic Power Menu (%1s a %1s)</string>
131132
<string name="update_notification_title">Aggiornamento di Classic Power Menu disponibile</string>
132133
<string name="shortcut_show_power_menu">Menù di avvio</string>
133134

app/src/main/res/values-ja/strings.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
<string name="settings_about_faq">よくある質問</string>
108108
<string name="settings_about_faq_file">faq_ja.md</string>
109109
<string name="settings_about">Classic Power Menu v%1s</string>
110-
<string name="settings_about_desc">制作: Kieron Quinn / Quinny899 @ XDA\nその他の画像: Rohith R Krishnan and Austin Andrews</string>
110+
<string name="settings_about_desc">制作: Kieron Quinn / Quinny899 @ XDA\nその他の画像: Rohith R Krishnan and Austin Andrews%1s</string>
111111

112112
<string name="chip_donate">寄付する</string>
113113
<string name="chip_twitter">Twitterでフォローする</string>

app/src/main/res/values-zh-rCN/strings.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@
9696
<string name="settings_about_header">关于</string>
9797
<string name="settings_about_faq">常见问题</string>
9898
<string name="settings_about">高级电源菜单 v%1s</string>
99-
<string name="settings_about_desc">开发: Kieron Quinn / Quinny899 @ XDA\n部分图片由 Rohith R Krishnan 和 Austin Andrews提供\n汉化:wushidi 和 ketal</string>
99+
<string name="settings_about_desc">开发: Kieron Quinn / Quinny899 @ XDA\n部分图片由 Rohith R Krishnan 和 Austin Andrews提供\n%1s</string>
100+
<string name="settings_about_translators">汉化:wushidi 和 ketal\n日本人: C0unt-zero\n意大利语: Vladi69</string>
100101

101102
<string name="chip_donate">捐赠</string>
102103
<string name="chip_twitter">关注我的 Twitter</string>

app/src/main/res/values/strings.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@
106106
<string name="settings_about_faq">Frequently Asked Questions</string>
107107
<string name="settings_about_faq_file">faq.md</string>
108108
<string name="settings_about">Classic Power Menu v%1s</string>
109-
<string name="settings_about_desc">Created by Kieron Quinn / Quinny899 @ XDA\nAdditional images by Rohith R Krishnan and Austin Andrews</string>
109+
<string name="settings_about_desc">Created by Kieron Quinn / Quinny899 @ XDA\nAdditional images by Rohith R Krishnan and Austin Andrews\n%1s</string>
110+
<string name="settings_about_translators">Translators:\nJapanese: C0unt-zero\nItalian: Vladi69\nChinese: wushidi and Ketal</string>
110111

111112
<string name="chip_donate">Donate</string>
112113
<string name="chip_twitter">Follow me on Twitter</string>

build.gradle

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22
buildscript {
3-
ext.koin_version = '3.1.5'
4-
ext.nav_version = "2.4.1"
3+
ext.koin_version = '3.1.6'
4+
ext.nav_version = "2.4.2"
55
ext.protobufVersion = '0.8.17'
66
repositories {
77
google()
@@ -10,7 +10,7 @@ buildscript {
1010
}
1111
dependencies {
1212
classpath 'com.android.tools.build:gradle:7.0.4'
13-
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10'
13+
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.21'
1414
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version"
1515
classpath "com.google.protobuf:protobuf-gradle-plugin:$protobufVersion"
1616
classpath 'com.google.android.gms:oss-licenses-plugin:0.10.5'

systemstubs/src/main/java/android/app/IActivityManager.java

+19
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,25 @@ int broadcastIntentWithFeature(
7676
boolean sticky,
7777
int userId);
7878

79+
//Android 13+
80+
int broadcastIntentWithFeature(
81+
IApplicationThread caller,
82+
String callingFeatureId,
83+
Intent intent,
84+
String resolvedType,
85+
IIntentReceiver resultTo,
86+
int resultCode,
87+
String resultData,
88+
Bundle map,
89+
String[] requiredPermissions,
90+
String[] excludePermissions,
91+
String[] excludePackages,
92+
int appOp,
93+
Bundle options,
94+
boolean serialized,
95+
boolean sticky,
96+
int userId);
97+
7998
Intent getIntentForIntentSender(IIntentSender sender);
8099

81100
int startActivityWithFeature(

0 commit comments

Comments
 (0)