diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..782045b --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*.tar.gz +*.sh +*.zip diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..1f0bd67 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,101 @@ +## Changelog + +**2026-01-06**: v3.51.1 (_20260106_) + +- Updated to SQLite v3.51.1. + +**2025-08-07**: v3.50.4 (_20250807_) + +- Updated to SQLite v3.50.4. + +**2025-02-20**: v3.49.1 (_20250220_) + +- Updated to SQLite v3.49.1. + +**2024-12-12**: v3.47.2 (_20241212_) + +- Updated to SQLite v3.47.2. + +**2024-12-11**: v3.47.1 (_20241211_) + +- Updated to SQLite v3.47.1. + +**2024-10-23**: v3.47.0 (_20241023_) + +- Updated to SQLite v3.47.0. + +**2024-08-25**: v3.46.1 (_20240825_) + +- Updated to SQLite v3.46.1. + +**2024-06-15**: v3.46.0 (_20240615_) + +- Updated to SQLite v3.46.0. + +**2024-04-18**: v3.45.3 (_20240418_) + +- Updated to SQLite v3.45.3. + +**2024-03-14**: v3.45.2 (_20240314_) + +- Updated to SQLite v3.45.2. + +**2024-02-04**: v3.45.1 (_20240204_) + +- Updated to SQLite v3.45.1. + +**2024-01-16**: v3.45.0 (_20240116_) + +- Updated to SQLite v3.45.0. + +**2023-12-29**: v3.44.2 (_20231229_) + +- Multi-arch support. +- Version scheme was changed. + +**2023-12-08**: v3.44.2 + +- Updated to SQLite v3.44.2. + +**2023-10-09**: v3.43.1 + +- Updated to SQLite 3.43.1. + +**2023-08-28**: v3.43.0 + +- Updated to SQLite 3.43.0. + +**2023-08-24**: v3.42.0 + +- Updated to SQLite 3.42.0. +- Version scheme was changed. + +**2022-11-17**: v3.40.0 (_v1.6_) + +- Updated to SQLite 3.40.0. + +**2021-07-26**: v3.36.0 (_v1.5_) + +- Updated to SQLite 3.36.0. + +**2021-04-25**: v3.35.5 (_v1.4_) + +- Updated to SQLite 3.35.5. +- Updated for Magisk v20.4 template format. + +**2019-03-29**: v3.27.2 (_v1.3_) + +- Updated to SQLite 3.27.2. + +**2019-03-29**: v3.24.0 (_v1.2_) + +- Updated for Magisk v19 template format. + +**2018-07-22**: v3.24.0 (_v1.1_) + +- Now installed in `/system/bin` if `/system/xbin` unavailable. + +**2018-07-03**: v3.24.0 (_v1.0_) + +- Initial release. +- SQLite 3.24.0. diff --git a/META-INF/com/google/android/update-binary b/META-INF/com/google/android/update-binary index 11e0962..28b48e5 100644 --- a/META-INF/com/google/android/update-binary +++ b/META-INF/com/google/android/update-binary @@ -1,155 +1,33 @@ #!/sbin/sh -########################################################################################## -# -# Magisk Module Template Install Script -# by topjohnwu -# -########################################################################################## -# Detect whether in boot mode -ps | grep zygote | grep -v grep >/dev/null && BOOTMODE=true || BOOTMODE=false -$BOOTMODE || ps -A 2>/dev/null | grep zygote | grep -v grep >/dev/null && BOOTMODE=true +################# +# Initialization +################# -TMPDIR=/dev/tmp -INSTALLER=$TMPDIR/install -MAGISKBIN=/data/adb/magisk - -# Default permissions umask 022 -# Initial cleanup -rm -rf $TMPDIR 2>/dev/null -mkdir -p $INSTALLER - # echo before loading util_functions ui_print() { echo "$1"; } require_new_magisk() { ui_print "*******************************" - ui_print " Please install Magisk v15.0+! " + ui_print " Please install Magisk v20.4+! " ui_print "*******************************" exit 1 } -########################################################################################## -# Environment -########################################################################################## +######################### +# Load util_functions.sh +######################### OUTFD=$2 -ZIP=$3 +ZIPFILE=$3 mount /data 2>/dev/null -# Utility functions must exist -[ -f $MAGISKBIN/util_functions.sh ] || require_new_magisk -# Load utility fuctions -. $MAGISKBIN/util_functions.sh - -# We can't alter magisk image live, use alternative image if required -$BOOTMODE && IMG=/data/adb/magisk_merge.img -# Always mount under tmp -MOUNTPATH=$TMPDIR/magisk_img - -# Preperation for flashable zips -get_outfd - -# Mount partitions -mount_partitions - -# Detect version and architecture -api_level_arch_detect - -# You can get the Android API version from $API, the CPU architecture from $ARCH -# Useful if you are creating Android version / platform dependent mods - -# Setup busybox and binaries -$BOOTMODE && boot_actions || recovery_actions - -########################################################################################## -# Preparation -########################################################################################## - -# Extract common files -unzip -o "$ZIP" module.prop config.sh 'common/*' -d $INSTALLER >&2 - -[ ! -f $INSTALLER/config.sh ] && abort "! Unable to extract zip file!" -# Load configurations -. $INSTALLER/config.sh - -# Check the installed magisk version -MIN_VER=`grep_prop minMagisk $INSTALLER/module.prop` -[ ! -z $MAGISK_VER_CODE -a $MAGISK_VER_CODE -ge $MIN_VER ] || require_new_magisk -MODID=`grep_prop id $INSTALLER/module.prop` -MODPATH=$MOUNTPATH/$MODID - -# Print mod name -print_modname - -# Please leave this message in your flashable zip for credits :) -ui_print "******************************" -ui_print "Powered by Magisk (@topjohnwu)" -ui_print "******************************" - -########################################################################################## -# Install -########################################################################################## - -# Get the variable reqSizeM. Use your own method to determine reqSizeM if needed -request_zip_size_check "$ZIP" - -# This function will mount $IMG to $MOUNTPATH, and resize the image based on $reqSizeM -mount_magisk_img - -# Create mod paths -rm -rf $MODPATH 2>/dev/null -mkdir -p $MODPATH - -# Extract files to system. Use your own method if needed -ui_print "- Extracting module files" -unzip -o "$ZIP" 'system/*' -d $MODPATH >&2 - -set_bindir - -# Remove placeholder -rm -f $MODPATH/system/placeholder 2>/dev/null - -# Handle replace folders -for TARGET in $REPLACE; do - mktouch $MODPATH$TARGET/.replace -done - -# Auto Mount -$AUTOMOUNT && touch $MODPATH/auto_mount - -# prop files -$PROPFILE && cp -af $INSTALLER/common/system.prop $MODPATH/system.prop - -# Module info -cp -af $INSTALLER/module.prop $MODPATH/module.prop -if $BOOTMODE; then - # Update info for Magisk Manager - mktouch /sbin/.core/img/$MODID/update - cp -af $INSTALLER/module.prop /sbin/.core/img/$MODID/module.prop -fi - -# post-fs-data mode scripts -$POSTFSDATA && cp -af $INSTALLER/common/post-fs-data.sh $MODPATH/post-fs-data.sh - -# service mode scripts -$LATESTARTSERVICE && cp -af $INSTALLER/common/service.sh $MODPATH/service.sh - -ui_print "- Setting permissions" -set_permissions - -########################################################################################## -# Finalizing -########################################################################################## - -# Unmount magisk image and shrink if possible -unmount_magisk_img - -$BOOTMODE || recovery_cleanup -rm -rf $TMPDIR +[ -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" +install_module exit 0 diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..a47bed6 --- /dev/null +++ b/Makefile @@ -0,0 +1,25 @@ +ZIP_FILES := customize.sh META-INF module.prop system +VERSION = v3.51.1 +VERSIONCODE = 20260106 +.PHONY: module.prop system/bin zip + +default: module.prop system/bin zip + +zip: + rm -f SQLite-$(VERSION)-for-magisk.multi-arch.zip + zip -9 -r SQLite-$(VERSION)-for-magisk.multi-arch.zip $(ZIP_FILES) + +module.prop: + sed -i 's/version=.*$$/version=$(VERSION)/' module.prop + sed -i 's/versionCode=.*$$/versionCode=$(VERSIONCODE)/' module.prop + +sqlite3-android: + make -C ../sqlite3-android clean + make -C ../sqlite3-android + +system/bin: + mkdir -p system/bin + cp ../sqlite3-android/libs/arm64-v8a/sqlite3-static system/bin/sqlite3.arm64 + cp ../sqlite3-android/libs/armeabi-v7a/sqlite3-static system/bin/sqlite3.arm + cp ../sqlite3-android/libs/x86_64/sqlite3-static system/bin/sqlite3.x64 + cp ../sqlite3-android/libs/x86/sqlite3-static system/bin/sqlite3.x86 diff --git a/README.md b/README.md index 6ac3e8a..fa290cb 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,30 @@ -# **SQLite3 for ARM aarch64** +# SQLite3 for arm, arm64, x86 and x64 ## Description -This Magisk module provides a statically linked and stripped `sqlite3` binary for ARM aarch64 devices. +This Magisk module provides a statically linked and stripped `sqlite3` binary for **arm64-v8a**, **armeabi-v7a**, **x86** and **x86_64** devices. -## Changelog +## Tested Devices -2018-07-22: v1.1 + - arm64-v8a: + - **Lenovo Tab M10 Plus Gen 3** + - **Xiaomi MI 6** + - **Samsung Galaxy S6 Edge** + - x86_64: + - **LDPlayer 9** + - **Waydroid** + +## Download -- Now installed in `/system/bin` if `/system/xbin` unavailable. +Releases: [SQLite-vX.XX.X-for-magisk.multi-arch.zip](https://github.com/rojenzaman/sqlite3-magisk-module/releases) -2018-07-03: v1.0 +## Changelog -- Initial release. -- SQLite 3.24.0. +Check: [CHANGELOG.md](CHANGELOG.md) ## Credits -Thanks to @stockrt for the convenient SQLite [build scripts for Android](https://github.com/stockrt/sqlite3-android). +Thanks to @jacopotediosi for the convenient SQLite [multi-arch build scripts for Android](https://github.com/jacopotediosi/sqlite3-android). ## Links [SQLite](https://www.sqlite.org/) diff --git a/common/post-fs-data.sh b/common/post-fs-data.sh deleted file mode 100644 index 426ab83..0000000 --- a/common/post-fs-data.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/system/bin/sh -# Please don't hardcode /magisk/modname/... ; instead, please use $MODDIR/... -# This will make your scripts compatible even if Magisk change its mount point in the future -MODDIR=${0%/*} - -# This script will be executed in post-fs-data mode -# More info in the main Magisk thread diff --git a/common/service.sh b/common/service.sh deleted file mode 100644 index 4512417..0000000 --- a/common/service.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/system/bin/sh -# Please don't hardcode /magisk/modname/... ; instead, please use $MODDIR/... -# This will make your scripts compatible even if Magisk change its mount point in the future -MODDIR=${0%/*} - -# This script will be executed in late_start service mode -# More info in the main Magisk thread diff --git a/common/system.prop b/common/system.prop deleted file mode 100644 index 3d42789..0000000 --- a/common/system.prop +++ /dev/null @@ -1,3 +0,0 @@ -# This file will be read by resetprop -# Example: Change dpi -# ro.sf.lcd_density=320 diff --git a/config.sh b/config.sh deleted file mode 100644 index eb5fda9..0000000 --- a/config.sh +++ /dev/null @@ -1,116 +0,0 @@ -########################################################################################## -# -# Magisk -# by topjohnwu -# -# This is a template zip for developers -# -########################################################################################## -########################################################################################## -# -# Instructions: -# -# 1. Place your files into system folder (delete the placeholder file) -# 2. Fill in your module's info into module.prop -# 3. Configure the settings in this file (common/config.sh) -# 4. For advanced features, add shell commands into the script files under common: -# post-fs-data.sh, service.sh -# 5. For changing props, add your additional/modified props into common/system.prop -# -########################################################################################## - -########################################################################################## -# Defines -########################################################################################## - -# NOTE: This part has to be adjusted to fit your own needs - -# This will be the folder name under /magisk -# This should also be the same as the id in your module.prop to prevent confusion -MODID=sqlite3 - -# Set to true if you need to enable Magic Mount -# Most mods would like it to be enabled -AUTOMOUNT=true - -# Set to true if you need to load system.prop -PROPFILE=false - -# Set to true if you need post-fs-data script -POSTFSDATA=false - -# Set to true if you need late_start service script -LATESTARTSERVICE=false - -########################################################################################## -# Installation Message -########################################################################################## - -# Set what you want to show when installing your mod - -print_modname() { - ui_print "********************************" - ui_print " sqlite3 installer " - ui_print "********************************" -} - -########################################################################################## -# Replace list -########################################################################################## - -# List all directories you want to directly replace in the system -# By default Magisk will merge your files with the original system -# Directories listed here however, will be directly mounted to the correspond directory in the system - -# You don't need to remove the example below, these values will be overwritten by your own list -# This is an example -REPLACE=" -/system/app/Youtube -/system/priv-app/SystemUI -/system/priv-app/Settings -/system/framework -" - -# Construct your own list here, it will overwrite the example -# !DO NOT! remove this if you don't need to replace anything, leave it empty as it is now -REPLACE="" - -########################################################################################## -# Permissions -########################################################################################## - -# NOTE: This part has to be adjusted to fit your own needs - -set_permissions() { - # Default permissions, don't remove them - set_perm_recursive $MODPATH 0 0 0755 0755 - - # Only some special files require specific permissions - # The default permissions should be good enough for most cases - - # Some templates if you have no idea what to do: - - # set_perm_recursive (default: u:object_r:system_file:s0) - # set_perm_recursive $MODPATH/system/lib 0 0 0755 0644 - - # set_perm (default: u:object_r:system_file:s0) - # set_perm $MODPATH/system/bin/app_process32 0 2000 0755 u:object_r:zygote_exec:s0 - # set_perm $MODPATH/system/bin/dex2oat 0 2000 0755 u:object_r:dex2oat_exec:s0 - # set_perm $MODPATH/system/lib/libart.so 0 0 0644 -} - -set_bindir(){ - local bindir=/system/bin - local xbindir=/system/xbin - - # Check for existence of /system/xbin directory. - if [ ! -d /sbin/.core/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" -} diff --git a/customize.sh b/customize.sh new file mode 100644 index 0000000..5e0b2a4 --- /dev/null +++ b/customize.sh @@ -0,0 +1,14 @@ +bindir=/system/bin + +ui_print "[0/3] Keeping necessary binary file: $MODPATH$xbindir/sqlite3.$ARCH" +cp $MODPATH$bindir/sqlite3.$ARCH $MODPATH$bindir/sqlite3.keep + +ui_print "[1/3] Deleting unnecessary binary files" +rm -f $MODPATH$bindir/sqlite3.arm $MODPATH$bindir/sqlite3.arm64 $MODPATH$bindir/sqlite3.x64 $MODPATH$bindir/sqlite3.x86 + +ui_print "[2/3] Restoring necessary binary file to $MODPATH$xbindir/sqlite3" +mv $MODPATH$bindir/sqlite3.keep $MODPATH$bindir/sqlite3 + +ui_print "[3/3] Installed to $bindir" + +set_perm_recursive $MODPATH 0 0 0755 0755 diff --git a/module.prop b/module.prop index eff4502..490d4bb 100644 --- a/module.prop +++ b/module.prop @@ -1,7 +1,6 @@ id=sqlite3 -name=SQLite for ARM aarch64 devices -version=v1.1 -versionCode=11 -author=ianmacd -description=Provides a statically linked sqlite3 binary for ARM aarch64 devices -minMagisk=1500 +name=SQLite for arm, arm64, x86 and x64 devices +version=v3.51.1 +versionCode=20260106 +author=Rojen Zaman +description=Provides a statically linked sqlite3 binary for arm, arm64, x86 and x64 devices diff --git a/system/bin/sqlite3.arm b/system/bin/sqlite3.arm new file mode 100755 index 0000000..2422a97 Binary files /dev/null and b/system/bin/sqlite3.arm differ diff --git a/system/bin/sqlite3.arm64 b/system/bin/sqlite3.arm64 new file mode 100755 index 0000000..afe77e1 Binary files /dev/null and b/system/bin/sqlite3.arm64 differ diff --git a/system/bin/sqlite3.x64 b/system/bin/sqlite3.x64 new file mode 100755 index 0000000..0cd049a Binary files /dev/null and b/system/bin/sqlite3.x64 differ diff --git a/system/bin/sqlite3.x86 b/system/bin/sqlite3.x86 new file mode 100755 index 0000000..ece142e Binary files /dev/null and b/system/bin/sqlite3.x86 differ diff --git a/system/xbin/sqlite3 b/system/xbin/sqlite3 deleted file mode 100755 index 24309c4..0000000 Binary files a/system/xbin/sqlite3 and /dev/null differ