Skip to content
This repository has been archived by the owner on Oct 27, 2023. It is now read-only.

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
syoker committed Apr 14, 2022
0 parents commit 253b7be
Show file tree
Hide file tree
Showing 7 changed files with 337 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/Files
173 changes: 173 additions & 0 deletions META-INF/com/google/android/update-binary
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
#!/sbin/sh

#################
# Initialization
#################

umask 022

# Global vars
TMPDIR=/dev/tmp
PERSISTDIR=/sbin/.magisk/mirror/persist

rm -rf $TMPDIR 2>/dev/null
mkdir -p $TMPDIR

# echo before loading util_functions
ui_print() { echo "$1"; }

require_new_magisk() {
ui_print "*******************************"
ui_print " Please install Magisk v19.0+! "
ui_print "*******************************"
exit 1
}

is_legacy_script() {
unzip -l "$ZIPFILE" install.sh | grep -q install.sh
return $?
}

print_modname() {
local len
len=`echo -n $MODNAME | wc -c`
len=$((len + 2))
local pounds=`printf "%${len}s" | tr ' ' '*'`
ui_print "$pounds"
ui_print " $MODNAME "
ui_print "$pounds"
ui_print "*******************"
ui_print " Powered by Magisk "
ui_print "*******************"
}

##############
# Environment
##############

OUTFD=$2
ZIPFILE=$3

mount /data 2>/dev/null

# Load utility functions
[ -f /data/adb/magisk/util_functions.sh ] || require_new_magisk
. /data/adb/magisk/util_functions.sh
[ $MAGISK_VER_CODE -gt 18100 ] || require_new_magisk

# Preperation for flashable zips
setup_flashable

# Mount partitions
mount_partitions

# Detect version and architecture
api_level_arch_detect

# Setup busybox and binaries
$BOOTMODE && boot_actions || recovery_actions

##############
# Preparation
##############

# Extract prop file
unzip -o "$ZIPFILE" module.prop -d $TMPDIR >&2
[ ! -f $TMPDIR/module.prop ] && abort "! Unable to extract zip file!"

$BOOTMODE && MODDIRNAME=modules_update || MODDIRNAME=modules
MODULEROOT=$NVBASE/$MODDIRNAME
MODID=`grep_prop id $TMPDIR/module.prop`
MODPATH=$MODULEROOT/$MODID
MODNAME=`grep_prop name $TMPDIR/module.prop`

# Create mod paths
rm -rf $MODPATH 2>/dev/null
mkdir -p $MODPATH

##########
# Install
##########

if is_legacy_script; then
unzip -oj "$ZIPFILE" module.prop install.sh uninstall.sh 'common/*' -d $TMPDIR >&2

# Load install script
. $TMPDIR/install.sh

# Callbacks
print_modname
on_install

# Custom uninstaller
[ -f $TMPDIR/uninstall.sh ] && cp -af $TMPDIR/uninstall.sh $MODPATH/uninstall.sh

# Skip mount
$SKIPMOUNT && touch $MODPATH/skip_mount

# prop file
$PROPFILE && cp -af $TMPDIR/system.prop $MODPATH/system.prop

# Module info
cp -af $TMPDIR/module.prop $MODPATH/module.prop

# post-fs-data scripts
$POSTFSDATA && cp -af $TMPDIR/post-fs-data.sh $MODPATH/post-fs-data.sh

# service scripts
$LATESTARTSERVICE && cp -af $TMPDIR/service.sh $MODPATH/service.sh

ui_print "- Setting permissions"
set_permissions
else
print_modname

unzip -o "$ZIPFILE" customize.sh -d $MODPATH >&2

if ! grep -q '^SKIPUNZIP=1$' $MODPATH/customize.sh 2>/dev/null; then
ui_print "- Extracting module files"
unzip -o "$ZIPFILE" -x 'META-INF/*' -d $MODPATH >&2

# Default permissions
set_perm_recursive $MODPATH 0 0 0755 0644
fi

# Load customization script
[ -f $MODPATH/customize.sh ] && . $MODPATH/customize.sh
fi

# Handle replace folders
for TARGET in $REPLACE; do
ui_print "- Replace target: $TARGET"
mktouch $MODPATH$TARGET/.replace
done

if $BOOTMODE; then
# Update info for Magisk Manager
mktouch $NVBASE/modules/$MODID/update
cp -af $MODPATH/module.prop $NVBASE/modules/$MODID/module.prop
fi

# Copy over custom sepolicy rules
if [ -f $MODPATH/sepolicy.rule -a -e $PERSISTDIR ]; then
ui_print "- Installing custom sepolicy patch"
PERSISTMOD=$PERSISTDIR/magisk/$MODID
mkdir -p $PERSISTMOD
cp -af $MODPATH/sepolicy.rule $PERSISTMOD/sepolicy.rule
fi

# Remove stuffs that don't belong to modules
rm -rf \
$MODPATH/system/placeholder $MODPATH/customize.sh \
$MODPATH/README.md $MODPATH/.git* 2>/dev/null

##############
# Finalizing
##############

cd /
$BOOTMODE || recovery_cleanup
rm -rf $TMPDIR

ui_print "- Done"
exit 0
1 change: 1 addition & 0 deletions META-INF/com/google/android/updater-script
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#MAGISK
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Extra Themed Icons

## Description
This module adds more icons either lines or filled (you can choose) than a normal Pixel Launcher.

## Requirements
- ROOT
- Android 12.1/12L
- Android 13

## Tested on Device
- Motorola One Fusion

## Tested on ROM
- [Pixel Experience 12.1 (build 04/05/2022)](https://t.me/MotoUpdatesbr/13) by [Veeronez](https://t.me/Veeronez "Veeronez in Telegram") (GSI)
- [Pixel Experience Plus 12.1 v412](https://github.com/ponces/treble_build_pe/releases/tag/v412-plus) by [Ponces](https://github.com/ponces "Ponces in GitHub") (GSI)

## Credits
- Filled Icons by [TeamFiles](https://t.me/modulesrepo "Modules Repository | Team Files™")
- Line Icons by [Lawnchair Team](https://t.me/lawnchairci "Lawnchair News")

## Changelog
### 1.0.0
- Initial Build
- 644 Filled Icons (Thanks [TeamFiles](https://t.me/modulesrepo "Modules Repository | Team Files™"))
- 295 Line Icons (Thanks [Lawnchair Team](https://t.me/lawnchairci "Lawnchair News"))
126 changes: 126 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
SKIPMOUNT=false
PROPFILE=false
POSTFSDATA=false
LATESTARTSERVICE=false
API_SUPPORT_MIN=31

REPLACE="
"

print_modname() {
ui_print ""
ui_print "••••••••••••••••••••••••••"
ui_print " Extra Themed Icons"
ui_print "••••••••••••••••••••••••••"
ui_print ""
ui_print "Module by @Syoker"
ui_print "Filled Icons by TeamFiles"
ui_print "Line Icons by Lawnchair Team"
ui_print ""
sleep 2

}

android_check() {
if [[ $API < API_SUPPORT_MIN ]]; then
ui_print "• Sorry, you need Android 12 or later to use this module."
ui_print ""
sleep 2
exit 1
fi
}

volume_keytest() {
ui_print "• Volume Key Test"
ui_print " Please press any key volume:"
(/system/bin/getevent -lc 1 2>&1 | /system/bin/grep VOLUME | /system/bin/grep " DOWN" > "$TMPDIR"/events) || return 1
return 0
}

volume_key() {
while (true); do
/system/bin/getevent -lc 1 2>&1 | /system/bin/grep VOLUME | /system/bin/grep " DOWN" > "$TMPDIR"/events
if (`cat "$TMPDIR"/events 2>/dev/null | /system/bin/grep VOLUME >/dev/null`); then
break
fi
done
if (`cat "$TMPDIR"/events 2>/dev/null | /system/bin/grep VOLUMEUP >/dev/null`); then
return 1
else
return 0
fi
}

on_install() {

android_check

unzip -o "$ZIPFILE" 'Files/*' -d $MODPATH >&2

if volume_keytest; then
ui_print " Key test function complete"
ui_print ""
sleep 2

ui_print "• Do you want to install filled icons or line icons?"
ui_print " Volume up(+): Filled icons"
ui_print " Volume down(-): Line icons"

SELECT=volume_key

if "$SELECT"; then
ui_print " Install line icons to system/product/overlay"
ui_print ""
if [ -f "/system/product/overlay/ThemedIconsPixelOverlay.apk" ]; then
if [ -f "/system/product/overlay/ThemedIconsOverlay.apk" ]; then
mkdir -p $MODPATH/system/product/overlay
cp -f $MODPATH/Files/Line_Icons/ThemedIconsPixelOverlay.apk $MODPATH/system/product/overlay/
cp -f $MODPATH/Files/Line_Icons/ThemedIconsOverlay.apk $MODPATH/system/product/overlay/
sleep 2
else
mkdir -p $MODPATH/system/product/overlay
cp -f $MODPATH/Files/Line_Icons/ThemedIconsPixelOverlay.apk $MODPATH/system/product/overlay/
sleep 2
fi
else
mkdir -p $MODPATH/system/product/overlay
cp -f $MODPATH/Files/Line_Icons/ThemedIconsOverlay.apk $MODPATH/system/product/overlay/
sleep 2
fi

else
ui_print " Install filled icons to system/product/overlay"
ui_print ""
if [ -f "/system/product/overlay/ThemedIconsPixelOverlay.apk" ]; then
if [ -f "/system/product/overlay/ThemedIconsOverlay.apk" ]; then
mkdir -p $MODPATH/system/product/overlay
cp -f $MODPATH/Files/Filled_Icons/ThemedIconsPixelOverlay.apk $MODPATH/system/product/overlay/
cp -f $MODPATH/Files/Filled_Icons/ThemedIconsOverlay.apk $MODPATH/system/product/overlay/
sleep 2
else
mkdir -p $MODPATH/system/product/overlay
cp -f $MODPATH/Files/Filled_Icons/ThemedIconsPixelOverlay.apk $MODPATH/system/product/overlay/
sleep 2
fi
else
mkdir -p $MODPATH/system/product/overlay
cp -f $MODPATH/Files/Filled_Icons/ThemedIconsOverlay.apk $MODPATH/system/product/overlay/
sleep 2
fi

fi

else
ui_print " You have not pressed any key, aborting installation."
ui_print ""
sleep 2
exit 1
fi

ui_print "- Deleting package cache"
rm -rf /data/system/package_cache/*
}

set_permissions() {
set_perm_recursive $MODPATH 0 0 0755 0644
}
7 changes: 7 additions & 0 deletions module.prop
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
id=Extra_Themed_Icons
name=Extra Themed Icons
version=v1.0.0
versionCode=1
author=@Syoker
description=This module adds more icons either lines or filled (you can choose) than a normal Pixel Launcher.
support=@Syoker on Telegram
3 changes: 3 additions & 0 deletions uninstall.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

rm -rf /data/system/package_cache/*

0 comments on commit 253b7be

Please sign in to comment.