From f68f5549af301de58fda687b87cd6b90d06e464f Mon Sep 17 00:00:00 2001 From: Tyler Nijmeh Date: Thu, 20 Jun 2024 17:37:25 -0700 Subject: [PATCH 01/16] Update to new gradle version Signed-off-by: Tyler Nijmeh --- app/src/main/AndroidManifest.xml | 1 - build.gradle | 2 +- gradle.properties | 3 +++ gradle/wrapper/gradle-wrapper.properties | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 0cad275e..85b1ea7a 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -17,7 +17,6 @@ Date: Thu, 20 Jun 2024 18:11:46 -0700 Subject: [PATCH 02/16] Upgrade for new gradle and android version Also return true on pair always! Signed-off-by: Tyler Nijmeh --- app/build.gradle | 24 +++++++++---------- .../java/com/draco/ladb/services/QSTile.kt | 2 ++ app/src/main/java/com/draco/ladb/utils/ADB.kt | 4 ++-- .../ladb/viewmodels/MainActivityViewModel.kt | 3 --- build.gradle | 4 ++-- 5 files changed, 18 insertions(+), 19 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 5a74ab16..3b49d446 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -6,12 +6,12 @@ plugins { android { - compileSdk 33 + compileSdk 34 defaultConfig { applicationId "com.draco.ladb" minSdk 26 - targetSdk 33 + targetSdk 34 versionCode 43 versionName "2.3.1" @@ -55,18 +55,18 @@ android { dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4' + implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.1-Beta' - implementation 'androidx.core:core-ktx:1.10.1' - implementation 'androidx.appcompat:appcompat:1.6.1' - implementation 'androidx.preference:preference-ktx:1.2.0' - implementation 'androidx.fragment:fragment-ktx:1.6.0' - implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1' - implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.6.1' - implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.1' + implementation 'androidx.core:core-ktx:1.13.1' + implementation 'androidx.appcompat:appcompat:1.7.0' + implementation 'androidx.preference:preference-ktx:1.2.1' + implementation 'androidx.fragment:fragment-ktx:1.8.0' + implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.2' + implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.8.2' + implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.2' implementation 'com.github.javiersantos:PiracyChecker:1.2.8' - implementation 'com.google.android.material:material:1.9.0' - implementation 'com.google.android.gms:play-services-oss-licenses:17.0.1' + implementation 'com.google.android.material:material:1.12.0' + implementation 'com.google.android.gms:play-services-oss-licenses:17.1.0' } diff --git a/app/src/main/java/com/draco/ladb/services/QSTile.kt b/app/src/main/java/com/draco/ladb/services/QSTile.kt index 4c687471..35d8d592 100644 --- a/app/src/main/java/com/draco/ladb/services/QSTile.kt +++ b/app/src/main/java/com/draco/ladb/services/QSTile.kt @@ -9,6 +9,8 @@ class QSTile : TileService() { super.onClick() val intent = Intent(applicationContext, MainActivity::class.java) .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) + + // TODO(tytydraco): fix deprecation later to avoid potential crash startActivityAndCollapse(intent) } } \ No newline at end of file diff --git a/app/src/main/java/com/draco/ladb/utils/ADB.kt b/app/src/main/java/com/draco/ladb/utils/ADB.kt index b5f6529f..7f65b79e 100644 --- a/app/src/main/java/com/draco/ladb/utils/ADB.kt +++ b/app/src/main/java/com/draco/ladb/utils/ADB.kt @@ -31,7 +31,6 @@ class ADB(private val context: Context) { private val sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context) private val adbPath = "${context.applicationInfo.nativeLibraryDir}/libadb.so" - private val scriptPath = "${context.getExternalFilesDir(null)}/script.sh" /** * Is the shell ready to handle commands? @@ -215,7 +214,8 @@ class ADB(private val context: Context) { killShell.waitFor(3, TimeUnit.SECONDS) killShell.destroyForcibly() - return pairShell.exitValue() == 0 + // FIXME(tytydraco): Return true on pair because some devices might mistakenly return false here. + return true } /** diff --git a/app/src/main/java/com/draco/ladb/viewmodels/MainActivityViewModel.kt b/app/src/main/java/com/draco/ladb/viewmodels/MainActivityViewModel.kt index ad4dc0dc..11f591e2 100644 --- a/app/src/main/java/com/draco/ladb/viewmodels/MainActivityViewModel.kt +++ b/app/src/main/java/com/draco/ladb/viewmodels/MainActivityViewModel.kt @@ -2,10 +2,7 @@ package com.draco.ladb.viewmodels import android.app.Activity import android.app.Application -import android.content.Intent -import android.net.Uri import android.os.Build -import android.os.Parcelable import androidx.core.content.edit import androidx.lifecycle.AndroidViewModel import androidx.lifecycle.LiveData diff --git a/build.gradle b/build.gradle index f1e98ae9..83f4bd71 100644 --- a/build.gradle +++ b/build.gradle @@ -1,12 +1,12 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = "1.8.20" + ext.kotlin_version = "1.9.21" repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:8.2.0' + classpath 'com.android.tools.build:gradle:8.2.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.google.android.gms:oss-licenses-plugin:0.10.6' From 9eefe899438874f3e9a28df5b5c7b6a517cdd634 Mon Sep 17 00:00:00 2001 From: Tyler Nijmeh Date: Thu, 20 Jun 2024 18:21:43 -0700 Subject: [PATCH 03/16] ADB: Request connection to localhost explicitly Signed-off-by: Tyler Nijmeh --- app/src/main/java/com/draco/ladb/utils/ADB.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/main/java/com/draco/ladb/utils/ADB.kt b/app/src/main/java/com/draco/ladb/utils/ADB.kt index 7f65b79e..c6e46629 100644 --- a/app/src/main/java/com/draco/ladb/utils/ADB.kt +++ b/app/src/main/java/com/draco/ladb/utils/ADB.kt @@ -126,9 +126,15 @@ class ADB(private val context: Context) { } adb(false, listOf("start-server")).waitFor() + + debug("Attempting to connect to localhost...") + debug("This may take a minute") + adb(false, listOf("connect", "localhost")).waitFor(1, TimeUnit.MINUTES) + debug("Waiting for device to connect...") debug("This may take a minute") val waitProcess = adb(false, listOf("wait-for-device")).waitFor(1, TimeUnit.MINUTES) + if (!waitProcess) { debug("Your device didn't connect to LADB") debug("If a reboot doesn't work, please contact support") From ee2f888e0349a57e84b4ea41460cd4ad188acb00 Mon Sep 17 00:00:00 2001 From: Tyler Nijmeh Date: Thu, 20 Jun 2024 18:22:22 -0700 Subject: [PATCH 04/16] ADB: Do not specify a transport ID for reliability Signed-off-by: Tyler Nijmeh --- app/src/main/java/com/draco/ladb/utils/ADB.kt | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/app/src/main/java/com/draco/ladb/utils/ADB.kt b/app/src/main/java/com/draco/ladb/utils/ADB.kt index c6e46629..58cb632b 100644 --- a/app/src/main/java/com/draco/ladb/utils/ADB.kt +++ b/app/src/main/java/com/draco/ladb/utils/ADB.kt @@ -145,12 +145,7 @@ class ADB(private val context: Context) { } shellProcess = if (autoShell) { - val argList = if (Build.SUPPORTED_ABIS[0] == "arm64-v8a") - listOf("-t", "1", "shell") - else - listOf("shell") - - adb(true, argList) + adb(true, listOf("shell")) } else { shell(true, listOf("sh", "-l")) } From fe62dd84dcc37e6fea858ea5d8a35b5f033e05bc Mon Sep 17 00:00:00 2001 From: Tyler Nijmeh Date: Thu, 20 Jun 2024 18:24:55 -0700 Subject: [PATCH 05/16] Upgrade kotlin version Signed-off-by: Tyler Nijmeh --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 83f4bd71..7209f4ee 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = "1.9.21" + ext.kotlin_version = "2.0.0" repositories { google() mavenCentral() From 7ef9156c3d0628520272417088e10cd51ba6514d Mon Sep 17 00:00:00 2001 From: Tyler Nijmeh Date: Thu, 20 Jun 2024 18:25:08 -0700 Subject: [PATCH 06/16] Update version code Signed-off-by: Tyler Nijmeh --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 3b49d446..b1ec87ab 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -12,8 +12,8 @@ android { applicationId "com.draco.ladb" minSdk 26 targetSdk 34 - versionCode 43 - versionName "2.3.1" + versionCode 44 + versionName "2.4" ndk { abiFilters 'arm64-v8a', 'armeabi-v7a', 'x86', 'x86_64' From b0845d0b729e5e9933c4d4226d9ee0023a98dd23 Mon Sep 17 00:00:00 2001 From: Tyler Nijmeh Date: Wed, 26 Jun 2024 15:56:31 -0700 Subject: [PATCH 07/16] Revert "ADB: Do not specify a transport ID for reliability" This reverts commit ee2f888e0349a57e84b4ea41460cd4ad188acb00. --- app/src/main/java/com/draco/ladb/utils/ADB.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/draco/ladb/utils/ADB.kt b/app/src/main/java/com/draco/ladb/utils/ADB.kt index 58cb632b..c6e46629 100644 --- a/app/src/main/java/com/draco/ladb/utils/ADB.kt +++ b/app/src/main/java/com/draco/ladb/utils/ADB.kt @@ -145,7 +145,12 @@ class ADB(private val context: Context) { } shellProcess = if (autoShell) { - adb(true, listOf("shell")) + val argList = if (Build.SUPPORTED_ABIS[0] == "arm64-v8a") + listOf("-t", "1", "shell") + else + listOf("shell") + + adb(true, argList) } else { shell(true, listOf("sh", "-l")) } From 3aae95777bc0f3dad3e230d89d54099f3bef5292 Mon Sep 17 00:00:00 2001 From: Tyler Nijmeh Date: Wed, 26 Jun 2024 15:57:41 -0700 Subject: [PATCH 08/16] ADB: Revert force-true pair result Signed-off-by: Tyler Nijmeh --- app/src/main/java/com/draco/ladb/utils/ADB.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/src/main/java/com/draco/ladb/utils/ADB.kt b/app/src/main/java/com/draco/ladb/utils/ADB.kt index c6e46629..8a9b0850 100644 --- a/app/src/main/java/com/draco/ladb/utils/ADB.kt +++ b/app/src/main/java/com/draco/ladb/utils/ADB.kt @@ -220,8 +220,7 @@ class ADB(private val context: Context) { killShell.waitFor(3, TimeUnit.SECONDS) killShell.destroyForcibly() - // FIXME(tytydraco): Return true on pair because some devices might mistakenly return false here. - return true + return pairShell.exitValue() == 0 } /** From 2fa99e9cfd2efc9c2f071ecd4b395d33350d5250 Mon Sep 17 00:00:00 2001 From: Tyler Nijmeh Date: Wed, 26 Jun 2024 15:58:07 -0700 Subject: [PATCH 09/16] Update version code Signed-off-by: Tyler Nijmeh --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index b1ec87ab..8e58ba24 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -12,8 +12,8 @@ android { applicationId "com.draco.ladb" minSdk 26 targetSdk 34 - versionCode 44 - versionName "2.4" + versionCode 45 + versionName "2.4.1" ndk { abiFilters 'arm64-v8a', 'armeabi-v7a', 'x86', 'x86_64' From ea8ad6644d8517e4f3e8b71b8203911a48da5a1f Mon Sep 17 00:00:00 2001 From: Tyler Nijmeh Date: Wed, 26 Jun 2024 16:00:03 -0700 Subject: [PATCH 10/16] QSTile: Fix for new android version Signed-off-by: Tyler Nijmeh --- .../main/java/com/draco/ladb/services/QSTile.kt | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/draco/ladb/services/QSTile.kt b/app/src/main/java/com/draco/ladb/services/QSTile.kt index 35d8d592..0ea14ede 100644 --- a/app/src/main/java/com/draco/ladb/services/QSTile.kt +++ b/app/src/main/java/com/draco/ladb/services/QSTile.kt @@ -1,6 +1,8 @@ package com.draco.ladb.services +import android.app.PendingIntent import android.content.Intent +import android.os.Build import android.service.quicksettings.TileService import com.draco.ladb.views.MainActivity @@ -10,7 +12,17 @@ class QSTile : TileService() { val intent = Intent(applicationContext, MainActivity::class.java) .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) - // TODO(tytydraco): fix deprecation later to avoid potential crash - startActivityAndCollapse(intent) + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) { + val pendingIntent = PendingIntent.getActivity( + applicationContext, + 0, + intent, + PendingIntent.FLAG_IMMUTABLE + ) + startActivityAndCollapse(pendingIntent) + } else { + startActivityAndCollapse(intent) + } + } } \ No newline at end of file From aa1b909b98421754592426769ac6ac8ebc451df0 Mon Sep 17 00:00:00 2001 From: Tyler Nijmeh Date: Thu, 20 Jun 2024 18:24:55 -0700 Subject: [PATCH 11/16] Upgrade kotlin version Signed-off-by: Tyler Nijmeh --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 83f4bd71..7209f4ee 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = "1.9.21" + ext.kotlin_version = "2.0.0" repositories { google() mavenCentral() From 5f5e24dee14a1495e9b9b21eb2b2c013ce8f2350 Mon Sep 17 00:00:00 2001 From: Tyler Nijmeh Date: Wed, 26 Jun 2024 16:00:03 -0700 Subject: [PATCH 12/16] QSTile: Fix for new android version Signed-off-by: Tyler Nijmeh --- .../main/java/com/draco/ladb/services/QSTile.kt | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/draco/ladb/services/QSTile.kt b/app/src/main/java/com/draco/ladb/services/QSTile.kt index 35d8d592..0ea14ede 100644 --- a/app/src/main/java/com/draco/ladb/services/QSTile.kt +++ b/app/src/main/java/com/draco/ladb/services/QSTile.kt @@ -1,6 +1,8 @@ package com.draco.ladb.services +import android.app.PendingIntent import android.content.Intent +import android.os.Build import android.service.quicksettings.TileService import com.draco.ladb.views.MainActivity @@ -10,7 +12,17 @@ class QSTile : TileService() { val intent = Intent(applicationContext, MainActivity::class.java) .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) - // TODO(tytydraco): fix deprecation later to avoid potential crash - startActivityAndCollapse(intent) + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) { + val pendingIntent = PendingIntent.getActivity( + applicationContext, + 0, + intent, + PendingIntent.FLAG_IMMUTABLE + ) + startActivityAndCollapse(pendingIntent) + } else { + startActivityAndCollapse(intent) + } + } } \ No newline at end of file From 115b0f6ff8f1daef32cf6f3d5b419aea531f9dab Mon Sep 17 00:00:00 2001 From: Tyler Nijmeh Date: Wed, 26 Jun 2024 15:57:41 -0700 Subject: [PATCH 13/16] ADB: Revert force-true pair result Signed-off-by: Tyler Nijmeh --- app/src/main/java/com/draco/ladb/utils/ADB.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/src/main/java/com/draco/ladb/utils/ADB.kt b/app/src/main/java/com/draco/ladb/utils/ADB.kt index 7f65b79e..8a2b9823 100644 --- a/app/src/main/java/com/draco/ladb/utils/ADB.kt +++ b/app/src/main/java/com/draco/ladb/utils/ADB.kt @@ -214,8 +214,7 @@ class ADB(private val context: Context) { killShell.waitFor(3, TimeUnit.SECONDS) killShell.destroyForcibly() - // FIXME(tytydraco): Return true on pair because some devices might mistakenly return false here. - return true + return pairShell.exitValue() == 0 } /** From 2ac0bfefa5fcbf17438e1c4d61de492812bf7c54 Mon Sep 17 00:00:00 2001 From: Tyler Nijmeh Date: Fri, 5 Jul 2024 11:22:06 -0700 Subject: [PATCH 14/16] Extract native libs Signed-off-by: Tyler Nijmeh --- app/src/main/AndroidManifest.xml | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 85b1ea7a..b38add6c 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,22 +1,23 @@ + xmlns:tools="http://schemas.android.com/tools" + android:installLocation="internalOnly"> + android:required="false"/> + android:required="false"/> - + + tools:ignore="ProtectedPermissions"/> - + - - + + + android:label="@string/more"/> + android:label="@string/bookmarks"/> - + @@ -57,7 +58,7 @@ android:grantUriPermissions="true"> + android:resource="@xml/provider_paths"/> From 185fdb50520964d09c0895ca1c0cae928a5e464f Mon Sep 17 00:00:00 2001 From: Tyler Nijmeh Date: Fri, 5 Jul 2024 11:24:26 -0700 Subject: [PATCH 15/16] Update version code Signed-off-by: Tyler Nijmeh --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 8e58ba24..bbb010f6 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -12,8 +12,8 @@ android { applicationId "com.draco.ladb" minSdk 26 targetSdk 34 - versionCode 45 - versionName "2.4.1" + versionCode 46 + versionName "2.4.2" ndk { abiFilters 'arm64-v8a', 'armeabi-v7a', 'x86', 'x86_64' From 915fdf130ec24b6876fe11f84b2502d91478ed28 Mon Sep 17 00:00:00 2001 From: Tyler Nijmeh Date: Sat, 6 Jul 2024 19:56:32 -0700 Subject: [PATCH 16/16] Revert completely to v3.2.1 Signed-off-by: Tyler Nijmeh --- app/build.gradle | 28 +++++++++---------- app/src/main/AndroidManifest.xml | 26 ++++++++--------- .../java/com/draco/ladb/services/QSTile.kt | 16 +---------- app/src/main/java/com/draco/ladb/utils/ADB.kt | 7 +---- .../ladb/viewmodels/MainActivityViewModel.kt | 3 ++ build.gradle | 4 +-- gradle.properties | 3 -- gradle/wrapper/gradle-wrapper.properties | 2 +- 8 files changed, 35 insertions(+), 54 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index bbb010f6..9541f365 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -6,14 +6,14 @@ plugins { android { - compileSdk 34 + compileSdk 33 defaultConfig { applicationId "com.draco.ladb" minSdk 26 - targetSdk 34 - versionCode 46 - versionName "2.4.2" + targetSdk 33 + versionCode 47 + versionName "2.4.3" ndk { abiFilters 'arm64-v8a', 'armeabi-v7a', 'x86', 'x86_64' @@ -55,18 +55,18 @@ android { dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.1-Beta' + implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4' - implementation 'androidx.core:core-ktx:1.13.1' - implementation 'androidx.appcompat:appcompat:1.7.0' - implementation 'androidx.preference:preference-ktx:1.2.1' - implementation 'androidx.fragment:fragment-ktx:1.8.0' - implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.2' - implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.8.2' - implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.2' + implementation 'androidx.core:core-ktx:1.10.1' + implementation 'androidx.appcompat:appcompat:1.6.1' + implementation 'androidx.preference:preference-ktx:1.2.0' + implementation 'androidx.fragment:fragment-ktx:1.6.0' + implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1' + implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.6.1' + implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.1' implementation 'com.github.javiersantos:PiracyChecker:1.2.8' - implementation 'com.google.android.material:material:1.12.0' - implementation 'com.google.android.gms:play-services-oss-licenses:17.1.0' + implementation 'com.google.android.material:material:1.9.0' + implementation 'com.google.android.gms:play-services-oss-licenses:17.0.1' } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index b38add6c..0cad275e 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,19 +1,19 @@ + xmlns:tools="http://schemas.android.com/tools" + android:installLocation="internalOnly"> + android:required="false" /> + android:required="false" /> - + + tools:ignore="ProtectedPermissions" /> - + - - + + + android:label="@string/more" /> + android:label="@string/bookmarks" /> - + @@ -58,7 +58,7 @@ android:grantUriPermissions="true"> + android:resource="@xml/provider_paths" /> diff --git a/app/src/main/java/com/draco/ladb/services/QSTile.kt b/app/src/main/java/com/draco/ladb/services/QSTile.kt index 0ea14ede..4c687471 100644 --- a/app/src/main/java/com/draco/ladb/services/QSTile.kt +++ b/app/src/main/java/com/draco/ladb/services/QSTile.kt @@ -1,8 +1,6 @@ package com.draco.ladb.services -import android.app.PendingIntent import android.content.Intent -import android.os.Build import android.service.quicksettings.TileService import com.draco.ladb.views.MainActivity @@ -11,18 +9,6 @@ class QSTile : TileService() { super.onClick() val intent = Intent(applicationContext, MainActivity::class.java) .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) - - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) { - val pendingIntent = PendingIntent.getActivity( - applicationContext, - 0, - intent, - PendingIntent.FLAG_IMMUTABLE - ) - startActivityAndCollapse(pendingIntent) - } else { - startActivityAndCollapse(intent) - } - + startActivityAndCollapse(intent) } } \ No newline at end of file diff --git a/app/src/main/java/com/draco/ladb/utils/ADB.kt b/app/src/main/java/com/draco/ladb/utils/ADB.kt index 8a9b0850..b5f6529f 100644 --- a/app/src/main/java/com/draco/ladb/utils/ADB.kt +++ b/app/src/main/java/com/draco/ladb/utils/ADB.kt @@ -31,6 +31,7 @@ class ADB(private val context: Context) { private val sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context) private val adbPath = "${context.applicationInfo.nativeLibraryDir}/libadb.so" + private val scriptPath = "${context.getExternalFilesDir(null)}/script.sh" /** * Is the shell ready to handle commands? @@ -126,15 +127,9 @@ class ADB(private val context: Context) { } adb(false, listOf("start-server")).waitFor() - - debug("Attempting to connect to localhost...") - debug("This may take a minute") - adb(false, listOf("connect", "localhost")).waitFor(1, TimeUnit.MINUTES) - debug("Waiting for device to connect...") debug("This may take a minute") val waitProcess = adb(false, listOf("wait-for-device")).waitFor(1, TimeUnit.MINUTES) - if (!waitProcess) { debug("Your device didn't connect to LADB") debug("If a reboot doesn't work, please contact support") diff --git a/app/src/main/java/com/draco/ladb/viewmodels/MainActivityViewModel.kt b/app/src/main/java/com/draco/ladb/viewmodels/MainActivityViewModel.kt index 11f591e2..ad4dc0dc 100644 --- a/app/src/main/java/com/draco/ladb/viewmodels/MainActivityViewModel.kt +++ b/app/src/main/java/com/draco/ladb/viewmodels/MainActivityViewModel.kt @@ -2,7 +2,10 @@ package com.draco.ladb.viewmodels import android.app.Activity import android.app.Application +import android.content.Intent +import android.net.Uri import android.os.Build +import android.os.Parcelable import androidx.core.content.edit import androidx.lifecycle.AndroidViewModel import androidx.lifecycle.LiveData diff --git a/build.gradle b/build.gradle index 7209f4ee..a76c5391 100644 --- a/build.gradle +++ b/build.gradle @@ -1,12 +1,12 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = "2.0.0" + ext.kotlin_version = "1.8.20" repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:8.2.2' + classpath 'com.android.tools.build:gradle:7.4.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.google.android.gms:oss-licenses-plugin:0.10.6' diff --git a/gradle.properties b/gradle.properties index 48ac76d3..5fae978e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -19,6 +19,3 @@ android.useAndroidX=true kotlin.code.style=official DEBUG_ANTIPIRACY=false RELEASE_ANTIPIRACY=true -android.defaults.buildfeatures.buildconfig=true -android.nonTransitiveRClass=false -android.nonFinalResIds=false diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index be3f26b2..6264c143 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Fri Jun 03 20:49:13 PDT 2022 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME