Skip to content
This repository was archived by the owner on Feb 23, 2019. It is now read-only.
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
Binary file modified addon.tar.xz
Binary file not shown.
95 changes: 59 additions & 36 deletions common/install.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
if [ -n "$OOS" ]; then
# Gets options from zip name
BOOT=false; FONT=false; RING=false; APP=false
OIFS=$IFS; IFS=\|
case $(echo $(basename $ZIPFILE) | tr '[:upper:]' '[:lower:]') in
*boot*|*Boot*|*BOOT*) BOOT=true;;
*font*|*Font*|*FONT*) FONT=true;;
*ring*|*Ring*|*RING*) RING=true;;
*app*|*App*|*APP*) APP=true;;
esac
IFS=$OIFS

if [ "$OOS" ]; then
ui_print " "
ui_print " Oxy-ify is only for non-OOS devices!"
ui_print " Why would you need this stuff if you are already in Oxygen OS?"
Expand All @@ -14,61 +25,73 @@ if [ -n "$OOS" ]; then
fi
fi

ui_print " "
ui_print " - Boot Animation Option -"
ui_print " Do you want to enable Oxygen OS boot animation?"
ui_print " (boot animation may not work for some devices)"
ui_print " Vol Up = Yes, Vol Down = No"
if $VKSEL; then
if [ "$BOOT" == false -a "$FONT" == false -a "$RING" == false -a "$APP" == false ]; then
ui_print " "
ui_print " - Boot Animation Option -"
ui_print " Do you want to enable Oxygen OS boot animation?"
ui_print " (boot animation may not work for some devices)"
ui_print " Vol Up = Yes, Vol Down = No"
if $VKSEL; then
BOOT=true
ui_print " "
ui_print " - Font Option -"
ui_print " Do you want OnePlus Slate font?"
ui_print " Vol Up = Yes, Vol Down = No"
if $VKSEL; then
FONT=true
ui_print " "
ui_print " - Ringtone Option -"
ui_print " Do you want Oxygen OS custom media sounds?"
ui_print " They include ringtones, alarms, notifications and UI sounds"
ui_print " Vol Up = Yes, Vol Down = No"
if $VKSEL; then
RING=true
if [ $API -ge 24 ]; then
ui_print " "
ui_print " - App Option -"
ui_print " Do you want OnePlus apps (Camera, Gallery and Weather)?"
ui_print " Vol Up = Yes, Vol Down = No"
if $VKSEL; then
APP=true
fi
fi
fi
fi
fi
else
ui_print " Options specified in zip name!"
fi

if $BOOT; then
ui_print " "
ui_print " Enabling boot animation..."
mkdir -p "$MAGISK_SIMPLE""$BFOLDER"
cp -f "$INSTALLER"/common/options/bootanimation.zip "$MAGISK_SIMPLE""$BFOLDER""$BZIP"
mkdir -p $MAGISK_SIMPLE/$BFOLDER
cp -f $INSTALLER/custom/bootanimation.zip $MAGISK_SIMPLE/$BFOLDER/$BZIP
else
ui_print " "
ui_print " Disabling boot animation..."
fi

ui_print " "
ui_print " - Font Option -"
ui_print " Do you want OnePlus Slate font?"
ui_print " Vol Up = Yes, Vol Down = No"
if $VKSEL; then
if $FONT; then
ui_print " "
ui_print " Enabling font..."
else
ui_print " "
ui_print " Disabling font..."
rm -rf "$INSTALLER"/system/fonts
rm -rf $INSTALLER/system/fonts
fi

ui_print " "
ui_print " - Ringtone Option -"
ui_print " Do you want Oxygen OS custom media sounds?"
ui_print " They include ringtones, alarms, notifications and UI sounds"
ui_print " Vol Up = Yes, Vol Down = No"
if $VKSEL; then
if $RING; then
ui_print " "
ui_print " Enabling custom media sounds..."
else
ui_print " "
ui_print " Disabling custom media sounds..."
rm -rf "$INSTALLER"/system/media/audio
rm -rf $INSTALLER/system/media/audio
fi

if [ "$API" -ge 24 ]; then
ui_print " "
ui_print " - App Option -"
ui_print " Do you want OnePlus apps (Camera, Gallery and Weather)?"
ui_print " Vol Up = Yes, Vol Down = No"
if $VKSEL; then
if [ $API -ge 24 ] && [ $APP ]; then
ui_print " "
ui_print " Enabling OnePlus apps..."
else
ui_print " "
ui_print " Disabling OnePlus apps..."
rm -rf "$INSTALLER"/system/priv-app/
fi
else
rm -rf "$INSTALLER"/system/priv-app/
fi
cp -rf $INSTALLER/custom/system $UNITY/system
fi
Binary file modified common/unityfiles/tools.tar.gz
Binary file not shown.
Binary file added common/unityfiles/tools/arm/bash
Binary file not shown.
Binary file added common/unityfiles/tools/arm/busybox
Binary file not shown.
Binary file added common/unityfiles/tools/x86/bash
Binary file not shown.
Binary file added common/unityfiles/tools/x86/busybox
Binary file not shown.
12 changes: 6 additions & 6 deletions common/unityfiles/util_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -281,14 +281,14 @@ cp_ch() {

patch_script() {
[ -L /system/vendor ] && local VEN=/vendor
sed -i -e "1i $SHEBANG" -e '2i MODPATH=${0%/*}' -e "2i SYS=$ROOT/system" -e "2i VEN=$ROOT$VEN" $1
sed -i -e "1i $SHEBANG" -e '1i MODPATH=${0%/*}' -e "1i SYS=$ROOT/system" -e "1i VEN=$ROOT$VEN" $1
for i in "ROOT" "MAGISK" "LIBDIR" "SYSOVERRIDE" "MODID"; do
sed -i "3i $i=$(eval echo \$$i)" $1
sed -i "2i $i=$(eval echo \$$i)" $1
done
if $MAGISK; then
sed -i -e "s|\$MOUNTPATH|$MAGISKTMP/img|g" -e "s|\$UNITY|$MAGISKTMP/img/$MODID|g" -e "3i INFO=$(echo $INFO | sed "s|$MOUNTPATH|$MAGISKTMP/img|")" $1
sed -i -e "s|\$MOUNTPATH|$MAGISKTMP/img|g" -e "s|\$UNITY|$MAGISKTMP/img/$MODID|g" -e "2i INFO=$(echo $INFO | sed "s|$MOUNTPATH|$MAGISKTMP/img|")" $1
else
sed -i -e "s|\$MOUNTPATH||g" -e "s|\$UNITY||g" -e "3i INFO=$INFO" $1
sed -i -e "s|\$MOUNTPATH||g" -e "s|\$UNITY||g" -e "2i INFO=$INFO" $1
fi
}

Expand Down Expand Up @@ -317,7 +317,7 @@ install_script() {
}

prop_process() {
sed -i "/^#/d" $1
sed -i -e "/^#/d" -e "/^ *$/d" $1
if $MAGISK; then
[ -f $PROP ] || mktouch $PROP
else
Expand Down Expand Up @@ -632,7 +632,7 @@ mount_partitions
api_level_arch_detect

# Check for min & max api version
[ -z $MINAPI ] && MINAPI=21 || { [ $MINAPI -lt 21 ] && MINAPI=21; }
[ -z $MINAPI ] && MINAPI=17 || { [ $MINAPI -lt 17 ] && MINAPI=17; }
[ $API -lt $MINAPI ] && { ui_print "! Your system API of $API is less than"; ui_print "! the minimum api of $MINAPI!"; abort "! Aborting!"; }
[ -z $MAXAPI ] || { [ $API -gt $MAXAPI ] && { ui_print "! Your system API of $API is greater than"; ui_print "! the maximum api of $MINAPI!"; abort "! Aborting!"; }; }

Expand Down
17 changes: 9 additions & 8 deletions config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ print_modname() {
# Defines
##########################################################################################

# Uncomment and change 'MINAPI' and 'MAXAPI' to the minimum and maxium android version for your mod (note that unity's minapi is 21 (lollipop) due to bash)
# Uncomment and change 'MINAPI' and 'MAXAPI' to the minimum and maxium android version for your mod (note that unity's minapi is 17) due to bash)
# Uncomment DYNAMICOREO if you want libs installed to vendor for oreo+ and system for anything older
# Uncomment SYSOVERRIDE if you want the mod to always be installed to system (even on magisk) - note that this can still be set to true by the user by adding 'sysover' to the zipname
# Uncomment DEBUG if you want full debug logs (saved to /sdcard in magisk manager and the zip directory in twrp) - note that this can still be set to true by the user by adding 'debug' to the zipname
Expand All @@ -40,21 +40,22 @@ print_modname() {
# A use for this would be to back up app data before it's wiped if your module includes an app
# NOTE: the normal upgrade process is just an uninstall followed by an install
unity_upgrade() {
: # Remove this if adding to this function
}

# Custom Variables for Install AND Uninstall - Keep everything within this function - runs before uninstall/install
unity_custom() {
if [ -f $VEN/build.prop ]; then BUILDS="/system/build.prop $VEN/build.prop"; else BUILDS="/system/build.prop"; fi
OOS=$(grep -E "ro.product.manufacturer=OnePlus|ro.product.vendor.brand=OnePlus" $BUILDS)
MANUFACTURER=$(grep "ro.product.manufacturer" $BUILDS)
if [ "$MANUFACTURER" == "HTC" ]; then
BFOLDER="/system/customize/resource/"
BFOLDER="/system/customize/resource"
BZIP="hTC_bootup.zip"
else
BFOLDER="/system/media/"
BFOLDER="/system/media"
BZIP="bootanimation.zip"
fi
MAGISK_SIMPLE="/data/adb/magisk_simple"


# Custom Variables for Install AND Uninstall - Keep everything within this function - runs before uninstall/install
unity_custom() {
: # Remove this if adding to this function
}

# Custom Functions for Install AND Uninstall - You can put them here
Expand Down
File renamed without changes.