From 65ed1424188887fc24d31252cfe85895c75bc456 Mon Sep 17 00:00:00 2001 From: vzhovnitsky Date: Tue, 23 Jul 2024 10:21:35 +0300 Subject: [PATCH 1/2] fix: Register BroadcastReceiver for theme style updates --- .../modules/appearance/AppearanceModule.java | 60 +++++++++++++------ 1 file changed, 43 insertions(+), 17 deletions(-) diff --git a/android/app/src/main/java/com/tonhub/wallet/modules/appearance/AppearanceModule.java b/android/app/src/main/java/com/tonhub/wallet/modules/appearance/AppearanceModule.java index 7342772a4..50c6dcc5d 100644 --- a/android/app/src/main/java/com/tonhub/wallet/modules/appearance/AppearanceModule.java +++ b/android/app/src/main/java/com/tonhub/wallet/modules/appearance/AppearanceModule.java @@ -1,10 +1,12 @@ package com.tonhub.wallet.modules.appearance; +import android.annotation.SuppressLint; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.res.Configuration; +import android.os.Build; import android.os.Bundle; import android.util.Log; @@ -45,28 +47,52 @@ public String getName() { return "AppearanceModule"; } + @SuppressLint("UnspecifiedRegisterReceiverFlag") @Override public void initialize() { super.initialize(); ReactApplicationContext rnAppContext = getReactApplicationContext(); - rnAppContext - .getApplicationContext() - .registerReceiver( - new BroadcastReceiver() { - @Override - public void onReceive(Context context, Intent intent) { - Bundle extras = intent.getExtras(); - if (extras != null) { - String style = extras.getString("style"); - if (style != null) { - rnAppContext - .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class) - .emit(APPEARANCE_CHANGED_EVENT_NAME, style); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { + rnAppContext + .getApplicationContext() + .registerReceiver( + new BroadcastReceiver() { + @Override + public void onReceive(Context context, Intent intent) { + Bundle extras = intent.getExtras(); + if (extras != null) { + String style = extras.getString("style"); + if (style != null) { + rnAppContext + .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class) + .emit(APPEARANCE_CHANGED_EVENT_NAME, style); + } } } - } - }, - new IntentFilter(THEME_STYLE_UPDATED_ACTION) - ); + }, + new IntentFilter(THEME_STYLE_UPDATED_ACTION), + Context.RECEIVER_NOT_EXPORTED + ); + } else { + rnAppContext + .getApplicationContext() + .registerReceiver( + new BroadcastReceiver() { + @Override + public void onReceive(Context context, Intent intent) { + Bundle extras = intent.getExtras(); + if (extras != null) { + String style = extras.getString("style"); + if (style != null) { + rnAppContext + .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class) + .emit(APPEARANCE_CHANGED_EVENT_NAME, style); + } + } + } + }, + new IntentFilter(THEME_STYLE_UPDATED_ACTION) + ); + } } } \ No newline at end of file From 6dd2f083637f21946236e25497f1909d6b599eff Mon Sep 17 00:00:00 2001 From: vzhovnitsky Date: Tue, 23 Jul 2024 10:27:05 +0300 Subject: [PATCH 2/2] v2.3.9 --- VERSION_CODE | 2 +- ios/wallet/Info.plist | 4 ++-- package.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/VERSION_CODE b/VERSION_CODE index 252b382b3..5e78f1eb7 100644 --- a/VERSION_CODE +++ b/VERSION_CODE @@ -1 +1 @@ -202 \ No newline at end of file +203 \ No newline at end of file diff --git a/ios/wallet/Info.plist b/ios/wallet/Info.plist index 0d489b32c..d161ad6b2 100644 --- a/ios/wallet/Info.plist +++ b/ios/wallet/Info.plist @@ -19,7 +19,7 @@ CFBundlePackageType $(PRODUCT_BUNDLE_PACKAGE_TYPE) CFBundleShortVersionString - 2.3.8 + 2.3.9 CFBundleSignature ???? CFBundleURLTypes @@ -41,7 +41,7 @@ CFBundleVersion - 202 + 203 ITSAppUsesNonExemptEncryption LSApplicationQueriesSchemes diff --git a/package.json b/package.json index 6de5fd62a..d71fac7ef 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wallet", - "version": "2.3.8", + "version": "2.3.9", "scripts": { "start": "expo start --dev-client", "android": "expo run:android",