forked from geode-sdk/android-launcher
the usual
This commit is contained in:
6 files changed
+33
-26
No files matched your search
@@ -8,7 +8,7 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdk = 34
|
compileSdk = 35
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId = "com.geode.launcher"
|
applicationId = "com.geode.launcher"
|
||||||
@@ -85,14 +85,14 @@ android {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation (platform("androidx.compose:compose-bom:$composeBOM"))
|
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.ui:ui")
|
||||||
implementation ("androidx.compose.material3:material3")
|
implementation ("androidx.compose.material3:material3")
|
||||||
implementation ("androidx.compose.ui:ui-tooling-preview")
|
implementation ("androidx.compose.ui:ui-tooling-preview")
|
||||||
implementation ("androidx.lifecycle:lifecycle-runtime-ktx:2.8.2")
|
implementation ("androidx.lifecycle:lifecycle-runtime-ktx:2.8.7")
|
||||||
implementation ("androidx.lifecycle:lifecycle-viewmodel-compose:2.8.2")
|
implementation ("androidx.lifecycle:lifecycle-viewmodel-compose:2.8.7")
|
||||||
implementation ("androidx.activity:activity-compose:1.9.0")
|
implementation ("androidx.activity:activity-compose:1.9.3")
|
||||||
implementation ("androidx.activity:activity-ktx:1.9.0")
|
implementation ("androidx.activity:activity-ktx:1.9.3")
|
||||||
implementation ("androidx.appcompat:appcompat:1.7.0")
|
implementation ("androidx.appcompat:appcompat:1.7.0")
|
||||||
implementation ("androidx.documentfile:documentfile:1.0.1")
|
implementation ("androidx.documentfile:documentfile:1.0.1")
|
||||||
implementation ("com.squareup.okio:okio:3.9.0")
|
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-serialization-json-okio:1.7.0")
|
||||||
implementation ("org.jetbrains.kotlinx:kotlinx-datetime:0.6.0")
|
implementation ("org.jetbrains.kotlinx:kotlinx-datetime:0.6.0")
|
||||||
debugImplementation ("androidx.compose.ui:ui-tooling")
|
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")
|
||||||
}
|
}
|
||||||
@@ -207,17 +207,17 @@ class GeometryDashActivity : AppCompatActivity(), Cocos2dxHelper.Cocos2dxHelperL
|
|||||||
private fun setupPostLibraryLoad(packageInfo: PackageInfo) {
|
private fun setupPostLibraryLoad(packageInfo: PackageInfo) {
|
||||||
// call native functions after native libraries init
|
// call native functions after native libraries init
|
||||||
JniToCpp.setupHSSAssets(
|
JniToCpp.setupHSSAssets(
|
||||||
packageInfo.applicationInfo.sourceDir,
|
packageInfo.applicationInfo!!.sourceDir,
|
||||||
Environment.getExternalStorageDirectory().absolutePath
|
Environment.getExternalStorageDirectory().absolutePath
|
||||||
)
|
)
|
||||||
Cocos2dxHelper.nativeSetApkPath(packageInfo.applicationInfo.sourceDir)
|
Cocos2dxHelper.nativeSetApkPath(packageInfo.applicationInfo!!.sourceDir)
|
||||||
|
|
||||||
BaseRobTopActivity.setCurrentActivity(this)
|
BaseRobTopActivity.setCurrentActivity(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("UnsafeDynamicallyLoadedCode")
|
@SuppressLint("UnsafeDynamicallyLoadedCode")
|
||||||
private fun tryLoadLibrary(packageInfo: PackageInfo, libraryName: String) {
|
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"
|
val libraryPath = if (nativeDir.endsWith('/')) "${nativeDir}lib$libraryName.so" else "$nativeDir/lib$libraryName.so"
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -422,6 +422,13 @@ class GeometryDashActivity : AppCompatActivity(), Cocos2dxHelper.Cocos2dxHelperL
|
|||||||
|
|
||||||
forceRefreshRate = PreferenceUtils.get(this).getBoolean(PreferenceUtils.Key.FORCE_HRR)
|
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) {
|
if (displayMode == DisplayMode.FULLSCREEN && Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||||
window.attributes.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES
|
window.attributes.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,8 +53,8 @@ object GamePackageUtils {
|
|||||||
fun detectAbiMismatch(context: Context, packageInfo: PackageInfo, loadException: Error): Boolean {
|
fun detectAbiMismatch(context: Context, packageInfo: PackageInfo, loadException: Error): Boolean {
|
||||||
val abi = LaunchUtils.applicationArchitecture
|
val abi = LaunchUtils.applicationArchitecture
|
||||||
val isExtracted =
|
val isExtracted =
|
||||||
packageInfo.applicationInfo.flags and ApplicationInfo.FLAG_EXTRACT_NATIVE_LIBS == ApplicationInfo.FLAG_EXTRACT_NATIVE_LIBS
|
packageInfo.applicationInfo!!.flags and ApplicationInfo.FLAG_EXTRACT_NATIVE_LIBS == ApplicationInfo.FLAG_EXTRACT_NATIVE_LIBS
|
||||||
val isSplit = (packageInfo.applicationInfo.splitSourceDirs?.size ?: 0) > 1
|
val isSplit = (packageInfo.applicationInfo?.splitSourceDirs?.size ?: 0) > 1
|
||||||
|
|
||||||
val metadata =
|
val metadata =
|
||||||
"Geometry Dash metadata:\nSplit sources: $isSplit\nExtracted libraries: $isExtracted\nLauncher architecture: $abi"
|
"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"
|
val oppositeArchitecture = if (abi == "arm64-v8a") "armeabi-v7a" else "arm64-v8a"
|
||||||
|
|
||||||
// detect issues using native library directory (only works on extracted libraries)
|
// 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)) {
|
if (nativeLibraryDir.contains(oppositeArchitecture)) {
|
||||||
return true
|
return true
|
||||||
@@ -105,8 +105,8 @@ object GamePackageUtils {
|
|||||||
val clazz = assetManager.javaClass
|
val clazz = assetManager.javaClass
|
||||||
val aspMethod = clazz.getDeclaredMethod("addAssetPath", String::class.java)
|
val aspMethod = clazz.getDeclaredMethod("addAssetPath", String::class.java)
|
||||||
|
|
||||||
aspMethod.invoke(assetManager, packageInfo.applicationInfo.sourceDir)
|
aspMethod.invoke(assetManager, packageInfo.applicationInfo?.sourceDir)
|
||||||
packageInfo.applicationInfo.splitSourceDirs?.forEach {
|
packageInfo.applicationInfo?.splitSourceDirs?.forEach {
|
||||||
aspMethod.invoke(assetManager, it)
|
aspMethod.invoke(assetManager, it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -122,14 +122,14 @@ object GamePackageUtils {
|
|||||||
val game = packageManager.getPackageInfo(Constants.PACKAGE_NAME, PackageManager.GET_SIGNING_CERTIFICATES)
|
val game = packageManager.getPackageInfo(Constants.PACKAGE_NAME, PackageManager.GET_SIGNING_CERTIFICATES)
|
||||||
val signingInfo = game.signingInfo
|
val signingInfo = game.signingInfo
|
||||||
|
|
||||||
signingInfo.signingCertificateHistory
|
signingInfo?.signingCertificateHistory ?: return false
|
||||||
} else {
|
} else {
|
||||||
val game = packageManager.getPackageInfo(Constants.PACKAGE_NAME, PackageManager.GET_SIGNATURES)
|
val game = packageManager.getPackageInfo(Constants.PACKAGE_NAME, PackageManager.GET_SIGNATURES)
|
||||||
game.signatures
|
game.signatures
|
||||||
}
|
}
|
||||||
|
|
||||||
return certificates.any {
|
return certificates?.any {
|
||||||
validateCertificate(it.toByteArray())
|
validateCertificate(it.toByteArray())
|
||||||
}
|
} ?: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -8,7 +8,7 @@ import androidx.compose.runtime.MutableState
|
|||||||
import androidx.compose.runtime.mutableStateOf
|
import androidx.compose.runtime.mutableStateOf
|
||||||
import androidx.compose.runtime.remember
|
import androidx.compose.runtime.remember
|
||||||
import androidx.compose.ui.platform.LocalContext
|
import androidx.compose.ui.platform.LocalContext
|
||||||
import androidx.compose.ui.platform.LocalLifecycleOwner
|
import androidx.lifecycle.compose.LocalLifecycleOwner
|
||||||
import androidx.core.content.edit
|
import androidx.core.content.edit
|
||||||
import androidx.lifecycle.Lifecycle
|
import androidx.lifecycle.Lifecycle
|
||||||
import androidx.lifecycle.LifecycleEventObserver
|
import androidx.lifecycle.LifecycleEventObserver
|
||||||
|
|||||||
+6
-6
@@ -1,14 +1,14 @@
|
|||||||
buildscript {
|
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.
|
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||||
plugins {
|
plugins {
|
||||||
id("com.android.application") version "8.5.0" apply false
|
id("com.android.application") version "8.7.2" apply false
|
||||||
id("com.android.library") version "8.5.0" apply false
|
id("com.android.library") version "8.7.2" apply false
|
||||||
id("org.jetbrains.kotlin.android") version "2.0.0" apply false
|
id("org.jetbrains.kotlin.android") version "2.0.10" apply false
|
||||||
id("org.jetbrains.kotlin.plugin.serialization") version "2.0.0" apply false
|
id("org.jetbrains.kotlin.plugin.serialization") version "2.0.10" apply false
|
||||||
id("org.jetbrains.kotlin.plugin.compose") version "2.0.0" apply false
|
id("org.jetbrains.kotlin.plugin.compose") version "2.0.10" apply false
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.register<Delete>("clean") {
|
tasks.register<Delete>("clean") {
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
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
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|||||||
Reference in new issue
Block a user