mirror of
https://github.com/geode-sdk/android-launcher.git
synced 2026-10-23 16:59:21 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f59492ca8e
|
||
|
|
352ff63ab0 | ||
|
|
91fc804dee | ||
|
|
87808b56b3 | ||
|
|
2c2884c3b8 | ||
|
|
74e91e7dc1 | ||
|
|
e3ffbf311e | ||
|
|
5ad77bca57 | ||
|
|
3be0127e04 | ||
|
|
458c837aba | ||
|
|
67ca7707d8 | ||
|
|
776a4fa468 | ||
|
|
9528eef313 | ||
|
|
9827fe36c1 | ||
|
|
ce44270b7a | ||
|
|
34e324c54d | ||
|
|
986e33ce03 |
No files matched your search
+18
-16
@@ -14,14 +14,14 @@ plugins {
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdk = 35
|
||||
compileSdk = 36
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "com.geode.launcher"
|
||||
applicationId = "com.geode.launcherXps"
|
||||
minSdk = 23
|
||||
targetSdk = 35
|
||||
versionCode = 20
|
||||
versionName = "1.5.0"
|
||||
versionCode = 22
|
||||
versionName = "1.0.1"
|
||||
|
||||
vectorDrawables {
|
||||
useSupportLibrary = true
|
||||
@@ -30,7 +30,7 @@ android {
|
||||
@Suppress("UnstableApiUsage")
|
||||
externalNativeBuild {
|
||||
cmake {
|
||||
arguments("-DUSE_TULIPHOOK:BOOL=OFF", "-DANDROID_STL=c++_shared")
|
||||
arguments("-DUSE_TULIPHOOK:BOOL=OFF", "-DANDROID_STL=c++_shared", "-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES:BOOL=OFF")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,32 +82,34 @@ android {
|
||||
}
|
||||
externalNativeBuild {
|
||||
cmake {
|
||||
version = "3.25.0+"
|
||||
path = file("src/main/cpp/CMakeLists.txt")
|
||||
}
|
||||
}
|
||||
namespace = "com.geode.launcher"
|
||||
ndkVersion = "27.2.12479018"
|
||||
ndkVersion = "28.1.13356709"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation (platform("androidx.compose:compose-bom:$composeBOM"))
|
||||
implementation ("androidx.core:core-ktx:1.15.0")
|
||||
implementation ("androidx.core:core-ktx:1.16.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.7")
|
||||
implementation ("androidx.lifecycle:lifecycle-viewmodel-compose:2.8.7")
|
||||
implementation ("androidx.activity:activity-compose:1.10.0")
|
||||
implementation ("androidx.activity:activity-ktx:1.10.0")
|
||||
implementation ("androidx.activity:activity-compose:1.10.1")
|
||||
implementation ("androidx.activity:activity-ktx:1.10.1")
|
||||
implementation ("androidx.appcompat:appcompat:1.7.0")
|
||||
implementation ("androidx.documentfile:documentfile:1.0.1")
|
||||
implementation ("com.squareup.okio:okio:3.10.2")
|
||||
implementation ("com.squareup.okio:okio:3.11.0")
|
||||
implementation ("com.squareup.okhttp3:okhttp:4.12.0")
|
||||
implementation ("org.jetbrains.kotlinx:kotlinx-serialization-json:1.8.0")
|
||||
implementation ("org.jetbrains.kotlinx:kotlinx-serialization-json-okio:1.8.0")
|
||||
implementation ("org.jetbrains.kotlinx:kotlinx-datetime:0.6.1")
|
||||
implementation ("com.mikepenz:multiplatform-markdown-renderer-android:0.30.0")
|
||||
implementation ("com.mikepenz:multiplatform-markdown-renderer-m3:0.30.0")
|
||||
implementation ("org.jetbrains.kotlinx:kotlinx-serialization-json:1.8.1")
|
||||
implementation ("org.jetbrains.kotlinx:kotlinx-serialization-json-okio:1.8.1")
|
||||
implementation ("org.jetbrains.kotlinx:kotlinx-datetime:0.6.2")
|
||||
implementation ("com.mikepenz:multiplatform-markdown-renderer-android:0.33.0")
|
||||
implementation ("com.mikepenz:multiplatform-markdown-renderer-m3:0.33.0")
|
||||
implementation ("androidx.browser:browser:1.8.0")
|
||||
debugImplementation ("androidx.compose.ui:ui-tooling")
|
||||
coreLibraryDesugaring ("com.android.tools:desugar_jdk_libs:2.1.4")
|
||||
coreLibraryDesugaring ("com.android.tools:desugar_jdk_libs:2.1.5")
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<queries>
|
||||
<package android:name="com.robtopx.geometryjump" />
|
||||
<package android:name="xyz.lncvrt.xps0000002200" />
|
||||
</queries>
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
@@ -39,8 +39,9 @@
|
||||
android:label="@string/app_name"
|
||||
android:hasFragileUserData="true"
|
||||
android:requestLegacyExternalStorage="true"
|
||||
android:enableOnBackInvokedCallback="true"
|
||||
android:theme="@style/Theme.GeodeLauncher"
|
||||
tools:targetApi="31">
|
||||
tools:targetApi="35">
|
||||
<activity
|
||||
android:name=".AltMainActivity"
|
||||
android:exported="false"
|
||||
@@ -89,7 +90,7 @@
|
||||
|
||||
<provider
|
||||
android:name=".UserDirectoryProvider"
|
||||
android:authorities="com.geode.launcher.user"
|
||||
android:authorities="com.geode.launcherXps.user"
|
||||
android:exported="true"
|
||||
android:grantUriPermissions="true"
|
||||
android:permission="android.permission.MANAGE_DOCUMENTS">
|
||||
@@ -99,7 +100,7 @@
|
||||
</provider>
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
android:authorities="com.geode.launcher.fileprovider"
|
||||
android:authorities="com.geode.launcherXps.fileprovider"
|
||||
android:exported="false"
|
||||
android:grantUriPermissions="true">
|
||||
<meta-data
|
||||
|
||||
@@ -13,7 +13,7 @@ option(USE_TULIPHOOK "enables choice of hooking library" OFF)
|
||||
if (USE_TULIPHOOK)
|
||||
FetchContent_Declare(TulipHook
|
||||
GIT_REPOSITORY https://github.com/geode-sdk/TulipHook.git
|
||||
GIT_TAG 0021301fcea265416fa8eb5372694931c1d410cb
|
||||
GIT_TAG 9aa1f95091ebac18c657d57b755f59d00fe6f1f8
|
||||
)
|
||||
|
||||
set(TULIP_LINK_SOURCE ON CACHE INTERNAL "")
|
||||
@@ -24,8 +24,9 @@ if (USE_TULIPHOOK)
|
||||
target_link_libraries(launcherfix PRIVATE TulipHook TulipHookInclude)
|
||||
else()
|
||||
FetchContent_Declare(dobby
|
||||
# this is the last version that builds on android at all
|
||||
GIT_REPOSITORY https://github.com/jmpews/Dobby
|
||||
GIT_TAG 6a80a61ea062424d1595613058a174c64454fa57
|
||||
GIT_TAG 0932d69c320e786672361ab53825ba8f4245e9d3
|
||||
)
|
||||
|
||||
FetchContent_GetProperties(dobby)
|
||||
|
||||
@@ -109,7 +109,7 @@ bool patch_symbol(std::uint32_t* hash_table, char* str_table, ElfW(Sym)* sym_tab
|
||||
// we found it! now go rename the symbol
|
||||
|
||||
#ifdef USE_TULIPHOOK
|
||||
auto res = tulip::hook::writeMemory(sym_name, new_symbol.data(), new_symbol.size());
|
||||
auto res = tulip::hook::writeMemory(sym_name, SYMBOL_PATCH_VALUE.data(), SYMBOL_PATCH_VALUE.size());
|
||||
if (!res) {
|
||||
__android_log_print(ANDROID_LOG_WARN, "GeodeLauncher-fix", "failed to patch symbol: %s", res.unwrapErr().c_str());
|
||||
return false;
|
||||
|
||||
@@ -14,6 +14,7 @@ import android.util.Log
|
||||
import android.view.ViewGroup
|
||||
import android.view.WindowManager
|
||||
import android.widget.FrameLayout
|
||||
import android.window.OnBackInvokedDispatcher
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.compose.ui.platform.ComposeView
|
||||
@@ -70,7 +71,7 @@ class GeometryDashActivity : AppCompatActivity(), Cocos2dxHelper.Cocos2dxHelperL
|
||||
private var mHasWindowFocus = false
|
||||
|
||||
private var displayMode = DisplayMode.DEFAULT
|
||||
private var mChosenDisplayRate: Float? = null
|
||||
private var mForceRefreshRate = false
|
||||
private var mLimitedRefreshRate: Int? = null
|
||||
private var mAspectRatio = 0.0f
|
||||
private var mScreenZoom = 1.0f
|
||||
@@ -121,6 +122,13 @@ class GeometryDashActivity : AppCompatActivity(), Cocos2dxHelper.Cocos2dxHelperL
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||
onBackInvokedDispatcher.registerOnBackInvokedCallback(OnBackInvokedDispatcher.PRIORITY_DEFAULT) {
|
||||
mGLSurfaceView?.sendKeyBack()
|
||||
}
|
||||
mGLSurfaceView?.manualBackEvents = true
|
||||
}
|
||||
}
|
||||
|
||||
private fun createVersionFile() {
|
||||
@@ -428,7 +436,7 @@ class GeometryDashActivity : AppCompatActivity(), Cocos2dxHelper.Cocos2dxHelperL
|
||||
val renderer = Cocos2dxRenderer(glSurfaceView)
|
||||
glSurfaceView.setCocos2dxRenderer(renderer)
|
||||
|
||||
renderer.setFrameRate = mChosenDisplayRate
|
||||
renderer.setFrameRate = mForceRefreshRate
|
||||
|
||||
val frameRate = mLimitedRefreshRate
|
||||
if (frameRate != null) {
|
||||
@@ -457,20 +465,24 @@ class GeometryDashActivity : AppCompatActivity(), Cocos2dxHelper.Cocos2dxHelperL
|
||||
val limitedRefreshRate = preferenceUtils.getInt(PreferenceUtils.Key.LIMIT_FRAME_RATE).takeIf { it != 0 }
|
||||
mLimitedRefreshRate = limitedRefreshRate
|
||||
|
||||
val forceRefreshRate = preferenceUtils.getBoolean(PreferenceUtils.Key.FORCE_HRR)
|
||||
if (forceRefreshRate && Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||
var chosenDisplay = display.supportedModes?.maxByOrNull { it.refreshRate }
|
||||
mForceRefreshRate = preferenceUtils.getBoolean(PreferenceUtils.Key.FORCE_HRR)
|
||||
if (mForceRefreshRate && Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||
val chosenDisplay = display.supportedModes?.maxByOrNull { it.refreshRate }
|
||||
if (chosenDisplay != null) {
|
||||
var chosenRefreshRate = chosenDisplay.refreshRate
|
||||
println("Forcing a refresh rate of $chosenRefreshRate (display ${chosenDisplay.modeId})")
|
||||
println("setupUIState: Forcing a refresh rate of $chosenRefreshRate (display ${chosenDisplay.modeId})")
|
||||
|
||||
window.attributes.preferredRefreshRate = chosenRefreshRate
|
||||
mChosenDisplayRate = chosenRefreshRate
|
||||
} else {
|
||||
println("setupUIState could not find a display to select refresh rate of...")
|
||||
}
|
||||
}
|
||||
|
||||
if (displayMode == DisplayMode.FULLSCREEN && Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||
window.attributes.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES
|
||||
GeodeUtils.handleSafeArea = true
|
||||
} else {
|
||||
GeodeUtils.handleSafeArea = false
|
||||
}
|
||||
|
||||
hideSystemUi()
|
||||
|
||||
@@ -58,9 +58,9 @@ import com.geode.launcher.utils.LaunchUtils
|
||||
import com.geode.launcher.utils.PreferenceUtils
|
||||
import com.mikepenz.markdown.compose.LocalBulletListHandler
|
||||
import com.mikepenz.markdown.m3.Markdown
|
||||
import com.mikepenz.markdown.m3.markdownColor
|
||||
import com.mikepenz.markdown.m3.markdownTypography
|
||||
import kotlinx.datetime.toJavaInstant
|
||||
import org.intellij.markdown.flavours.gfm.GFMFlavourDescriptor
|
||||
import java.io.File
|
||||
import java.net.ConnectException
|
||||
import java.net.UnknownHostException
|
||||
@@ -191,17 +191,17 @@ fun LauncherUpdateInformation(onDismiss: () -> Unit) {
|
||||
style = Typography.titleLarge
|
||||
)
|
||||
|
||||
CompositionLocalProvider(LocalBulletListHandler provides { _, _, _ -> "• " }) {
|
||||
// every new release of the markdown library adds another arg to it
|
||||
CompositionLocalProvider(LocalBulletListHandler provides { _, _, _, _, _ -> "• " }) {
|
||||
Markdown(
|
||||
content = nextRelease.release.body.replace("\r", ""),
|
||||
colors = markdownColor(
|
||||
linkText = MaterialTheme.colorScheme.primary
|
||||
),
|
||||
typography = markdownTypography(
|
||||
link = MaterialTheme.typography.bodyLarge.copy(
|
||||
textDecoration = TextDecoration.Underline
|
||||
)
|
||||
textDecoration = TextDecoration.Underline,
|
||||
color = MaterialTheme.colorScheme.primary,
|
||||
),
|
||||
),
|
||||
flavour = GFMFlavourDescriptor(),
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -370,10 +370,13 @@ fun UpdateCard(releaseViewModel: ReleaseViewModel, modifier: Modifier = Modifier
|
||||
}
|
||||
|
||||
UpdateProgressIndicator(
|
||||
stringResource(
|
||||
if (outOf != null) stringResource(
|
||||
R.string.release_fetch_downloading,
|
||||
downloaded,
|
||||
outOf ?: "…"
|
||||
outOf
|
||||
) else stringResource(
|
||||
R.string.release_fetch_downloading_indeterminate,
|
||||
downloaded,
|
||||
),
|
||||
modifier = modifier,
|
||||
releaseViewModel = releaseViewModel,
|
||||
|
||||
@@ -146,6 +146,11 @@ fun DeveloperSettingsScreen(onBackPressedDispatcher: OnBackPressedDispatcher?) {
|
||||
}
|
||||
|
||||
OptionsGroup(title = stringResource(R.string.preference_category_updater)) {
|
||||
SettingsCard(
|
||||
title = stringResource(R.string.preference_use_index_update_api),
|
||||
preferenceKey = PreferenceUtils.Key.USE_INDEX_API
|
||||
)
|
||||
|
||||
SettingsSelectCard(
|
||||
title = stringResource(R.string.preference_release_channel_tag_name),
|
||||
dialogTitle = stringResource(R.string.preference_release_channel_select),
|
||||
|
||||
@@ -120,6 +120,17 @@ class ReleaseManager private constructor(
|
||||
}
|
||||
|
||||
val gameVersion = GamePackageUtils.getGameVersionCode(applicationContext.packageManager)
|
||||
val preferences = PreferenceUtils.get(applicationContext)
|
||||
|
||||
if (preferences.getBoolean(PreferenceUtils.Key.USE_INDEX_API)) {
|
||||
val targetTag = preferences.getInt(PreferenceUtils.Key.RELEASE_CHANNEL_TAG)
|
||||
|
||||
return when (targetTag) {
|
||||
2 -> releaseRepository.getReleaseByTag("nightly")
|
||||
1 -> releaseRepository.getLatestIndexRelease(gameVersion, true)
|
||||
else -> releaseRepository.getLatestIndexRelease(gameVersion, false)
|
||||
}
|
||||
} else {
|
||||
val targetTag = getBestReleaseForGameVersion(gameVersion) ?: return null
|
||||
|
||||
return when (targetTag) {
|
||||
@@ -128,6 +139,7 @@ class ReleaseManager private constructor(
|
||||
else -> releaseRepository.getReleaseByTag(targetTag)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private suspend fun downloadLauncherUpdate(release: Downloadable) {
|
||||
val download = release.getDownload() ?: return
|
||||
|
||||
@@ -28,7 +28,7 @@ class ReleaseRepository(private val httpClient: OkHttpClient) {
|
||||
}
|
||||
|
||||
suspend fun getLatestLauncherRelease(): DownloadableLauncherRelease? {
|
||||
val releasePath = "$GITHUB_API_BASE/repos/geode-sdk/android-launcher/releases/latest"
|
||||
val releasePath = "$GITHUB_API_BASE/repos/Lncvrt/xps-geode-launcher/releases/latest"
|
||||
|
||||
val url = URL(releasePath)
|
||||
|
||||
@@ -165,10 +165,10 @@ class ReleaseRepository(private val httpClient: OkHttpClient) {
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
suspend fun getLatestIndexRelease(gd: String, prerelease: Boolean = false): DownloadableLoaderRelease? {
|
||||
suspend fun getLatestIndexRelease(gd: Long, prerelease: Boolean = false): DownloadableLoaderRelease? {
|
||||
val url = "$GEODE_API_BASE/loader/versions/latest".toHttpUrlOrNull()!!
|
||||
.newBuilder()
|
||||
.addQueryParameter("gd", gd)
|
||||
.addQueryParameter("gd", gd.toString())
|
||||
.addQueryParameter("platform", "android")
|
||||
.addQueryParameter("prerelease", prerelease.toString())
|
||||
.build()
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.geode.launcher.utils
|
||||
import android.annotation.SuppressLint
|
||||
|
||||
object Constants {
|
||||
const val PACKAGE_NAME = "com.robtopx.geometryjump"
|
||||
const val PACKAGE_NAME = "xyz.lncvrt.xps0000002200"
|
||||
|
||||
const val COCOS_LIB_NAME = "cocos2dcpp"
|
||||
const val FMOD_LIB_NAME = "fmod"
|
||||
|
||||
@@ -21,7 +21,9 @@ import androidx.activity.result.ActivityResultLauncher
|
||||
import androidx.activity.result.contract.ActivityResultContracts
|
||||
import androidx.annotation.Keep
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.browser.customtabs.CustomTabsIntent
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.net.toUri
|
||||
import androidx.documentfile.provider.DocumentFile
|
||||
import com.geode.launcher.BuildConfig
|
||||
import com.geode.launcher.R
|
||||
@@ -37,6 +39,8 @@ import kotlin.system.exitProcess
|
||||
@Suppress("unused", "KotlinJniMissingFunction")
|
||||
object GeodeUtils {
|
||||
private lateinit var activity: WeakReference<AppCompatActivity>
|
||||
var handleSafeArea: Boolean = false
|
||||
|
||||
private lateinit var openFileResultLauncher: ActivityResultLauncher<GeodeOpenFileActivityResult.OpenFileParams>
|
||||
private lateinit var openDirectoryResultLauncher: ActivityResultLauncher<Uri?>
|
||||
private lateinit var openFilesResultLauncher: ActivityResultLauncher<GeodeOpenFilesActivityResult.OpenFileParams>
|
||||
@@ -386,6 +390,9 @@ object GeodeUtils {
|
||||
return ""
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current version code of the launcher.
|
||||
*/
|
||||
@JvmStatic
|
||||
fun getLauncherVersion(): Int {
|
||||
return BuildConfig.VERSION_CODE
|
||||
@@ -457,9 +464,16 @@ object GeodeUtils {
|
||||
}
|
||||
|
||||
// vibration
|
||||
|
||||
/**
|
||||
* If vibration is supported on the device.
|
||||
*/
|
||||
@JvmStatic
|
||||
fun vibrateSupported(): Boolean = getVibrator()?.hasVibrator() == true
|
||||
|
||||
/**
|
||||
* Vibrates for the given amount of time.
|
||||
*/
|
||||
@JvmStatic
|
||||
fun vibrate(ms: Long) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
@@ -470,6 +484,10 @@ object GeodeUtils {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Vibrates with the given pattern.
|
||||
* @see android.os.VibrationEffect.createWaveform
|
||||
*/
|
||||
@JvmStatic
|
||||
fun vibratePattern(pattern: LongArray, repeat: Int) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
@@ -480,6 +498,19 @@ object GeodeUtils {
|
||||
}
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun getScreenInsets(): IntArray? {
|
||||
if (!handleSafeArea || Build.VERSION.SDK_INT < Build.VERSION_CODES.P) {
|
||||
return null
|
||||
}
|
||||
|
||||
return activity.get()?.run {
|
||||
val displayCutout = window.decorView.rootWindowInsets?.displayCutout ?: return null
|
||||
|
||||
intArrayOf(displayCutout.safeInsetLeft, displayCutout.safeInsetBottom, displayCutout.safeInsetRight, displayCutout.safeInsetTop)
|
||||
}
|
||||
}
|
||||
|
||||
const val ARGUMENT_SAFE_MODE = "--geode:safe-mode"
|
||||
|
||||
private var additionalLaunchArguments = arrayListOf<String>()
|
||||
@@ -518,6 +549,10 @@ object GeodeUtils {
|
||||
capabilityListener = WeakReference(listener)
|
||||
}
|
||||
|
||||
/**
|
||||
* Reports that the game client supports a feature.
|
||||
* These features typically require callbacks into the game, so ensure that the required methods are registered first.
|
||||
*/
|
||||
@JvmStatic
|
||||
fun reportPlatformCapability(capability: String?): Boolean {
|
||||
if (capability.isNullOrEmpty()) {
|
||||
@@ -527,11 +562,24 @@ object GeodeUtils {
|
||||
return capabilityListener.get()?.onCapabilityAdded(capability) == true
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun openWebview(url: String) {
|
||||
val activity = activity.get() ?: return
|
||||
CustomTabsIntent.Builder()
|
||||
.setShowTitle(true)
|
||||
.build()
|
||||
.launchUrl(activity, url.toUri())
|
||||
}
|
||||
|
||||
external fun nativeKeyUp(keyCode: Int, modifiers: Int)
|
||||
external fun nativeKeyDown(keyCode: Int, modifiers: Int, isRepeating: Boolean)
|
||||
external fun nativeActionScroll(scrollX: Float, scrollY: Float)
|
||||
external fun resizeSurface(width: Int, height: Int)
|
||||
|
||||
// represents the timestamp of the next input callback, in nanoseconds (most events don't send it, but it's there)
|
||||
/**
|
||||
* Gives the timestamp of the next input callback, in nanoseconds.
|
||||
* Enable this by sending the "timestamp_inputs" platform capability.
|
||||
* @see reportPlatformCapability
|
||||
*/
|
||||
external fun setNextInputTimestamp(timestamp: Long)
|
||||
}
|
||||
@@ -147,13 +147,15 @@ class PreferenceUtils(private val sharedPreferences: SharedPreferences) {
|
||||
CUSTOM_ASPECT_RATIO,
|
||||
SCREEN_ZOOM,
|
||||
SCREEN_ZOOM_FIT,
|
||||
LIMIT_FRAME_RATE
|
||||
LIMIT_FRAME_RATE,
|
||||
USE_INDEX_API,
|
||||
}
|
||||
|
||||
private fun defaultValueForBooleanKey(key: Key): Boolean {
|
||||
return when (key) {
|
||||
Key.UPDATE_AUTOMATICALLY, Key.FORCE_HRR -> true
|
||||
Key.DEVELOPER_MODE -> BuildConfig.DEBUG
|
||||
Key.USE_INDEX_API -> true
|
||||
else -> false
|
||||
}
|
||||
}
|
||||
@@ -195,6 +197,7 @@ class PreferenceUtils(private val sharedPreferences: SharedPreferences) {
|
||||
Key.SCREEN_ZOOM -> "PreferenceScreenZoom"
|
||||
Key.SCREEN_ZOOM_FIT -> "PreferenceScreenZoomFit"
|
||||
Key.LIMIT_FRAME_RATE -> "PreferenceLimitFrameRate"
|
||||
Key.USE_INDEX_API -> "PreferenceUseIndexApi"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.cocos2dx.lib
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.opengl.GLSurfaceView
|
||||
import android.os.Build
|
||||
@@ -54,6 +55,7 @@ class Cocos2dxGLSurfaceView(context: Context) : GLSurfaceView(context) {
|
||||
}
|
||||
|
||||
var sendTimestampEvents = false
|
||||
var manualBackEvents = false
|
||||
|
||||
var cocos2dxEditText: Cocos2dxEditText? = null
|
||||
set(value) {
|
||||
@@ -119,8 +121,21 @@ class Cocos2dxGLSurfaceView(context: Context) : GLSurfaceView(context) {
|
||||
}
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.R)
|
||||
fun updateRefreshRate(refreshRate: Float) {
|
||||
holder.surface.setFrameRate(refreshRate, Surface.FRAME_RATE_COMPATIBILITY_DEFAULT)
|
||||
fun updateRefreshRate() {
|
||||
val chosenDisplay = display.supportedModes?.maxByOrNull { it.refreshRate }
|
||||
if (chosenDisplay == null) {
|
||||
println("updateRefreshRate failed to find a display to maximize refresh rate...")
|
||||
return
|
||||
}
|
||||
|
||||
val chosenRefreshRate = chosenDisplay.refreshRate
|
||||
|
||||
println("updateRefreshRate: selecting refresh rate of ${chosenDisplay.refreshRate} (display ${chosenDisplay.modeId})")
|
||||
|
||||
holder.surface.setFrameRate(chosenRefreshRate, Surface.FRAME_RATE_COMPATIBILITY_DEFAULT)
|
||||
if (isAttachedToWindow) {
|
||||
(context as Activity).window.attributes.preferredRefreshRate = chosenRefreshRate
|
||||
}
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
@@ -245,6 +260,26 @@ class Cocos2dxGLSurfaceView(context: Context) : GLSurfaceView(context) {
|
||||
}
|
||||
}
|
||||
|
||||
fun sendKeyBack() {
|
||||
if (BaseRobTopActivity.blockBackButton) {
|
||||
return
|
||||
}
|
||||
|
||||
if (useKeyboardEvents) {
|
||||
queueEvent {
|
||||
cocos2dxRenderer.handleKeyDown(KeyEvent.KEYCODE_BACK)
|
||||
}
|
||||
} else {
|
||||
val currentTime = System.nanoTime()
|
||||
queueEvent {
|
||||
if (sendTimestampEvents)
|
||||
GeodeUtils.setNextInputTimestamp(currentTime)
|
||||
|
||||
GeodeUtils.nativeKeyDown(KeyEvent.KEYCODE_BACK, 0, false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean {
|
||||
if (!useKeyboardEvents) {
|
||||
return legacyKeyDown(keyCode, event)
|
||||
|
||||
@@ -64,7 +64,7 @@ class Cocos2dxRenderer(private var handler: Cocos2dxGLSurfaceView) : GLSurfaceVi
|
||||
private var screenWidth = 0
|
||||
private var screenHeight = 0
|
||||
var sendResizeEvents = false
|
||||
var setFrameRate: Float? = null
|
||||
var setFrameRate = false
|
||||
private var mAnimationInterval: Long? = null
|
||||
|
||||
fun limitFrameRate(rate: Int) {
|
||||
@@ -82,9 +82,8 @@ class Cocos2dxRenderer(private var handler: Cocos2dxGLSurfaceView) : GLSurfaceVi
|
||||
}
|
||||
|
||||
override fun onSurfaceChanged(gl10: GL10?, width: Int, height: Int) {
|
||||
val chosenRefreshRate = setFrameRate
|
||||
if (chosenRefreshRate != null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||
handler.updateRefreshRate(chosenRefreshRate)
|
||||
if (setFrameRate && Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||
handler.updateRefreshRate()
|
||||
}
|
||||
|
||||
println("renderer surfaceChanged: ${width}x${height}@${handler.display.refreshRate}fps")
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<resources>
|
||||
<string name="app_name" translatable="false">Geode</string>
|
||||
<string name="app_name" translatable="false">XPS: Geode Edition</string>
|
||||
<string name="no_activity_found">No activity found for this action.</string>
|
||||
|
||||
<!-- MainActivity strings -->
|
||||
<string name="game_not_found">Geometry Dash was not found.\nThe full version of the game is required.</string>
|
||||
<string name="game_not_found">XPS 2.2 isn\'t installed</string>
|
||||
<string name="launcher_launch">Launch</string>
|
||||
<string name="launcher_settings">Settings</string>
|
||||
<string name="launcher_download">Download</string>
|
||||
@@ -18,7 +18,7 @@
|
||||
<string name="launcher_settings_icon_alt">settings icon</string>
|
||||
<string name="launcher_retry_icon_alt">retry icon</string>
|
||||
<string name="geode_download_title">Geode is not installed.</string>
|
||||
<string name="game_outdated">A Geometry Dash update is required.\nYou currently have update %1$s.</string>
|
||||
<string name="game_outdated">A XPS update is required.\nYou currently have update %1$s.</string>
|
||||
<string name="geode_download_description">Geode is downloading. Please wait.</string>
|
||||
<plurals name="automatically_load_countdown">
|
||||
<item quantity="one">Automatically launching game in %1$d second.</item>
|
||||
@@ -28,14 +28,14 @@
|
||||
<string name="launcher_error_icon_alt">error</string>
|
||||
<string name="launcher_unsupported_version_title">Unsupported version</string>
|
||||
<string name="launcher_outdated_version_description">
|
||||
The current version of Geometry Dash is not compatible with the version supported by the launcher (%2$s). You must update Geometry Dash to fix this.\nLaunch will continue, but crashes may occur!
|
||||
The current version of XPS is not compatible with the version supported by the launcher (%2$s). You must update XPS to fix this.\nLaunch will continue, but crashes may occur!
|
||||
</string>
|
||||
<string name="launcher_unsupported_version_description">
|
||||
The current version of Geometry Dash is not compatible with the version supported by the launcher. A launcher update is required to fix this.\nLaunch will continue, but crashes may occur!
|
||||
The current version of XPS is not compatible with the version supported by the launcher. A launcher update is required to fix this.\nLaunch will continue, but crashes may occur!
|
||||
</string>
|
||||
|
||||
<string name="launcher_game_update_required_short">A Geometry Dash update is required.</string>
|
||||
<string name="launcher_game_update_required">The currently installed version of Geometry Dash is no longer supported. Please update Geometry Dash to continue receiving Geode updates.</string>
|
||||
<string name="launcher_game_update_required_short">A XPS update is required.</string>
|
||||
<string name="launcher_game_update_required">The currently installed version of XPS is no longer supported. Please update XPS to continue receiving Geode updates.</string>
|
||||
|
||||
<string name="launcher_update_available">A new launcher update is available!</string>
|
||||
<string name="launcher_update_dismiss">Dismiss</string>
|
||||
@@ -60,18 +60,18 @@
|
||||
<string name="launcher_notification_settings">Launcher Settings</string>
|
||||
<string name="launcher_notification_update_failed">Failed to update Geode.</string>
|
||||
<string name="launcher_notification_update_success">Geode updated!</string>
|
||||
<string name="launcher_notification_compatibility">Unsupported Geometry Dash version.</string>
|
||||
<string name="launcher_notification_compatibility">Unsupported XPS version.</string>
|
||||
<string name="launcher_notification_compatibility_description">An update is required to receive Geode updates.</string>
|
||||
<string name="launcher_notification_update_cta">Tap for more information.</string>
|
||||
|
||||
<string name="launcher_starting_game">Starting Geometry Dash…</string>
|
||||
<string name="launcher_starting_game">Starting XPS…</string>
|
||||
<string name="launcher_downloading_update">Downloading update…</string>
|
||||
<string name="launcher_downloading_update_details">(%1$s/%2$s)</string>
|
||||
<string name="launcher_cancelled_manual">Launch paused.</string>
|
||||
<string name="launcher_cancelled_navigated_away">Launch paused.</string>
|
||||
<string name="launcher_cancelled_crash">Launch paused due to a crash.</string>
|
||||
<string name="launcher_cancelled_error">Could not start Geode.</string>
|
||||
<string name="launcher_cancelled_outdated">A Geometry Dash update is required.</string>
|
||||
<string name="launcher_cancelled_outdated">A XPS update is required.</string>
|
||||
<string name="launcher_cancelled_restart">Restart</string>
|
||||
<string name="launcher_cancelled_resume">Resume</string>
|
||||
<string name="launcher_cancelled_retry">Retry</string>
|
||||
@@ -84,6 +84,7 @@
|
||||
<string name="release_fetch_in_progress">Checking for new releases…</string>
|
||||
<string name="release_fetch_success">Geode updated!</string>
|
||||
<string name="release_fetch_downloading">Downloading update… (%1$s/%2$s)</string>
|
||||
<string name="release_fetch_downloading_indeterminate">Downloading update… (%1$s)</string>
|
||||
<string name="release_fetch_cancelling">Cancelling update…</string>
|
||||
<string name="release_fetch_no_internet">No internet found.</string>
|
||||
<string name="release_fetch_cancelled">Update cancelled.</string>
|
||||
@@ -95,15 +96,15 @@
|
||||
<!-- GeometryDashActivity strings -->
|
||||
<string name="load_failed_link_error">Failed to link libraries</string>
|
||||
<string name="load_failed_link_error_description">Game libraries could not be found. Try to:</string>
|
||||
<string name="load_failed_abi_error">The architecture of the launcher and Geometry Dash do not match. Try to:</string>
|
||||
<string name="load_failed_abi_error">The architecture of the launcher and XPS do not match. Try to:</string>
|
||||
<string name="load_failed_generic_error">Failed to load Geode</string>
|
||||
<string name="load_failed_generic_error_description">Uncaught error during game load. Try to:</string>
|
||||
<string name="load_failed_crashed">Geode crashed</string>
|
||||
<string name="load_failed_crashed_description">A crash was reported during the last session. Try to:</string>
|
||||
<string name="load_failed_recommendation_reinstall">Reinstall Geometry Dash.</string>
|
||||
<string name="load_failed_recommendation_reinstall">Reinstall XPS.</string>
|
||||
<string name="load_failed_recommendation_switch_32bit_abi">Install the 32-bit version of the launcher.</string>
|
||||
<string name="load_failed_recommendation_switch_64bit_abi">Install the non 32-bit version of the launcher.</string>
|
||||
<string name="load_failed_recommendation_update">Verify that the latest versions of the launcher and Geometry Dash are installed.</string>
|
||||
<string name="load_failed_recommendation_update">Verify that the latest versions of the launcher and XPS are installed.</string>
|
||||
<string name="load_failed_recommendation_report">Report this issue to the developers.</string>
|
||||
<string name="load_failed_recommendation_safe_mode">Hold the Launch button to launch in safe mode.</string>
|
||||
<string name="load_failed_recommendation_dev_stl">Devs: If this is a locally built Geode version, please use the c++_shared ANDROID_STL!</string>
|
||||
@@ -192,9 +193,9 @@
|
||||
<string name="preference_loader_version_description">%1$s</string>
|
||||
<string name="preference_loader_version">Geode %1$s</string>
|
||||
|
||||
<string name="preference_game_version_name">Geometry Dash</string>
|
||||
<string name="preference_game_version_name">XPS</string>
|
||||
<string name="preference_game_version_description">%1$s (%2$s)</string>
|
||||
<string name="preference_game_version">Geometry Dash %1$s (%2$s)</string>
|
||||
<string name="preference_game_version">XPS %1$s (%2$s)</string>
|
||||
<string name="preference_game_source_google">Google</string>
|
||||
<string name="preference_game_source_amazon">Amazon</string>
|
||||
<string name="preference_game_source_unknown">Unknown</string>
|
||||
@@ -254,4 +255,5 @@
|
||||
|
||||
<string name="preference_override_exceptions_name">Custom exceptions fix symbols</string>
|
||||
<string name="preference_override_exceptions_description">Uses exception_symbols.txt to patch</string>
|
||||
<string name="preference_use_index_update_api">Use index release API</string>
|
||||
</resources>
|
||||
+6
-6
@@ -1,14 +1,14 @@
|
||||
buildscript {
|
||||
val composeBOM by extra("2025.01.00")
|
||||
val composeBOM by extra("2025.04.01")
|
||||
}
|
||||
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
plugins {
|
||||
id("com.android.application") version "8.8.0" apply false
|
||||
id("com.android.library") version "8.8.0" apply false
|
||||
id("org.jetbrains.kotlin.android") version "2.1.0" apply false
|
||||
id("org.jetbrains.kotlin.plugin.serialization") version "2.1.0" apply false
|
||||
id("org.jetbrains.kotlin.plugin.compose") version "2.1.0" apply false
|
||||
id("com.android.application") version "8.9.2" apply false
|
||||
id("com.android.library") version "8.9.2" apply false
|
||||
id("org.jetbrains.kotlin.android") version "2.1.20" apply false
|
||||
id("org.jetbrains.kotlin.plugin.serialization") version "2.1.20" apply false
|
||||
id("org.jetbrains.kotlin.plugin.compose") version "2.1.20" apply false
|
||||
}
|
||||
|
||||
tasks.register<Delete>("clean") {
|
||||
|
||||
+2
-1
@@ -1,6 +1,7 @@
|
||||
#Thu Apr 24 10:54:01 MST 2025
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
Reference in new issue
Block a user