Skip to content

Commit

Permalink
Merge pull request #47 from KieronQuinn/1.5
Browse files Browse the repository at this point in the history
1.5
  • Loading branch information
KieronQuinn authored Jun 8, 2022
2 parents 4fc0a8a + 62de229 commit c601751
Show file tree
Hide file tree
Showing 16 changed files with 116 additions and 75 deletions.
12 changes: 0 additions & 12 deletions .idea/modules.xml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ open class UserBroadcastDispatcher(
bgHandler.obtainMessage(MSG_UNREGISTER_RECEIVER, receiver).sendToTarget()
}

@SuppressLint("RestrictedApi")
private fun handleRegisterReceiver(receiverData: ReceiverData) {
Preconditions.checkState(bgHandler.looper.isCurrentThread,
"This method should only be called from BG thread")
Expand Down
2 changes: 1 addition & 1 deletion Controls/src/main/res/values-it/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<!-- Device Controls setup, title [CHAR LIMIT=50] -->
<string name="quick_controls_setup_title">Configura i controlli smart</string>
<!-- Device Controls setup, subtitle [CHAR LIMIT=100] -->
<string name="quick_controls_subtitle">Aggiungi controlli smart dei dispositivi connessi</string>
<string name="quick_controls_setup_subtitle">Aggiungi controlli smart dei dispositivi connessi</string>

<!-- Controls management providers screen title [CHAR LIMIT=60]-->
<string name="controls_providers_title">Scegli app per aggiungere i controlli</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,16 +197,20 @@ public void onWalletCardsRetrieved(GetWalletCardsResponse response) {
return;
}
List<WalletCard> walletCards = response.getWalletCards();
if(walletCards.size() == 0) return;

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

mDefaultCardId = data.get(response.getSelectedIndex()).getCardId();
if(walletCards.isEmpty()){
mDefaultCardId = null;
}else {
mDefaultCardId = data.get(response.getSelectedIndex()).getCardId();
}

mWalletLoyaltyCardCallback.getMethod().invoke(data, () -> {
if(data.size() == 0) return;
//Make sure we're still attached
if(mWalletView.isAttachedToWindow()) {
setupWalletView(data, response);
Expand Down
3 changes: 2 additions & 1 deletion QuickAccessWallet/src/main/res/layout/wallet_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:clipChildren="false">

<LinearLayout
Expand Down Expand Up @@ -50,7 +51,7 @@
android:layout_width="@dimen/wallet_menu_btn_size"
android:layout_height="@dimen/wallet_menu_btn_size"
android:padding="12dp"
android:tint="@android:color/white"
app:tint="@android:color/white"
android:contentDescription="@string/accessibility_menu"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:theme="@style/Wallet.Theme" />
Expand Down
18 changes: 9 additions & 9 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
id 'com.google.android.gms.oss-licenses-plugin'
}

def version = '1.4.2'
def version = '1.5'

android {
compileSdk 31
Expand All @@ -16,7 +16,7 @@ android {
applicationId "com.kieronquinn.app.classicpowermenu"
minSdk 30
targetSdk 31
versionCode 142
versionCode 150
versionName version

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down Expand Up @@ -72,21 +72,21 @@ dependencies {

//AndroidX
def lifecycle_version = "2.4.1"
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'androidx.core:core-ktx:1.8.0'
implementation 'androidx.appcompat:appcompat:1.4.2'
implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-process:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-service:$lifecycle_version"
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.work:work-runtime-ktx:2.7.1'
implementation "androidx.core:core-splashscreen:1.0.0-beta01"
implementation "androidx.core:core-splashscreen:1.0.0-rc01"
implementation "androidx.navigation:navigation-fragment-ktx:$nav_version"
implementation "androidx.navigation:navigation-ui-ktx:$nav_version"

//Material
implementation 'com.google.android.material:material:1.5.0'
implementation 'com.google.android.material:material:1.6.1'

//Monet
implementation 'com.github.KieronQuinn:MonetCompat:0.4.1'
Expand Down Expand Up @@ -117,7 +117,7 @@ dependencies {
implementation 'com.journeyapps:zxing-android-embedded:4.1.0@aar'

//libsu for root operations
def libsuVersion = '3.2.1'
def libsuVersion = '4.0.3'
implementation "com.github.topjohnwu.libsu:core:${libsuVersion}"
implementation "com.github.topjohnwu.libsu:service:${libsuVersion}"
implementation "com.github.topjohnwu.libsu:io:${libsuVersion}"
Expand All @@ -138,7 +138,7 @@ dependencies {

//Other third party
implementation 'org.lsposed.hiddenapibypass:hiddenapibypass:4.3'
implementation 'com.airbnb.android:lottie:4.2.2'
implementation 'com.airbnb.android:lottie:5.0.3'
implementation 'com.jakewharton:process-phoenix:2.1.2'
implementation 'me.saket:better-link-movement-method:2.2.0'
implementation "io.noties.markwon:core:4.6.2"
Expand Down
4 changes: 2 additions & 2 deletions app/release/output-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 140,
"versionName": "1.4",
"versionCode": 150,
"versionName": "1.5",
"outputFile": "app-release.apk"
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,9 @@ class Xposed: IXposedHookLoadPackage, ServiceConnection {

XposedBridge.hookMethod(showMethod, object: XC_MethodHook() {
override fun beforeHookedMethod(param: MethodHookParam) {
val keyguardShowing = param.args[0]
val deviceProvisioned = param.args[1]
val showingIndex = param.args.indexOfFirst { it is Boolean }
val keyguardShowing = param.args[showingIndex]
val deviceProvisioned = param.args[showingIndex + 1]
mKeyguardShowing.set(param.thisObject, keyguardShowing)
mDeviceProvisioned.set(param.thisObject, deviceProvisioned)
if(handleShow(param)){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class SettingsMainFragment : SettingsSwitchedFragment(), AutoExpandOnRotate, Pro
SettingsItem.AboutSetting(
R.drawable.ic_about,
getString(R.string.settings_about, BuildConfig.VERSION_NAME),
getText(R.string.settings_about_desc),
getString(R.string.settings_about_desc, getString(R.string.settings_about_translators)),
tripleTapAction = viewModel::onAboutTripleTapped
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,48 +13,72 @@ import androidx.core.os.BuildCompat
/**
* Handles differences between calls on Android 11 and 12+
*/
@SuppressLint("UnsafeOptInUsageError")
fun IActivityManager.broadcastIntentWithFeatureCompat(
thread: IApplicationThread,
attributionTag: String?,
intent: Intent,
intentType: String?,
identifier: Int
) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
broadcastIntentWithFeature(
thread,
attributionTag,
intent,
intentType,
null,
Activity.RESULT_OK,
null,
null,
null,
null,
-1,
null,
false,
false,
identifier
)
} else {
broadcastIntentWithFeature(
thread,
attributionTag,
intent,
intentType,
null,
Activity.RESULT_OK,
null,
null,
null,
-1,
null,
false,
false,
identifier
)
when {
BuildCompat.isAtLeastT() -> {
broadcastIntentWithFeature(
thread,
attributionTag,
intent,
intentType,
null,
Activity.RESULT_OK,
null,
null,
null,
null,
null,
-1,
null,
false,
false,
identifier
)
}
Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> {
broadcastIntentWithFeature(
thread,
attributionTag,
intent,
intentType,
null,
Activity.RESULT_OK,
null,
null,
null,
null,
-1,
null,
false,
false,
identifier
)
}
else -> {
broadcastIntentWithFeature(
thread,
attributionTag,
intent,
intentType,
null,
Activity.RESULT_OK,
null,
null,
null,
-1,
null,
false,
false,
identifier
)
}
}
}

Expand Down
9 changes: 5 additions & 4 deletions app/src/main/res/values-it/strings.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<resources xmlns:tools="http://schemas.android.com/tools">

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

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

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-ja/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
<string name="settings_about_faq">よくある質問</string>
<string name="settings_about_faq_file">faq_ja.md</string>
<string name="settings_about">Classic Power Menu v%1s</string>
<string name="settings_about_desc">制作: Kieron Quinn / Quinny899 @ XDA\nその他の画像: Rohith R Krishnan and Austin Andrews</string>
<string name="settings_about_desc">制作: Kieron Quinn / Quinny899 @ XDA\nその他の画像: Rohith R Krishnan and Austin Andrews%1s</string>

<string name="chip_donate">寄付する</string>
<string name="chip_twitter">Twitterでフォローする</string>
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@
<string name="settings_about_header">关于</string>
<string name="settings_about_faq">常见问题</string>
<string name="settings_about">高级电源菜单 v%1s</string>
<string name="settings_about_desc">开发: Kieron Quinn / Quinny899 @ XDA\n部分图片由 Rohith R Krishnan 和 Austin Andrews提供\n汉化:wushidi 和 ketal</string>
<string name="settings_about_desc">开发: Kieron Quinn / Quinny899 @ XDA\n部分图片由 Rohith R Krishnan 和 Austin Andrews提供\n%1s</string>
<string name="settings_about_translators">汉化:wushidi 和 ketal\n日本人: C0unt-zero\n意大利语: Vladi69</string>

<string name="chip_donate">捐赠</string>
<string name="chip_twitter">关注我的 Twitter</string>
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@
<string name="settings_about_faq">Frequently Asked Questions</string>
<string name="settings_about_faq_file">faq.md</string>
<string name="settings_about">Classic Power Menu v%1s</string>
<string name="settings_about_desc">Created by Kieron Quinn / Quinny899 @ XDA\nAdditional images by Rohith R Krishnan and Austin Andrews</string>
<string name="settings_about_desc">Created by Kieron Quinn / Quinny899 @ XDA\nAdditional images by Rohith R Krishnan and Austin Andrews\n%1s</string>
<string name="settings_about_translators">Translators:\nJapanese: C0unt-zero\nItalian: Vladi69\nChinese: wushidi and Ketal</string>

<string name="chip_donate">Donate</string>
<string name="chip_twitter">Follow me on Twitter</string>
Expand Down
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.koin_version = '3.1.5'
ext.nav_version = "2.4.1"
ext.koin_version = '3.1.6'
ext.nav_version = "2.4.2"
ext.protobufVersion = '0.8.17'
repositories {
google()
Expand All @@ -10,7 +10,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.4'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.21'
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version"
classpath "com.google.protobuf:protobuf-gradle-plugin:$protobufVersion"
classpath 'com.google.android.gms:oss-licenses-plugin:0.10.5'
Expand Down
19 changes: 19 additions & 0 deletions systemstubs/src/main/java/android/app/IActivityManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,25 @@ int broadcastIntentWithFeature(
boolean sticky,
int userId);

//Android 13+
int broadcastIntentWithFeature(
IApplicationThread caller,
String callingFeatureId,
Intent intent,
String resolvedType,
IIntentReceiver resultTo,
int resultCode,
String resultData,
Bundle map,
String[] requiredPermissions,
String[] excludePermissions,
String[] excludePackages,
int appOp,
Bundle options,
boolean serialized,
boolean sticky,
int userId);

Intent getIntentForIntentSender(IIntentSender sender);

int startActivityWithFeature(
Expand Down

0 comments on commit c601751

Please sign in to comment.