v2.3.1-v19 part 1

This commit is contained in:
Didgeridoohan 2018-06-30 22:29:20 -07:00 committed by GitHub
parent 0eeda837d5
commit 9827387019
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 61 additions and 36 deletions

View File

@ -25,7 +25,7 @@ if [ ! -f "$POSTFILE" ]; then
log_start log_start
log_handler "Post-fs-data boot script not found." log_handler "Post-fs-data boot script not found."
log_handler "Restoring boot script (${POSTFILE})." log_handler "Restoring boot script (${POSTFILE})."
cp -afv $MODPATH/propsconf_post $POSTFILE >> $LOGFILE cp -af $MODPATH/propsconf_post $POSTFILE >> $LOGFILE
chmod -v 755 $POSTFILE >> $INSTLOG chmod -v 755 $POSTFILE >> $INSTLOG
# Deleting settings script to force a restore # Deleting settings script to force a restore
rm -f $LATEFILE rm -f $LATEFILE
@ -38,7 +38,7 @@ if [ ! -f "$LATEFILE" ] || [ -f "$RESETFILE" ]; then
log_handler "Late_start service boot script not found." log_handler "Late_start service boot script not found."
fi fi
log_handler "$RSTTXT boot script (${LATEFILE})." log_handler "$RSTTXT boot script (${LATEFILE})."
cp -afv $MODPATH/propsconf_late $LATEFILE >> $LOGFILE cp -af $MODPATH/propsconf_late $LATEFILE >> $LOGFILE
chmod -v 755 $LATEFILE >> $INSTLOG chmod -v 755 $LATEFILE >> $INSTLOG
fi fi

View File

@ -9,7 +9,7 @@
# In that case, feel free to delete it. # In that case, feel free to delete it.
# Script version # Script version
SCRIPTV=10 SCRIPTV=11
SETTRANSF=1 SETTRANSF=1
# Variables # Variables

View File

@ -98,7 +98,7 @@ if [ -d "$MODPATH" ]; then
# Copies the stock build.prop to the module. Only if set in propsconf_late. # Copies the stock build.prop to the module. Only if set in propsconf_late.
if [ "$(get_file_value $LATEFILE "BUILDPROPENB=")" == 1 ] && [ "$(get_file_value $LATEFILE "BUILDEDIT=")" == 1 ]; then if [ "$(get_file_value $LATEFILE "BUILDPROPENB=")" == 1 ] && [ "$(get_file_value $LATEFILE "BUILDEDIT=")" == 1 ]; then
log_handler "Stock build.prop copied from /system." log_handler "Stock build.prop copied from /system."
cp -afv $SYSTEMLOC/build.prop $MODPATH/system/build.prop >> $LOGFILE cp -af $SYSTEMLOC/build.prop $MODPATH/system/build.prop >> $LOGFILE
# Edits the module copy of build.prop # Edits the module copy of build.prop
module_values module_values
@ -134,3 +134,4 @@ else
echo "$MODPATH not found." >> $POSTLOGFILE echo "$MODPATH not found." >> $POSTLOGFILE
echo "Module no longer installed." >> $POSTLOGFILE echo "Module no longer installed." >> $POSTLOGFILE
fi fi

View File

@ -20,16 +20,21 @@ $CACHELOC/magisk.log.bak
/data/adb/magisk_debug.log /data/adb/magisk_debug.log
$CACHELOC/propsconf* $CACHELOC/propsconf*
/sbin/.core/mirror/system/build.prop /sbin/.core/mirror/system/build.prop
/sbin/.core/mirror/vendor/build.prop
" "
CONFFILE=$CACHELOC/propsconf_conf CONFFILE=$CACHELOC/propsconf_conf
RESETFILE=$CACHELOC/reset_mhpc RESETFILE=$CACHELOC/reset_mhpc
MAGISKLOC=/data/adb/magisk MAGISKLOC=/data/adb/magisk
BBWWWPATH=BB_PLACEHOLDER BBWWWPATH=BB_PLACEHOLDER
BBLOC=$MODPATH/busybox BBLOC=$MODPATH/busybox
if [ -f "$BBLOC" ]; then if [ -f "$BBLOC" ] && [ "$BBT" == "module" ]; then
BBPATH=$BBLOC BBPATH=$BBLOC
elif [ -d "$IMGPATH/busybox-ndk" ]; then elif [ -d "$IMGPATH/busybox-ndk" ]; then
BBPATH=$(find $IMGPATH/busybox-ndk -name 'busybox') if [ "$BBT" != "topjohnwu" ]; then
BBPATH=$(find $IMGPATH/busybox-ndk -name 'busybox')
else
BBPATH=$MAGISKLOC/busybox
fi
else else
BBPATH=$MAGISKLOC/busybox BBPATH=$MAGISKLOC/busybox
fi fi
@ -37,7 +42,10 @@ if [ -z "$(echo $PATH | grep /sbin:)" ]; then
alias resetprop="$MAGISKLOC/magisk resetprop" alias resetprop="$MAGISKLOC/magisk resetprop"
fi fi
alias cat="$BBPATH cat" alias cat="$BBPATH cat"
alias chmod="$BBPATH chmod"
alias cp="$BBPATH cp"
alias grep="$BBPATH grep" alias grep="$BBPATH grep"
alias mv="$BBPATH mv"
alias printf="$BBPATH printf" alias printf="$BBPATH printf"
alias sed="$BBPATH sed" alias sed="$BBPATH sed"
alias sort="$BBPATH sort" alias sort="$BBPATH sort"
@ -77,7 +85,9 @@ ro.vendor.build.fingerprint
# Finding file values # Finding file values
get_file_value() { get_file_value() {
cat $1 | grep $2 | sed "s|.*${2}||" | sed 's|\"||g' if [ -f "$1" ]; then
cat $1 | grep $2 | sed "s|.*${2}||" | sed 's|\"||g'
fi
} }
# Logs # Logs
@ -195,11 +205,11 @@ orig_check() {
script_ran_check() { script_ran_check() {
POSTCHECK=0 POSTCHECK=0
if [ "$(cat $RUNFILE | grep "post-fs-data.d finished")" ]; then if [ -f "$RUNFILE" ] && [ "$(cat $RUNFILE | grep "post-fs-data.d finished")" ]; then
POSTCHECK=1 POSTCHECK=1
fi fi
LATECHECK=0 LATECHECK=0
if [ "$(cat $RUNFILE | grep "Boot script finished")" ]; then if [ -f "$RUNFILE" ] && [ "$(cat $RUNFILE | grep "Boot script finished")" ]; then
LATECHECK=1 LATECHECK=1
fi fi
} }
@ -279,14 +289,14 @@ reboot_chk() {
reset_fn() { reset_fn() {
BUILDPROPENB=$(get_file_value $LATEFILE "BUILDPROPENB=") BUILDPROPENB=$(get_file_value $LATEFILE "BUILDPROPENB=")
FINGERPRINTENB=$(get_file_value $LATEFILE "FINGERPRINTENB=") FINGERPRINTENB=$(get_file_value $LATEFILE "FINGERPRINTENB=")
cp -afv $MODPATH/propsconf_late $LATEFILE >> $LOGFILE cp -af $MODPATH/propsconf_late $LATEFILE >> $LOGFILE
if [ "$BUILDPROPENB" ] && [ "$BUILDPROPENB" != 1 ]; then if [ "$BUILDPROPENB" ] && [ "$BUILDPROPENB" != 1 ]; then
replace_fn BUILDPROPENB 1 $BUILDPROPENB $LATEFILE replace_fn BUILDPROPENB 1 $BUILDPROPENB $LATEFILE
fi fi
if [ "$FINGERPRINTENB" ] && [ "$FINGERPRINTENB" != 1 ]; then if [ "$FINGERPRINTENB" ] && [ "$FINGERPRINTENB" != 1 ]; then
replace_fn FINGERPRINTENB 1 $FINGERPRINTENB $LATEFILE replace_fn FINGERPRINTENB 1 $FINGERPRINTENB $LATEFILE
fi fi
chmod-v 755 $LATEFILE >> $INSTLOG chmod -v 755 $LATEFILE >> $LOGFILE
placeholder_update $LATEFILE IMGPATH IMG_PLACEHOLDER $IMGPATH placeholder_update $LATEFILE IMGPATH IMG_PLACEHOLDER $IMGPATH
placeholder_update $LATEFILE CACHELOC CACHE_PLACEHOLDER $CACHELOC placeholder_update $LATEFILE CACHELOC CACHE_PLACEHOLDER $CACHELOC
@ -441,6 +451,8 @@ download_bb() {
wget -T 5 -O $MODPATH/busybox $BBWWWPATH >> $LOGFILE wget -T 5 -O $MODPATH/busybox $BBWWWPATH >> $LOGFILE
if [ -f "$MODPATH/busybox" ]; then if [ -f "$MODPATH/busybox" ]; then
chmod -v 755 $MODPATH/busybox >> $LOGFILE chmod -v 755 $MODPATH/busybox >> $LOGFILE
else
log_print "No connection."
fi fi
} }
@ -478,7 +490,7 @@ download_prints() {
LISTVERSION=$(get_file_value $PRINTSTMP "PRINTSV=") LISTVERSION=$(get_file_value $PRINTSTMP "PRINTSV=")
if [ "$LISTVERSION" == "Dev" ] || [ "$LISTVERSION" -gt "$(get_file_value $PRINTSLOC "PRINTSV=")" ]; then if [ "$LISTVERSION" == "Dev" ] || [ "$LISTVERSION" -gt "$(get_file_value $PRINTSLOC "PRINTSV=")" ]; then
if [ "$(get_file_value $PRINTSTMP "PRINTSTRANSF=")" -le "$(get_file_value $PRINTSLOC "PRINTSTRANSF=")" ]; then if [ "$(get_file_value $PRINTSTMP "PRINTSTRANSF=")" -le "$(get_file_value $PRINTSLOC "PRINTSTRANSF=")" ]; then
mv -f $PRINTSTMP $PRINTSLOC mv -f $PRINTSTMP $PRINTSLOC >> $LOGFILE
# Updates list version in module.prop # Updates list version in module.prop
VERSIONTMP=$(get_file_value $MODPATH/module.prop "version=") VERSIONTMP=$(get_file_value $MODPATH/module.prop "version=")
replace_fn version $VERSIONTMP "${MODVERSION}-v${LISTVERSION}" $MODPATH/module.prop replace_fn version $VERSIONTMP "${MODVERSION}-v${LISTVERSION}" $MODPATH/module.prop
@ -925,7 +937,17 @@ collect_logs() {
# Saving Magisk and module log files and device original build.prop # Saving Magisk and module log files and device original build.prop
for ITEM in $TMPLOGLIST; do for ITEM in $TMPLOGLIST; do
cp -afv $ITEM $TMPLOGLOC >> $LOGFILE if [ -f "$ITEM" ]; then
case "$ITEM" in
*build.prop*) BPNAME="build_$(echo $ITEM | sed 's|\/build.prop||' | sed 's|.*\/||g').prop"
;;
*) BPNAME=""
;;
esac
cp -af $ITEM ${TMPLOGLOC}/${BPNAME} >> $LOGFILE
else
log_handler "$ITEM not available."
fi
done done
# Saving the current prop values # Saving the current prop values
@ -936,32 +958,34 @@ collect_logs() {
tar -zcvf propslogs.tar.gz propslogs >> $LOGFILE tar -zcvf propslogs.tar.gz propslogs >> $LOGFILE
# Copy package to internal storage # Copy package to internal storage
mv -fv $CACHELOC/propslogs.tar.gz /storage/emulated/0 >> $LOGFILE mv -f $CACHELOC/propslogs.tar.gz /storage/emulated/0 >> $LOGFILE
# Remove temporary directory # Remove temporary directory
rm -rf $TMPLOGLOC >> $LOGFILE rm -rf $TMPLOGLOC >> $LOGFILE
log_handler "Logs and information collected." log_handler "Logs and information collected."
INPUTTMP="" if [ "$1" != "issue" ]; then
menu_header "${C}$1${N}" INPUTTMP=""
echo "" menu_header "${C}$1${N}"
echo "Logs and information collected." echo ""
echo "" echo "Logs and information collected."
echo "The packaged file has been saved to the" echo ""
echo "root of your device's internal storage." echo "The packaged file has been saved to the"
echo "" echo "root of your device's internal storage."
echo "Attach the file to a post in the support" echo ""
echo "thread @ XDA, with a detailed description" echo "Attach the file to a post in the support"
echo "of your issue." echo "thread @ XDA, with a detailed description"
echo "" echo "of your issue."
echo -n "Press enter to continue..." echo ""
read -r INPUTTMP echo -n "Press enter to continue..."
case "$INPUTTMP" in read -r INPUTTMP
*) case "$INPUTTMP" in
if [ "$2" == "l" ]; then *)
exit_fn if [ "$2" == "l" ]; then
fi exit_fn
;; fi
esac ;;
esac
fi
} }