Repository navigation
v0.3.2
AltShift v0.3.2 — the first public release of AltShift for Android 8.0+, packaging the complete feature set accumulated across v0.1–v0.3.1. It delivers signed release distribution, deterministic build artifacts, an allocation-free Russian ЙЦУКЕН transliteration pipeline, event-driven automatic IME switching, a fullscreen onboarding wizard, and Light/Dark/System themes in pure Java 21 with zero Kotlin, DI, or cloud telemetry.
⌨️ Russian Transliteration & Input Pipeline
- Allocation-free
TransliterationTable: Maps key codes to Cyrillic via primitive-indexed static arrays, resolving Shift and CapsLock at lookup time without iterators, string concatenation, or runtime allocations on the typing path. - Full Russian PC layout & CapsLock isolation: Emulates desktop ЙЦУКЕН punctuation and the physical number row (
!,",№,;,%,:,?,*,(,)). CapsLock inversion applies strictly to alphabetic keys while keeping digits and symbols unaffected. - Language toggle & app hotkeys:
Alt + Shifttoggles Russian mode by default (captured from the next physical combination in UI, matched in either modifier order, bypassing OS subtype switching). Application hotkeys match modifier masks + key codes on initial key-down (repeatCount == 0) via launcher intents before transliteration. - Pass-through & fail-safe service: Unmapped/out-of-range keys, Ctrl/Meta chords, and events when Russian mode is off pass through unchanged. External intents,
InputConnectioncalls, and device lookups are guarded so IME exceptions cannot take down system input.
🔄 Automatic IME Switching
- Physical keyboard detection & foreground monitor:
KeyboardPresenceMonitorchecksKEYBOARD_NOKEYS/hardKeyboardHiddenand enumeratesInputManagerdevices (excluding virtual and touchscreen-only devices;KEYBOARD_TYPE_ALPHABETICon API 29+).KeyboardSwitchServiceruns as an event-drivenspecialUseforeground service listening toInputDeviceListenercallbacks rather than polling. - Secure-settings switching & fallbacks: With
WRITE_SECURE_SETTINGS,InputMethodSwitcherupdatesSettings.Secure.DEFAULT_INPUT_METHODdirectly, remembers the previous soft keyboard, and restores it on detach. Without it, AltShift falls back to a one-tap reconnection notification or the system picker (previous/nextguarded to API 28+). - Soft-keyboard suppression & reboot recovery:
onShowInputRequested()returnsfalsewhile a physical keyboard is attached;BootReceiverrestartsKeyboardSwitchServiceafterBOOT_COMPLETEDwhen auto-switching is enabled andWRITE_SECURE_SETTINGSis granted.
🎨 Onboarding, UI & Architecture
- Fullscreen onboarding & Material 3 dashboard: A three-step wizard verifies IME enablement, active selection, overlay access, and runtime
POST_NOTIFICATIONS(Android 13+) with one-tap actions and hardened notification icons. Native XML views provide a toolbar status badge, language-shortcut card, auto-switch controls, hotkey list, key-capture dialog, andRecyclerViewapp picker, with persisted Light/Dark/System themes (root overdraw removed). - Pure Java 21 & zero-bloat storage: Uses AppCompat, Material 3,
RecyclerView,SharedPreferences, andorg.jsononly—no Kotlin, Compose, DI, or annotation processors. All settings and hotkeys stay strictly local per package, vanish on uninstall, and guard platform calls individually against OEM restrictions.
🧪 Build, CI/CD & Tests
- Signed CI & deterministic artifacts:
versionCode 5,versionName '0.3.2'(minSdk 26,targetSdk 34, Java 21, Groovy DSL, pinned Gradle wrapper).applicationVariantsnames outputsAltShift-v0.3.2.apkandAltShift-v0.3.2-debug.apk. GitHub Actions (actions/setup-java@v5, Temurin 21, Gradle cache) decodesKEYSTORE_BASE64intoapp/release.jks(always removed in cleanup), builds both variants, uploads artifacts, and publishes tags viasoftprops/action-gh-release. Added git-ignored local wrapper templatescripts/build-release.sh.example. - JVM test suite: Covers
TransliterationTable(lower/upper letters, CapsLock inversion on letters vs isolation on digits/symbols, punctuation, Russian number row, null/out-of-range keys), hotkey matching (modifier masks, order equivalence, language shortcut, null package, unknown key codes, persistence round-trips),KeyLabelFormatter, andThemeModeparsing/fallbacks.
📥 Installation
| Asset | Description |
|---|---|
AltShift-v0.3.2.apk |
Signed release build — recommended. |
AltShift-v0.3.2-debug.apk |
Debug build signed with the local debug key. |
adb install -r AltShift-v0.3.2.apk
adb shell ime enable ru.b1sted.altshift/.service.HardwareInputService
adb shell ime set ru.b1sted.altshift/.service.HardwareInputServiceOptional autonomous switching (also configurable via Settings → System → Languages & input → On-screen keyboard):
adb shell pm grant ru.b1sted.altshift android.permission.WRITE_SECURE_SETTINGSNote: Distributed via GitHub Releases (not Google Play). Debug and release APKs use different signing keys—uninstall the debug build (
adb uninstall ru.b1sted.altshift) before switching, which also clears local configuration.
🔨 Building from Source
Requires JDK 21, Android SDK Platform 34, and Build-Tools 34.0.0, with sdk.dir in local.properties:
./gradlew assembleDebug
# Or signed release (with KEYSTORE_FILE / KEYSTORE_PASSWORD / KEY_ALIAS / KEY_PASSWORD or scripts/build-release.sh):
./gradlew assembleRelease⚠️ Notes & Limitations
- No on-screen keyboard: AltShift does not draw a soft keyboard; use the system IME or automatic fallback when no physical keyboard is attached.
- Permission-scoped switching: Without
WRITE_SECURE_SETTINGS, automatic switching is limited to the reconnection notification prompt or the system keyboard picker. - App picker scope: Only components with a launcher activity appear in the application picker for hotkey binding.
- Incompatible signing keys: Release builds cannot update a debug installation in place without uninstalling first.
🛡️ Security & Analysis (AltShift-v0.3.2.apk)
- VirusTotal: Scan report
- Pithus: Static analysis
Full Changelog: v0.1...v0.3.2