custom exceptions option

This commit is contained in:
qimiko committed 2024-06-22 02:34:18 -07:00
1 parent 3661df2667
commit 9f5ccd9ef1
6 files changed
+80 -18

No files matched your search

@@ -146,6 +146,12 @@ class GeometryDashActivity : AppCompatActivity(), Cocos2dxHelper.Cocos2dxHelperL
tryLoadLibrary(gdPackageInfo, Constants.COCOS_LIB_NAME)
if (GamePackageUtils.getGameVersionCode(packageManager) >= 39L) {
val customSymbols = PreferenceUtils.get(this).getBoolean(PreferenceUtils.Key.CUSTOM_SYMBOL_LIST)
if (customSymbols) {
val symbolFile = File(LaunchUtils.getBaseDirectory(this), "exception_symbols.txt")
LauncherFix.enableCustomSymbolList(symbolFile.path)
}
// this fix requires geode v3, which is 2.206+
// there is a short period in which 2.206 users will still have geode v2, but whatever. ig
LauncherFix.performExceptionsRenaming()
@@ -14,4 +14,6 @@ object LauncherFix {
external fun setOriginalDataPath(dataPath: String)
external fun performExceptionsRenaming()
external fun enableCustomSymbolList(symbolsPath: String)
}
@@ -134,7 +134,12 @@ fun DeveloperSettingsScreen(onBackPressedDispatcher: OnBackPressedDispatcher?) {
// if only there was a better way to define this!
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!@#$%^&*(){}<>[]?:;'\"~`-_+=\\| ".contains(c)
}}
)
)
SettingsCard(
title = stringResource(R.string.preference_override_exceptions_name),
description = stringResource(R.string.preference_override_exceptions_description),
preferenceKey = PreferenceUtils.Key.CUSTOM_SYMBOL_LIST
)
}
OptionsGroup(title = stringResource(R.string.preference_category_updater)) {
@@ -140,7 +140,8 @@ class PreferenceUtils(private val sharedPreferences: SharedPreferences) {
ENABLE_REDESIGN,
RELEASE_CHANNEL_TAG,
DEVELOPER_MODE,
CLEANUP_APKS
CLEANUP_APKS,
CUSTOM_SYMBOL_LIST
}
private fun defaultValueForBooleanKey(key: Key): Boolean {
@@ -177,6 +178,7 @@ class PreferenceUtils(private val sharedPreferences: SharedPreferences) {
Key.RELEASE_CHANNEL_TAG -> "PreferenceReleaseChannelTag"
Key.DEVELOPER_MODE -> "PreferenceDeveloperMode"
Key.CLEANUP_APKS -> "PreferenceCleanupPackages"
Key.CUSTOM_SYMBOL_LIST -> "PreferenceCustomSymbolList"
}
}