Repository navigation
v0.4.2
AltShift v0.4.2 — patch release for Android 8.0+ since v0.4.1. It resolves blocked or delayed input-method switches caused by active Android 14+ stylus handwriting sessions and strips proprietary Google Play dependency metadata from distributed APKs for clean sideload, F-Droid, and scanner inspection. Transliteration, hotkeys, onboarding, notifications, and battery-optimization behavior are unchanged.
🖊️ Stylus Handwriting Session Teardown
InputMethodSwitcher.resetStylusHandwritingSession(Context): Releases an active stylus handwriting session before switching IMEs. Returns early below Android 14 (API 34 /UPSIDE_DOWN_CAKE), leaving theminSdk 26path untouched.- IME & client teardown: Calls
InputMethodService.finishStylusHandwriting()directly when running on the IME context. From anActivity, posts to the decor view once a window token is attached and callsInputMethodManager.hideSoftInputFromWindow(token, 0)to dismiss sessions held by other keyboards such as Gboard. - Lifecycle & exception guards: Skips finishing/destroyed activities, missing window tokens, or unavailable
InputMethodManagerinstances, and wraps platform calls intry/catch (RuntimeException)withLog.wso device-specific handwriting implementations cannot crash switching. - Attach & picker integration:
KeyboardMonitor.applyKeyboardAttached()queues the teardown on the main handler upon hardware keyboard attach, andSwitchBackActivity.onCreate()runs it before opening the system IME picker so Gboard's handwriting window cannot suppress the picker.
📦 Clean APK Metadata
dependenciesInfodisabled:app/build.gradlesetsincludeInApk = falseandincludeInBundle = false, removing the proprietary Play PKDS metadata block from APK signatures and App Bundles.- Packaging-only scope: Application code, runtime dependencies, permissions, resources, and the
minSdk/targetSdkcontract are unchanged.
🧪 Build, Tests & Verification
- Version & docs:
versionCode 9,versionName '0.4.2'(AltShift-v0.4.2.apk/AltShift-v0.4.2-debug.apk). Toolchain unchanged (minSdk 26,targetSdk 34, Java 21, Gradle 8.9, AGP 8.7.3). Removed the hardcodedVersion-0.4.1badge fromREADME.md(retaining the dynamicReleasebadge);RELEASE-NOTES.mdstays local/untracked; no architecture, DI, storage, or model changes. - Automated checks:
./gradlew test lintDebugand./gradlew assembleDebugpassed (BUILD SUCCESSFUL), gated by the existingModelTest,TransliterationTableTest,ThemeModeTest, andKeyLabelFormatterTestJVM suites (no new instrumentation tests added). - Remaining manual checks: Android ≤13 early-return behavior, and verifying PKDS metadata removal via
apksigner verify --print-certs/ APK analyzer.
📥 Installation
| Asset | Description |
|---|---|
AltShift-v0.4.2.apk |
Release build, R8-minified, signed with the CI release keystore. |
AltShift-v0.4.2-debug.apk |
Debug build, unminified, signed with the local debug key. |
adb install -r AltShift-v0.4.2.apk
adb shell ime enable ru.b1sted.altshift/.service.HardwareInputService
adb shell ime set ru.b1sted.altshift/.service.HardwareInputServiceOptional provisioning grants:
adb shell pm grant ru.b1sted.altshift android.permission.WRITE_SECURE_SETTINGS
adb shell pm grant ru.b1sted.altshift android.permission.POST_NOTIFICATIONS
adb shell appops set ru.b1sted.altshift SYSTEM_ALERT_WINDOW allow
adb shell cmd deviceidle whitelist +ru.b1sted.altshiftNote: Debug and release APKs use different signing keys (
adb uninstall ru.b1sted.altshiftis required when switching between them). Uninstalling clearsaltshift_prefs,WRITE_SECURE_SETTINGS, and the battery exemption.
🔨 Building from Source
Requires JDK 21, Android SDK Platform 34 (Build-Tools 34.0.0), and sdk.dir in local.properties:
./gradlew test lintDebug assembleDebug
# Or signed release (with KEYSTORE_FILE / KEYSTORE_PASSWORD / KEY_ALIAS / KEY_PASSWORD or scripts/build-release.sh):
./gradlew assembleRelease⚠️ Notes & Limitations
- Android 14+ & owner/client scope:
finishStylusHandwriting()requires API 34+ (no-op on Android 8.0–13). AltShift finishes its own session directly, while third-party IMEs rely onhideSoftInputFromWindow()once a decor window token exists; OEM handwriting keyboards may vary and require device verification. - Packaging-only metadata change: Disabling
dependenciesInfostrips PKDS metadata without altering signing, permissions, or runtime behavior. - No v0.4.1 regressions or backup changes: Onboarding, notifications, transliteration, hotkeys, and Dynamic Island geometry are untouched, and
allowBackup="false"resets preferences on uninstall orpm clear.
🛡️ Security & Analysis (AltShift-v0.4.2.apk)
- VirusTotal: Scan report
- Pithus: Static analysis
Full Changelog: v0.4.1...v0.4.2