Skip to content

Commit 3bb4a72

Browse files
committed
Upload file
1 parent 1d3f342 commit 3bb4a72

2 files changed

Lines changed: 20 additions & 3 deletions

File tree

krscript/src/main/java/com/omarea/krscript/model/ShellHandlerBase.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,7 @@ protected void onReaderMsg(Object msg) {
9090
if (msg == null) return;
9191

9292
// KHÔNG trim để giữ newline
93-
// String log = msg.toString();
94-
String log = msg.toString().replaceAll("\\[[0-9;]*m", "");
93+
String log = msg.toString();
9594

9695
// progress:[x/y]
9796
if (Pattern.matches("^progress:\\[[\\-0-9]+/[0-9]+]$", log.trim())) {

pio/src/main/assets/home/bin/unpak_img

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,25 @@ mkdir -p "$OUTPUT/${namepv##*/}" $OUTPUT/config
149149
echo "$dang_file" > "$OUTPUT/config/${namepv##*/}_info"
150150
echo "$(fsck.f2fs "$file_img" | grep 'superblock features' | grep -cm1 ro)" > "$OUTPUT/config/${namepv##*/}_f2fs_ro"
151151
elif [ "$dang_file" == 'erofs' ];then
152-
extract.erofs -T$threads -x -i "$file_img" -o "$OUTPUT" >$TMP/extract_erofs.log || killtree "\nextract.erofs error: ${namepv##*/}" "$OUTPUT/${namepv##*/}"
152+
extract.erofs -T$threads -x -i "$file_img" -o "$OUTPUT" >$TMP/extract_erofs.log || killtree "\nextract.erofs error: ${namepv##*/}" "$OUTPUT/${namepv##*/}" &
153+
if [ -f $TMP/extract_erofs.log ];then
154+
while true; do
155+
number_kk="$(sed -E 's/\x1b\[[0-9;]*m//g; s/[\r\t]/\n/g' "$TMP/extract_erofs.log" | grep -E 'Extract: \[[^]]+\]' | tail -n 1 | awk '{print $3}' | cut -d\. -f1)"
156+
if [ -z "$number_kk" ];then
157+
number_kk=0
158+
iv=$((iv+1))
159+
[ "$iv" -ge 10 ] && break
160+
fi
161+
if [ $number_kk -ge 98 ] || [ "$(grep -cm1 "100.00%" $TMP/extract_erofs.log)" == 1 ];then
162+
progress -1/0
163+
break
164+
else
165+
[ "$number_kk" ] && progress $number_kk/100
166+
sleep 0.5
167+
fi
168+
done
169+
fi
170+
wait
153171
[ -f $TMP/extract_erofs.log ] && sed -i 's/\x1b\[[^m]*m//g' $TMP/extract_erofs.log
154172
echo "$dang_file" > "$OUTPUT/config/${namepv##*/}_info"
155173
if [ -f $OUTPUT/config/exception.log ];then

0 commit comments

Comments
 (0)