Skip to content

Commit

Permalink
Add android-extract-ndk.sh to automatically pull out libndk translati…
Browse files Browse the repository at this point in the history
…ons for arm apps
  • Loading branch information
sickcodes committed Sep 14, 2021
1 parent 4704a3e commit 745750a
Show file tree
Hide file tree
Showing 2 changed files with 109 additions and 0 deletions.
62 changes: 62 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,64 @@
# Droid-NDK-Extractor
Android NDK Extractor - Extract ARM native bridge translations for use in any Android derivative.

System Requirements:

```
p7zip
binwalk
git
```

`./android-extract-ndk.sh`

```bash

#!/bin/bash
# Author: sickcodes
# Contact: https://twitter.com/sickcodes
# Repo: https://github.com/sickcodes/Droid-NDK-Extractor
# Copyright: sickcodes (C) 2021
# License: GPLv3+

ARCH="${1}"
ARCH="${ARCH:="x86_64"}"

mkdir ./working

cd ./working

git clone https://gitlab.com/android-generic/android_vendor_google_emu-x86.git

yes | ./android_vendor_google_emu-x86/download-files.sh "${ARCH}"

yes | unzip "${ARCH}-*-linux.zip"

7z e x86_64/system.img

binwalk -e \
--depth 1 \
--count 1 \
-y 'filesystem' \
super.img # only search for filesystem signatures

# 1048576 0x100000 \
# Linux EXT filesystem, blocks count: 234701, \
# image size: 240333824, rev 1.0, ext2 filesystem data, \
# UUID=31e7cd0f-5577-515b-bea5-c836952b952b, volume name "/"

mkdir extracted
cd extracted

yes | 7z x ../_super.img.extracted/100000.ext

find system \( -name 'libndk_translation*' -o -name '*arm*' -o -name 'ndk_translation*' \) | tar -cf native-bridge.tar -T -

pwd

stat native-bridge.tar

echo "${PWD}/native-bridge.tar"

# move native-bridge.tar somewhere, and remove the ./working folder as it is no longer required.

```
47 changes: 47 additions & 0 deletions android-extract-ndk.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/bin/bash
# Author: sickcodes
# Contact: https://twitter.com/sickcodes
# Repo: https://github.com/sickcodes/Droid-NDK-Extractor
# Copyright: sickcodes (C) 2021
# License: GPLv3+

ARCH="${1}"
ARCH="${ARCH:="x86_64"}"

mkdir ./working

cd ./working

git clone https://gitlab.com/android-generic/android_vendor_google_emu-x86.git

yes | ./android_vendor_google_emu-x86/download-files.sh "${ARCH}"

yes | unzip "${ARCH}-*-linux.zip"

7z e x86_64/system.img

binwalk -e \
--depth 1 \
--count 1 \
-y 'filesystem' \
super.img # only search for filesystem signatures

# 1048576 0x100000 \
# Linux EXT filesystem, blocks count: 234701, \
# image size: 240333824, rev 1.0, ext2 filesystem data, \
# UUID=31e7cd0f-5577-515b-bea5-c836952b952b, volume name "/"

mkdir extracted
cd extracted

yes | 7z x ../_super.img.extracted/100000.ext

find system \( -name 'libndk_translation*' -o -name '*arm*' -o -name 'ndk_translation*' \) | tar -cf native-bridge.tar -T -

pwd

stat native-bridge.tar

echo "${PWD}/native-bridge.tar"

# move native-bridge.tar somewhere, and remove the ./working folder as it is no longer required.

0 comments on commit 745750a

Please sign in to comment.