[LINUX][TOOL] Android 9.0 partition repack tool!

Post your great articles here :)
Post Reply
bumerc
Administrator & Developer
Posts: 1551
Joined: Tue Oct 02, 2018 6:19 pm
Answers: 0
Has thanked: 211 times
Been thanked: 334 times

#41

cchumi wrote: Fri Jan 15, 2021 3:43 pm Some files are encrypted. I tried to extract dts from dtb but it failed. Probably that file is encrypted too.
How did you decompile dt.img?
kalehrl
Verified Member
Posts: 11
Joined: Thu Jan 06, 2022 12:22 pm
Answers: 0

#42

I couldn't decompile it.
I tried with dtimageextract:

Code: Select all

root@debian:/home/kalehrl/Templates/android/dtimgextract# ./dtimgextract dt.img
Not a dt.img, processing as boot.img(got @AML, wanted QCDT)
Not a boot.img, aborting (got @AML, wanted ANDROID!)
Also with boot.img:

Code: Select all

root@debian:/home/kalehrl/Templates/android/dtimgextract# ./dtimgextract boot.img
Not a dt.img, processing as boot.img(got ANDR, wanted QCDT)
hd_magic: ANDROID!
k_size: 0x9724c8
k_addr: 0x1080000
r_size: 0x0
r_addr: 0x1000000
s_size: 0x165f7
s_addr: 0xf00000
t_addr: 0x100
p_size: 0x800
unused: 0x1
unused: 0x12000143
pname: 
cmdline: androidboot.dtbo_idx=0 --cmdline root=/dev/mmcblk0p18 buildvariant=userdebug
id: 3689159978
Skipping android boot header 0x244(0x800)
Skipping kernel 0x9724c8(0x972800)
Skipping ramdisk 0x0(0x0)
Skinning secondary image 0x165f7(0x16800)
Trying header at 0x989800
Not a dt.img, processing as boot.img(got J��*, wanted QCDT)
Not a boot.img, aborting (got J��*Y�5{, wanted ANDROID!)
I also tried with an android kitchen but no result.
thiagojp2020
Posts: 1
Joined: Sun Dec 13, 2020 10:29 pm
Answers: 0

#43

i'm doing the edits here on the android 9 osp firmware and i'm getting this kind of response in bc-tool

mkdir -p "bc-tool/stamp"
cd bc-tool/system && ./build
/bin/bash: line 1: cd: bc-tool/system: No such file or directory
make: *** [build/mod.mak:62: bc-tool/stamp/.stamp.mod-system] Error 1
bumerc
Administrator & Developer
Posts: 1551
Joined: Tue Oct 02, 2018 6:19 pm
Answers: 0
Has thanked: 211 times
Been thanked: 334 times

#44

kalehrl wrote: Mon Jan 17, 2022 6:54 pm i'm doing the edits here on the android 9 osp firmware and i'm getting this kind of response in bc-tool
Only Amlogic packages are supported
brunom80
Posts: 2
Joined: Sat Apr 02, 2022 11:52 am
Answers: 0
Has thanked: 1 time

#45

Can someone please reupload the tool, i can´t find it anywhere else. Thank you
Doctorbeefy
Posts: 4
Joined: Wed Nov 24, 2021 3:05 am
Answers: 0
Been thanked: 1 time

#46

@bumerc can you reupload the bc-tool? Please and thank you.
oldman20
Verified Member
Posts: 17
Joined: Sat May 14, 2022 4:23 pm
Answers: 0
Has thanked: 4 times

#47

bumerc wrote: Mon May 18, 2020 8:48 pm
mohy wrote: Mon May 18, 2020 6:49 am the download link of bc-tool is not correct, it says File is in owner's trash...
is updated, thanks for the hint
please reup bc-tool-update-pie-q-02a (beta) sir, it isn't availble now

thank!

Image
oldman20
Verified Member
Posts: 17
Joined: Sat May 14, 2022 4:23 pm
Answers: 0
Has thanked: 4 times

#48

oldman20
Verified Member
Posts: 17
Joined: Sat May 14, 2022 4:23 pm
Answers: 0
Has thanked: 4 times

#49

Code: Select all

chuctran@pop-os:~/afck/ingredients$ ./01-get-it-all
update-supersu-v2.82-20170528234214.zip: downloading
chuctran@pop-os:~/afck/ingredients$ ./01-get-it-all
update-supersu-v2.82-20170528234214.zip: up-to-date
chuctran@pop-os:~/afck/ingredients$ cd ..
chuctran@pop-os:~/afck$ [b]make mod-supersu[/b]
mkdir -p "bc-tool/stamp"
#mkdir -p bc-tool/system/system/system/app/supersu
#unzip -qojp  common/superuser.apk > bc-tool/system/system/system/app/supersu/supersu.apk
# пропатчим supersu
#	@echo -e 'patching apk file bc-tool/system/system/system/app/supersu/supersu.apk'
java -jar tools/apktool_2.4.0.jar decode -o out/amlogic/device/1-2g/patch-supersu.apk -f bc-tool/system/system/system/app/supersu/supersu.apk
[b]input file (bc-tool/system/system/system/app/supersu/supersu.apk) was not found or was not readable.
make: *** [build/mod.mak:62: bc-tool/stamp/.stamp.mod-supersu] error 1[/b]
chuctran@pop-os:~/afck$ make mod-init.d
make: nothing to be done for 'mod-init.d'.
first to thank your greatest work, 1 followed and have same issue:

@bumerc: i noticed in 01-get-it-all file has many app to be download

Code: Select all

#!/bin/sh
#
# Этот сценарий попытается скачать все нужне компоненты из разных мест в Интернете.
# Так как Интернет это динамически изменяющаяся среда, нет гарантии, что все ссылки
# рабочие, но надеюсь, что большинство файлов всё-таки будет скачано. Остальное можно
# попытаться найти самостоятельно.
#

WHITE="[1;37m"
LRED="[1;31m"
LGREEN="[1;32m"
RST="[0m"

get() {
	dst="$1"
	url="$2"
	if test -e "$dst" ; then
		echo "$dst: up-to-date"
		return 0
	fi
	expr match "$url" '.*/$' >/dev/null && url="$url/$dst"
	echo "$dst: ${LGREEN}downloading${RST}"
	wget -qO "$dst" "$url"
}

get_manual() {
	if test -e "$1" ; then
		echo "$1: up-to-date"
		return 0
	fi
	echo -e "${WHITE}$1${LRED}: missing, please download it manually from${RST}"
	echo "	-> ${LGREEN}$2${RST}"
}

get_apkpure() {
	if test -e "$1" ; then
		echo "$1: up-to-date"
		return 0
	fi
	echo -n "$1: ${LGREEN}downloading${RST} ..."
	url=$(wget -qO- "$2" | sed -ne '/<iframe id="iframe_download"/{' -e 's/.*src="\(.*\)"><\/iframe>/\1/' -e p -e q -e '}')
	if wget -qO "$1" "$url" ; then
		echo "${WHITE}OK${RST}"
	else
		echo "${LRED}FAILED${RST}"
		rm -f "$2"
	fi
}

#ZADE=http://zade.cobra.ru/afck/ingredients/

#get_manual BusyBox.ver.1.29.2.Binary.TB-BB.zip "https://forum.xda-developers.com/devdb/project/?id=20023#downloads"
#get BusyBox.ver.1.29.2.Binary.TB-BB.zip $ZADE
#get_manual frytv90.apk "https://4pda.ru/forum/dl/post/15048550/frytv90.apk"
#get frytv90.apk $ZADE

#get com.semperpax.spmc17.tar.gz $ZADE
#get x96max-bootloader.img.lzma $ZADE
#get x96max-stock-modules.tar.lzma $ZADE
#get x96max-stock-boot-4G.img.lzma $ZADE
#get bootanimation.zip $ZADE
#get DroidTvSettings.apk $ZADE

get UPDATE-SuperSU-v2.82-20170528234214.zip 'https://download.chainfire.eu/1113/SuperSU/UPDATE-SuperSU-v2.82-20170528234214.zip?retrieve_file=1'
#get SimpleGalleryPro.apk 'https://f-droid.org/repo/com.simplemobiletools.gallery.pro_220.apk'
#get open_gapps-tvstock.zip 'https://github.com/opengapps/arm/releases/download/20190127/open_gapps-arm-8.1-tvstock-20190127.zip'
#get org.jwz.android.xscreensaver.apk "https://www.jwz.org/xscreensaver/xscreensaver-5.42.apk"
#get org.gdroid.gdroid.apk "https://f-droid.org/repo/org.gdroid.gdroid_7003.apk"
#get org.schabi.newpipe_71.apk "https://f-droid.org/repo/org.schabi.newpipe_71.apk"
#get SPMC-17.6a2-spmc-ed022ef-armeabi-v7a.apk "http://download.semperpax.com/spmc/android-arm/SPMC-17.6a2-spmc-ed022ef-armeabi-v7a.apk"
#get OrBot.apk "https://guardianproject.info/releases/Orbot-v15.4.0-BETA-1-ARM-ONLY.apk"
#get AceStreamATV.apk "http://dl.acestream.org/products/acestream-engine/android-tv/armv7/latest"

#get_apkpure APKPure.apk "https://apkpure.com/apkpure/com.apkpure.aegon/download?from=details"
#get_apkpure Backgrounds_HD_Wallpapers.apk "https://apkpure.com/backgrounds-hd-wallpapers/hd.backgrounds.wallpapers.theme/download?from=details"
#get_apkpure Weather.apk 'https://apkpure.com/weather/com.macropinch.swan/download?from=details'
#get_apkpure XAPK_Installer.apk 'https://apkpure.com/xapk-installer/com.apkpure.installer/download?from=details'
#get_apkpure atv_launcher.apk 'https://apkpure.com/atv-launcher/ca.dstudio.atvlauncher.free/download?from=details'
#get_apkpure TotalCommander.apk 'https://apkpure.com/total-commander-file-manager/com.ghisler.android.TotalCommander/download?from=details'
#get_apkpure TotCmd_WiFi_WLAN_Plugin.apk 'https://apkpure.com/wifi-wlan-plugin-for-totalcmd/com.ghisler.tcplugins.wifitransfer/download?from=details'
#get_apkpure TotCmd_LAN_plugin.apk 'https://apkpure.com/lan-plugin-for-total-commander/com.ghisler.tcplugins.LAN/download?from=details'
#get_apkpure TotCmd_FTP_plugin.apk 'https://apkpure.com/ftp-plugin-for-total-commander/com.ghisler.tcplugins.FTP/download?from=details'

But when run it, only SuperSU downloaded, but file size only 5.4kb, i must download manual then overwrite it in ~/afck/ingredients folder
then run make mod-supersu get error like above
how to solve it? thank you!
Last edited by oldman20 on Tue May 17, 2022 2:00 am, edited 1 time in total.
oldman20
Verified Member
Posts: 17
Joined: Sat May 14, 2022 4:23 pm
Answers: 0
Has thanked: 4 times

#50

anyone? i run everything is fine exclude this:

Code: Select all

~/afck$ make mod-supersu
mkdir -p "bc-tool/stamp"
#mkdir -p bc-tool/system/system/system/app/SuperSU
#unzip -qojp  common/Superuser.apk > bc-tool/system/system/system/app/SuperSU/SuperSU.apk
# Пропатчим SuperSU
#	@echo -e 'Patching APK file bc-tool/system/system/system/app/SuperSU/SuperSU.apk'
java -jar tools/apktool_2.4.0.jar decode -o out/amlogic/device/1-2g/patch-SuperSU.apk -f bc-tool/system/system/system/app/SuperSU/SuperSU.apk
Input file (bc-tool/system/system/system/app/SuperSU/SuperSU.apk) was not found or was not readable.
make: *** [build/mod.mak:62: bc-tool/stamp/.stamp.mod-supersu] Error 1
and i check in bc-tool/system/system/system/app/SuperSU/SuperSU.apk doesn't exist! already installed java and python:

Code: Select all

$ java -version
openjdk version "11.0.15" 2022-04-19
OpenJDK Runtime Environment (build 11.0.15+10-Ubuntu-0ubuntu0.22.04.1)
OpenJDK 64-Bit Server VM (build 11.0.15+10-Ubuntu-0ubuntu0.22.04.1, mixed mode, sharing)

$ sudo apt install python3.10
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
python3.10 is already the newest version (3.10.4-3).
python3.10 set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

$ python3.10 --version
Python 3.10.4

Post Reply