Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions defines.mk
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ $(OUT_OBJ_SYSTEM)/$(2): $(BOARD_SYSTEM)/$(2) $(MERGE_UPDATE_TXT) $(PREPARE_FRW_R
$(hide) $(call name_to_id,$$(tempSmaliDir))
$(hide) $(call update_apktool_yml,$$(tempSmaliDir)/apktool.yml,$(APKTOOL_BOARD_TAG));
$(hide) mkdir -p $(OUT_OBJ_SYSTEM)
$(hide) $(APKTOOL) b $$(tempSmaliDir) -p $(APKTOOL_FRAME_PATH_BOARD_MODIFY) -o $$@
$(hide) $(APKTOOL_FRAMEWORK) b $$(tempSmaliDir) -p $(APKTOOL_FRAME_PATH_BOARD_MODIFY) -o $$@
$(hide) rm -rf "$$(tempSmaliDir)";
$(hide) echo "<<< build |target-files|SYSTEM|board_modify_jar| to $$@ done"
endef
Expand Down Expand Up @@ -480,7 +480,7 @@ $(eval board_prebuilt_from:=)
$(hide) $(call custom_jar,$$(jarBaseName),$$(tempSmaliDir))
$(hide) $(call name_to_id,$$(tempSmaliDir))
$(hide) $(call update_apktool_yml,$$(tempSmaliDir)/apktool.yml,$(APKTOOL_MERGED_TAG));
$(hide) $(APKTOOL) b $$(tempSmaliDir) -o $$@;
$(hide) $(APKTOOL_FRAMEWORK) b $$(tempSmaliDir) -o $$@;
$(hide) rm -rf $$(tempSmaliDir);
$(hide) rm -rf $$(boardSmaliDir);
$(hide) echo "<<< build |target-files|SYSTEM|vendor_modify_jar| to $$@ done";
Expand Down
1 change: 1 addition & 0 deletions locals.mk
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ OTA_CERT := $(PORT_ROOT)/$(CERTS_PATH)/testkey
############### tools in $(PORT_ROOT)/tools ###############
PORT_TOOLS := $(PORT_ROOT)/tools
APKTOOL := $(PORT_TOOLS)/apktool
APKTOOL_FRAMEWORK := $(PORT_TOOLS)/apktool_framework
OTA_NORMALIZE := $(PORT_TOOLS)/otanormalize

NAME_TO_ID_TOOL := $(PORT_TOOLS)/nametoid
Expand Down
17 changes: 6 additions & 11 deletions tools/target_files_from_device.sh
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,11 @@ function updateSystemPartitionSize {
slot_suffix="_a"
fi
fi
if [ "$ROOT_STATE" = "system_root" ]; then
SYSTEM_MOUNT_POINT=$(adb shell su -c find /dev/block/ -name system$slot_suffix)
SYSTEM_SOFT_MOUNT_POINT=$(adb shell su -c ls -l $SYSTEM_MOUNT_POINT | awk -F '->' '{print $2}' | awk -F '/' '{print $NF}')
else

waitForDeviceOnline
SYSTEM_MOUNT_POINT=$(adb shell find /dev/block/ -name "system"$slot_suffix)
SYSTEM_MOUNT_POINT=$(adb shell mount | grep "system" | awk '{print $1}')
SYSTEM_SOFT_MOUNT_POINT=$(adb shell ls -l $SYSTEM_MOUNT_POINT | awk -F '->' '{print $2}' | awk -F '/' '{print $NF}')
fi

SYSTEM_PARTITION_SIZE=$(adb shell cat proc/partitions | grep $SYSTEM_SOFT_MOUNT_POINT | awk 'BEGIN{FS=" "}{print $3}')
if [ x"$SYSTEM_PARTITION_SIZE" = x ] || [ -z "$(echo $SYSTEM_PARTITION_SIZE | sed -n "/^[0-9]\+$/p")" ]; then
echo "system partition size get error!"
Expand Down Expand Up @@ -218,11 +215,9 @@ function buildSystemInfo {
function buildSystemDir_dd {
echo ">> dd system from device (time-costly, be patient) ..."
waitForDeviceOnline
if [ "$ROOT_STATE" = "system_root" ];then
adb shell su -c dd if=$SYSTEM_MOUNT_POINT of=/sdcard/system.img bs=2048 > /dev/null 2>&1
else
adb shell dd if=$SYSTEM_MOUNT_POINT of=/sdcard/system.img bs=2048 > /dev/null 2>&1
fi

adb shell dd if=$SYSTEM_MOUNT_POINT of=/sdcard/system.img bs=2048> /dev/null 2>&1

adb pull /sdcard/system.img $OUT_DIR/system.img > /dev/null 2>&1
adb shell rm /sdcard/system.img
unpack_systemimg $OUT_DIR/system.img $SYSTEM_DIR
Expand Down