Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
Magisk
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Magisk
Commits
0b70bd2b
Commit
0b70bd2b
authored
Mar 20, 2020
by
osm0sis
Committed by
John Wu
Mar 21, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scripts: make remaining header/section dividers uniform
- match other recent formatting updates from topjohnwu
parent
84ecba46
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
43 additions
and
42 deletions
+43
-42
addon.d.sh
scripts/addon.d.sh
+3
-3
boot_patch.sh
scripts/boot_patch.sh
+21
-20
emulator.sh
scripts/emulator.sh
+3
-3
flash_script.sh
scripts/flash_script.sh
+8
-8
magisk_uninstaller.sh
scripts/magisk_uninstaller.sh
+4
-4
module_installer.sh
scripts/module_installer.sh
+2
-2
util_functions.sh
scripts/util_functions.sh
+2
-2
No files found.
scripts/addon.d.sh
View file @
0b70bd2b
...
@@ -26,9 +26,9 @@ trampoline() {
...
@@ -26,9 +26,9 @@ trampoline() {
fi
fi
ui_print
()
{
$BOOTMODE
&&
log
-t
Magisk
--
"
$1
"
||
echo
-e
"ui_print
$1
\n
ui_print"
>>
/proc/self/fd/
$OUTFD
;
}
ui_print
()
{
$BOOTMODE
&&
log
-t
Magisk
--
"
$1
"
||
echo
-e
"ui_print
$1
\n
ui_print"
>>
/proc/self/fd/
$OUTFD
;
}
ui_print
"***********************
*
"
ui_print
"***********************"
ui_print
"
*
Magisk addon.d failed"
ui_print
" Magisk addon.d failed"
ui_print
"***********************
*
"
ui_print
"***********************"
ui_print
"! Cannot find Magisk binaries - was data wiped or not decrypted?"
ui_print
"! Cannot find Magisk binaries - was data wiped or not decrypted?"
ui_print
"! Reflash OTA from decrypted recovery or reflash Magisk"
ui_print
"! Reflash OTA from decrypted recovery or reflash Magisk"
exit
1
exit
1
...
...
scripts/boot_patch.sh
View file @
0b70bd2b
#!/system/bin/sh
#!/system/bin/sh
##########################################################################################
##########################################################################################
#
#
#
# Magisk Boot Image Patcher
# Magisk Boot Image Patcher
# by topjohnwu
# by topjohnwu
...
@@ -23,10 +23,11 @@
...
@@ -23,10 +23,11 @@
# chromeos folder This folder includes all the utilities and keys to sign
# chromeos folder This folder includes all the utilities and keys to sign
# (optional) chromeos boot images. Currently only used for Pixel C
# (optional) chromeos boot images. Currently only used for Pixel C
#
#
##########################################################################################
###########################################################################################
##########################################################################################
############
# Functions
# Functions
############
##############################################################################
############
# Pure bash dirname implementation
# Pure bash dirname implementation
getdir
()
{
getdir
()
{
...
@@ -36,9 +37,9 @@ getdir() {
...
@@ -36,9 +37,9 @@ getdir() {
esac
esac
}
}
#################
#########################################################################
#################
# Initialization
# Initialization
#################
#########################################################################
#################
if
[
-z
$SOURCEDMODE
]
;
then
if
[
-z
$SOURCEDMODE
]
;
then
# Switch to the location of the script file
# Switch to the location of the script file
...
@@ -62,9 +63,9 @@ chmod -R 755 .
...
@@ -62,9 +63,9 @@ chmod -R 755 .
# Extract magisk if doesn't exist
# Extract magisk if doesn't exist
[
-e
magisk
]
||
./magiskinit
-x
magisk magisk
[
-e
magisk
]
||
./magiskinit
-x
magisk magisk
#########
#################################################################################
#########
# Unpack
# Unpack
#########
#################################################################################
#########
CHROMEOS
=
false
CHROMEOS
=
false
...
@@ -83,9 +84,9 @@ esac
...
@@ -83,9 +84,9 @@ esac
[
-f
recovery_dtbo
]
&&
RECOVERYMODE
=
true
[
-f
recovery_dtbo
]
&&
RECOVERYMODE
=
true
###################
#######################################################################
###################
# Ramdisk
r
estores
# Ramdisk
R
estores
###################
#######################################################################
###################
# Test patch status and do restore
# Test patch status and do restore
ui_print
"- Checking ramdisk status"
ui_print
"- Checking ramdisk status"
...
@@ -121,9 +122,9 @@ if [ $((STATUS & 8)) -ne 0 ]; then
...
@@ -121,9 +122,9 @@ if [ $((STATUS & 8)) -ne 0 ]; then
export
TWOSTAGEINIT
=
true
export
TWOSTAGEINIT
=
true
fi
fi
##################
########################################################################
##################
# Ramdisk
p
atches
# Ramdisk
P
atches
##################
########################################################################
##################
ui_print
"- Patching ramdisk"
ui_print
"- Patching ramdisk"
...
@@ -146,9 +147,9 @@ fi
...
@@ -146,9 +147,9 @@ fi
rm
-f
ramdisk.cpio.orig config
rm
-f
ramdisk.cpio.orig config
#################
#########################################################################
#################
# Binary
p
atches
# Binary
P
atches
#################
#########################################################################
#################
for
dt
in
dtb kernel_dtb extra recovery_dtbo
;
do
for
dt
in
dtb kernel_dtb extra recovery_dtbo
;
do
[
-f
$dt
]
&&
./magiskboot dtb
$dt
patch
&&
ui_print
"- Patch fstab in
$dt
"
[
-f
$dt
]
&&
./magiskboot dtb
$dt
patch
&&
ui_print
"- Patch fstab in
$dt
"
...
@@ -172,9 +173,9 @@ if [ -f kernel ]; then
...
@@ -172,9 +173,9 @@ if [ -f kernel ]; then
77616E745F696E697472616D667300
77616E745F696E697472616D667300
fi
fi
#################
#########################################################################
#################
# Repack
and f
lash
# Repack
& F
lash
#################
#########################################################################
#################
ui_print
"- Repacking boot image"
ui_print
"- Repacking boot image"
./magiskboot repack
"
$BOOTIMAGE
"
||
abort
"! Unable to repack boot image!"
./magiskboot repack
"
$BOOTIMAGE
"
||
abort
"! Unable to repack boot image!"
...
...
scripts/emulator.sh
View file @
0b70bd2b
#!/usr/bin/env bash
#!/usr/bin/env bash
################################################################
################################################################
#####
# AVD Magisk Setup
# AVD Magisk Setup
################################################################
################################################################
#####
#
#
# This script will setup an environment with minimal Magisk that
# This script will setup an environment with minimal Magisk that
# Magisk Manager will be happy to run properly within the official
# Magisk Manager will be happy to run properly within the official
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
# The script assumes you are using x86/x64 emulator images.
# The script assumes you are using x86/x64 emulator images.
# Build binaries with `./build.py binary` before running this script.
# Build binaries with `./build.py binary` before running this script.
#
#
################################################################
################################################################
#####
abort
()
{
abort
()
{
echo
"
$@
"
echo
"
$@
"
...
...
scripts/flash_script.sh
View file @
0b70bd2b
...
@@ -6,9 +6,9 @@
...
@@ -6,9 +6,9 @@
#
#
############################################
############################################
##############
##############################
##############
# Preparation
# Preparation
##############
##############################
##############
COMMONDIR
=
$INSTALLER
/common
COMMONDIR
=
$INSTALLER
/common
APK
=
$COMMONDIR
/magisk.apk
APK
=
$COMMONDIR
/magisk.apk
...
@@ -30,9 +30,9 @@ fi
...
@@ -30,9 +30,9 @@ fi
setup_flashable
setup_flashable
############
################################
############
# Detection
# Detection
############
################################
############
PRETTY_VER
=
$MAGISK_VER
PRETTY_VER
=
$MAGISK_VER
echo
$PRETTY_VER
|
grep
-q
'\.'
&&
PRETTY_VER
=
v
$PRETTY_VER
echo
$PRETTY_VER
|
grep
-q
'\.'
&&
PRETTY_VER
=
v
$PRETTY_VER
...
@@ -60,9 +60,9 @@ chmod -R 755 $CHROMEDIR $BINDIR
...
@@ -60,9 +60,9 @@ chmod -R 755 $CHROMEDIR $BINDIR
# Check if system root is installed and remove
# Check if system root is installed and remove
remove_system_su
remove_system_su
##############
##############################
##############
# Environment
# Environment
##############
##############################
##############
ui_print
"- Constructing environment"
ui_print
"- Constructing environment"
...
@@ -83,9 +83,9 @@ fi
...
@@ -83,9 +83,9 @@ fi
$BOOTMODE
||
recovery_actions
$BOOTMODE
||
recovery_actions
#####################
#######################
#####################
# Boot/DTBO Patching
# Boot/DTBO Patching
#####################
#######################
#####################
install_magisk
install_magisk
...
...
scripts/magisk_uninstaller.sh
View file @
0b70bd2b
...
@@ -6,9 +6,9 @@
...
@@ -6,9 +6,9 @@
#
#
############################################
############################################
##############
##############################
##############
# Preparation
# Preparation
##############
##############################
##############
# This path should work in any cases
# This path should work in any cases
TMPDIR
=
/dev/tmp
TMPDIR
=
/dev/tmp
...
@@ -51,9 +51,9 @@ $DATA_DE || abort "! Cannot access /data, please uninstall with Magisk Manager"
...
@@ -51,9 +51,9 @@ $DATA_DE || abort "! Cannot access /data, please uninstall with Magisk Manager"
$BOOTMODE
||
recovery_actions
$BOOTMODE
||
recovery_actions
run_migrations
run_migrations
############
################################
############
# Uninstall
# Uninstall
############
################################
############
get_flags
get_flags
find_boot_image
find_boot_image
...
...
scripts/module_installer.sh
View file @
0b70bd2b
...
@@ -170,9 +170,9 @@ rm -rf \
...
@@ -170,9 +170,9 @@ rm -rf \
$MODPATH
/system/placeholder
$MODPATH
/customize.sh
\
$MODPATH
/system/placeholder
$MODPATH
/customize.sh
\
$MODPATH
/README.md
$MODPATH
/.git
*
2>/dev/null
$MODPATH
/README.md
$MODPATH
/.git
*
2>/dev/null
#############
#
#############
# Finalizing
# Finalizing
#############
#
#############
cd
/
cd
/
$BOOTMODE
||
recovery_cleanup
$BOOTMODE
||
recovery_cleanup
...
...
scripts/util_functions.sh
View file @
0b70bd2b
#########################################
#########################################
###
#
#
# Magisk General Utility Functions
# Magisk General Utility Functions
# by topjohnwu
# by topjohnwu
#
#
#########################################
#########################################
###
#MAGISK_VERSION_STUB
#MAGISK_VERSION_STUB
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment