diff --git a/app/build.gradle.kts b/app/build.gradle.kts index dcf934f..a952cbc 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -8,7 +8,7 @@ plugins { } android { - compileSdk = 34 + compileSdk = 35 defaultConfig { applicationId = "com.geode.launcher" @@ -85,14 +85,14 @@ android { dependencies { implementation (platform("androidx.compose:compose-bom:$composeBOM")) - implementation ("androidx.core:core-ktx:1.13.1") + implementation ("androidx.core:core-ktx:1.15.0") implementation ("androidx.compose.ui:ui") implementation ("androidx.compose.material3:material3") implementation ("androidx.compose.ui:ui-tooling-preview") - implementation ("androidx.lifecycle:lifecycle-runtime-ktx:2.8.2") - implementation ("androidx.lifecycle:lifecycle-viewmodel-compose:2.8.2") - implementation ("androidx.activity:activity-compose:1.9.0") - implementation ("androidx.activity:activity-ktx:1.9.0") + implementation ("androidx.lifecycle:lifecycle-runtime-ktx:2.8.7") + implementation ("androidx.lifecycle:lifecycle-viewmodel-compose:2.8.7") + implementation ("androidx.activity:activity-compose:1.9.3") + implementation ("androidx.activity:activity-ktx:1.9.3") implementation ("androidx.appcompat:appcompat:1.7.0") implementation ("androidx.documentfile:documentfile:1.0.1") implementation ("com.squareup.okio:okio:3.9.0") @@ -101,5 +101,5 @@ dependencies { implementation ("org.jetbrains.kotlinx:kotlinx-serialization-json-okio:1.7.0") implementation ("org.jetbrains.kotlinx:kotlinx-datetime:0.6.0") debugImplementation ("androidx.compose.ui:ui-tooling") - coreLibraryDesugaring ("com.android.tools:desugar_jdk_libs:2.0.4") + coreLibraryDesugaring ("com.android.tools:desugar_jdk_libs:2.1.2") } diff --git a/app/src/main/java/com/geode/launcher/GeometryDashActivity.kt b/app/src/main/java/com/geode/launcher/GeometryDashActivity.kt index 51e2943..c1bd7f8 100644 --- a/app/src/main/java/com/geode/launcher/GeometryDashActivity.kt +++ b/app/src/main/java/com/geode/launcher/GeometryDashActivity.kt @@ -207,17 +207,17 @@ class GeometryDashActivity : AppCompatActivity(), Cocos2dxHelper.Cocos2dxHelperL private fun setupPostLibraryLoad(packageInfo: PackageInfo) { // call native functions after native libraries init JniToCpp.setupHSSAssets( - packageInfo.applicationInfo.sourceDir, + packageInfo.applicationInfo!!.sourceDir, Environment.getExternalStorageDirectory().absolutePath ) - Cocos2dxHelper.nativeSetApkPath(packageInfo.applicationInfo.sourceDir) + Cocos2dxHelper.nativeSetApkPath(packageInfo.applicationInfo!!.sourceDir) BaseRobTopActivity.setCurrentActivity(this) } @SuppressLint("UnsafeDynamicallyLoadedCode") private fun tryLoadLibrary(packageInfo: PackageInfo, libraryName: String) { - val nativeDir = getNativeLibraryDirectory(packageInfo.applicationInfo) + val nativeDir = getNativeLibraryDirectory(packageInfo.applicationInfo!!) val libraryPath = if (nativeDir.endsWith('/')) "${nativeDir}lib$libraryName.so" else "$nativeDir/lib$libraryName.so" try { @@ -422,6 +422,13 @@ class GeometryDashActivity : AppCompatActivity(), Cocos2dxHelper.Cocos2dxHelperL forceRefreshRate = PreferenceUtils.get(this).getBoolean(PreferenceUtils.Key.FORCE_HRR) + if (forceRefreshRate) { + val maxRefreshRate = display?.supportedModes?.maxBy { it.refreshRate }?.refreshRate + if (maxRefreshRate != null) { + window.attributes.preferredRefreshRate = maxRefreshRate + } + } + if (displayMode == DisplayMode.FULLSCREEN && Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { window.attributes.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES } diff --git a/app/src/main/java/com/geode/launcher/utils/GamePackageUtils.kt b/app/src/main/java/com/geode/launcher/utils/GamePackageUtils.kt index 02b8def..9ec3249 100644 --- a/app/src/main/java/com/geode/launcher/utils/GamePackageUtils.kt +++ b/app/src/main/java/com/geode/launcher/utils/GamePackageUtils.kt @@ -53,8 +53,8 @@ object GamePackageUtils { fun detectAbiMismatch(context: Context, packageInfo: PackageInfo, loadException: Error): Boolean { val abi = LaunchUtils.applicationArchitecture val isExtracted = - packageInfo.applicationInfo.flags and ApplicationInfo.FLAG_EXTRACT_NATIVE_LIBS == ApplicationInfo.FLAG_EXTRACT_NATIVE_LIBS - val isSplit = (packageInfo.applicationInfo.splitSourceDirs?.size ?: 0) > 1 + packageInfo.applicationInfo!!.flags and ApplicationInfo.FLAG_EXTRACT_NATIVE_LIBS == ApplicationInfo.FLAG_EXTRACT_NATIVE_LIBS + val isSplit = (packageInfo.applicationInfo?.splitSourceDirs?.size ?: 0) > 1 val metadata = "Geometry Dash metadata:\nSplit sources: $isSplit\nExtracted libraries: $isExtracted\nLauncher architecture: $abi" @@ -74,7 +74,7 @@ object GamePackageUtils { val oppositeArchitecture = if (abi == "arm64-v8a") "armeabi-v7a" else "arm64-v8a" // detect issues using native library directory (only works on extracted libraries) - val nativeLibraryDir = packageInfo.applicationInfo.nativeLibraryDir + val nativeLibraryDir = packageInfo.applicationInfo!!.nativeLibraryDir if (nativeLibraryDir.contains(oppositeArchitecture)) { return true @@ -105,8 +105,8 @@ object GamePackageUtils { val clazz = assetManager.javaClass val aspMethod = clazz.getDeclaredMethod("addAssetPath", String::class.java) - aspMethod.invoke(assetManager, packageInfo.applicationInfo.sourceDir) - packageInfo.applicationInfo.splitSourceDirs?.forEach { + aspMethod.invoke(assetManager, packageInfo.applicationInfo?.sourceDir) + packageInfo.applicationInfo?.splitSourceDirs?.forEach { aspMethod.invoke(assetManager, it) } } @@ -122,14 +122,14 @@ object GamePackageUtils { val game = packageManager.getPackageInfo(Constants.PACKAGE_NAME, PackageManager.GET_SIGNING_CERTIFICATES) val signingInfo = game.signingInfo - signingInfo.signingCertificateHistory + signingInfo?.signingCertificateHistory ?: return false } else { val game = packageManager.getPackageInfo(Constants.PACKAGE_NAME, PackageManager.GET_SIGNATURES) game.signatures } - return certificates.any { + return certificates?.any { validateCertificate(it.toByteArray()) - } + } ?: false } } \ No newline at end of file diff --git a/app/src/main/java/com/geode/launcher/utils/PreferenceUtils.kt b/app/src/main/java/com/geode/launcher/utils/PreferenceUtils.kt index 2c125fd..575d132 100644 --- a/app/src/main/java/com/geode/launcher/utils/PreferenceUtils.kt +++ b/app/src/main/java/com/geode/launcher/utils/PreferenceUtils.kt @@ -8,7 +8,7 @@ import androidx.compose.runtime.MutableState import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.ui.platform.LocalContext -import androidx.compose.ui.platform.LocalLifecycleOwner +import androidx.lifecycle.compose.LocalLifecycleOwner import androidx.core.content.edit import androidx.lifecycle.Lifecycle import androidx.lifecycle.LifecycleEventObserver diff --git a/build.gradle.kts b/build.gradle.kts index b6fe383..0da6454 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,14 +1,14 @@ buildscript { - val composeBOM by extra("2024.06.00") + val composeBOM by extra("2024.10.01") } // Top-level build file where you can add configuration options common to all sub-projects/modules. plugins { - id("com.android.application") version "8.5.0" apply false - id("com.android.library") version "8.5.0" apply false - id("org.jetbrains.kotlin.android") version "2.0.0" apply false - id("org.jetbrains.kotlin.plugin.serialization") version "2.0.0" apply false - id("org.jetbrains.kotlin.plugin.compose") version "2.0.0" apply false + id("com.android.application") version "8.7.2" apply false + id("com.android.library") version "8.7.2" apply false + id("org.jetbrains.kotlin.android") version "2.0.10" apply false + id("org.jetbrains.kotlin.plugin.serialization") version "2.0.10" apply false + id("org.jetbrains.kotlin.plugin.compose") version "2.0.10" apply false } tasks.register("clean") { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a441313..09523c0 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME