[parasitic] Fix Android 9 compatibility (#1229)

This commit is contained in:
LoveSy 2021-10-06 23:36:55 +08:00 committed by GitHub
parent f75579a8e7
commit 8e9fa6eb5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -48,7 +48,7 @@ public class ParasiticManagerHooker {
if (managerPkgInfo == null) { if (managerPkgInfo == null) {
Context ctx = ActivityThread.currentActivityThread().getSystemContext(); Context ctx = ActivityThread.currentActivityThread().getSystemContext();
var sourceDir = "/proc/self/fd/" + managerFd; var sourceDir = "/proc/self/fd/" + managerFd;
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.O_MR1) { if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.P) {
var dstDir = appInfo.dataDir + "/cache/lsposed.apk"; var dstDir = appInfo.dataDir + "/cache/lsposed.apk";
try (var inStream = new FileInputStream(sourceDir); var outStream = new FileOutputStream(dstDir)) { try (var inStream = new FileInputStream(sourceDir); var outStream = new FileOutputStream(dstDir)) {
FileChannel inChannel = inStream.getChannel(); FileChannel inChannel = inStream.getChannel();