5 Commits
Author SHA1 Message Date
ajp_anton 6b11e76504 Release 2.1 2026-06-23 13:19:55 +00:00
ajp_anton 60769980cd Improve AOSP side arrow support 2026-06-23 13:04:42 +00:00
ajp_anton c2ee5a5581 Support AOSP API 34 and Google APIs 2026-06-22 22:05:36 +00:00
ajp_anton 465dec356d Add AOSP side arrow support 2026-06-22 18:26:12 +00:00
ajp_anton 1fc63aef8d Add initial AOSP button support 2026-06-22 11:31:13 +00:00
7 changed files with 1349 additions and 31 deletions
+21 -4
View File
@@ -13,16 +13,33 @@ It lets you choose what should happen when Back, Home, or Recents is pressed or
- Kill the foreground app.
- Toggle auto-rotate.
- Toggle the flashlight.
- Add optional side-arrow buttons for moving the text cursor left and right.
- Configure side-arrow long-press behavior, including repeated cursor movement.
- Test long-press durations from the settings screen.
## Requirements
- Android device using three-button navigation.
- LSPosed.
- Xposed API 101 or newer.
- The module enabled for System UI.
- LSPosed with Xposed API 101 or newer.
- Android 14 / API 34 or newer.
- The module enabled for the relevant navigation packages.
This has only been tested on a Samsung Galaxy Z Fold5 running One UI 8.0 / Android 16. Compatibility may vary between Android versions and vendor System UI implementations.
The module declares scope entries for:
- `android` and `system`, used for privileged actions such as killing the foreground app.
- `com.android.systemui`, used for phone navigation bars.
- `com.android.launcher3` and `com.google.android.apps.nexuslauncher`, used for AOSP/Google taskbar navigation.
- `com.sec.android.app.launcher` and `com.samsung.systemui.navillera`, used for Samsung/One UI navigation.
## Tested On
- Samsung Galaxy Z Fold5 running One UI 8.0 / Android 16 with Magisk and LSPosed.
- AOSP emulator API 34 / Android 14 with Magisk and LSPosed.
- AOSP emulator API 35 / Android 15 with Magisk and LSPosed.
- AOSP emulator API 36 / Android 16 with Magisk and LSPosed.
- Android 16 Google APIs emulator with Magisk and LSPosed.
The emulator tests covered button press overrides, long-press overrides with custom duration, side-arrow visibility, side-arrow tinting, enabling/disabling side arrows, and side-arrow long-press repeat behavior where supported by the emulator navigation implementation. Actual device testing with others than the Galaxy Z Fold 5 has not been done. Compatibility may vary between Android versions and vendor System UI / launcher implementations.
## AI Assistance
+1 -1
View File
@@ -54,7 +54,7 @@ android {
defaultConfig {
applicationId = "se.ajpanton.navbuttons"
minSdk = 35
minSdk = 34
targetSdk = 35
versionCode = project.findProperty("nbVersionCode")?.toString()?.toIntOrNull() ?: 1777070659
versionName = project.findProperty("nbVersionName")?.toString() ?: "0.3"
+5
View File
@@ -3,6 +3,11 @@
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES" />
<queries>
<package android:name="org.lsposed.manager" />
</queries>
<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
@@ -7,6 +7,7 @@ import android.view.ViewConfiguration
import androidx.annotation.StringRes
import io.github.libxposed.service.XposedService
import io.github.libxposed.service.XposedServiceHelper
import java.util.UUID
enum class NavButtonId(
val preferencePrefix: String,
@@ -68,6 +69,7 @@ class NavButtonSettingsStore(context: Context) {
)
init {
ensurePrivilegedActionToken()
registerRemotePreferencesListener(localPreferences)
}
@@ -197,6 +199,15 @@ class NavButtonSettingsStore(context: Context) {
}
}
private fun ensurePrivilegedActionToken() {
if (localPreferences.contains(KEY_PRIVILEGED_ACTION_TOKEN)) {
return
}
writeToPreferences(localPreferences, System.currentTimeMillis()) {
putString(KEY_PRIVILEGED_ACTION_TOKEN, UUID.randomUUID().toString())
}
}
private fun writeToPreferences(
preferences: SharedPreferences,
updatedAtMs: Long,
@@ -220,6 +231,7 @@ class NavButtonSettingsStore(context: Context) {
const val KEY_SIDE_ARROW_LONG_PRESS_ACTION = "side_arrow_long_press_action"
const val KEY_SIDE_ARROW_REPEAT_STEPS_PER_SECOND = "side_arrow_repeat_steps_per_second"
const val KEY_SIDE_ARROW_LONG_PRESS_DURATION_MS = "side_arrow_long_press_duration_ms"
const val KEY_PRIVILEGED_ACTION_TOKEN = "privileged_action_token"
private const val KEY_LAST_UPDATED_AT_MS = "last_updated_at_ms"
const val MIN_DURATION_MS = 100
@@ -358,6 +370,12 @@ class NavButtonSettingsStore(context: Context) {
editor.remove(KEY_SIDE_ARROWS_ENABLED)
}
if (source.contains(KEY_PRIVILEGED_ACTION_TOKEN)) {
editor.putString(KEY_PRIVILEGED_ACTION_TOKEN, source.getString(KEY_PRIVILEGED_ACTION_TOKEN, null))
} else {
editor.remove(KEY_PRIVILEGED_ACTION_TOKEN)
}
if (source.contains(KEY_LAST_UPDATED_AT_MS)) {
editor.putLong(KEY_LAST_UPDATED_AT_MS, source.getLong(KEY_LAST_UPDATED_AT_MS, 0L))
} else {
File diff suppressed because it is too large Load Diff
@@ -1,4 +1,7 @@
android
system
com.android.systemui
com.android.launcher3
com.google.android.apps.nexuslauncher
com.sec.android.app.launcher
com.samsung.systemui.navillera
+1 -1
View File
@@ -1 +1 @@
version=2.0
version=2.1