diff --git a/LICENSE b/LICENSE index 5b6c682..c651365 100644 --- a/LICENSE +++ b/LICENSE @@ -75,6 +75,25 @@ busybox: GPLv2 https://github.com/osm0sis/android-busybox-ndk (pre-patched source tree used to build available upon request) +lptools_static: Apache License 2.0 + + Copyright (C) 2020 Pierre-Hugues Husson + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + Source not required, however, respective source is provided: + https://github.com/phhusson/vendor_lptools + ## Optional Binary Licenses: diff --git a/META-INF/com/google/android/updater-script b/META-INF/com/google/android/updater-script index d9b2dec..d6b51d7 100644 --- a/META-INF/com/google/android/updater-script +++ b/META-INF/com/google/android/updater-script @@ -3,4 +3,4 @@ # Dummy file; update-binary is a shell script (DO NOT CHANGE) # # -# AK_BASE_VERSION=20220428 +# AK_BASE_VERSION=20220430 diff --git a/tools/ak3-core.sh b/tools/ak3-core.sh index 01e1c96..c1eae85 100755 --- a/tools/ak3-core.sh +++ b/tools/ak3-core.sh @@ -437,8 +437,14 @@ flash_generic() { if [ ! "$imgblock" ]; then abort "$1 partition could not be found. Aborting..."; fi; - # TODO: add dynamic partition resizing using lptools_static instead of aborting - if [ "$(wc -c < $img)" -gt "$(wc -c < $imgblock)" ]; then + if [ "$path" == "/dev/block/mapper" ]; then + $bin/lptools_static remove $1_ak3; + $bin/lptools_static create $1_ak3 $(wc -c < $img) || abort "Creating $1_ak3 failed. Aborting..."; + $bin/lptools_static unmap $1_ak3 || abort "Unmapping $1_ak3 failed. Aborting..."; + $bin/lptools_static map $1_ak3 || abort "Mapping $1_ak3 failed. Aborting..."; + $bin/lptools_static replace $1_ak3 $1$slot || abort "Replacing $1$slot failed. Aborting..."; + imgblock=/dev/block/mapper/$1_ak3; + elif [ "$(wc -c < $img)" -gt "$(wc -c < $imgblock)" ]; then abort "New $1 image larger than $1 partition. Aborting..."; fi; isro=$(blockdev --getro $imgblock 2>/dev/null); @@ -470,10 +476,10 @@ flash_dtbo() { flash_generic dtbo; } ### write_boot (repack ramdisk then build, sign and write image, vendor_dlkm and dtbo) write_boot() { - flash_generic vendor_dlkm; # TODO: move below boot once resizing is supported repack_ramdisk; flash_boot; flash_generic vendor_boot; # temporary until hdr v4 can be unpacked/repacked fully by magiskboot + flash_generic vendor_dlkm; flash_generic dtbo; } ### diff --git a/tools/lptools_static b/tools/lptools_static new file mode 100755 index 0000000..b7556c4 Binary files /dev/null and b/tools/lptools_static differ