Repository navigation
WaEnhancer Community 0.0.5
WaEnhancer Community 0.0.5
SHA-256: 709904ab115196f3c780d9412e9286ac496fd0131a8affa34bc765e9ecf0aa45
Changes since v0.0.4.
What's changed
- #47 Fix late review findings from PRs #45 and #46
- #48 refactor: stage removal of New XSharedPreferences
- #49 refactor: remove deprecated New XSharedPreferences metadata
- #50 fix: unify Freeze Last Seen state across UI controls
- #51 fix: make runtime diagnostics reflect exercised hooks
Full changelog
This section compiles the descriptions of the pull requests included in this release.
#47 — Fix late review findings from PRs #45 and #46
Merged by contribution from @igorcv88.
Applies the two still-valid Codex review findings left after PRs #44–#46 were merged.
- PR #45 P2: the direct HideSeen/read-receipt enforcement now preserves
VIEW_ONCE_TYPEwhen the raw incoming message is view-once, matching the existing job/dispatch/protocol paths. Receipt suppression happens before classification so a future classification failure cannot leak a read receipt. - PR #46 P1: WhatsApp startup no longer depends on an empty/private
XSharedPreferencesbefore the provider fallback exists.DeferredProviderSharedPreferencesstays on the legacy store only untilFeatureLoaderreceives the hostApplication, then hydrates the UID-validatedProviderSharedPreferencesbefore the first startup preference decision (show_hook_toast, Bootloader Spoofer, custom supported versions,bypass_version_check, etc.).
The Android 17 manager fix from PR #46 remains intact: this does not restore MODE_WORLD_READABLE or the global ContextImpl.checkMode() bypass.
CI should validate :app:testWhatsappDebugUnitTest :app:assembleWhatsappDebug before merge.
#48 — refactor: stage removal of New XSharedPreferences
Merged by contribution from @igorcv88.
Objective
Prepare WaEnhancer Community for LSPosed's announced removal of New XSharedPreferences (NSP) without combining this work with the postponed libxposed/resource-hook migration.
This is deliberately Phase 1 of 2. It removes the runtime dependency on XSharedPreferences and stages preference data for a safe metadata transition, but intentionally keeps xposedminversion=93 and xposedsharedprefs=true for this transition build.
Device validation completed
Phase 1 has now been tested on-device:
- existing WaEnhancer settings remained applied in WhatsApp;
- changing settings in the WaEnhancer app propagated to WhatsApp normally;
- no behavioral regression was noticed during random preference toggles;
- the staged migration snapshot was confirmed at
/data/user/0/com.waenhancer.community/files/nsp_preferences_v1.json(about 16 KB).
This validates the provider-only runtime path and confirms that the Phase-2 restore source exists on the tested installation.
Why this is staged
LSPosed's NSP mode redirects the module's SharedPreferences directory. Simply removing xposedsharedprefs / lowering xposedminversion in the same build would make existing public and private stores move back to the normal app data directory and can make an existing installation appear to have lost its settings.
Users must therefore run a Phase-1 build at least once before Phase 2 removes the NSP metadata.
Phase 1 changes
- runtime WhatsApp preferences now use the existing UID-validated
HookProvider/ProviderSharedPreferencesbridge as the authoritative path WppXposedno longer constructs or readsXSharedPreferencesDeferredProviderSharedPreferencesno longer requires an XSP fallback; it returns defaults only before the hostApplicationexists and hydrates from the provider onceFeatureLoader.mAppis availableXPrefManagerno longer reflectively creates XSharedPreferencesFeature.reloadPrefs()is transport-agnostic- removed the unused preference parameter from the system-server downgrade patch
- added
NspPreferenceMigration, which captures typed copies of both public and private preference stores intofilesDir/nsp_preferences_v1.json - the snapshot is refreshed after preference changes and kept outside the redirected SharedPreferences directory
- future restore is wired into both
Application.onCreate()andHookProvider.onCreate()so the first post-NSP provider request cannot observe an empty store - after a successful Phase-2 restore, the snapshot is deleted because it can contain private-store secrets
Intentionally unchanged in this PR
xposedminversionremains 93xposedsharedprefsremains true- legacy Xposed entrypoints remain unchanged
IXposedHookInitPackageResources/ resource hooks remain unchanged- no libxposed API 101/102 migration
Therefore the LSPosed deprecation banner is expected to remain for this Phase-1 build.
Phase 2
A separate stacked branch/PR performs the metadata cut only after this validated Phase-1 state:
- set
xposedminversion=82 - remove
xposedsharedprefs - restore the staged snapshot into normal app-private SharedPreferences on first start
- verify the LSPosed deprecation banner disappears while legacy/resource hooks remain untouched
Build checks
./gradlew :app:testWhatsappDebugUnitTest :app:assembleWhatsappDebugDo not merge Phase 2 into this PR. Keeping the metadata transition separate is the rollback/data-preservation boundary.
#49 — refactor: remove deprecated New XSharedPreferences metadata
Merged by contribution from @igorcv88.
Objective
Complete Phase 2 of the staged New XSharedPreferences (NSP) removal after Phase 1 was merged and validated on-device.
Device validation from Phase 1
The merged Phase-1 build was installed over the existing module and verified to keep all previously applied settings working. Random preference changes in the WaEnhancer app propagated to WhatsApp normally, with no observed behavioral regression. The migration snapshot was also confirmed at:
/data/user/0/com.waenhancer.community/files/nsp_preferences_v1.json
with a size of about 16 KB.
That means the provider-only runtime preference path and the migration source are both present on the tested installation.
Phase 2 change
This PR intentionally contains only the LSPosed metadata cut:
xposedminversion: 93 -> 82- remove
xposedsharedprefs=true
No resource hooks, legacy entrypoints, Xposed method hooks, libxposed APIs, Gradle configuration, or application logic are changed in this PR.
Why the change is now safe
Phase 1 already moved runtime preference transport to the UID-validated HookProvider / ProviderSharedPreferences path and stopped WppXposed, XPrefManager, and the deferred runtime wrapper from constructing XSharedPreferences.
NspPreferenceMigration stores the previous NSP-backed public/private preference state in filesDir, which is outside the redirected SharedPreferences directory. With NSP no longer declared, startup detects the transition and restores that staged snapshot into the normal app-private SharedPreferences stores. Restore is wired through both HookProvider.onCreate() and Application.onCreate() so the first post-upgrade access cannot observe an empty provider store merely because WhatsApp starts before the companion app.
Intentionally not included
There are a couple of legacy compatibility checks elsewhere that reference the old XSharedPreferences class with instanceof. They are no longer the active preference transport. They are left untouched here because XSharedPreferences itself belongs to the old legacy Xposed API (including API 82); the feature LSPosed is deprecating is the New XSharedPreferences semantics/metadata, not the existence of every legacy class reference. Keeping this PR to the metadata cut makes any runtime regression attributable and reversible.
Expected result
- existing settings survive the first upgrade from the Phase-1 build;
- runtime preference reads/writes continue through the provider bridge;
- module remains a legacy Xposed module;
IXposedHookInitPackageResourcesbehavior is unchanged;- the LSPosed "uses features that will be deprecated" banner should disappear if the support-channel guidance is correctly understood.
Required device validation
- Install this Phase-2 APK over the already-tested Phase-1 build.
- Open WhatsApp and confirm existing WaEnhancer settings are still active.
- Open the WaEnhancer manager and confirm saved values are still present.
- Change a manager setting and verify WhatsApp receives it.
- Change an embedded WhatsApp WaEnhancer setting and verify it persists back to the manager.
- Restart WhatsApp and re-check behavior.
- Confirm the LSPosed deprecation banner disappears while the module is still labeled
legacy. - Re-check any private/provider-backed feature you use, especially Tasker/secrets/Bootloader Spoofer.
After a successful restore, the staged snapshot is deleted by the migration helper because it can contain data from the private store.
CI
./gradlew :app:testWhatsappDebugUnitTest :app:assembleWhatsappDebug#50 — fix: unify Freeze Last Seen state across UI controls
Merged by contribution from @igorcv88.
Problem
Freeze Last Seen had two independent state keys:
freezelastseenin the Companion / embedded settingsfreeze_last_seen_actualin the WhatsApp home menu and Quick Settings tile
The runtime hook accepted either key, but the home-menu key is not part of the provider-backed preference schema. After the provider-only preference migration, toggling Freeze Last Seen from the WhatsApp menu could appear to work until restart and then return to OFF. Enabling freezelastseen from the Companion also caused show_freezeLastSeen to be disabled and automatically unchecked, so the WhatsApp menu item disappeared.
Fix
- use
freezelastseenas the single Freeze Last Seen state key in the hook, WhatsApp home menu and Quick Settings tile - keep
show_freezeLastSeenexclusively as the display-control preference - preserve the checked value of
show_freezeLastSeenwhile it is temporarily disabled by the active Freeze Last Seen dependency, instead of clearing it - apply the same display-toggle behavior in both Companion and embedded WhatsApp settings
- remove obsolete direct
freeze_last_seen_actualhandling from the Freeze Last Seen hook
Expected behavior
With Show Freeze Last Seen Button enabled:
- menu shows
Freeze Last Seen (OFF)while the feature is off - toggling it from WhatsApp persists
freezelastseen=true, restarts WhatsApp, and the menu returns asON - toggling it off returns the same menu item as
OFF - enabling/disabling Freeze Last Seen in the Companion is reflected by the WhatsApp menu after restart
- the Quick Settings tile reflects and changes the same state
Ghost Mode behavior remains able to activate the Freeze Last Seen hook independently as before.
Validation
Run:
./gradlew :app:testWhatsappDebugUnitTest :app:assembleWhatsappDebugDevice smoke test should cover Companion -> menu, menu -> Companion, ON -> OFF, OFF -> ON, restart persistence, embedded settings, and the Freeze Last Seen Quick Settings tile.
#51 — fix: make runtime diagnostics reflect exercised hooks
Merged by contribution from @igorcv88.
Problem
The functional diagnostics/validation screen was effectively static even when hooks were visibly working on-device.
The root causes were infrastructure bugs rather than user testing:
RuntimeDiagnostics.initialize(...)existed but was never called, so snapshots never received the host package/version, module version or Xposed API identity thatValidationSessionrequires.HostCompatibility.probe()produced the authoritativeprobeDefinitive=trueresult, but no runtime path ever called it.ValidationSession.isCurrentSnapshot()therefore rejected every snapshot as non-current.- normal feature
loadedevents were kept only in the in-process JSON becauseRuntimeDiagnostics.feature()persisted onlytriggered/error events. - the validation model treated missing
resolverPassedbookkeeping asRESOLVER_FAILEDand requiredloaded + installed + triggeredfor required features, even though the normal non-lazyFeatureLoadernever recordsresolverPassed/installedthe way the lazyFeatureRegistrydoes. - only a few features actually emitted
diagnosticTriggered(). In particular,ViewOnceandFreezeLastSeencould never becomeTRIGGEREDregardless of how often they were exercised.
Fix
- initialize the runtime snapshot exactly once from the first normal
Featureconstruction, after DexKit is available - run the authoritative semantic
HostCompatibility.probe()once and record unexpected probe failures explicitly instead of leaving a blank/non-definitive snapshot - debounce/persist all runtime evidence, including
loaded, so the Companion can actually observe it without synchronous Binder I/O on hook hot paths - treat a real callback execution as stronger evidence than optional installation bookkeeping: a hook that actually fires is reported as
TRIGGEREDeven if the normal loader did not emitresolverPassed/installed - distinguish an explicit
resolverFailedevent from merely absent resolver metadata - instrument the real effect paths for:
ViewOnce— records only when the hook actually changes an incoming view-once stateFreezeLastSeen— records when the replacement callback actually suppresses the host last-seen update
- show runtime snapshot age in the report so it is visible whether new evidence is reaching the Companion
- extend
ValidationModelTestfor callback-authoritative evidence and explicit resolver failures
Existing callback diagnostics for HideSeen, AntiRevoke, and DownloadViewOnce are preserved and now have a valid/persisted runtime snapshot to write into.
Semantics
This does not mark every feature validated automatically.
NOT_EXERCISEDmeans there is no real callback evidence yet.TRIGGEREDmeans an instrumented hook callback actually executed during the active validation session.- manual behavior confirmation remains separate where required.
- missing bookkeeping is no longer mislabeled as resolver failure.
- actual probe/resolver failures remain failures.
Device validation
After installing this build and restarting WhatsApp:
- open Diagnostics and start a WhatsApp validation session;
- exercise View Once ->
ViewOnceshould becomeTRIGGERED; - save view-once media ->
DownloadViewOnceshould becomeTRIGGERED; - enable/use Freeze Last Seen ->
FreezeLastSeenshould becomeTRIGGERED; - exercise Hide Seen / Anti-Revoke as applicable -> their existing callback evidence should update;
- verify
Runtime snapshot agechanges after runtime events; - only tick manual behavior confirmation after observing the expected behavior.
Untested hooks should remain NOT_EXERCISED.
Stacking
This PR is intentionally stacked on fix/freeze-last-seen-state / PR #50 because the Freeze Last Seen diagnostic callback is applied on top of the canonical freezelastseen state fix. Retarget to master after #50 merges.
CI
./gradlew :app:testWhatsappDebugUnitTest :app:assembleWhatsappDebug