Skip to content

Commit

Permalink
Flashable ZIP to enable the soft task bar
Browse files Browse the repository at this point in the history
Initial commit
  • Loading branch information
MSe1969 committed May 22, 2024
0 parents commit 3ecc8e8
Show file tree
Hide file tree
Showing 10 changed files with 173 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lin18.1-GTS210TB*
8 changes: 8 additions & 0 deletions create-zip.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

rm lin18.1-GTS210TB*

cd install
zip -r ../lin18.1-GTS210TB_install_V0.01.zip *
cd ..

Binary file not shown.
32 changes: 32 additions & 0 deletions install/META-INF/com/google/android/updater-script
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
ui_print("Enabling soft task bar...");
ifelse(is_mounted("/system"), unmount("/system"));
ifelse(is_mounted("/system_root"), unmount("/system_root"));
package_extract_file("mount-system.sh", "/tmp/mount-system.sh");
package_extract_file("unmount-system.sh", "/tmp/unmount-system.sh");
package_extract_file("sys-sys.sh", "/tmp/sys-sys.sh");
package_extract_file("sys-root.sh", "/tmp/sys-root.sh");
package_extract_file("update-prop.sh", "/tmp/update-prop.sh");
set_metadata("/tmp/mount-system.sh", "uid", 0, "gid", 0, "mode", 0755);
set_metadata("/tmp/unmount-system.sh", "uid", 0, "gid", 0, "mode", 0755);
set_metadata("/tmp/sys-sys.sh", "uid", 0, "gid", 0, "mode", 0755);
set_metadata("/tmp/sys-root.sh", "uid", 0, "gid", 0, "mode", 0755);
set_metadata("/tmp/update-prop.sh", "uid", 0, "gid", 0, "mode", 0755);
run_program("/tmp/mount-system.sh") == 0 || abort("Could not mount /system");

if run_program("/tmp/sys-root.sh") != 0 then
if run_program("/tmp/sys-sys.sh") == 0 then
package_extract_dir("system", "/system/system");
set_metadata("/system/system/addon.d/63-tbprop.sh", "uid", 0, "gid", 0, "mode", 0644, "selabel", "u:object_r:system_file:s0");
else
package_extract_dir("system", "/system");
set_metadata("/system/addon.d/63-tbprop.sh", "uid", 0, "gid", 0, "mode", 0644, "selabel", "u:object_r:system_file:s0");
endif;
else
package_extract_dir("system", "/system_root/system");
set_metadata("/system_root/system/addon.d/63-tbprop.sh", "uid", 0, "gid", 0, "mode", 0644, "selabel", "u:object_r:system_file:s0");
endif;

run_program("/tmp/update-prop.sh") == 0 || ui_print("Could not update build.prop");
run_program("/tmp/unmount-system.sh") == 0 || ui_print("Could not unmount /system");
ui_print("Done");
set_progress(1.000000);
36 changes: 36 additions & 0 deletions install/mount-system.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/sbin/sh

# Modern devices use /system as root ("/")
# TWRP 3.6.x sometimes also uses /system_root,
# even if property not present
system_as_root=`getprop ro.build.system_root_image`
if [ "$system_as_root" == "true" ] || [ -d "/system_root" ]; then
if mount -o rw /system_root; then
exit 0
fi

active_slot=`getprop ro.boot.slot_suffix`
if [ ! -z "$active_slot" ]; then
block=/dev/block/bootdevice/by-name/system$active_slot
else
block=/dev/block/bootdevice/by-name/system
fi
mkdir -p /system_root
if mount -o rw $block /system_root ||
mount -o rw $block /system_root -t ext4 ||
mount -o rw $block /system_root -t f2fs; then
exit 0
fi
else
if mount /system; then
exit 0
fi

# Try to get the block from /etc/recovery.fstab
block=`cat /etc/recovery.fstab | cut -d '#' -f 1 | grep /system | grep -o '/dev/[^ ]*' | head -1`
if [ -n "$block" ] && mount $block /system; then
exit 0
fi
fi

exit 1
14 changes: 14 additions & 0 deletions install/sys-root.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/sbin/sh

#
# Depending on the recovery (e.g. TWRP 3.6.x on some devices),
# the /system_root partition may be used, even if the property
# is not present - so we need to use this script
# to find out about that
#
system_as_root=`getprop ro.build.system_root_image`
if [ "$system_as_root" == "true" ] || [ -d "/system_root" ]; then
exit 0
else
exit 1
fi
12 changes: 12 additions & 0 deletions install/sys-sys.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/sbin/sh

#
# Depending on the recovery, the /system partition may
# be mounted under /system/system - so we need to use this script
# to find out about that
#
if [ -d /system/system ]; then
exit 0
else
exit 1
fi
32 changes: 32 additions & 0 deletions install/system/addon.d/63-tbprop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/sbin/sh
#
# ADDOND_VERSION=2
#

. /tmp/backuptool.functions

case "$1" in
backup)
# Stub
;;
restore)
matching=$(grep "qemu.hw.mainkeys" $S/build.prop)
if [ -z $matching ]; then
echo " " >> $S/build.prop
echo "# Enable Taskbar" >> $S/build.prop
echo "qemu.hw.mainkeys=0" >> $S/build.prop
fi
;;
pre-backup)
# Stub
;;
post-backup)
# Stub
;;
pre-restore)
# Stub
;;
post-restore)
# Stub
;;
esac
17 changes: 17 additions & 0 deletions install/unmount-system.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/sbin/sh

# Modern devices use /system as root ("/")
# TWRP 3.6.x sometimes also uses /system_root,
# even if property not present
system_as_root=`getprop ro.build.system_root_image`
if [ "$system_as_root" == "true" ] || [ -d "/system_root" ]; then
if umount /system_root; then
exit 0
fi
else
if umount /system; then
exit 0
fi
fi

exit 1
21 changes: 21 additions & 0 deletions install/update-prop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/sbin/sh

#
# Depending on the recovery, the /system partition may
# be mounted under /system/system - so we need to use this script
# to find out about that
#
if [ -d /system/system ]; then
PROP_FILE="/system/system/build.prop"
elif [ -d /system_root ]; then
PROP_FILE="/system_root/system/build.prop"
else
PROP_FILE="/system/build.prop"
fi

matching=$(grep "qemu.hw.mainkeys" "$PROP_FILE")
if [ -z $matching ]; then
echo " " >> "$PROP_FILE"
echo "# Enable Taskbar" >> "$PROP_FILE"
echo "qemu.hw.mainkeys=0" >> "$PROP_FILE"
fi

0 comments on commit 3ecc8e8

Please sign in to comment.