Repository navigation
KsuWebUI-SN 1.2-31
·
43 commits
to main
since this release
Tip
Highlights: you can now turn a module on or off right from the list (with a reboot prompt), modules show an Update available badge when a newer version exists, cards show the module's version code, and a new ℹ️ Information screen in the settings drawer explains every option and icon.
✨ New
- Module on/off switch: every module card now has a switch at the end of the bottom row. Turning it off marks the module as disabled, turning it on enables it again. The change takes effect after a reboot, so the app then asks Reboot now or Later. If you flip the same module back before rebooting, the pending change is cancelled and no reboot is asked. If the change fails you get a "Couldn't change the module state" message.
- Update available badge: if a module's
module.prophas a numericversionCodeand anupdateJsonlink, the app checks that link in the background when the list loads. When the module's published version code is higher than the installed one, its card shows a green Update available badge. Checks that fail or time out are ignored quietly. - Version code on cards: a "Version code: …" line now appears under the version on cards of modules that declare a
versionCode. - Information screen: a new ℹ️ button next to Settings in the drawer opens a short guide. It explains Theme, Module Banners, Module Icons, Disabled Modules and Hidden Modules, and what each card icon and button means (disabled, hidden, update, pinned, settings gear, switch).
🔁 Changed
- Status labels on cards: a module with one status still shows it as text (red Disabled or Hidden in place of the date, or the green Update available badge). A module with more than one status now shows small icons instead of the old combined "Disabled · Hidden" text, so the row no longer overflows.
- Card bottom row: the settings gear moved to the start of the row, the size and date (or status) chips are centered in the space between the gear and the switch, and the switch sits at the end.
- Translations: all the new texts are translated in Arabic, French, Polish, Japanese and Simplified Chinese.
🌍 For translation contributors
Translating the app (Click to expand)
- Guided translation:
scripts/add_language.py <code>now walks you through the translation. It createsvalues-<code>/strings.xmlwith every string marked<!-- TODO translate -->, shows each English string, and you type the translation and press Enter. - Skip and quit: Enter alone skips a string, and
quit_translatesaves and quits. - Saved as you go: every answer is written to the file straight away. Run the same command again to continue with the strings still marked.
- Safety checks: placeholders like
%sand%1$dmust match the English text, and special characters are escaped for you. A table of what you translated is shown at the end. - Old behaviour:
--create-onlyjust creates the file so you can edit it by hand. - Docs: the English README and the translated ones in
docs/describe the new flow. - Checking: run
python3 scripts/check_strings.pywhen you are done.
⚙️ Under the hood
For developers ⚠️ (Click to expand)
Module switch (MainActivity.kt)
setModuleEnabled(item, enable): runstouchorrm -fon/data/adb/modules/<id>/disablethroughShell.cmdonApp.executor, with single quotes in the id escaped. The switch is disabled while the command runs, then the card is rebuilt from the new state. On failure it showsmodule_toggle_failed.- Pending reboot tracking:
markPendingReboot(id)keeps the ids changed since boot in thepending_rebootstring set (KEY_PENDING_REBOOT) and stores the current/proc/sys/kernel/random/boot_idunderpending_boot_id(KEY_PENDING_BOOT). A different boot id clears the set. Toggling an id a second time removes it, and the reboot prompt is only shown while the change still needs a reboot. showRebootPrompt(enabled): uses a newshowConfirmoverload that takesCharSequencetitle and message plus custom Yes / No labels (reboot_nowand the existingupdate_later). The oldshowConfirm(icon, title, message, onYes)now calls it.
Module updates
ModuleUpdateChecker.kt(new):latestVersionCode(url)only accepts links starting withhttp, uses a 6 second connect and read timeout, sendsUser-Agent: KsuWebUI-SN, accepts HTTP 200 only, reads at most 256 KB and returns the trimmedversionCodefield of the JSON as aLong, ornullon any problem.checkModuleUpdates(mods): runs after the list is built. It only checks modules with a numericversionCodeand anupdateJsonlink, at most 4 requests at a time (Semaphore(4)), and callssetModuleUpdate(id)on the main thread when the remote code is higher.Moduledata class: new fieldsversionCode,updateJsonandupdateAvailable. Themodule.propparser now readsversionCodeandupdateJson.
Card layout (item_module.xml, onBindViewHolder)
- New views:
version_codeTextView,toggle(MaterialSwitch, scaled to 0.85), and the chipsmodule_update,status_disabled,status_hiddenandstatus_update. The three status chips are icon-only and are only used when a module has more than one status. - Status logic:
statusCountcounts disabled, hidden and update. Zero shows the date, one shows text (or the update chip), more than one shows the icon chips and hides the date chip. - Layout: the settings gear moved to the start of the bottom row. The chip group is wrapped in a
FrameLayoutwithlayout_weight="1"and the group centered inside it.
Information screen
showInfoDialog(): builds the dialog from the newdialog_info.xml,item_info_header.xmlanditem_info_row.xml, opened by the newdrawer_infobutton inactivity_main.xml(the Settings title row is now a horizontal row with the button at the end).- Resources: new drawables
ic_info,ic_blockandic_update, and colorsupdate_chip(#1E8E3E,#5BD982in night),update_chip_text(#FFFFFF,#00210Bin night) andstatus_red(#E53935). - Strings: 25 new strings (
version_code,module_update_available,module_toggle,module_toggle_failed,reboot_to_enable,reboot_to_disable,reboot_to_apply_message,reboot_now,info_title,info_closeand theinfo_*texts) in English, Arabic, French, Polish, Japanese and Simplified Chinese.check_strings.pypasses and noTODO translatemarkers are left.