| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 5efd523 commit 060d22b
7 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -15,12 +15,12 @@ def getGitHash = { -> | |||
| 15 | 15 | } | |
| 16 | 16 | ||
| 17 | 17 | android { | |
| 18 | - compileSdk 34 | ||
| 18 | + compileSdk 35 | ||
| 19 | 19 | ||
| 20 | 20 | defaultConfig { | |
| 21 | 21 | applicationId "com.httpsms" | |
| 22 | 22 | minSdk 28 | |
| 23 | - targetSdk 33 | ||
| 23 | + targetSdk 35 | ||
| 24 | 24 | versionCode 1 | |
| 25 | 25 | versionName "${getGitHash()}" | |
| 26 | 26 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | |
@@ -51,23 +51,23 @@ android { | |||
| 51 | 51 | } | |
| 52 | 52 | ||
| 53 | 53 | dependencies { | |
| 54 | - implementation platform('com.google.firebase:firebase-bom:32.7.4') | ||
| 54 | + implementation platform('com.google.firebase:firebase-bom:33.5.1') | ||
| 55 | 55 | implementation 'com.journeyapps:zxing-android-embedded:4.3.0' | |
| 56 | 56 | implementation 'com.google.firebase:firebase-analytics-ktx' | |
| 57 | 57 | implementation 'com.google.firebase:firebase-messaging-ktx' | |
| 58 | - implementation 'com.squareup.okhttp3:okhttp:4.10.0' | ||
| 58 | + implementation 'com.squareup.okhttp3:okhttp:4.12.0' | ||
| 59 | 59 | implementation 'com.jakewharton.timber:timber:5.0.1' | |
| 60 | 60 | implementation 'androidx.preference:preference-ktx:1.2.1' | |
| 61 | - implementation 'androidx.work:work-runtime-ktx:2.9.0' | ||
| 62 | - implementation 'androidx.core:core-ktx:1.12.0' | ||
| 61 | + implementation 'androidx.work:work-runtime-ktx:2.10.0' | ||
| 62 | + implementation 'androidx.core:core-ktx:1.15.0' | ||
| 63 | 63 | implementation "androidx.cardview:cardview:1.0.0" | |
| 64 | - implementation 'com.beust:klaxon:5.5' | ||
| 65 | - implementation 'androidx.appcompat:appcompat:1.6.1' | ||
| 66 | - implementation 'org.apache.commons:commons-text:1.9' | ||
| 67 | - implementation 'com.google.android.material:material:1.11.0' | ||
| 68 | - implementation 'androidx.constraintlayout:constraintlayout:2.1.4' | ||
| 69 | - implementation 'androidx.core:core-ktx:1.12.0' | ||
| 64 | + implementation 'com.beust:klaxon:5.6' | ||
| 65 | + implementation 'androidx.appcompat:appcompat:1.7.0' | ||
| 66 | + implementation 'org.apache.commons:commons-text:1.12.0' | ||
| 67 | + implementation 'com.google.android.material:material:1.12.0' | ||
| 68 | + implementation 'androidx.constraintlayout:constraintlayout:2.2.0' | ||
| 69 | + implementation 'androidx.core:core-ktx:1.15.0' | ||
| 70 | 70 | testImplementation 'junit:junit:4.13.2' | |
| 71 | - androidTestImplementation 'androidx.test.ext:junit:1.1.5' | ||
| 72 | - androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' | ||
| 71 | + androidTestImplementation 'androidx.test.ext:junit:1.2.1' | ||
| 72 | + androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1' | ||
| 73 | 73 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -19,6 +19,7 @@ | |||
| 19 | 19 | <uses-permission android:name="android.permission.WAKE_LOCK" /> | |
| 20 | 20 | <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/> | |
| 21 | 21 | <uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" /> | |
| 22 | + <uses-permission android:name="android.permission.FOREGROUND_SERVICE_REMOTE_MESSAGING"/> | ||
| 22 | 23 | ||
| 23 | 24 | <application | |
| 24 | 25 | android:allowBackup="true" | |
@@ -47,7 +48,7 @@ | |||
| 47 | 48 | tools:ignore="LockedOrientationActivity" /> | |
| 48 | 49 | <activity | |
| 49 | 50 | android:name="com.journeyapps.barcodescanner.CaptureActivity" | |
| 50 | - android:screenOrientation="portrait" | ||
| 51 | + android:screenOrientation="fullSensor" | ||
| 51 | 52 | tools:replace="screenOrientation" | |
| 52 | 53 | tools:ignore="DiscouragedApi" /> | |
| 53 | 54 | ||
@@ -60,6 +61,7 @@ | |||
| 60 | 61 | ||
| 61 | 62 | <service | |
| 62 | 63 | android:name=".MyFirebaseMessagingService" | |
| 64 | + android:foregroundServiceType="remoteMessaging" | ||
| 63 | 65 | android:exported="false"> | |
| 64 | 66 | <intent-filter> | |
| 65 | 67 | <action android:name="com.google.firebase.MESSAGING_EVENT" /> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -120,6 +120,7 @@ class LoginActivity : AppCompatActivity() { | |||
| 120 | 120 | } | |
| 121 | 121 | ||
| 122 | 122 | @SuppressLint("HardwareIds") | |
| 123 | + @Suppress("DEPRECATION") | ||
| 123 | 124 | private fun getPhoneNumber(context: Context): String? { | |
| 124 | 125 | val telephonyManager = this.getSystemService(Context.TELEPHONY_SERVICE) as TelephonyManager | |
| 125 | 126 | if (ActivityCompat.checkSelfPermission( | |
@@ -291,8 +292,8 @@ class LoginActivity : AppCompatActivity() { | |||
| 291 | 292 | } | |
| 292 | 293 | ||
| 293 | 294 | Thread { | |
| 294 | - val error = HttpSmsApiService(apiKey.text.toString(), URI(serverUrl.text.toString().trim())).validateApiKey() | ||
| 295 | - liveData.postValue(error) | ||
| 295 | + val response = HttpSmsApiService(apiKey.text.toString(), URI(serverUrl.text.toString().trim())).validateApiKey() | ||
| 296 | + liveData.postValue(response) | ||
| 296 | 297 | Timber.d("finished validating api URL") | |
| 297 | 298 | }.start() | |
| 298 | 299 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,7 +1,10 @@ | |||
| 1 | 1 | package com.httpsms | |
| 2 | 2 | ||
| 3 | 3 | import android.content.Context | |
| 4 | + import android.content.Context.RECEIVER_EXPORTED | ||
| 4 | 5 | import android.content.IntentFilter | |
| 6 | + import android.os.Build | ||
| 7 | + import androidx.annotation.RequiresApi | ||
| 5 | 8 | import timber.log.Timber | |
| 6 | 9 | ||
| 7 | 10 | object Receiver { | |
@@ -12,19 +15,35 @@ object Receiver { | |||
| 12 | 15 | if(sentReceiver == null) { | |
| 13 | 16 | Timber.d("registering [sent] receiver for intent [${SmsManagerService.sentAction()}]") | |
| 14 | 17 | sentReceiver = SentReceiver() | |
| 15 | - context.registerReceiver( | ||
| 16 | - sentReceiver, | ||
| 17 | - IntentFilter(SmsManagerService.sentAction()) | ||
| 18 | - ) | ||
| 18 | + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { | ||
| 19 | + context.registerReceiver( | ||
| 20 | + sentReceiver, | ||
| 21 | + IntentFilter(SmsManagerService.sentAction()), | ||
| 22 | + RECEIVER_EXPORTED | ||
| 23 | + ) | ||
| 24 | + } else { | ||
| 25 | + context.registerReceiver( | ||
| 26 | + sentReceiver, | ||
| 27 | + IntentFilter(SmsManagerService.sentAction()) | ||
| 28 | + ) | ||
| 29 | + } | ||
| 19 | 30 | } | |
| 20 | 31 | ||
| 21 | 32 | if(deliveredReceiver == null) { | |
| 22 | 33 | Timber.d("registering [delivered] receiver for intent [${SmsManagerService.deliveredAction()}]") | |
| 23 | 34 | deliveredReceiver = DeliveredReceiver() | |
| 24 | - context.registerReceiver( | ||
| 25 | - deliveredReceiver, | ||
| 26 | - IntentFilter(SmsManagerService.deliveredAction()) | ||
| 27 | - ) | ||
| 35 | + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { | ||
| 36 | + context.registerReceiver( | ||
| 37 | + deliveredReceiver, | ||
| 38 | + IntentFilter(SmsManagerService.deliveredAction()), | ||
| 39 | + RECEIVER_EXPORTED | ||
| 40 | + ) | ||
| 41 | + } else { | ||
| 42 | + context.registerReceiver( | ||
| 43 | + deliveredReceiver, | ||
| 44 | + IntentFilter(SmsManagerService.deliveredAction()) | ||
| 45 | + ) | ||
| 46 | + } | ||
| 28 | 47 | } | |
| 29 | 48 | } | |
| 30 | 49 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -36,7 +36,7 @@ class SmsManagerService { | |||
| 36 | 36 | } else { | |
| 37 | 37 | context.getSystemService(SubscriptionManager::class.java) | |
| 38 | 38 | } | |
| 39 | - return localSubscriptionManager.activeSubscriptionInfoList.size > 1 | ||
| 39 | + return localSubscriptionManager.activeSubscriptionInfoList!!.size > 1 | ||
| 40 | 40 | } | |
| 41 | 41 | } | |
| 42 | 42 | ||
@@ -61,11 +61,11 @@ class SmsManagerService { | |||
| 61 | 61 | context.getSystemService(SubscriptionManager::class.java) | |
| 62 | 62 | } | |
| 63 | 63 | ||
| 64 | - Timber.d("active subscription info size: [${localSubscriptionManager.activeSubscriptionInfoList.size}]") | ||
| 65 | - val subscriptionId = if (sim == Constants.SIM1 && localSubscriptionManager.activeSubscriptionInfoList.size > 0) { | ||
| 66 | - localSubscriptionManager.activeSubscriptionInfoList[0].subscriptionId | ||
| 67 | - } else if (sim == Constants.SIM2 && localSubscriptionManager.activeSubscriptionInfoList.size > 1) { | ||
| 68 | - localSubscriptionManager.activeSubscriptionInfoList[1].subscriptionId | ||
| 64 | + Timber.d("active subscription info size: [${localSubscriptionManager.activeSubscriptionInfoList!!.size}]") | ||
| 65 | + val subscriptionId = if (sim == Constants.SIM1 && localSubscriptionManager.activeSubscriptionInfoList!!.size > 0) { | ||
| 66 | + localSubscriptionManager.activeSubscriptionInfoList!![0].subscriptionId | ||
| 67 | + } else if (sim == Constants.SIM2 && localSubscriptionManager.activeSubscriptionInfoList!!.size > 1) { | ||
| 68 | + localSubscriptionManager.activeSubscriptionInfoList!![1].subscriptionId | ||
| 69 | 69 | } else{ | |
| 70 | 70 | SubscriptionManager.getDefaultSmsSubscriptionId() | |
| 71 | 71 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -98,7 +98,7 @@ class PhoneStateReceiver : BroadcastReceiver() { | |||
| 98 | 98 | } | |
| 99 | 99 | ||
| 100 | 100 | var sim = Constants.SIM1 | |
| 101 | - localSubscriptionManager.activeSubscriptionInfoList.forEach { | ||
| 101 | + localSubscriptionManager.activeSubscriptionInfoList!!.forEach { | ||
| 102 | 102 | if (it.subscriptionId == subscriptionId) { | |
| 103 | 103 | if (it.simSlotIndex > 0){ | |
| 104 | 104 | sim = Constants.SIM2 | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -11,7 +11,7 @@ buildscript { | |||
| 11 | 11 | } | |
| 12 | 12 | dependencies { | |
| 13 | 13 | // Add this line | |
| 14 | - classpath 'com.google.gms:google-services:4.4.0' | ||
| 14 | + classpath 'com.google.gms:google-services:4.4.2' | ||
| 15 | 15 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" | |
| 16 | 16 | } | |
| 17 | 17 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments