Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

Commit

Permalink
1.0.7 release
Browse files Browse the repository at this point in the history
  • Loading branch information
topjohnwu authored and TechnoSparks committed Sep 18, 2017
1 parent c5de99f commit 6c3520d
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 66 deletions.
85 changes: 39 additions & 46 deletions META-INF/com/google/android/update-binary
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,12 @@ MAGISKBIN=/data/magisk
# Default permissions
umask 022

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

##########################################################################################
# Flashable update-binary preparation
# Environment
##########################################################################################

OUTFD=$2
Expand All @@ -43,73 +47,63 @@ ui_print() {
require_new_magisk() {
ui_print "***********************************"
ui_print "! $MAGISKBIN isn't setup properly!"
ui_print "! Please install Magisk v13.1+!"
ui_print "! Please install Magisk v14.0+!"
ui_print "***********************************"
exit 1
}

# Mount /data to access MAGISKBIN
ui_print "- Mounting /system, /vendor, /data, /cache"
mount -o ro /system 2>/dev/null
mount -o ro /vendor 2>/dev/null
mount /data 2>/dev/null
mount /cache 2>/dev/null

# MAGISKBIN must exist, binaries and utility functions are placed there
[ -d $MAGISKBIN -a -f $MAGISKBIN/magisk -a -f $MAGISKBIN/util_functions.sh ] || require_new_magisk

# Utility functions must exist
[ -f $MAGISKBIN/util_functions.sh ] || require_new_magisk
# Load utility fuctions
. $MAGISKBIN/util_functions.sh
[ ! -z $SCRIPT_VERSION -a $SCRIPT_VERSION -ge 1310 ] || require_new_magisk
get_outfd

rm -rf $TMPDIR 2>/dev/null
mkdir -p $INSTALLER
unzip -o "$ZIP" config.sh -d $INSTALLER 2>/dev/null
$BOOTMODE && ! is_mounted /magisk && abort "! Magisk is not activated!"
[ ! -f /system/build.prop ] && abort "! /system could not be mounted!"

# 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

# We need busybox/binaries to be setup
$BOOTMODE && boot_actions || recovery_actions

##########################################################################################
# Prepare
# Preparation
##########################################################################################

[ ! -f $INSTALLER/config.sh ] && abort "! Unable to extract zip file!"
# Extract common files
unzip -o "$ZIP" module.prop config.sh 'common/*' -d $INSTALLER 2>/dev/null

[ ! -f $INSTALLER/config.sh ] && abort "! Unable to extract zip file!"
# Load configurations
. $INSTALLER/config.sh

# Check the min magisk version
MIN_VER=`grep_prop template $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 "******************************"

ui_print "- Mounting /system, /vendor, /data, /cache"
mount -o ro /system 2>/dev/null
mount -o ro /vendor 2>/dev/null
mount /data 2>/dev/null
mount /cache 2>/dev/null

[ ! -f /data/magisk.img ] && abort "! Magisk is not installed"
$BOOTMODE && ! is_mounted /magisk && abort "! Magisk is not activated!"
[ ! -f /system/build.prop ] && abort "! /system could not be mounted!"

# 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

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

ui_print "- Extracting module files"
unzip -o "$ZIP" -d $INSTALLER 2>/dev/null
request_size_check $INSTALLER

# We're going to use magisk binary now, require some recovery fixes
$BOOTMODE || recovery_actions
request_zip_size_check "$ZIP"

if [ -f "$IMG" ]; then
ui_print "- $IMG detected!"
ui_print "- Found $IMG"
image_size_check $IMG
if [ "$reqSizeM" -gt "$curFreeM" ]; then
newSizeM=$(((reqSizeM + curUsedM) / 32 * 32 + 64))
Expand All @@ -124,16 +118,15 @@ fi

ui_print "- Mounting $IMG to $MOUNTPATH"
MAGISKLOOP=`$MAGISKBIN/magisk --mountimg $IMG $MOUNTPATH`
is_mounted $MOUNTPATH || abort"! $IMG mount failed..."
is_mounted $MOUNTPATH || abort "! $IMG mount failed..."

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

# Copy files
ui_print "- Copying files"
mv $INSTALLER/system $MODPATH/system
mv $INSTALLER/ts-binds-folderlist.txt $MODPATH/
ui_print "- Extracting module files"
unzip -o "$ZIP" 'system/*' -d $MODPATH 2>/dev/null
unzip -o "$ZIP" 'ts-binds-folderlist.txt' -d $MODPATH 2>/dev/null

# Handle replace folders
for TARGET in $REPLACE; do
Expand Down Expand Up @@ -179,7 +172,7 @@ if [ $curSizeM -gt $newSizeM ]; then
fi

$BOOTMODE || recovery_cleanup
rm -rf $TMPDIR

ui_print "- Done"
print_onFinish
exit 0
25 changes: 10 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ Derived from a very long-living trick for users who are struggling with the inte
For example, if you mirror the `Download` folder on Internal with the `Stuff from Internet` folder on your SD Card, the same list of cat pictures will be shown on both directories when navigated via a file manager, and any changes will take effect on both paths.

## Notice
Using this module will disable sdcardfs.
- Using this module will disable sdcardfs
- Not compatible with Huawei stock ROMs
- **Currently** not compatible when device has no SD Card slot
- **Currently** not compatible when adoptable storage is used

## Links
- [**More Info and Further Reading**](https://www.technosparks.net/pages/product-documentation/ts-binds)
Expand All @@ -17,24 +20,16 @@ Using this module will disable sdcardfs.
- [Changelogs](https://github.com/Magisk-Modules-Repo/ts-binds/releases)

## Changelog (2 recent versions)
### 1.0.7
**Additions**
- Magisk v14 compliant

**Regressions**
- Not backward compatible with previous Magisk versions
### 1.0.6
**Additions**
- Disable sdcardfs by using prop entries

### 1.0.5
**Additions**
- Print out log contents when `tsbinds log` is executed in terminal

**Modifications**
- Get sdcard's name more reliably
- Changed the description of the module
- Modified README to reflect the new place of the repository

### 1.0.4
**Additions**
- Added support to bind two different files!
- folderlist now has a link to an in-depth tutorial

**Fixes**
- Invalid path to log file in service.sh

Expand Down
1 change: 0 additions & 1 deletion config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
# Defines
##########################################################################################

MODID=ts-binds
AUTOMOUNT=true
PROPFILE=true
POSTFSDATA=false
Expand Down
6 changes: 3 additions & 3 deletions module.prop
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
id=ts-binds
name=ts-binds
version=1.0.6 beta 2
versionCode=10
version=1.0.7
versionCode=11
author=TechnoSparks
description=ts-binds binds two different folders on your device so that both folders share the same contents
template=4
template=1400
2 changes: 1 addition & 1 deletion ts-binds-folderlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
#|
#| The hash symbol (hashtag) is a comment character - everything after it will not be processed by the shell. The hash symbol at the start of a line will prevent the folder couple from being processed by ts-binds. The example below won't be processed by the shell until you remove the hash symbol.
#|
#| For more info: https://github.com/TechnoSparks/ts-binds/wiki/Bind-Two-Different-Folders
#| For more info: https://www.technosparks.net/pages/product-documentation/ts-binds?q=bind

# folderbind whatsapp "$sd/Application Data/WhatsApp" $int/WhatsApp

0 comments on commit 6c3520d

Please sign in to comment.