iBotPeaches / Apktool

A tool for reverse engineering Android apk files

Home Page:https://apktool.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] [-] zipalign: symbol lookup error

A-Unix opened this issue · comments

Information

  1. Apktool Version (apktool -2.9.1) -
  2. Operating System ( Linux ) -
  3. APK From? (Other) -
  4. Java Version (11) -

Stacktrace/Logcat

[*] Rebuilding apk with ```abc``` as /tmp/d20231231-119197-mcvihu/output.apk
[*] Aligning /tmp/d20231231-119197-mcvihu/output.apk
[-] zipalign: symbol lookup error: zipalign: undefined symbol: _ZN11zip_archive6WriterD2Ev
Error: Unable to align apk with zipalign.

Steps to Reproduce

  1. apktool d netflix.apk
  2. apktool b netfix.apk

Frameworks

If this APK is from an OEM ROM (Samsung, HTC, LG). Please attach framework files
(.apks that live in /system/framework or /system/priv-app)

APK

If this APK can be freely shared, please upload/attach a link to it: Link

Questions to ask before submission

  1. Have you tried apktool d, apktool b without changing anything? No, I did something with manifest of original apk.
  2. If you are trying to install a modified apk, did you resign it? Couln't even rebuild it.
  3. Are you using the latest apktool version? Yes, its 2.9.1

We don't have zipalign bundled, so this must be a different tool. Closing.

Okay, however, I'm still writing the solution here to help people who will be searching for a solution to this error.

To fix this error, enter these commands:

  1. nano /etc/apt/sources.list
    Then you will see something like this:

Screenshot_2023-12-31_23_46_46

  1. Add this line in the file: deb http://ftp.de.debian.org/debian buster main and comment out any other line that is not in the comment, you can use # to comment out a line, after making changes, your file should look like this:

Screenshot2

  1. After that, hit CTRL+X, Y, ENTER in the same sequence I wrote.
  2. Now, update your system using apt update
  3. After the update is done, run this command: apt --purge remove zipalign -y, this removes all files of zipalign from the system.
  4. Now install the zipalign again using apt install zipalign -y.
  5. After installation, type zipalign. You will see the result :)

Edit 1: After you install the Zipalign, you will need to prevent it from auto upgrading as that will result into the same error you faced earlier and came here to find a fix to issue. To prevent it from upgrading, just type this command in your terminal: apt-mark hold zipalign. Then you also need to comment out that debian repo line using #, and remove the # from kali repo line to update your system using kali official repo. After making the changes your file should look like this:

1

After that, save the changes to file and exit, now you need to update your system again using apt update and then you'll be good to go.