forked from upstream-mirrors/quik
fixed ~~all~~ most of the ~~things~~ errors - it compiles now
This commit is contained in:
@@ -20,11 +20,11 @@ apply plugin: 'com.android.library'
|
||||
apply plugin: 'kotlin-android'
|
||||
|
||||
android {
|
||||
compileSdk 25
|
||||
compileSdk 33
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 23
|
||||
targetSdkVersion 25
|
||||
minSdkVersion 26
|
||||
targetSdkVersion 33
|
||||
}
|
||||
|
||||
|
||||
@@ -45,5 +45,13 @@ dependencies {
|
||||
}
|
||||
|
||||
repositories {
|
||||
google()
|
||||
maven { url "https://jitpack.io" }
|
||||
maven { url 'https://maven.google.com' }
|
||||
maven {
|
||||
name 'glide-snapshot'
|
||||
url 'https://oss.sonatype.org/content/repositories/snapshots'
|
||||
}
|
||||
mavenCentral()
|
||||
jcenter()
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<application>
|
||||
|
||||
<provider android:name=".MmsFileProvider"
|
||||
|
||||
@@ -55,6 +55,12 @@ import timber.log.Timber;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import android.net.Network;
|
||||
import android.net.NetworkRequest;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.NetworkCapabilities;
|
||||
import android.os.Build;
|
||||
|
||||
/**
|
||||
* The TransactionService of the MMS Client is responsible for handling requests
|
||||
* to initiate client-transactions sent from:
|
||||
@@ -181,6 +187,7 @@ public class TransactionService extends Service implements Observer {
|
||||
IntentFilter intentFilter = new IntentFilter();
|
||||
intentFilter.addAction(ConnectivityManager.CONNECTIVITY_ACTION);
|
||||
registerReceiver(mReceiver, intentFilter);
|
||||
mConnMgr = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
}
|
||||
|
||||
private void initServiceHandler() {
|
||||
@@ -458,8 +465,10 @@ public class TransactionService extends Service implements Observer {
|
||||
private synchronized void createWakeLock() {
|
||||
// Create a new wake lock if we haven't made one yet.
|
||||
if (mWakeLock == null) {
|
||||
PowerManager pm = (PowerManager)getSystemService(Context.POWER_SERVICE);
|
||||
mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "MMS Connectivity");
|
||||
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
|
||||
|
||||
// Use a unique tag with a prefix followed by a colon for better debugging
|
||||
mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "myapp:MMSConnectivity");
|
||||
mWakeLock.setReferenceCounted(false);
|
||||
}
|
||||
}
|
||||
@@ -481,31 +490,68 @@ public class TransactionService extends Service implements Observer {
|
||||
|
||||
protected int beginMmsConnectivity() throws IOException {
|
||||
Timber.v("beginMmsConnectivity");
|
||||
|
||||
// Take a wake lock so we don't fall asleep before the message is downloaded.
|
||||
createWakeLock();
|
||||
|
||||
if (Utils.isMmsOverWifiEnabled(this)) {
|
||||
NetworkInfo niWF = mConnMgr.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
|
||||
if ((niWF != null) && (niWF.isConnected())) {
|
||||
Timber.v("beginMmsConnectivity: Wifi active");
|
||||
return 0;
|
||||
Network[] networks = mConnMgr.getAllNetworks();
|
||||
for (Network network : networks) {
|
||||
NetworkCapabilities capabilities = mConnMgr.getNetworkCapabilities(network);
|
||||
if (capabilities != null && capabilities.hasTransport(NetworkCapabilities.TRANSPORT_WIFI)) {
|
||||
if (capabilities.hasCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET) &&
|
||||
capabilities.hasCapability(NetworkCapabilities.NET_CAPABILITY_VALIDATED)) {
|
||||
Timber.v("beginMmsConnectivity: Wifi active");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int result = mConnMgr.startUsingNetworkFeature(ConnectivityManager.TYPE_MOBILE, "enableMMS");
|
||||
// Request the mobile network for MMS connectivity
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
NetworkRequest.Builder builder = new NetworkRequest.Builder();
|
||||
|
||||
Timber.v("beginMmsConnectivity: result=" + result);
|
||||
// Specify MMS capability and cellular transport
|
||||
builder.addCapability(NetworkCapabilities.NET_CAPABILITY_MMS);
|
||||
builder.addTransportType(NetworkCapabilities.TRANSPORT_CELLULAR);
|
||||
|
||||
switch (result) {
|
||||
case 0:
|
||||
case 1:
|
||||
acquireWakeLock();
|
||||
return result;
|
||||
NetworkRequest networkRequest = builder.build();
|
||||
|
||||
mConnMgr.requestNetwork(networkRequest, new ConnectivityManager.NetworkCallback() {
|
||||
@Override
|
||||
public void onAvailable(Network network) {
|
||||
// Bind the process to the network once it's available
|
||||
mConnMgr.bindProcessToNetwork(network);
|
||||
Timber.v("beginMmsConnectivity: Mobile network available for MMS");
|
||||
|
||||
// Acquire wake lock once the network is available
|
||||
acquireWakeLock();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUnavailable() {
|
||||
Timber.e("beginMmsConnectivity: Unable to establish MMS connectivity");
|
||||
// You can handle this by throwing an IOException if necessary
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLost(Network network) {
|
||||
Timber.e("beginMmsConnectivity: Mobile network for MMS lost");
|
||||
// Handle losing the network if needed
|
||||
}
|
||||
});
|
||||
|
||||
// You may need to block or wait until the network becomes available before proceeding.
|
||||
// Using something like a CountDownLatch can help block until onAvailable() is called.
|
||||
// Here we return 1 to indicate the request has been initiated.
|
||||
return 1;
|
||||
}
|
||||
|
||||
throw new IOException("Cannot establish MMS connectivity");
|
||||
}
|
||||
|
||||
|
||||
protected void endMmsConnectivity() {
|
||||
try {
|
||||
Timber.v("endMmsConnectivity");
|
||||
|
||||
+11
-5
@@ -13,9 +13,9 @@ buildscript {
|
||||
ext.billing_version = '5.1.0'
|
||||
ext.conductor_version = '2.1.5'
|
||||
ext.coroutines_version = '1.4.3'
|
||||
ext.dagger_version = "2.16"
|
||||
ext.dagger_version = "2.18"
|
||||
ext.espresso_version = '3.1.0-alpha3'
|
||||
ext.exoplayer_version = "2.8.1"
|
||||
ext.exoplayer_version = "r2.9.0"
|
||||
ext.glide_version = "4.8.0"
|
||||
ext.junit_version = '4.12'
|
||||
ext.kotlin_version = '1.7.20'
|
||||
@@ -24,7 +24,7 @@ buildscript {
|
||||
ext.mockito_version = '2.18.3'
|
||||
ext.moshi_version = '1.8.0'
|
||||
ext.okhttp3_version = '4.10.0'
|
||||
ext.realm_version = '10.16.0'
|
||||
ext.realm_version = '10.15.0'
|
||||
ext.realm_adapters_version = '3.1.0'
|
||||
ext.rxandroid_version = '2.0.1'
|
||||
ext.rxdogtag_version = '0.2.0'
|
||||
@@ -37,9 +37,15 @@ buildscript {
|
||||
ext.abiCodes = ['armeabi-v7a': 1, 'arm64-v8a': 2]
|
||||
|
||||
repositories {
|
||||
maven { url 'https://maven.google.com' }
|
||||
jcenter()
|
||||
google()
|
||||
maven { url "https://jitpack.io" }
|
||||
maven { url 'https://maven.google.com' }
|
||||
maven {
|
||||
name 'glide-snapshot'
|
||||
url 'https://oss.sonatype.org/content/repositories/snapshots'
|
||||
}
|
||||
mavenCentral()
|
||||
jcenter()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
+9
-1
@@ -23,7 +23,7 @@ android {
|
||||
compileSdk 33
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 23
|
||||
minSdk 26
|
||||
targetSdkVersion 33
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
@@ -40,5 +40,13 @@ dependencies {
|
||||
}
|
||||
|
||||
repositories {
|
||||
google()
|
||||
maven { url "https://jitpack.io" }
|
||||
maven { url 'https://maven.google.com' }
|
||||
maven {
|
||||
name 'glide-snapshot'
|
||||
url 'https://oss.sonatype.org/content/repositories/snapshots'
|
||||
}
|
||||
mavenCentral()
|
||||
jcenter()
|
||||
}
|
||||
|
||||
+15
-5
@@ -31,7 +31,7 @@ android {
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 23
|
||||
minSdk 26
|
||||
targetSdkVersion 33
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
@@ -63,8 +63,10 @@ dependencies {
|
||||
kapt "com.google.dagger:dagger-android-processor:$dagger_version"
|
||||
kapt "com.google.dagger:dagger-compiler:$dagger_version"
|
||||
//Resolve jdk8+ Generation Annotations - javax annotation does not exist
|
||||
compileOnly 'com.github.pengrad:jdk9-deps:1.0'
|
||||
// compileOnly "javax.annotation:jsr250-api:1.0"
|
||||
implementation 'com.github.pengrad:jdk9-deps:1ffe84c468'
|
||||
|
||||
// look into jakarta.annotation-api when switching to java 9
|
||||
implementation 'javax.annotation:javax.annotation-api:1.3.2'
|
||||
|
||||
// rxjava
|
||||
implementation "io.reactivex.rxjava2:rxandroid:$rxandroid_version"
|
||||
@@ -85,12 +87,12 @@ dependencies {
|
||||
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-rx2:$coroutines_version"
|
||||
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-reactive:$coroutines_version"
|
||||
|
||||
implementation 'com.callcontrol:datashare:1.2.0'
|
||||
implementation 'com.callcontrol:datashare:1.3.0'
|
||||
implementation "com.f2prateek.rx.preferences2:rx-preferences:$rx_preferences_version"
|
||||
implementation "com.jakewharton.timber:timber:$timber_version"
|
||||
implementation "com.squareup.moshi:moshi:$moshi_version"
|
||||
implementation "com.squareup.okhttp3:okhttp:$okhttp3_version"
|
||||
implementation 'io.michaelrocks:libphonenumber-android:8.10.16'
|
||||
implementation 'io.michaelrocks:libphonenumber-android:8.13.47'
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||
implementation project(":android-smsmms")
|
||||
implementation project(':common')
|
||||
@@ -101,5 +103,13 @@ dependencies {
|
||||
}
|
||||
|
||||
repositories {
|
||||
google()
|
||||
maven { url "https://jitpack.io" }
|
||||
maven { url 'https://maven.google.com' }
|
||||
maven {
|
||||
name 'glide-snapshot'
|
||||
url 'https://oss.sonatype.org/content/repositories/snapshots'
|
||||
}
|
||||
mavenCentral()
|
||||
jcenter()
|
||||
}
|
||||
|
||||
@@ -16,4 +16,7 @@
|
||||
~ You should have received a copy of the GNU General Public License
|
||||
~ along with QKSMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
<manifest />
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
</manifest>
|
||||
|
||||
@@ -31,7 +31,18 @@ class SubscriptionManagerCompat @Inject constructor(context: Context, private va
|
||||
|
||||
val activeSubscriptionInfoList: List<SubscriptionInfoCompat>
|
||||
get() {
|
||||
return subscriptionManager?.activeSubscriptionInfoList?.map { SubscriptionInfoCompat(it) } ?: listOf()
|
||||
return if (permissions.hasPhone()) {
|
||||
try {
|
||||
subscriptionManager?.activeSubscriptionInfoList?.map {
|
||||
SubscriptionInfoCompat(it)
|
||||
} ?: listOf()
|
||||
} catch (e: SecurityException) {
|
||||
// Handle exception if permission is not granted
|
||||
listOf()
|
||||
}
|
||||
} else {
|
||||
listOf()
|
||||
}
|
||||
}
|
||||
|
||||
init {
|
||||
|
||||
+16
-2
@@ -31,7 +31,7 @@ android {
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 23
|
||||
minSdk 26
|
||||
targetSdkVersion 33
|
||||
}
|
||||
namespace 'dev.octoshrimpy.quik.domain'
|
||||
@@ -45,7 +45,10 @@ dependencies {
|
||||
implementation "com.google.dagger:dagger:$dagger_version"
|
||||
kapt "com.google.dagger:dagger-compiler:$dagger_version"
|
||||
//Resolve jdk8+ Generation Annotations - javax annotation does not exist
|
||||
compileOnly 'com.github.pengrad:jdk9-deps:1.0'
|
||||
implementation 'com.github.pengrad:jdk9-deps:1ffe84c468'
|
||||
|
||||
// look into jakarta.annotation-api when switching to java 9
|
||||
implementation 'javax.annotation:javax.annotation-api:1.3.2'
|
||||
|
||||
// realm
|
||||
kapt "io.realm:realm-annotations:$realm_version"
|
||||
@@ -66,8 +69,19 @@ dependencies {
|
||||
implementation "com.jakewharton.timber:timber:$timber_version"
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||
implementation project(":common")
|
||||
|
||||
// implementation 'com.github.pengrad:jdk9-deps:1ffe84c'
|
||||
|
||||
}
|
||||
|
||||
repositories {
|
||||
google()
|
||||
maven { url "https://jitpack.io" }
|
||||
maven { url 'https://maven.google.com' }
|
||||
maven {
|
||||
name 'glide-snapshot'
|
||||
url 'https://oss.sonatype.org/content/repositories/snapshots'
|
||||
}
|
||||
mavenCentral()
|
||||
jcenter()
|
||||
}
|
||||
|
||||
@@ -28,14 +28,15 @@ android {
|
||||
|
||||
defaultConfig {
|
||||
applicationId 'dev.octoshrimpy.quik'
|
||||
minSdkVersion 23
|
||||
minSdkVersion 26
|
||||
targetSdkVersion 33
|
||||
versionCode 2224
|
||||
versionName "4.0.7"
|
||||
versionName '4.0.7'
|
||||
setProperty("archivesBaseName", "QUIK-v${versionName}")
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
setProperty("archivesBaseName", "QUIK-v${versionName}")
|
||||
versionNameSuffix '-testing'
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
@@ -125,8 +126,8 @@ dependencies {
|
||||
kapt "com.github.bumptech.glide:compiler:$glide_version"
|
||||
|
||||
// exoplayer
|
||||
implementation "com.google.android.exoplayer:exoplayer-core:$exoplayer_version"
|
||||
implementation("com.google.android.exoplayer:exoplayer-ui:$exoplayer_version", {
|
||||
implementation "com.github.google.ExoPlayer:exoplayer-core:$exoplayer_version"
|
||||
implementation("com.github.google.ExoPlayer:exoplayer-ui:$exoplayer_version", {
|
||||
exclude group: "com.android.support", module: "support-media-compat"
|
||||
})
|
||||
|
||||
@@ -148,8 +149,10 @@ dependencies {
|
||||
kapt "com.google.dagger:dagger-android-processor:$dagger_version"
|
||||
// compileOnly "javax.annotation:jsr250-api:1.0"
|
||||
//Resolve jdk8+ Generation Annotations - javax annotation does not exist
|
||||
compileOnly 'com.github.pengrad:jdk9-deps:1.0'
|
||||
// implementation 'javax.annotation:javax.annotation-api:1.3.2'
|
||||
implementation 'com.github.pengrad:jdk9-deps:1ffe84c468'
|
||||
|
||||
// look into jakarta.annotation-api when switching to java 9
|
||||
implementation 'javax.annotation:javax.annotation-api:1.3.2'
|
||||
|
||||
// ezvcard
|
||||
implementation('com.googlecode.ez-vcard:ez-vcard:0.10.4', {
|
||||
@@ -159,7 +162,8 @@ dependencies {
|
||||
})
|
||||
|
||||
// realm
|
||||
implementation("io.realm:android-adapters:$realm_adapters_version") { transitive = false }
|
||||
implementation "com.github.realm:realm-android-adapters:$realm_adapters_version"
|
||||
// implementation("io.realm:android-adapters:$realm_adapters_version") { transitive = false }
|
||||
kapt "io.realm:realm-annotations:$realm_version"
|
||||
kapt "io.realm:realm-annotations-processor:$realm_version"
|
||||
|
||||
@@ -191,9 +195,9 @@ dependencies {
|
||||
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-rx2:$coroutines_version"
|
||||
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-reactive:$coroutines_version"
|
||||
|
||||
implementation "com.github.chrisbanes:PhotoView:2.0.0"
|
||||
implementation "com.github.chrisbanes:photoview:2.1.4"
|
||||
implementation "com.f2prateek.rx.preferences2:rx-preferences:$rx_preferences_version"
|
||||
implementation "com.google.android:flexbox:0.3.1"
|
||||
implementation "com.github.google:flexbox-layout:0.3.1"
|
||||
implementation "com.jakewharton.timber:timber:$timber_version"
|
||||
implementation "com.squareup.moshi:moshi-kotlin:$moshi_version"
|
||||
implementation "me.leolin:ShortcutBadger:1.1.22"
|
||||
|
||||
@@ -221,7 +221,7 @@ class Navigator @Inject constructor(
|
||||
fun showSupport() {
|
||||
val intent = Intent(Intent.ACTION_SENDTO)
|
||||
intent.data = Uri.parse("mailto:")
|
||||
intent.putExtra(Intent.EXTRA_EMAIL, arrayOf("octoshrimpy@gmail.com"))
|
||||
intent.putExtra(Intent.EXTRA_EMAIL, arrayOf("quik@octo.sh"))
|
||||
intent.putExtra(Intent.EXTRA_SUBJECT, "QUIK Support")
|
||||
intent.putExtra(Intent.EXTRA_TEXT, StringBuilder("\n\n")
|
||||
.append("\n\n--- Please write your message above this line ---\n\n")
|
||||
|
||||
@@ -388,7 +388,7 @@
|
||||
<string name="about_developer" translatable="false">Marcos Jones</string>
|
||||
<string name="about_source" translatable="false">https://github.com/octoshrimpy/quik</string>
|
||||
<string name="about_changelog" translatable="false">https://github.com/octoshrimpy/quik/releases</string>
|
||||
<string name="about_contact" translatable="false">octoshrimpy@gmail.com</string>
|
||||
<string name="about_contact" translatable="false">quik@octo.sh</string>
|
||||
<string name="about_license" translatable="false">GNU General Public License v3.0</string>
|
||||
<string name="about_copyright" translatable="false">© 2014–2024</string>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user