Hax4us / Apkmod

Apkmod can decompile, recompile, sign APK, and bind the payload with any legit APP
GNU General Public License v3.0
717 stars 96 forks source link

libz relocation error #3

Closed bl4ckholez closed 4 years ago

bl4ckholez commented 5 years ago

[+] Copying APKs... done. [+] Decompiling APKs...

(standard_in) 1: syntax error /data/data/com.termux/files/usr/bin/apkmod: line 118: [: 1: unary operator expected [] Decompiling /data/data/com.termux/files/home/Linder/TempP/e.apk Error relocating /data/data/com.termux/files/usr/lib/libz.so.1: __errno: symbol not found [] Decompiled into /data/data/com.termux/files/home/Linder/TempP/e (standard_in) 1: syntax error /data/data/com.termux/files/usr/bin/apkmod: line 118: [: 1: unary operator expected [] Decompiling /data/data/com.termux/files/home/Linder/TempP/payload.apk Error relocating /data/data/com.termux/files/usr/lib/libz.so.1: __errno: symbol not found [] Decompiled into /data/data/com.termux/files/home/Linder/TempP/payload

done. [+] Copying payload smali codes to target apk... cp: cannot stat 'payload/smali/com/': No such file or directory done. [+] Fetching Package Name & MainActivity smali location ERROR OCCURED! EXITING...

[Errno 2] No such file or directory: 'e/AndroidManifest.xml'

Hax4us commented 5 years ago

Plz update apkmod by apkmod -u then try again. By the way, Apkmod has its own bind feature so you can try apkmod -b /path/to/your/app.apk LHOST=yourlhost LPORT=yourport -o /path/to/final/app.pak

bl4ckholez commented 5 years ago

(09:53:41) ○ [u0_a284@localhost] ~ → apkmod -b $HOME/app.apk -o $HOME/aapp.apk LHOST=127.0.0.1 LPORT=4444 [] Binding /data/data/com.termux/files/home/app.apk Using APK template: /data/data/com.termux/files/home/app.apk [] Decompiling original APK.. [*] Decompiling payload APK.. Error: No such file or directory @ rb_sysopen - /data/data/com.termux/files/usr/share/TermuxAlpine/root/.bind/original/AndroidManifest.xml [!] Can't bind, take screenshot and open a issue on github (09:55:18) ○ [u0_a284@localhost] ~ →

Hax4us commented 5 years ago

Give your original app ( app.apk in this case ) plus give output with screenshots of following commands

  1. termux-info
  2. apktool -version
  3. apkmod -v
bl4ckholez commented 5 years ago

termux-info

System information: Linux localhost 3.18.24-perf-gc0dfdcc #1 SMP PREEMPT Tue Nov 8 03:54:04 CST 2016 aarch64 Android Termux-packages arch: aarch64 Android version: 6.0.1 Device manufacturer: asus Device model: ASUS_Z017DB

apktool -version

Error relocating /data/data/com.termux/files/usr/lib/libz.so.1: __errno: symbol not found

apkmod -v

1.2

Hax4us commented 5 years ago

Check alpine is working or not , by executing startalpine and try following command inside alpine :

  1. apktool -version
bl4ckholez commented 5 years ago

startalpine [root@localhost home]# apktool -version 2.4.0

Hax4us commented 5 years ago

Try this inside termux bash $(which apktool) -version and give output

bl4ckholez commented 5 years ago

bash $(which apktool) -version Error relocating /data/data/com.termux/files/usr/lib/libz.so.1: __errno: symbol not found

hocinelop commented 5 years ago

Same problem

Hax4us commented 5 years ago

@bl4ckholez try this in termux

  1. unset LD_LIBRARY_PATH then
  2. apktool -version
hocinelop commented 5 years ago

@Hax4us CANNOT LINK EXECUTABLE "proot": library "libtalloc.so.2" not found [1] 22690 abort apktool -version

bl4ckholez commented 5 years ago

unset LD_LIBRARY_PATH

CANNOT LINK EXECUTABLE: library "libandroid-support.so" not found page record for 0x7f9cc5a010 was not found (block_size=16) () ○ [u0_a284@localhost] ~

apktool -version

CANNOT LINK EXECUTABLE: library "libtalloc.so.2" not found CANNOT LINK EXECUTABLE: library "libandroid-support.so" not found page record for 0x7fa620a010 was not found (block_size=16)

Hax4us commented 5 years ago

@bl4ckholez @hocinelop try this now in termux

  1. wget https://pastebin.com/raw/AxJmaf6r -O $PREFIX/share/TermuxAlpine/usr/bin/apktool
  2. Then Try again apktool -version
bl4ckholez commented 5 years ago

wget https://pastebin.com/raw/AxJmaf6r -O $PREFIX/share/TermuxAlpine/usr/bin/apktool --2019-09-19 19:08:44-- https://pastebin.com/raw/AxJmaf6r Resolving pastebin.com... 104.22.3.84, 104.22.2.84, 2606:4700:10::6816:254, ... Connecting to pastebin.com|104.22.3.84|:443... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [text/plain] Saving to: ‘/data/data/com.termux/files/usr/share/TermuxAlpine/usr/bin/apktool’

/data/data/com.ter [ <=> ] 123 --.-KB/s in 0s

2019-09-19 19:09:12 (6.12 MB/s) - ‘/data/data/com.termux/files/usr/share/TermuxAlpine/usr/bin/apktool’ saved [123]

apktool -version

Error relocating /data/data/com.termux/files/usr/lib/libz.so.1: __errno: symbol not found

Hax4us commented 5 years ago

@bl4ckholez whats output of env

bl4ckholez commented 5 years ago

env SHELL=/data/data/com.termux/files/usr/bin/bash LSCOLORS=Gxfxcxdxdxegedabagacad GREP_COLOR=1;33 HISTCONTROL=ignorespace:erasedups HISTSIZE=5000 BASH_IT=/data/data/com.termux/files/home/.bash_it PREFIX=/data/data/com.termux/files/usr CENSYS_API_ID=c95768c1-31a9-4a28-b488-f1acfb1fd45c PWD=/data/data/com.termux/files/home TODO=t CENSYS_API_SECRET=VMZdaTQOnM4R0A2LjRnmGmJKep3sHKAT EXTERNAL_STORAGE=/sdcard LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so GIT_HOSTING=git@git.domain.com HOME=/data/data/com.termux/files/home LANG=en_US.UTF-8 AUTOFEATURE=true autotest TMPDIR=/data/data/com.termux/files/usr/tmp ANDROID_DATA=/data TERM=xterm-256color IRC_CLIENT=irssi BASH_IT_THEME=nwinkler_random_colors SHLVL=1 ANDROID_ROOT=/system LD_LIBRARY_PATH=/data/data/com.termux/files/usr/lib PATH=/data/data/com.termux/files/usr/bin:/data/data/com.termux/files/usr/bin/applets OLDPWD=/data/data/com.termux/files/home/.bash_it SCMCHECK=true =/data/data/com.termux/files/usr/bin/env

Hax4us commented 5 years ago

try :

  1. curl -L https://github.com/Hax4us/Apkmod/raw/master/scripts/apktool_alpine.sh -o $PREFIX/share/TermuxAlpine/usr/bin/apktool
  2. curl https://file.io/B1wbtE -o $(which apktool)
  3. apktool -version
bl4ckholez commented 5 years ago

LINK FILE 404 NOT FOUND.

https://file.io/B1wbtE

rk649477 commented 5 years ago

$ apkmod -b /data/data/com.termux/files/home/r.apk -o /sdcard LHOST=server.net LPORT=4444 [*] Binding /storage/emulated/0 Using APK template: /storage/emulated/0 Error: The following options failed to validate: LHOST, LPORT. [!] Can't bind, take screenshot and open a issue on github $

Hax4us commented 5 years ago

LINK FILE 404 NOT FOUND.

https://file.io/B1wbtE

Oops sorry file was deleted now I uploaded again :

  1. curl -L https://gist.githubusercontent.com/Hax4us/594aa21bb7d18f5fc2e9eba9b6e15433/raw/ac6b04f1495febf2ca06c3eb544934fd781daaa2/apktool_termux.sh -o $(which apktool)
  2. apktool -version
Hax4us commented 5 years ago

$ apkmod -b /data/data/com.termux/files/home/r.apk -o /sdcard LHOST=server.net LPORT=4444 [*] Binding /storage/emulated/0 Using APK template: /storage/emulated/0 Error: The following options failed to validate: LHOST, LPORT. [!] Can't bind, take screenshot and open a issue on github $

Your LHOST is wrong so give valid one.

rk649477 commented 5 years ago

apkmod -b /data/data/com.termux/files/home/r.apk -o /sdcard LHOST=127.0.0.1 LPORT=4444 [*] Binding /storage/emulated/0 Using APK template: /storage/emulated/0 Error: The following options failed to validate: LHOST, LPORT. [!] Can't bind, take screenshot and open a issue on github

Hax4us commented 5 years ago

@rk649477 don't mix different type of issues in one hence open your separate issue.

bl4ckholez commented 5 years ago

(14:41:23) ○ [u0_a284@localhost] ~ → curl -L https://gist.githubusercontent.com/Hax4us/594aa21bb7d18f5fc2e9eba9b6e15433/raw/ac6b04f1495febf2ca06c3eb544934fd781daaa2/apktool_termux.sh -o $(which apktool) % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 382 100 382 0 0 451 0 --:--:-- --:--:-- --:--:-- 451

(14:41:47) ○ [u0_a284@localhost] ~ → apktool -version 2.4.0

Hax4us commented 4 years ago

@bl4ckholez update your apkmod to v1.3 by apkmod -u and issue should be solved now

bl4ckholez commented 4 years ago

apkmod -u [!] Invalid option: -u

Hax4us commented 4 years ago

apkmod -u [!] Invalid option: -u

I see , I forget to add -u option well then install manually from README instructions and don't forget to remove or delete old setup.sh file before downloading new one

Hax4us commented 4 years ago

You can reopen it if problem still exist.

whitehattamil commented 4 years ago

cannot link executable "proot": library "libtalloc.so.2" not found Please help me

Hax4us commented 4 years ago

try apt update && apt upgrade then reinstall apkmod by apkmod -u

whitehattamil commented 4 years ago

It worked thanks

vi-shalt commented 4 years ago

Screenshot_20200504-144517_Termux Bro plz help