Skip to content
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

*.zip
*.bat
146 changes: 14 additions & 132 deletions META-INF/com/google/android/update-binary
Original file line number Diff line number Diff line change
@@ -1,151 +1,33 @@
#!/sbin/sh

TMPDIR=/dev/tmp
MOUNTPATH=/dev/magisk_img
#################
# Initialization
#################

# Default permissions
umask 022

# Initial cleanup
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 the latest Magisk! "
ui_print "***********************************"
ui_print "*******************************"
ui_print " Please install Magisk v20.4+! "
ui_print "*******************************"
exit 1
}

imageless_magisk() {
[ $MAGISK_VER_CODE -gt 18100 ]
return $?
}

##########################################################################################
# Environment
##########################################################################################
#########################
# Load util_functions.sh
#########################

OUTFD=$2
ZIPFILE=$3

mount /data 2>/dev/null

# Load utility functions
if [ -f /data/adb/magisk/util_functions.sh ]; then
. /data/adb/magisk/util_functions.sh
NVBASE=/data/adb
else
require_new_magisk
fi

# 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 common files
unzip -oj "$ZIPFILE" module.prop install.sh uninstall.sh 'common/*' -d $TMPDIR >&2

[ ! -f $TMPDIR/install.sh ] && abort "! Unable to extract zip file!"
# Load install script
. $TMPDIR/install.sh

if imageless_magisk; then
$BOOTMODE && MODDIRNAME=modules_update || MODDIRNAME=modules
MODULEROOT=$NVBASE/$MODDIRNAME
else
$BOOTMODE && IMGNAME=magisk_merge.img || IMGNAME=magisk.img
IMG=$NVBASE/$IMGNAME
request_zip_size_check "$ZIPFILE"
mount_magisk_img
MODULEROOT=$MOUNTPATH
fi

MODID=`grep_prop id $TMPDIR/module.prop`
MODPATH=$MODULEROOT/$MODID

print_modname

ui_print "******************************"
ui_print "Powered by Magisk (@topjohnwu)"
ui_print "******************************"

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

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

# Remove placeholder
rm -f $MODPATH/system/placeholder 2>/dev/null

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

# Auto Mount
if imageless_magisk; then
$SKIPMOUNT && touch $MODPATH/skip_mount
else
$SKIPMOUNT || touch $MODPATH/auto_mount
fi

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

# Module info
cp -af $TMPDIR/module.prop $MODPATH/module.prop
if $BOOTMODE; then
# Update info for Magisk Manager
if imageless_magisk; then
mktouch $NVBASE/modules/$MODID/update
cp -af $TMPDIR/module.prop $NVBASE/modules/$MODID/module.prop
else
mktouch /sbin/.magisk/img/$MODID/update
cp -af $TMPDIR/module.prop /sbin/.magisk/img/$MODID/module.prop
fi
fi

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

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

on_install

# Handle replace folders
for TARGET in $REPLACE; do
mktouch $MODPATH$TARGET/.replace
done

ui_print "- Setting permissions"
set_permissions

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

cd /
imageless_magisk || unmount_magisk_img
$BOOTMODE || recovery_cleanup
rm -rf $TMPDIR $MOUNTPATH
[ -f /data/adb/magisk/util_functions.sh ] || require_new_magisk
. /data/adb/magisk/util_functions.sh
[ $MAGISK_VER_CODE -lt 20400 ] && require_new_magisk

ui_print "- Done"
exit 0
install_module
exit 0
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ This Magisk module provides a statically linked and stripped `sqlite3` binary fo

## Changelog

2021-04-25: v1.4

- Updated to SQLite 3.35.5.
- Updated for Magisk v20.4 template format.

2019-03-29: v1.3

- Updated to SQLite 3.27.2.
Expand Down
7 changes: 0 additions & 7 deletions common/post-fs-data.sh

This file was deleted.

7 changes: 0 additions & 7 deletions common/service.sh

This file was deleted.

3 changes: 0 additions & 3 deletions common/system.prop

This file was deleted.

15 changes: 15 additions & 0 deletions customize.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
bindir=/system/bin
xbindir=/system/xbin

# Check for existence of /system/xbin directory.
if [ ! -d /sbin/.magisk/mirror$xbindir ]; then
# Use /system/bin instead of /system/xbin.
mkdir -p $MODPATH$bindir
mv $MODPATH$xbindir/sqlite3 $MODPATH$bindir
rmdir $MODPATH$xbindir
xbindir=$bindir
fi

ui_print "- Installed to $xbindir"

set_perm_recursive $MODPATH 0 0 0755 0755
171 changes: 0 additions & 171 deletions install.sh

This file was deleted.

Loading