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
799ef338
Commit
799ef338
authored
Oct 30, 2016
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update build script
parent
d5087858
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
13 deletions
+36
-13
.gitignore
.gitignore
+1
-1
build.sh
build.sh
+35
-12
No files found.
.gitignore
View file @
799ef338
build.sh
View file @
799ef338
#!/bin/bash
usage
()
{
echo
"
$0
--
all <version number>"
echo
"
$0
all <version number>"
echo
-e
"
\t
Build binaries, zip, and sign Magisk"
echo
-e
"
\t
This is equlivant to first --build, then --zip"
echo
"
$0
--
clean"
echo
"
$0
clean"
echo
-e
"
\t
Cleanup compiled / generated files"
echo
"
$0
--
build"
echo
"
$0
build"
echo
-e
"
\t
Build the binaries with ndk"
echo
"
$0
--
zip <version number>"
echo
"
$0
zip <version number>"
echo
-e
"
\t
Zip and sign Magisk"
echo
"
$0
--
uninstaller"
echo
"
$0
uninstaller"
echo
-e
"
\t
Zip and sign the uninstaller"
exit
1
}
...
...
@@ -56,14 +56,18 @@ build_bin() {
}
zip_package
()
{
if
[
!
-f
"zip_static/arm/bootimgtools"
]
;
then
echo
"! Missing binaries!!"
echo
"! Please run
\"
$0
build
\"
before zipping"
exit
1
fi
echo
"************************"
echo
"* Adding version info"
echo
"*
\"
Magisk v
$1
\"
"
echo
"************************"
sed
"s/MAGISK_VERSION_STUB/Magisk v
$1
Boot Image Patcher/g"
scripts/flash_script.sh
>
zip_static/META-INF/com/google/android/update-binary
sed
"s/MAGISK_VERSION_STUB/setprop magisk.version
$1
/g"
scripts/magic_mask.sh
>
zip_static/common/magic_mask.sh
echo
"************************"
echo
"* Zipping
the package
"
echo
"* Zipping
Magisk v
$1
"
echo
"************************"
cd
zip_static
find
.
-type
f
-exec
chmod
644
{}
\;
...
...
@@ -74,6 +78,25 @@ zip_package() {
sign_zip
"Magisk-v
$1
.zip"
}
zip_uninstaller
()
{
if
[
!
-f
"uninstaller/arm/bootimgtools"
]
;
then
echo
"! Missing binaries!!"
echo
"! Please run
\"
$0
build
\"
before zipping"
exit
1
fi
echo
"************************"
echo
"* Zipping uninstaller"
echo
"************************"
cd
uninstaller
find
.
-type
f
-exec
chmod
644
{}
\;
find
.
-type
d
-exec
chmod
755
{}
\;
TIMESTAMP
=
$(
date
"+%Y%m%d"
)
rm
-rf
"../Magisk-uninstaller-
$TIMESTAMP
.zip"
zip
"../Magisk-uninstaller-
$TIMESTAMP
.zip"
-r
.
cd
../
sign_zip
"Magisk-uninstaller-
$TIMESTAMP
.zip"
}
sign_zip
()
{
if
[
!
-f
"zipsigntools/zipadjust"
]
;
then
echo
"************************"
...
...
@@ -103,22 +126,22 @@ DIR="$(cd "$(dirname "$0")"; pwd)"
cd
"
$DIR
"
case
$1
in
"
--
all"
)
"all"
)
[
-z
"
$2
"
]
&&
echo
-e
"! Missing version number
\n
"
&&
usage
build_bin
zip_package
$2
;;
"
--
clean"
)
"clean"
)
cleanup
;;
"
--
build"
)
"build"
)
build_bin
;;
"
--
zip"
)
"zip"
)
[
-z
"
$2
"
]
&&
echo
-e
"! Missing version number
\n
"
&&
usage
zip_package
$2
;;
"
--
uninstaller"
)
"uninstaller"
)
zip_uninstaller
;;
*
)
...
...
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