Skip to content

Incorrect directory structure after installing module packaged with PowerShell Compress-Archive on Windows #3224

@RinOfficial0615

Description

@RinOfficial0615

Please check before submitting an issue

  • I have searched the issues and haven't found anything relevant
  • I will upload bugreport file in KernelSU Manager - Settings - Report log
  • I know how to reproduce the issue which may not be specific to my device

Describe the bug

When creating a KernelSU module zip file using Windows PowerShell's Compress-Archive command, the resulting archive uses backslashes (\) as path separators (Windows convention). After installing such a module via KernelSU Manager, the directory structure is not preserved correctly. Instead of creating a subdirectory (e.g., zygisk), the files are extracted with the backslash treated as part of the filename, leading to a single file named like zygisk\arm64-v8a.so under the module root.

Powershell version: 5.1.26100.6899 (just the built-in one)
Sample module: zygisk_test.zip

Expected directory tree after installation:

/data/adb/modules_update/zygisk_test/
├── module.prop
└── zygisk/
    └── arm64-v8a.so

Actual directory tree after installation:

/data/adb/modules_update/zygisk_test/
├── module.prop
└── zygisk\arm64-v8a.so   (treated as a single file name)

To Reproduce

  1. Create a test module directory (like this) with the following structure on Windows:

    zygisk_test/
    ├── module.prop
    └── zygisk/
        └── arm64-v8a.so
    
  2. Inside the parent folder of zygisk_test, open built-in PowerShell and run:

    Compress-Archive -Path ./zygisk_test/* -DestinationPath zygisk_test.zip
  3. Transfer the zygisk_test.zip to your Android device and flash it via KernelSU Manager (Modules → Install from storage).

  4. After installation, check the module directory with a file manager or adb shell:

    ls -R /data/adb/modules_update/zygisk_test

    Observe that zygisk\arm64-v8a.so appears as a single file, not inside a zygisk folder.

  5. (Optional) Extract the same zip using MT Manager or 7-Zip to confirm that the archive itself is correct.

Expected behavior

The module should be extracted with the correct subdirectory structure: zygisk/arm64-v8a.so should be placed inside a zygisk folder, and module.prop should remain at the root. KernelSU Manager should treat backslashes as equivalent to forward slashes when extracting ZIP archives, as most archive tools do.

Screenshots

N/A

Logs

N/A

Device info

  • Device: Redmi Note 12 Turbo
  • OS Version: ColorOS PJZ110_16.0.3.501(CN01)
  • KernelSU Version: 32308
  • Kernel Version: 5.10.249-Glow-v4.5

Additional context

  • The issue appears to be caused by KernelSU Manager's ZIP extraction logic not normalizing path separators. Windows-generated ZIP files commonly use backslashes, and it is the responsibility of the extracting tool to interpret them correctly.
  • This problem does not occur when the zip is created on Linux/macOS or with tools that use forward slashes (e.g., zip command in WSL, 7-Zip with correct settings).
  • Since MT Manager and 7-Zip handle the same file correctly, it confirms the bug is specific to KernelSU Manager's extraction code.
  • Important: This issue cannot be reproduced when using PowerShell 7 (version 7.x) to create the zip archive.
  • BugReport file if needed: KernelSU_bugreport_2026-02-23_11_36.tar.gz

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions