diff --git a/README.md b/README.md index ef2ac1b..55b8c06 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # SwiftBackupPrem -Swift Backup Premium LSPosed module (tested on v4.2.3 and v4.2.5, but should also work on newer versions - thanks to [DexKit](https://github.com/LuckyPray/DexKit)). +Swift Backup Premium LSPosed module (tested on v4.2.3, v4.2.5 and v5.0.4, but should also work on newer versions - thanks to [DexKit](https://github.com/LuckyPray/DexKit)). Optionally also allows you to set your own firebase credentials, so only your firebase instance is used. diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 4dc285d..a01dc24 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -14,8 +14,8 @@ android { applicationId = "io.github.juby210.swiftbackupprem" minSdk = 27 targetSdk = 34 - versionCode = 203 - versionName = "2.0.3" + versionCode = 204 + versionName = "2.0.4" } buildTypes { @@ -40,7 +40,7 @@ android { compose = true resValues = false } - composeOptions.kotlinCompilerExtensionVersion = "1.5.3" + composeOptions.kotlinCompilerExtensionVersion = "1.5.8" tasks.withType { kotlinOptions { jvmTarget = "11" @@ -50,18 +50,15 @@ android { dependencies { compileOnly("de.robv.android.xposed:api:82") - implementation("org.luckypray:dexkit:2.0.0-rc7") + implementation("org.luckypray:dexkit:2.0.0") // AndroidX implementation("androidx.core:core-ktx:1.12.0") - implementation("androidx.activity:activity-compose:1.8.0") + implementation("androidx.activity:activity-compose:1.8.2") // Compose - val composeVersion = "1.5.4" + val composeVersion = "1.6.0" implementation("androidx.compose.ui:ui:$composeVersion") implementation("androidx.compose.ui:ui-tooling:$composeVersion") implementation("androidx.compose.material3:material3:1.1.2") - - // Accompanist - implementation("com.google.accompanist:accompanist-systemuicontroller:0.32.0") } diff --git a/app/src/main/java/io/github/juby210/swiftbackupprem/BackupModule.kt b/app/src/main/java/io/github/juby210/swiftbackupprem/BackupModule.kt index 549eeee..243c9c0 100644 --- a/app/src/main/java/io/github/juby210/swiftbackupprem/BackupModule.kt +++ b/app/src/main/java/io/github/juby210/swiftbackupprem/BackupModule.kt @@ -7,14 +7,13 @@ import io.github.juby210.swiftbackupprem.util.PreferencesManager import org.json.JSONArray import org.json.JSONObject import java.io.File -import java.lang.reflect.Modifier fun hookBackupApk(cl: ClassLoader, ctx: Context, customFirebaseApp: Boolean, prefs: PreferencesManager) { val pathsA = cl.loadClass("${paths!!.name}\$a") XposedBridge.hookMethod(backupApk!!.getDeclaredMethod("c"), object : XC_MethodHook() { override fun afterHookedMethod(param: MethodHookParam) { val pathsClass = paths!! - val aInstance = pathsClass.getDeclaredField("y").get(null) + val aInstance = pathsClass.declaredFields.first { it.type == pathsA }.get(null) val instance = pathsA.getDeclaredMethod("d").invoke(aInstance) val basePath = pathsClass.getDeclaredMethod("m").invoke(instance) as String diff --git a/app/src/main/java/io/github/juby210/swiftbackupprem/DexKit.kt b/app/src/main/java/io/github/juby210/swiftbackupprem/DexKit.kt index 8379cee..ded5fb7 100644 --- a/app/src/main/java/io/github/juby210/swiftbackupprem/DexKit.kt +++ b/app/src/main/java/io/github/juby210/swiftbackupprem/DexKit.kt @@ -6,12 +6,11 @@ import android.content.Context import android.util.Log import android.widget.Toast import org.luckypray.dexkit.DexKitBridge -import org.luckypray.dexkit.query.matchers.* import java.lang.reflect.Modifier -private val classesClientId = mapOf(561 to "kf.s0", 569 to "rf.r0") -private val classesBackupApk = mapOf(561 to "org.swiftapps.swiftbackup.common.w1", 569 to "org.swiftapps.swiftbackup.common.n2") -private val classesPaths = mapOf(561 to "me.b", 569 to "te.c") +private val classesClientId = mapOf(561 to "kf.s0", 569 to "rf.r0", 590 to "eh.u") +private val classesBackupApk = mapOf(561 to "org.swiftapps.swiftbackup.common.w1", 569 to "org.swiftapps.swiftbackup.common.n2", 590 to "org.swiftapps.swiftbackup.common.c2") +private val classesPaths = mapOf(561 to "me.b", 569 to "te.c", 590 to "org.swiftapps.swiftbackup.a") @JvmField var clientId: Class<*>? = null @@ -30,8 +29,8 @@ fun findObfuscatedClasses(ctx: Context, cl: ClassLoader, sourceDir: String) { } else { System.loadLibrary("dexkit") val excludePackages = listOf("android", "androidx", "com", "iammert", "java", "javax", "kotlin", "kotlinx", "moe", "nz.mega", - "okhttp3", "okio", "org", "retrofit", "rikka") - DexKitBridge.create(sourceDir)?.use { bridge -> + "okhttp3", "okio", "retrofit", "rikka") + DexKitBridge.create(sourceDir).use { bridge -> bridge.findClass { excludePackages(excludePackages) matcher { @@ -63,7 +62,7 @@ fun findObfuscatedClasses(ctx: Context, cl: ClassLoader, sourceDir: String) { addParamType("boolean") } } - }.firstOrNull()?.let { + }.singleOrNull()?.let { clientId = it.getInstance(cl) Log.d("SBP", "Found client id class: ${it.name}") } @@ -83,7 +82,7 @@ fun findObfuscatedClasses(ctx: Context, cl: ClassLoader, sourceDir: String) { usingStrings("stable", "swift_backup_apks/", "SwiftBackupApkSaver") } } - }.firstOrNull()?.let { + }.singleOrNull()?.let { backupApk = it.getInstance(cl) Log.d("SBP", "Found backup apk class: ${it.name}") } @@ -107,7 +106,7 @@ fun findObfuscatedClasses(ctx: Context, cl: ClassLoader, sourceDir: String) { } } } - }.firstOrNull()?.let { + }.singleOrNull()?.let { paths = it.getInstance(cl) Log.d("SBP", "Found paths class: ${it.name}") } diff --git a/app/src/main/java/io/github/juby210/swiftbackupprem/MainActivity.kt b/app/src/main/java/io/github/juby210/swiftbackupprem/MainActivity.kt index 96627b6..5e7f816 100644 --- a/app/src/main/java/io/github/juby210/swiftbackupprem/MainActivity.kt +++ b/app/src/main/java/io/github/juby210/swiftbackupprem/MainActivity.kt @@ -7,6 +7,7 @@ import android.widget.Toast import androidx.activity.ComponentActivity import androidx.activity.compose.rememberLauncherForActivityResult import androidx.activity.compose.setContent +import androidx.activity.enableEdgeToEdge import androidx.activity.result.contract.ActivityResultContracts import androidx.compose.foundation.layout.* import androidx.compose.foundation.rememberScrollState @@ -29,6 +30,7 @@ class MainActivity : ComponentActivity() { @SuppressLint("WorldReadableFiles") @OptIn(ExperimentalMaterial3Api::class) override fun onCreate(savedInstanceState: Bundle?) { + enableEdgeToEdge() super.onCreate(savedInstanceState) val prefs: PreferencesManager diff --git a/app/src/main/java/io/github/juby210/swiftbackupprem/ui/theme/Theme.kt b/app/src/main/java/io/github/juby210/swiftbackupprem/ui/theme/Theme.kt index 11974e3..0a3c354 100644 --- a/app/src/main/java/io/github/juby210/swiftbackupprem/ui/theme/Theme.kt +++ b/app/src/main/java/io/github/juby210/swiftbackupprem/ui/theme/Theme.kt @@ -4,9 +4,7 @@ import android.os.Build import androidx.compose.foundation.isSystemInDarkTheme import androidx.compose.material3.* import androidx.compose.runtime.Composable -import androidx.compose.runtime.SideEffect import androidx.compose.ui.platform.LocalContext -import com.google.accompanist.systemuicontroller.rememberSystemUiController @Composable fun Theme(content: @Composable () -> Unit) { @@ -19,15 +17,6 @@ fun Theme(content: @Composable () -> Unit) { else -> lightColorScheme() } - val systemUiController = rememberSystemUiController() - - SideEffect { - systemUiController.setSystemBarsColor( - color = colorScheme.background, - darkIcons = !isDarkTheme - ) - } - MaterialTheme( colorScheme = colorScheme, content = content diff --git a/build.gradle.kts b/build.gradle.kts index 3d4182a..3501cd0 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -6,8 +6,8 @@ buildscript { jcenter() } dependencies { - classpath("com.android.tools.build:gradle:8.1.2") - classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.10") + classpath("com.android.tools.build:gradle:8.2.2") + classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.22") } } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 9507c28..e223ed2 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Fri Oct 27 16:54:55 CEST 2023 +#Tue Feb 06 16:02:37 CET 2024 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists