Permalink
Browse files

boot-patcher: update binaries and scripts to lazyflasher 6.0

Signed-off-by: James Christopher Adduono <jc@adduono.com>
  • Loading branch information...
jcadduono committed Nov 22, 2017
1 parent 7a56473 commit 01126b4682ae4c6de38b445fcc8e58be90bc1f40
Showing with 31 additions and 20 deletions.
  1. BIN nethunter-installer/boot-patcher/arch/amd64/tools/bbe
  2. BIN nethunter-installer/boot-patcher/arch/amd64/tools/bootimg
  3. BIN nethunter-installer/boot-patcher/arch/amd64/tools/bzip2
  4. BIN nethunter-installer/boot-patcher/arch/amd64/tools/chromeos/futility
  5. BIN nethunter-installer/boot-patcher/arch/amd64/tools/lz4
  6. BIN nethunter-installer/boot-patcher/arch/amd64/tools/sepolicy-inject
  7. BIN nethunter-installer/boot-patcher/arch/amd64/tools/sepolicy-inject-M
  8. BIN nethunter-installer/boot-patcher/arch/amd64/tools/sepolicy-inject-N
  9. BIN nethunter-installer/boot-patcher/arch/arm64/tools/bbe
  10. BIN nethunter-installer/boot-patcher/arch/arm64/tools/bootimg
  11. BIN nethunter-installer/boot-patcher/arch/arm64/tools/bzip2
  12. BIN nethunter-installer/boot-patcher/arch/arm64/tools/chromeos/futility
  13. BIN nethunter-installer/boot-patcher/arch/arm64/tools/lz4
  14. BIN nethunter-installer/boot-patcher/arch/arm64/tools/sepolicy-inject
  15. BIN nethunter-installer/boot-patcher/arch/arm64/tools/sepolicy-inject-M
  16. BIN nethunter-installer/boot-patcher/arch/arm64/tools/sepolicy-inject-N
  17. BIN nethunter-installer/boot-patcher/arch/armhf/tools/bbe
  18. BIN nethunter-installer/boot-patcher/arch/armhf/tools/bootimg
  19. BIN nethunter-installer/boot-patcher/arch/armhf/tools/bzip2
  20. BIN nethunter-installer/boot-patcher/arch/armhf/tools/chromeos/futility
  21. BIN nethunter-installer/boot-patcher/arch/armhf/tools/lz4
  22. BIN nethunter-installer/boot-patcher/arch/armhf/tools/sepolicy-inject
  23. BIN nethunter-installer/boot-patcher/arch/armhf/tools/sepolicy-inject-M
  24. BIN nethunter-installer/boot-patcher/arch/armhf/tools/sepolicy-inject-N
  25. BIN nethunter-installer/boot-patcher/arch/i386/tools/bbe
  26. BIN nethunter-installer/boot-patcher/arch/i386/tools/bootimg
  27. BIN nethunter-installer/boot-patcher/arch/i386/tools/bzip2
  28. BIN nethunter-installer/boot-patcher/arch/i386/tools/chromeos/futility
  29. BIN nethunter-installer/boot-patcher/arch/i386/tools/lz4
  30. BIN nethunter-installer/boot-patcher/arch/i386/tools/sepolicy-inject
  31. BIN nethunter-installer/boot-patcher/arch/i386/tools/sepolicy-inject-M
  32. BIN nethunter-installer/boot-patcher/arch/i386/tools/sepolicy-inject-N
  33. +4 −2 nethunter-installer/boot-patcher/boot-patcher.sh
  34. +27 −18 nethunter-installer/boot-patcher/patch.d-env
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -115,11 +115,12 @@ dump_boot() {

# determine the format the ramdisk was compressed in
determine_ramdisk_format() {
magicbytes=$(hexdump -vn2 -e '2/1 "%x"' "$split_img/boot.img-ramdisk")
magicbytes=$(hexdump -vn2 -e '2/1 "%.2x"' "$split_img/boot.img-ramdisk")
case "$magicbytes" in
425a) rdformat=bzip2; decompress="$bin/bzip2 -dc" ;;
1f8b|1f9e) rdformat=gzip; decompress="gzip -dc" ;;
0221) rdformat=lz4; decompress="$bin/lz4 -d" ;;
0422) rdformat=lz4; decompress="$bin/lz4 -d" ;;
0221) rdformat=lz4l; decompress="$bin/lz4 -d" ;;
894c) rdformat=lzo; decompress="lzop -dc" ;;
5d00) rdformat=lzma; decompress="lzma -dc" ;;
fd37) rdformat=xz; decompress="xz -dc" ;;
@@ -133,6 +134,7 @@ determine_ramdisk_format() {
bzip2) compress="$bin/bzip2 -9c" ;;
gzip) compress="gzip -9c" ;;
lz4) compress="$bin/lz4 -9" ;;
lz4l) compress="$bin/lz4 -9l" ;;
lzo) compress="lzop -9c" ;;
lzma) compress="$bin/xz --format=lzma --lzma1=dict=16MiB -9";
abort "LZMA ramdisk compression is currently unsupported" ;;
@@ -37,24 +37,6 @@ found_sepolicy=false
found_file_contexts=false
[ -f "$file_contexts" ] && found_file_contexts=true

if $found_sepolicy; then
if "$seinject" -e -c filesystem -P "$sepolicy" &&
! "$seinject-N" -e -c filesystem -P "$sepolicy"
then
# Android 7.0+ (Nougat)
android_api=24
seinject="$seinject-N"
elif "$seinject" -e -s gatekeeper_service -P "$sepolicy"
then
# Android 6.0 (Marshmallow)
android_api=23
elif "$seinject" -e -c service_manager -P "$sepolicy"
then
# Android 5.1 (Lollipop MR1)
android_api=21
fi
fi

print() {
if [ "$1" ]; then
echo "ui_print -- $1" > "$console"
@@ -69,6 +51,31 @@ abort() {
exit 1
}

# sinject_test
# tests for Android API and sets seinject binary accordingly
seinject_test() {
$found_sepolicy || return 1
[ -x "$seinject" ] || return 1
if "$seinject" -e -c filesystem -P "$sepolicy" &&
! "$seinject-M" -e -c filesystem -P "$sepolicy"; then
# Android 7.0+ (Nougat)
android_api=24
return
fi
seinject="$seinject-M"
[ -x "$seinject" ] || return 1
if "$seinject" -e -s gatekeeper_service -P "$sepolicy"; then
# Android 6.0 (Marshmallow)
android_api=23
return
fi
if "$seinject" -e -c service_manager -P "$sepolicy"; then
# Android 5.1 (Lollipop MR1)
android_api=21
return
fi
}

# setperm <directory permissions> <file permissions> <directory>
# recursively sets permissions of files & directories
setperm() {
@@ -214,4 +221,6 @@ seadd() {
"$seinject" -P "$sepolicy" "$@"
}

seinject_test

cd "$ramdisk"

0 comments on commit 01126b4

Please sign in to comment.