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

Commit

Permalink
Unity v3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Zackptg5 committed Jan 10, 2019
1 parent 85b5e2d commit 28858d8
Show file tree
Hide file tree
Showing 4 changed files with 127 additions and 137 deletions.
12 changes: 10 additions & 2 deletions META-INF/com/google/android/update-binary
Expand Up @@ -12,19 +12,27 @@ export TMPDIR=/dev/tmp; export INSTALLER=$TMPDIR/install; export OUTFD=$2; expor
# Default Permissions
umask 022

# Preliminary detection of bootmode for ui_print function
ps | grep zygote | grep -qv grep >/dev/null && BOOTMODE=true || BOOTMODE=false
$BOOTMODE || ps -A 2>/dev/null | grep zygote | grep -qv grep >/dev/null && BOOTMODE=true

ui_print() {
$BOOTMODE && echo "$1" || echo -e "ui_print $1\nui_print" >> /proc/self/fd/$OUTFD
}

# Initial Cleanup
rm -rf $TMPDIR 2>/dev/null
mkdir -p $INSTALLER

# Extract Unityfiles
unzip -o "$ZIPFILE" 'common/unityfiles/tools.tar.gz' 'common/unityfiles/util_functions.sh' -d $INSTALLER >&2
[ -f "$INSTALLER/common/unityfiles/tools.tar.gz" ] || { echo "! Unable to extract zip file !"; exit 1; }
[ -f "$INSTALLER/common/unityfiles/tools.tar.gz" ] || { ui_print "! Unable to extract zip file !"; exit 1; }

# Load Util_Functions, Add In-House Binaries to PATH, Start Bash Shell
export ARCH32=`getprop ro.product.cpu.abi | cut -c-3`
[ -z $ARCH32 ] && export ARCH32=`getprop ro.product.cpu.abi2 | cut -c-3`
[ -z $ARCH32 ] && export ARCH32=arm
(tar -xf $INSTALLER/common/unityfiles/tools.tar.gz -C $INSTALLER/common/unityfiles) || { echo "! Unable to extract unity tools !"; exit 1; }
(tar -xf $INSTALLER/common/unityfiles/tools.tar.gz -C $INSTALLER/common/unityfiles) || { ui_print "! Unable to extract unity tools !"; exit 1; }
chmod -R 755 $INSTALLER/common/unityfiles/tools/$ARCH32
echo $PATH | grep -q "$INSTALLER/common/unityfiles/tools/$ARCH32" || export PATH=$INSTALLER/common/unityfiles/tools/$ARCH32:$PATH
bash $INSTALLER/common/unityfiles/util_functions.sh
7 changes: 7 additions & 0 deletions README.md
Expand Up @@ -9,6 +9,13 @@ Unity Installer allows 1 zip to work for multiple devices and root solutions. [M
* All root solutions (requires init.d support for boot scripts if not using magisk or supersu. Try [Init.d Injector](https://forum.xda-developers.com/android/software-hacking/mod-universal-init-d-injector-wip-t3692105))

## Change Log
### v3.1 - 1.10.2019
* Actually enforce minapi of 21
* Bring util_functions more in line with magisk util_functions
* Change debug paths - follow /sdcard symlink in bootmode and, same directory zip was in for twrp
* Overhauled cp_ch - added capability for folder copying with cp_ch - see support thread for new usage
* Fixed boot script patching bug

### v3.0 - 1.7.2019
* Bug fixes with variables - fix install path issues
* Other bug fixes (mainly for system installs)
Expand Down

0 comments on commit 28858d8

Please sign in to comment.