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
86da87f2
Commit
86da87f2
authored
Apr 18, 2017
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update build script and tools
parent
102a7f87
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
17 deletions
+50
-17
build.cmd
build.cmd
+33
-9
build.sh
build.sh
+17
-8
zipadjust.exe
ziptools/win_bin/zipadjust.exe
+0
-0
No files found.
build.cmd
View file @
86da87f2
...
...
@@ -4,22 +4,25 @@ SET me=%~nx0
SET parent=%~dp0
SET tab=
SET OK=
SET DEBUG=
CD %parent%
call :%~1 "%~2"
call :%~1 "%~2"
"%~3"
IF NOT DEFINED OK CALL :usage
EXIT /B %ERRORLEVEL%
:usage
ECHO %me% all ^<version name^>
ECHO %me% all ^<version name^>
^<version code^>
ECHO %tab%Build binaries, zip, and sign Magisk
ECHO %tab%This is equlivant to first ^<build^>, then ^<zip^>
ECHO %me% clean
ECHO %tab%Cleanup compiled / generated files
ECHO %me% build
ECHO %me% build
^<version name^> ^<version code^>
ECHO %tab%Build the binaries with ndk
ECHO %me% debug
ECHO %tab%Build the binaries with the debug flag on
ECHO %tab%Call ^<zip^> afterwards if you want to flash on device
ECHO %me% zip ^<version name^>
ECHO %tab%Zip and sign Magisk
ECHO %me% uninstaller
...
...
@@ -29,18 +32,39 @@ EXIT /B %ERRORLEVEL%
:all
SET OK=y
IF [%~1] == [] (
CALL :error "Missing version number"
CALL :error "Missing version info"
CALL :usage
EXIT /B %ERRORLEVEL%
)
IF [%~2] == [] (
CALL :error "Missing version info"
CALL :usage
EXIT /B %ERRORLEVEL%
)
CALL :build
CALL :build
"%~1" "%~2"
CALL :zip "%~1"
EXIT /B %ERRORLEVEL%
:debug
SET OK=y
SET DEBUG=-DDEBUG
CALL :build "VER_DEBUG" "99999"
EXIT /B %ERRORLEVEL%
:build
SET OK=y
IF [%~1] == [] (
CALL :error "Missing version info"
CALL :usage
EXIT /B %ERRORLEVEL%
)
IF [%~2] == [] (
CALL :error "Missing version info"
CALL :usage
EXIT /B %ERRORLEVEL%
)
ECHO ************************
ECHO * Building
binaries
ECHO * Building
: VERSION=%~1 CODE=%~2
ECHO ************************
FOR /F "tokens=* USEBACKQ" %%F IN (`where ndk-build`) DO (
IF [%%F] == [] (
...
...
@@ -48,7 +72,7 @@ EXIT /B %ERRORLEVEL%
EXIT /B 1
)
)
CALL ndk-build
-j4
|| CALL :error "Magisk binary tools build failed...."
CALL ndk-build
APP_CFLAGS="-DMAGISK_VERSION=%~1 -DMAGISK_VER_CODE=%~2 %DEBUG%" -j%NUMBER_OF_PROCESSORS%
|| CALL :error "Magisk binary tools build failed...."
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%
ECHO ************************
ECHO * Copying binaries
...
...
@@ -92,7 +116,7 @@ EXIT /B %ERRORLEVEL%
:zip
SET OK=y
IF [%~1] == [] (
CALL :error "Missing version
number
"
CALL :error "Missing version
info
"
CALL :usage
EXIT /B %ERRORLEVEL%
)
...
...
build.sh
View file @
86da87f2
#!/bin/bash
usage
()
{
echo
"
$0
all <version name>"
echo
"
$0
all <version name>
<version code>
"
echo
-e
"
\t
Build binaries, zip, and sign Magisk"
echo
-e
"
\t
This is equlivant to first <build>, then <zip>"
echo
"
$0
clean"
echo
-e
"
\t
Cleanup compiled / generated files"
echo
"
$0
build"
echo
"
$0
build
<verison name> <version code>
"
echo
-e
"
\t
Build the binaries with ndk"
echo
"
$0
debug"
echo
-e
"
\t
Build the binaries with the debug flag on
\n\t
Call <zip> afterwards if you want to flash on device"
echo
"
$0
zip <version name>"
echo
-e
"
\t
Zip and sign Magisk"
echo
"
$0
uninstaller"
...
...
@@ -48,10 +50,10 @@ error() {
build_bin
()
{
echo
"************************"
echo
"* Building
binaries
"
echo
"* Building
: VERSION=
$1
CODE=
$2
"
echo
"************************"
[
-z
`
which ndk-build
`
]
&&
error
"Please add ndk-build to PATH!"
ndk-build
-j4
||
error
"Magisk binary tools build failed...."
ndk-build
APP_CFLAGS
=
"-DMAGISK_VERSION=
$1
-DMAGISK_VER_CODE=
$2
$DEBUG
"
-j
${
CPUNUM
}
||
error
"Magisk binary tools build failed...."
echo
"************************"
echo
"* Copying binaries"
echo
"************************"
...
...
@@ -150,21 +152,28 @@ sign_zip() {
DIR
=
"
$(
cd
"
$(
dirname
"
$0
"
)
"
;
pwd
)
"
cd
"
$DIR
"
DEBUG
=
CPUNUM
=
`
getconf _NPROCESSORS_ONLN
`
case
$1
in
"all"
)
[
-z
"
$2
"
]
&&
echo
-e
"! Missing version number
\n
"
&&
usage
build_bin
[
-z
"
$2
"
-o
-z
"
$3
"
]
&&
echo
-e
"! Missing version info
\n
"
&&
usage
build_bin
$2
$3
zip_package
$2
;;
"clean"
)
cleanup
;;
"build"
)
build_bin
[
-z
"
$2
"
-o
-z
"
$3
"
]
&&
echo
-e
"! Missing version info
\n
"
&&
usage
build_bin
$2
$3
;;
"debug"
)
DEBUG
=
"-DDEBUG"
build_bin
"VER_DEBUG"
"99999"
;;
"zip"
)
[
-z
"
$2
"
]
&&
echo
-e
"! Missing version
number
\n
"
&&
usage
[
-z
"
$2
"
]
&&
echo
-e
"! Missing version
info
\n
"
&&
usage
zip_package
$2
;;
"uninstaller"
)
...
...
ziptools/win_bin/zipadjust.exe
View file @
86da87f2
This diff was suppressed by a .gitattributes entry.
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