REAndroid / APKEditor

Powerful android apk editor - aapt/aapt2 independent
Apache License 2.0
931 stars 143 forks source link

`AccessDeniedException` Error with APKEditor v1.3.9 #131

Closed AbhiTheModder closed 1 month ago

AbhiTheModder commented 1 month ago

Description: When attempting to merge .apks files using APKEditor version 1.3.9 with ARSCLib version 1.3.5, I encountered a java.nio.file.AccessDeniedException during the merge process. The tool fails to access certain APK splits, specifically split_config.kn.apk. This issue does not occur in the older version 1.38.

Steps to Reproduce:

  1. Run the following command:
    ╰─> java -jar apktool.jar m -i input.apks -o out.apk
  2. The following error is thrown:
    00.000 I: [MERGE] Using: APKEditor version 1.3.9, ARSCLib version 1.3.5
    00.018 I: [MERGE] Merging ...
       Input: input.apks
     Output: out.apk
     ---------------------------- 
    00.019 I: [MERGE] Extracting to: tmp_4febf97b
    00.181 I: [MERGE] Searching apk files ...
    00.183 I: [MERGE] Found apk files: 11
     00.183 [MERGE] Loading: split_config.kn.apk                                                                                           
    ERROR:
    java.nio.file.AccessDeniedException: tmp_4febf97b/split_config.kn.apk
            at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:90)
            at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
            at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
            at java.base/sun.nio.fs.UnixFileSystemProvider.newFileChannel(UnixFileSystemProvider.java:181)
            at java.base/java.nio.channels.FileChannel.open(FileChannel.java:298)
            at java.base/java.nio.channels.FileChannel.open(FileChannel.java:357)
            at com.reandroid.archive.io.ZipFileInput.getFileChannel(ZipFileInput.java:84)
            at com.reandroid.archive.io.ZipFileInput.getFooter(ZipFileInput.java:69)
            at com.reandroid.archive.block.EndRecord.findEndRecord(EndRecord.java:61)
            at com.reandroid.archive.model.CentralFileDirectory.visit(CentralFileDirectory.java:48)
            at com.reandroid.archive.Archive.<init>(Archive.java:46)
            at com.reandroid.archive.ArchiveFile.<init>(ArchiveFile.java:30)
            at com.reandroid.archive.ArchiveFile.<init>(ArchiveFile.java:33)
            at com.reandroid.apk.ApkModule.loadApkFile(ApkModule.java:1308)
            at com.reandroid.apk.ApkBundle.loadApkDirectory(ApkBundle.java:135)
            at com.reandroid.apkeditor.merge.Merger.run(Merger.java:61)
            at com.reandroid.apkeditor.merge.Merger.execute(Merger.java:235)
            at com.reandroid.apkeditor.Main.execute(Main.java:89)
            at com.reandroid.apkeditor.Main.execute(Main.java:64)
            at com.reandroid.apkeditor.Main.main(Main.java:36)

Error Log:

java.nio.file.AccessDeniedException: tmp_4febf97b/split_config.kn.apk
    at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:90)
    at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
    at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
    at java.base/sun.nio.fs.UnixFileSystemProvider.newFileChannel(UnixFileSystemProvider.java:181)
    at java.base/java.nio.channels.FileChannel.open(FileChannel.java:298)
    at java.base/java.nio.channels.FileChannel.open(FileChannel.java:357)
    ...

Environment:

Additional Notes:

Please let me know if additional information or logs are required!


REAndroid commented 1 month ago

I believe this issue is fixed in recent commits, build the recent commit or grab from action artifacts

AbhiTheModder commented 1 month ago

I believe this issue is fixed in recent commits, build the recent commit or grab from action artifacts

Yes, it's fixed... please do release it, thanks.