Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

app修补boot.img在安卓10以上没权限 #2

Closed
thouger opened this issue Aug 22, 2023 · 0 comments
Closed

app修补boot.img在安卓10以上没权限 #2

thouger opened this issue Aug 22, 2023 · 0 comments

Comments

@thouger
Copy link

thouger commented Aug 22, 2023

/storage/emulated/0/Download这个路径会没权限,应该放在/data/data下面,

diff --git a/app/src/main/java/me/bmax/akpatch/ui/util/Patch.kt b/app/src/main/java/me/bmax/akpatch/ui/util/Patch.kt
index c14a962..21f22e5 100644
--- a/app/src/main/java/me/bmax/akpatch/ui/util/Patch.kt
+++ b/app/src/main/java/me/bmax/akpatch/ui/util/Patch.kt
@@ -88,7 +88,8 @@ fun patchBootimg(uri: Uri, superKey: String, onMessage: (String) -> Unit): Int {
     val currentTime = dateFormat.format(time)
     val nativeDir = File(pApp.applicationInfo.nativeLibraryDir)
     onMessage("exe_dir: ${nativeDir.absolutePath}")
-    val workDir = File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS), "akpatch_${currentTime}")
+//    val workDir = File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS), "akpatch")
+    val workDir = File("/data/data/me.bmax.akpatch")
     workDir.mkdirs()
     onMessage("work_dir: ${workDir.absolutePath}")

不过后面的修补又报错了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants