Clean up compatibility support code

This commit is contained in:
ajp_anton
2026-06-30 19:17:47 +00:00
parent 6b11e76504
commit 6f308a823c
14 changed files with 670 additions and 297 deletions
+1 -5
View File
@@ -86,9 +86,5 @@ dependencies {
implementation("androidx.annotation:annotation:1.7.1")
implementation("io.github.libxposed:service:101.0.0")
implementation("org.lsposed.hiddenapibypass:hiddenapibypass:6.1")
compileOnly("io.github.libxposed:api:101.0.0")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
compileOnly("io.github.libxposed:api:102.0.0")
}
+2 -23
View File
@@ -1,28 +1,7 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
-adaptresourcefilecontents META-INF/xposed/java_init.list
-dontobfuscate
-keep class se.ajpanton.navbuttons.NavButtons
-keepclassmembers class se.ajpanton.navbuttons.NavButtons {
-keep,allowoptimization,allowobfuscation public class * extends io.github.libxposed.api.XposedModule {
public <init>();
}
+6 -3
View File
@@ -6,13 +6,16 @@
<queries>
<package android:name="org.lsposed.manager" />
<package android:name="com.android.systemui" />
<package android:name="com.android.launcher3" />
<package android:name="com.google.android.apps.nexuslauncher" />
<package android:name="com.sec.android.app.launcher" />
</queries>
<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:allowBackup="false"
android:description="@string/xposed_desc"
android:fullBackupContent="@xml/backup_rules"
android:forceQueryable="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
File diff suppressed because it is too large Load Diff
@@ -81,6 +81,31 @@ class SettingsActivity : Activity() {
applySectionTopMargin(sideArrowsSectionView)
SideArrowsSectionController(sideArrowsSectionView).bind()
sectionsContainer.addView(sideArrowsSectionView)
sendSettingsChangedBroadcast()
}
private fun sendSettingsChangedBroadcast() {
val intent = Intent(NavButtonSettingsStore.ACTION_SETTINGS_CHANGED)
NavButtonId.entries.forEach { buttonId ->
val config = settingsStore.getConfig(buttonId)
intent.putExtra(NavButtonSettingsStore.pressActionKey(buttonId), config.pressAction.storageValue)
intent.putExtra(NavButtonSettingsStore.longPressActionKey(buttonId), config.longPressAction.storageValue)
intent.putExtra(NavButtonSettingsStore.longPressDurationKey(buttonId), config.longPressDurationMs)
}
intent.putExtra(NavButtonSettingsStore.KEY_SIDE_ARROWS_ENABLED, settingsStore.isSideArrowsEnabled())
intent.putExtra(
NavButtonSettingsStore.KEY_SIDE_ARROW_LONG_PRESS_ACTION,
settingsStore.getSideArrowLongPressAction().storageValue,
)
intent.putExtra(
NavButtonSettingsStore.KEY_SIDE_ARROW_LONG_PRESS_DURATION_MS,
settingsStore.getSideArrowLongPressDurationMs(),
)
intent.putExtra(
NavButtonSettingsStore.KEY_SIDE_ARROW_REPEAT_STEPS_PER_SECOND,
settingsStore.getSideArrowRepeatStepsPerSecond(),
)
sendBroadcast(intent)
}
private fun applySectionTopMargin(sectionView: View) {
@@ -246,7 +271,10 @@ class SettingsActivity : Activity() {
NavButtonAction.entries,
selectedAction,
NavButtonAction::labelRes,
) { action -> storeAction(buttonId, action) }
) { action ->
storeAction(buttonId, action)
sendSettingsChangedBroadcast()
}
}
private fun bindDurationInput() {
@@ -280,6 +308,7 @@ class SettingsActivity : Activity() {
if (parsed in NavButtonSettingsStore.MIN_DURATION_MS..NavButtonSettingsStore.MAX_DURATION_MS) {
lastValidDurationMs = parsed
settingsStore.setLongPressDurationMs(buttonId, parsed)
sendSettingsChangedBroadcast()
}
}
})
@@ -327,6 +356,7 @@ class SettingsActivity : Activity() {
lastValidDurationMs = sanitized
if (persist) {
settingsStore.setLongPressDurationMs(buttonId, sanitized)
sendSettingsChangedBroadcast()
}
}
}
@@ -374,12 +404,7 @@ class SettingsActivity : Activity() {
sideArrowsCheckbox.setOnCheckedChangeListener { _, isChecked ->
settingsStore.setSideArrowsEnabled(isChecked)
updateOptionsEnabled()
sendBroadcast(
Intent(NavButtonSettingsStore.ACTION_SETTINGS_CHANGED).putExtra(
NavButtonSettingsStore.EXTRA_SIDE_ARROWS_ENABLED,
isChecked,
),
)
sendSettingsChangedBroadcast()
}
}
@@ -390,8 +415,9 @@ class SettingsActivity : Activity() {
settingsStore.getSideArrowLongPressAction(),
SideArrowLongPressAction::labelRes,
) { action ->
settingsStore.setSideArrowLongPressAction(action)
updateRepeatSpeedVisibility(action)
settingsStore.setSideArrowLongPressAction(action)
updateRepeatSpeedVisibility(action)
sendSettingsChangedBroadcast()
}
updateRepeatSpeedVisibility(settingsStore.getSideArrowLongPressAction())
}
@@ -429,6 +455,7 @@ class SettingsActivity : Activity() {
) {
lastValidRepeatSpeed = parsed
settingsStore.setSideArrowRepeatStepsPerSecond(parsed)
sendSettingsChangedBroadcast()
}
}
})
@@ -474,6 +501,7 @@ class SettingsActivity : Activity() {
if (parsed in NavButtonSettingsStore.MIN_DURATION_MS..NavButtonSettingsStore.MAX_DURATION_MS) {
lastValidDurationMs = parsed
settingsStore.setSideArrowLongPressDurationMs(parsed)
sendSettingsChangedBroadcast()
}
}
})
@@ -536,6 +564,7 @@ class SettingsActivity : Activity() {
lastValidRepeatSpeed = sanitized
if (persist) {
settingsStore.setSideArrowRepeatStepsPerSecond(sanitized)
sendSettingsChangedBroadcast()
}
}
@@ -590,6 +619,7 @@ class SettingsActivity : Activity() {
lastValidDurationMs = sanitized
if (persist) {
settingsStore.setSideArrowLongPressDurationMs(sanitized)
sendSettingsChangedBroadcast()
}
}
+8
View File
@@ -0,0 +1,8 @@
<resources>
<style name="Theme.NavButtons" parent="@android:style/Theme.DeviceDefault.DayNight">
<item name="android:windowActionBar">false</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowBackground">@drawable/bg_settings_window</item>
<item name="android:windowOptOutEdgeToEdgeEnforcement">true</item>
</style>
</resources>
-1
View File
@@ -3,6 +3,5 @@
<item name="android:windowActionBar">false</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowBackground">@drawable/bg_settings_window</item>
<item name="android:windowOptOutEdgeToEdgeEnforcement">true</item>
</style>
</resources>
-13
View File
@@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?><!--
Sample backup rules file; uncomment and customize as necessary.
See https://developer.android.com/guide/topics/data/autobackup
for details.
Note: This file is ignored for devices older that API 31
See https://developer.android.com/about/versions/12/backup-restore
-->
<full-backup-content>
<!--
<include domain="sharedpref" path="."/>
<exclude domain="sharedpref" path="device.xml"/>
-->
</full-backup-content>
@@ -1,19 +0,0 @@
<?xml version="1.0" encoding="utf-8"?><!--
Sample data extraction rules file; uncomment and customize as necessary.
See https://developer.android.com/about/versions/12/backup-restore#xml-changes
for details.
-->
<data-extraction-rules>
<cloud-backup>
<!-- TODO: Use <include> and <exclude> to control what is backed up.
<include .../>
<exclude .../>
-->
</cloud-backup>
<!--
<device-transfer>
<include .../>
<exclude .../>
</device-transfer>
-->
</data-extraction-rules>
@@ -1,3 +1,3 @@
minApiVersion=101
targetApiVersion=101
targetApiVersion=102
staticScope=true
@@ -4,4 +4,3 @@ com.android.systemui
com.android.launcher3
com.google.android.apps.nexuslauncher
com.sec.android.app.launcher
com.samsung.systemui.navillera