Commit graph

141 commits

Author SHA1 Message Date
okhsunrog
23e2ca292b Add package visibility hooks in system_server
Hides selected packages from selected caller UIDs at the PackageManagerService
Binder stub. Filters getInstalled{Packages,Applications}, queryIntent*,
resolve{Intent,Service}, get{Package,Application}Info, getPackageUid,
getPackagesForUid, getInstaller{PackageName,SourceInfo}. Hooks
IPackageManagerBase with PackageManagerService fallback.

Config via /data/system/vpnhide_hidden_pkgs.txt and
/data/system/vpnhide_observer_uids.txt with inotify live-reload. Callers
with UID < 10000 are exempt to avoid breaking installd / LauncherApps.
2026-04-15 14:55:26 +03:00
okhsunrog
cffb52776b Fix logcat collection — read directly without su
logcat via su runs as root and can't see app's own log entries on some
devices. Use Runtime.exec("logcat") directly instead, which reads the
app's own log buffer without needing READ_LOGS permission.
2026-04-15 14:17:32 +03:00
okhsunrog
3d138f914c chore: update-json for v0.5.3 2026-04-15 00:56:23 +03:00
okhsunrog
00a40db04c chore: bump version to v0.5.3 2026-04-15 00:49:37 +03:00
okhsunrog
1a1b69a3e3 Fix clang-format violations in kmod 2026-04-15 00:40:45 +03:00
okhsunrog
f67cb40925 Add debug logging toggle and diagnostic export
kmod: add /proc/vpnhide_debug toggle — writing "1" enables detailed
pr_info logging in all 6 kretprobe hooks (uid, target, interface name,
filter decisions). Disabled by default, zero overhead when off.

app: add "Collect debug log" button on Diagnostics screen. Enables
kmod debug, clears dmesg, runs all checks, captures dmesg, collects
device info, module status, targets, interfaces, /proc/net, kallsyms,
LSPosed config, root manager version, and logcat into a zip. Save to
disk or share via share sheet.

Also: remove unused kmod/symvers/, add kmod/*.lds to .gitignore.
2026-04-15 00:35:29 +03:00
okhsunrog
832b78c087 Split update-version.sh into two scripts
- scripts/update-version.sh — updates source files (module.prop, Cargo.toml, etc.)
- scripts/update-json.sh — generates Magisk/KSU update-json files

update-json must be committed AFTER the release is published to avoid
a race where Magisk sees a new version but the zip doesn't exist yet.
2026-04-14 17:36:26 +03:00
okhsunrog
8420965cd9 chore: bump version to v0.5.2 2026-04-14 17:03:50 +03:00
Danila Gornushko
a04d3748f3
Merge pull request #14 from okhsunrog/fix/ifconf-5.10
Fix SIOCGIFCONF filtering on kernel 5.10
2026-04-14 17:02:04 +03:00
okhsunrog
ca9773d14f Fix hardcoded v0.1.0 in customize.sh — read version from module.prop 2026-04-14 16:56:57 +03:00
okhsunrog
c1a1e37b73 Fix unsafe block in netlink_recv for Rust 2024 edition 2026-04-14 16:45:43 +03:00
okhsunrog
aa2d6c098c Fix SIOCGIFCONF filtering on kernel 5.10
dev_ifconf() changed its signature between 5.10 and 5.15:

  5.10:  dev_ifconf(struct net *, struct ifconf *ifc, int size)
         x1 = kernel pointer (caller did copy_from_user)
  5.15+: dev_ifconf(struct net *, struct ifconf __user *uifc)
         x1 = userspace pointer

The kretprobe handler assumed 5.15+ (copy_from_user on x1), which
silently failed on 5.10 because copy_from_user on a kernel pointer
returns EFAULT. This left SIOCGIFCONF unfiltered — tun0 visible.

Use LINUX_VERSION_CODE to select the right access method at compile
time. Each kmod build already targets a specific GKI generation, so
this is safe.

Reported by users on Android 12 (5.10) and Android 14 (non-GKI 5.10).
2026-04-14 16:14:14 +03:00
okhsunrog
14bdfd9650 Hook recv for netlink filtering on Android 10 (no SELinux block)
On Android 10 and devices with permissive SELinux, netlink RTM_GETLINK
is not blocked by sepolicy. The existing recvmsg hook covers most
callers (bionic getifaddrs, Java NetworkInterface), but code using
recv() goes through recvfrom via a bare branch — a different syscall
path. Hooking recvfrom directly breaks recv (shadowhook overwrites the
branch target), so we hook recv instead (12 bytes, safe for island mode).

Also switch diagnostic checks from recv to recvmsg so they go through
the hooked path, and add a separate recv-based check for full coverage.
2026-04-14 16:00:59 +03:00
okhsunrog
6590c8344f Fix zygisk first-launch race: dashboard waited on stale selfNeedsRestart
ensureSelfInTargets() and loadDashboardState() ran as independent
coroutines, so the dashboard could read selfNeedsRestart=false before
the init completed. On slower devices (Pixel 4a) this caused "Installed,
inactive" instead of the restart prompt.

- Make selfNeedsRestart nullable; show spinner until resolved
- Sync zygisk targets to module dir so next app fork picks them up
- Show "restart app to activate" instead of misleading "inactive"
- Add scripts/clean-device.sh for testing fresh installs via adb
2026-04-14 15:24:20 +03:00
okhsunrog
7f410432d4 Fix license badge: use static MIT badge 2026-04-14 03:48:08 +03:00
okhsunrog
ac597680dc Add Star History chart to README 2026-04-14 03:47:31 +03:00
okhsunrog
56c83f0fc3 Add badges to README 2026-04-14 03:44:58 +03:00
okhsunrog
8030c2b7c7 Fix module changelog: use raw markdown instead of HTML release page
KernelSU-Next and Magisk fetch the changelog URL and display it as text.
Pointing to the GitHub releases HTML page showed raw HTML tags.
Now points to a raw markdown file that renders correctly.
2026-04-14 03:30:04 +03:00
okhsunrog
b68fc25b2c Fix ktlint indentation in DashboardData 2026-04-14 03:07:02 +03:00
okhsunrog
64cc4be1f0 Add pre-commit hook for ktlint 2026-04-14 03:04:57 +03:00
okhsunrog
20bcbc3b3e Fix ktlint formatting in DashboardData 2026-04-14 03:03:32 +03:00
okhsunrog
5aadb0165b Rename APK artifact from vpnhide-lsposed to vpnhide 2026-04-14 03:00:10 +03:00
okhsunrog
0073ef7030 Fix false LSPosed warnings and improve target detection
- Detect LSPosed in all known module paths (zygisk_vector, zygisk_lsposed, lsposed)
- Skip LSPosed config warnings when hooks are already active at runtime
- Check all modules for empty targets, not just LSPosed
- Bump version to v0.5.1
2026-04-14 02:57:37 +03:00
okhsunrog
7e9c1def9c Add screenshots to README and rename branding to assets 2026-04-14 00:46:02 +03:00
okhsunrog
e5a85c5b7d chore: bump version to v0.5.0 2026-04-14 00:39:21 +03:00
Danila Gornushko
f6678868e5
Merge pull request #13 from okhsunrog/fix/hook-race-condition
Fix system_server crash: copy-on-write for writeToParcel hooks
2026-04-14 00:14:48 +03:00
okhsunrog
0d41f15ae6 Fix system_server crash: use copy-on-write instead of mutating shared objects
The writeToParcel hooks were mutating the real NetworkCapabilities,
NetworkInfo, and LinkProperties objects in beforeHookedMethod and
restoring them in afterHookedMethod. Between before and after, other
ConnectivityService threads could read the mutated object, causing
IllegalStateException in checkNrisConsistency ("This NRI is already
registered") and crashing system_server.

Fix: create a copy of each object, modify the copy, write the copy
to the Parcel, and skip the original writeToParcel via setResult(null).
The original object is never mutated. ThreadLocal re-entrancy guard
prevents infinite recursion when the copy's writeToParcel triggers
the same hook.
2026-04-14 00:09:48 +03:00
Danila Gornushko
4c859b21e8
Merge pull request #12 from okhsunrog/fix/zygisk-api-v2
Lower zygisk API from v5 to v2 for Magisk v27 compatibility
2026-04-14 00:04:14 +03:00
Danila Gornushko
325b2f0ce3
Merge pull request #11 from okhsunrog/feat/apps-ui
Rework Apps tab UI with search, filters, and fastscroller
2026-04-14 00:04:04 +03:00
okhsunrog
2d02ffc658 Lower zygisk API from v5 to v2 for Magisk v27 compatibility
Only get_module_dir() and set_option(DlCloseModuleLibrary) are used,
both available since v2. This fixes module loading on Magisk v27 which
does not support API v5.
2026-04-13 23:55:57 +03:00
okhsunrog
ee73ac09da Refactor: split MainActivity.kt and DashboardScreen.kt into focused files
- ShellUtils.kt: constants, suExec, suExecAsync, ensureSelfInTargets,
  cleanupStaleZygiskStatus
- AppPickerScreen.kt: AppEntry, InstalledModules, AppPickerScreen, AppRow,
  LayerChip, AppsHelpDialog, buildSaveCommand, buildUidResolver
- DashboardData.kt: domain types (ModuleState, LsposedState, ProtectionCheck,
  etc.), loadDashboardState, protection check functions
- MainActivity.kt: only Activity, theme, MainScreen navigation, root screens
- DashboardScreen.kt: only UI composables

No behavioral changes. MainActivity 981→343 lines, DashboardScreen 1363→623.
2026-04-13 23:50:49 +03:00
okhsunrog
c918e05f3f Rework Apps tab UI: search in TopAppBar, filter menu, fastscroller, Russian apps filter
- Move search to TopAppBar with expandable SearchBar (back arrow + clear)
- Replace hint card with help icon (?) in TopAppBar opening a dialog
- Add filter icon with dropdown menu (show system apps, Russian apps only)
- Add fastscroller with letter indicator on drag (fastscroller-material3)
- Sort app list alphabetically (was selected-first)
- Remove nested Scaffold to fix double top padding
- Add RussianAppFilter: detects Russian apps by package prefix (ru.*) and
  known company prefixes (Sberbank, Tinkoff, Yandex, VK, Ozon, etc.)
- Add JUnit tests for RussianAppFilter
2026-04-13 23:40:53 +03:00
okhsunrog
6f80892f24 Move update JSON files to update-json/ directory 2026-04-13 23:05:01 +03:00
Danila Gornushko
2eb13bedd5
Merge pull request #10 from okhsunrog/feat/app-update
Add app update check and changelog
2026-04-13 22:55:55 +03:00
okhsunrog
52373267dc Add app update check and changelog with version history
- UpdateChecker: check GitHub Releases API for newer APK, parse bundled
  changelog.json, post-update detection via SharedPreferences
- Dashboard: "Update available" card with download button, changelog dialog
  with icon arrow navigation shown after app update
- changelog.json: bilingual (en/ru) changelog for v0.5.0, 0.4.2, 0.4.1, 0.4.0
  with sections (added/changed/fixed)
- Extract compareSemver/normalizeVersion to shared UpdateChecker.kt
- Apps tab: replace checkbox with FilterChip next to search, reduce padding
2026-04-13 22:44:55 +03:00
okhsunrog
8f522166ee Add Magisk/KSU auto-update support via updateJson
- update-version.sh generates per-KMI update JSON files for kmod and one
  for zygisk, pointing to GitHub Release artifacts
- CI injects updateJson URL into module.prop before packaging zips
- module.prop in repo stays clean (no updateJson), CI appends it per-variant
- Update version mismatch issue texts to direct users to KernelSU/Magisk
  Modules for updating
- Fix versionName/versionCode back to 0.4.2 (was accidentally 0.4.3 from
  test bump)
2026-04-13 21:15:35 +03:00
Danila Gornushko
d0730496c9
Merge pull request #9 from okhsunrog/feat/dashboard
Add dashboard with diagnostics, per-layer app toggles, and install recommendations
2026-04-13 21:07:17 +03:00
okhsunrog
f66ef2e638 Update README for new dashboard UI and fix CI lint
- Rewrite install instructions: app-first flow with Dashboard recommendation
- Document per-app L/K/Z layer toggles and Zygisk caveat
- Describe full diagnostics system (module status, LSPosed config validation,
  version mismatch detection, native install recommendation, live protection
  checks)
- Add shell configuration in collapsible section for advanced users
- Sync EN and RU versions
- Fix signing config crash when keystore.properties is missing (CI lint job)
2026-04-13 20:58:47 +03:00
okhsunrog
14af7b7ec4 Rework Apps tab UI and fix lint issues
- Replace top bar filter icon with inline "Show system apps" checkbox
- Add hint card explaining L/K/Z layer toggles and Zygisk caveat
- Move showSystem state inside AppPickerScreen
- Fix RELEASE_OR_CODENAME lint error (requires API 30, min is 29)
- Mark technical check strings as translatable="false"
- Add Android lint step to CI
- Apply ktlint formatting
2026-04-13 20:48:26 +03:00
okhsunrog
a260670450 Add native module install recommendation 2026-04-13 20:33:34 +03:00
okhsunrog
1e2b43a446 Improve LSPosed dashboard status and copy 2026-04-13 20:23:01 +03:00
okhsunrog
191b3ad4b8 Fix module version mismatch copy 2026-04-13 19:13:22 +03:00
okhsunrog
f1df811cca Add zygisk runtime status and module version checks 2026-04-13 19:07:46 +03:00
okhsunrog
61589878a6 fix targets adding and filtering logic 2026-04-13 18:39:51 +03:00
okhsunrog
cf307cb416 feat: LSPosed version display and mismatch detection
HookEntry uses BuildConfig.VERSION_NAME instead of unreliable reflection
to write version to the status file. Dashboard shows "Running module
version: X.Y.Z" in the LSPosed card, and warns in Issues when the
running module version differs from the installed app version (reboot
needed to apply update).

Bump to 0.4.3.
2026-04-13 18:13:17 +03:00
okhsunrog
25e7d1d1be feat: add dashboard, per-component target lists, LSPosed status detection
Dashboard as new landing screen with module status cards (kmod, zygisk,
LSPosed), aggregated protection checks (native + Java API), and issue
alerts. Uses sealed types for type-safe state modeling (invalid states
are unrepresentable).

Three separate target lists: kmod, zygisk, and lsposed each have
independent targets.txt. Users can configure per-app which layers
protect it (L/K/Z chips in app picker). Service.sh scripts decoupled —
each resolves only its own component, with migration from unified lists.

HookEntry writes /data/system/vpnhide_hook_active with version and
boot_id so the app can detect if LSPosed hooks are active this boot.

VPN Hide app auto-adds itself to all target lists for self-diagnostics.
If just added, shows "restart needed" instead of stale check results.
App hides itself from the app picker and target counts.

Diagnostics tab no longer runs checks without VPN — shows banner only.
Removed "Run All" button (results are cached per process lifetime).

Splash screen follows system dark/light theme via Material3 DayNight.
2026-04-13 18:03:25 +03:00
Danila Gornushko
42c9717445
Merge pull request #8 from okhsunrog/drop-webui
Drop WebUI and action.sh from kmod and zygisk
2026-04-13 16:33:47 +03:00
okhsunrog
9ba7bfb127 refactor: drop WebUI and action.sh from kmod and zygisk modules
The VPN Hide app is now the sole UI for target management. WebUI was
KernelSU-Next-only and redundant since the app works on both KSU and
Magisk. Remove webroot/, action.sh, and all references across docs,
install scripts, module descriptions, and code comments.
2026-04-13 16:28:39 +03:00
okhsunrog
fc21377d6e docs: remove test-app references from READMEs, update component descriptions 2026-04-13 16:17:10 +03:00
okhsunrog
9c129dac1c feat: add chameleon mascot branding and app icon
- Add branding/ directory with logo.png and icon-512.png
- Replace default app icon with chameleon-in-hoodie adaptive icon
  (all densities: mdpi through xxxhdpi + monochrome)
- Update both READMEs with centered logo and title (floppa-vpn style)
2026-04-13 16:09:27 +03:00