针对 Android 12+ 的 Xposed 模块,用于在 MediaProvider 中根据运行时配置隐藏普通存储路径,并提供与 Android/data 相关的 Unicode 场景的调试和修复能力。
针对 Android 12+ 的 Xposed 模块,用于在 MediaProvider 中根据运行时配置隐藏普通存储路径,并提供与 Android/data 相关的 Unicode 场景的调试和修复能力。
FuseHide is an Android 12+ storage-visibility module and MediaProvider/FUSE research tool. It injects into the MediaProvider process and hooks the userspace FUSE implementation in libfuse_jni.so, allowing selected apps to see a filtered view of /storage/emulated/0 (/sdcard) according to runtime-configurable, per-UID rules.
FuseHide currently provides two injection backends:
Both backends converge on the same libfusehide.so runtime, the same path policy, and the same configuration model.
FuseHide also keeps the original MediaProvider-oriented Unicode research and mitigation path for Android/data and Android/obb. Normal /sdcard path hiding and the special Android/data / Android/obb path are related to the same MediaProvider process, but they are not the same hook path.
[!WARNING] FuseHide works by hooking internal MediaProvider and FUSE implementation details. These ABIs are not public Android APIs and can change between Android releases, MediaProvider updates, and vendor ROMs. The project deliberately skips unsafe hooks when an ABI cannot be verified instead of blindly applying offsets or layouts.
/storage/emulated/0 for selected packages.Download/private without hiding their visible parent directory.FuseHide currently targets:
com.android.providers.media.module, orcom.google.android.providers.media.module.For the LSPosed backend, a compatible LSPosed/libxposed environment is required.
For the Zygisk backend, a compatible root environment and Zygisk implementation are required. The packaged installer supports Magisk-compatible installation flows and KernelSU-style module installation; the actual runtime still depends on a working Zygisk implementation on the device.
The Xposed metadata is under app/src/main/resources/META-INF/xposed/.
The runtime chain is:
LSPosed / libxposed
-> Entry.onPackageLoaded()
-> only accept MediaProvider package names
-> System.loadLibrary("fusehide")
-> hook Application.attach()
-> capture MediaProvider Application
-> register config/status receivers
-> native_init()
-> PostNativeInit("libfuse_jni.so", ...)
-> InstallFuseHooks()Entry intentionally ignores non-MediaProvider processes.
The default static scope contains:
com.android.providers.media.module
com.google.android.providers.media.moduleThe Zygisk implementation lives under app/src/main/cpp/zygisk/.
The runtime chain is:
Zygisk
-> preAppSpecialize()
-> match MediaProvider process name
-> preload injected dex + libfusehide.so from the module directory
-> postAppSpecialize()
-> Dobby-hook linker do_dlopen
-> wait until libfuse_jni.so is loaded
-> call libfusehide native_init()
-> provide DobbyHook through the native hook API bridge
-> PostNativeInit("libfuse_jni.so", ...)
-> register HideConfigNativeBridge JNI methods
-> start ZygiskEntry with the MediaProvider system contextThe injected Java classes are loaded from the APK dex payload through InMemoryDexClassLoader.
FuseHide should not install both hook backends into the same MediaProvider process.
The Zygisk module contains post-fs-data.sh logic that checks LSPosed's module/scope database for an enabled FuseHide MediaProvider scope. When that scope is detected, the module records lsp_scope_enabled and disables the Zygisk module path. The native Zygisk entry also checks the marker and refuses to inject when the LSPosed path is active.
In other words, use one injection backend for MediaProvider at a time.
Normal path hiding does not require fuse-bpf. FuseHide performs the policy enforcement inside MediaProvider's userspace FUSE daemon.
A simplified request flow is:
restricted app
-> Linux VFS
-> /dev/fuse
-> MediaProvider libfuse_jni worker
-> FuseHide request/reply hooks
-> per-UID hide policy
-> filtered FUSE resultFuseHide does not rely on only one lookup hook. The implementation covers several layers so that a path cannot remain visible simply because a different filesystem operation was used.
The native layer hooks or wraps relevant MediaProvider paths such as:
is_app_accessible_pathpf_lookuppf_lookup_postfilterpf_getattrpf_createpf_mkdirpf_mknodpf_unlinkpf_rmdirpf_renamestat, lstat, open, getxattr, and related callsWhen a resolved per-UID rule says that the requested path belongs to a hidden subtree, FuseHide attempts to make the target behave as absent rather than merely inaccessible.
Hiding a path from stat() or lookup is not enough: the entry must also disappear from directory listings.
FuseHide therefore covers multiple enumeration stages, including:
pf_readdirpf_readdirpluspf_readdir_postfilterdo_readdir_commonGetDirectoryEntriesaddDirectoryEntriesFromLowerFsfuse_reply_bufWrappedReplyBuf() acts as a final FUSE-wire filtering layer. It recovers the request UID / inode / parent-path context, recognizes supported directory-entry payload layouts, removes entries matching the resolved hide rule, and forwards the rewritten reply buffer.
A hidden target may already have a positive dentry, inode, or attribute cache entry. Without cache handling, an app could observe a path even after the policy says it should be hidden.
FuseHide therefore also handles:
fuse_reply_entryfuse_reply_attrfuse_reply_errShouldNotCachefuse_lowlevel_notify_inval_entryfuse_lowlevel_notify_inval_inodeFor hidden targets the implementation can zero entry/attribute timeouts, avoid caching, and schedule entry/inode invalidation. Runtime tracking is scoped carefully so that state learned from one UID is not blindly reused for another UID with a different hide policy.
Android/data and Android/obb/storage/emulated/0/Android/data and /storage/emulated/0/Android/obb are special MediaProvider paths. Their access control is not simply the same directory-enumeration path used for ordinary public /sdcard folders.
FuseHide retains hooks and diagnostics around components such as:
is_bpf_backing_pathis_package_owned_pathDefault_Ignorable_Code_Point handlingMediaProvider.isUidAllowedAccessToDataOrObbPathForFuse() tracing in debuggable buildsThe Unicode policy recognizes default-ignorable characters and normalizes the affected comparison paths so that visually disguised path components do not escape the intended MediaProvider checks.
This special-path work should not be confused with normal configured path hiding: ordinary /sdcard filtering is implemented through the FUSE request/reply path even when fuse-bpf is not running.
FuseHide maintains a runtime HideConfig with these main fields:
enableHideAllRootEntrieshideAllRootEntriesExemptionshiddenRootEntryNameshiddenRelativePathshiddenPackagespackageRuleshiddenRootEntryNames contains first-level names under /storage/emulated/0.
For example:
su
daemonsuhiddenRelativePaths contains paths relative to /storage/emulated/0:
Download/private
Documents/internal/testLeading/trailing slashes and repeated separators are normalized by the native policy.
hiddenPackages is the package allow-list for the global hide rule.
For each FUSE request, FuseHide resolves the request UID to its current package set through PackageManager#getPackagesForUid(). If one of those packages is present in hiddenPackages, the global rule is merged into that UID's effective rule.
The UID-to-rule result is cached, but package add/remove broadcasts invalidate the package-set generation and derived caches so a stale package association is not kept indefinitely.
Package-specific targets are stored as PackageHideRule objects and can be edited with [package.name] sections.
Example:
su
daemonsu
[io.github.xiaotong6666.fusehide]
xinhao
Download/private
[com.eltavine.duckdetector]
MT2
xinhaoRules before the first section are global targets. A value containing / is treated as a relative path; a value without / is treated as a first-level entry name.
Package-specific rules are matched against every package currently belonging to the request UID and merged together. A package-specific section can therefore apply even when that package is not listed in hiddenPackages; hiddenPackages specifically controls inheritance of the global rule.
The current native defaults are:
Global root names:
su
daemonsuPackages receiving the global rule:
com.eltavine.duckdetector
io.github.xiaotong6666.fusehide
io.github.a13e300.fusefixerPackage-specific defaults:
[io.github.xiaotong6666.fusehide]
xinhao
[com.eltavine.duckdetector]
MT2
xinhaoenableHideAllRootEntries is disabled by default.
When enabled, all first-level entries are considered hidden except configured exemptions. The source defaults currently keep these names visible:
Android
DCIM
Document
Download
Movies
PicturesThe configuration UI is not just an editor for local preferences. FuseHide can synchronize a configuration into the already injected MediaProvider process and ask that process to report the native configuration it actually has applied.
The main pieces are:
HideConfigStoreHideConfigProviderHideConfigRequestReceiverEntry / ZygiskEntryHideConfigNativeBridgeThe injected process first attempts to recover a persisted injected-process snapshot, then obtains current app-side configuration through the provider path. A broadcast fallback is available when the provider path cannot be used.
Reload transactions use reload tokens, and the fallback IPC path contains authentication checks rather than accepting arbitrary unauthenticated configuration broadcasts.
Configuration changes are published atomically to the native policy. Applying a new configuration increments its generation and invalidates dependent UID rules, root snapshots, path-classification caches, and tracked hidden targets.
The injected process also retries configuration loading around boot/user lifecycle events such as:
ACTION_LOCKED_BOOT_COMPLETED暂无开放 Issues,或尚未同步最近议题。