Skip to content

Commit

Permalink
the usual
Browse files Browse the repository at this point in the history
  • Loading branch information
qimiko committed Nov 3, 2024
1 parent 4ae10db commit 03e12bf
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 26 deletions.
14 changes: 7 additions & 7 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
}

android {
compileSdk = 34
compileSdk = 35

defaultConfig {
applicationId = "com.geode.launcher"
Expand Down Expand Up @@ -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")
Expand All @@ -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")
}
13 changes: 10 additions & 3 deletions app/src/main/java/com/geode/launcher/GeometryDashActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
}
Expand Down
16 changes: 8 additions & 8 deletions app/src/main/java/com/geode/launcher/utils/GamePackageUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down Expand Up @@ -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)
}
}
Expand All @@ -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
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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<Delete>("clean") {
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 03e12bf

Please sign in to comment.