Open lpcdma opened 3 years ago
其他两款产品做了路径重定向
./Android/data/com.ludashi.dualspace/virtual/0/pkg_name/cache/1628778272764_haha.txt
./Android/data/com.ludashi.dualspace/virtual/0/pkg_name/cache/1628778283444_haha.txt
./Android/data/com.ludashi.dualspace/virtual/0/pkg_name/cache/1628778310401_haha.txt
./Android/data/com.lbe.parallel.intl.arm64/parallel_intl/0/pkg_name、cache/1628778505191_haha.txt
In android 11+ you cannot access android/data without the proper permissions anymore. This project shows how now restricted paths can be accessed on android 11+.
这个编译好的也不行。 这个只是部分开源,缺失很多东西,比如64位支持的 应该只能用目录重定位来解决,下面是解决这个bug的代码
//setupVirtualStorage
if (Build.VERSION.SDK_INT >= 30) {
for (String storageRoot : storageRoots) {
for (String whiteDir : whiteList) {
// white list, do not redirect
String whitePath = new File(storageRoot, whiteDir).getAbsolutePath();
NativeEngine.whitelist(whitePath, true);
}
String xPrivatePath = privatePath + "/" + info.packageName;
File xPrivatePathFile = new File(xPrivatePath);
if (!xPrivatePathFile.exists()) {
xPrivatePathFile.mkdirs();
}
NativeEngine.redirectDirectory(new File(storageRoot, "Android/data/" + info.packageName).getAbsolutePath(), xPrivatePathFile.getAbsolutePath());
NativeEngine.redirectDirectory(new File(storageRoot, "Android/obb/" + info.packageName).getAbsolutePath(), xPrivatePathFile.getAbsolutePath());
}
}
HOOK_SYMBOL(handle, faccessat);
HOOK_SYMBOL(handle, openat);
if (api_level >= 30) {
findSyscalls("/apex/com.android.runtime/lib64/bionic/libc.so", on_found_syscall_aarch64);
findSyscalls("/apex/com.android.runtime/bin/linker64", on_found_linker_syscall_arch64);
}
需要解决两个问题:
问题描述
在Android 11上无法写入/sdcard/Android/data/package_name/cache|files/file.log文件
复现步骤
代码如下
异常堆栈
环境
机型: 系统版本:Andorid 11 ROM版本:MIUI 12.5.7 Xposed 插件以及插件版本:20.0.3 VirtualXposed版本:20.0.3
补充
不知道是否有办法绕过,已经开启了系统所有文件访问权限。
参考 https://stackoverflow.com/questions/62782648/android-11-scoped-storage-permissions https://developer.android.com/about/versions/11/privacy/storage