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
ad7ec799
Commit
ad7ec799
authored
Sep 05, 2018
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support custom config paths
parent
0543239c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
25 deletions
+25
-25
build.py
build.py
+25
-25
No files found.
build.py
View file @
ad7ec799
...
@@ -397,34 +397,10 @@ def build_all(args):
...
@@ -397,34 +397,10 @@ def build_all(args):
zip_uninstaller
(
args
)
zip_uninstaller
(
args
)
build_snet
(
args
)
build_snet
(
args
)
with
open
(
'config.prop'
,
'r'
)
as
f
:
for
line
in
[
l
.
strip
(
'
\t\r\n
'
)
for
l
in
f
]:
if
line
.
startswith
(
'#'
)
or
len
(
line
)
==
0
:
continue
prop
=
line
.
split
(
'='
)
config
[
prop
[
0
]
.
strip
(
'
\t\r\n
'
)]
=
prop
[
1
]
.
strip
(
'
\t\r\n
'
)
if
'version'
not
in
config
or
'versionCode'
not
in
config
:
error
(
'"version" and "versionCode" is required in "config.prop"'
)
try
:
config
[
'versionCode'
]
=
int
(
config
[
'versionCode'
])
except
ValueError
:
error
(
'"versionCode" is required to be an integer'
)
if
'prettyName'
not
in
config
:
config
[
'prettyName'
]
=
'false'
config
[
'prettyName'
]
=
config
[
'prettyName'
]
.
lower
()
==
'true'
if
'outdir'
not
in
config
:
config
[
'outdir'
]
=
'out'
mkdir_p
(
config
[
'outdir'
])
parser
=
argparse
.
ArgumentParser
(
description
=
'Magisk build script'
)
parser
=
argparse
.
ArgumentParser
(
description
=
'Magisk build script'
)
parser
.
add_argument
(
'-r'
,
'--release'
,
action
=
'store_true'
,
help
=
'compile Magisk for release'
)
parser
.
add_argument
(
'-r'
,
'--release'
,
action
=
'store_true'
,
help
=
'compile Magisk for release'
)
parser
.
add_argument
(
'-v'
,
'--verbose'
,
action
=
'store_true'
,
help
=
'verbose output'
)
parser
.
add_argument
(
'-v'
,
'--verbose'
,
action
=
'store_true'
,
help
=
'verbose output'
)
parser
.
add_argument
(
'-c'
,
'--config'
,
default
=
'config.prop'
,
help
=
'config file location'
)
subparsers
=
parser
.
add_subparsers
(
title
=
'actions'
)
subparsers
=
parser
.
add_subparsers
(
title
=
'actions'
)
all_parser
=
subparsers
.
add_parser
(
'all'
,
help
=
'build everything (binaries/apks/zips)'
)
all_parser
=
subparsers
.
add_parser
(
'all'
,
help
=
'build everything (binaries/apks/zips)'
)
...
@@ -458,6 +434,30 @@ if len(sys.argv) == 1:
...
@@ -458,6 +434,30 @@ if len(sys.argv) == 1:
sys
.
exit
(
1
)
sys
.
exit
(
1
)
args
=
parser
.
parse_args
()
args
=
parser
.
parse_args
()
# Some default values
config
[
'outdir'
]
=
'out'
config
[
'prettyName'
]
=
'false'
with
open
(
args
.
config
,
'r'
)
as
f
:
for
line
in
[
l
.
strip
(
'
\t\r\n
'
)
for
l
in
f
]:
if
line
.
startswith
(
'#'
)
or
len
(
line
)
==
0
:
continue
prop
=
line
.
split
(
'='
)
config
[
prop
[
0
]
.
strip
(
'
\t\r\n
'
)]
=
prop
[
1
]
.
strip
(
'
\t\r\n
'
)
if
'version'
not
in
config
or
'versionCode'
not
in
config
:
error
(
'"version" and "versionCode" is required in "config.prop"'
)
try
:
config
[
'versionCode'
]
=
int
(
config
[
'versionCode'
])
except
ValueError
:
error
(
'"versionCode" is required to be an integer'
)
config
[
'prettyName'
]
=
config
[
'prettyName'
]
.
lower
()
==
'true'
mkdir_p
(
config
[
'outdir'
])
if
args
.
release
and
not
os
.
path
.
exists
(
keystore
):
if
args
.
release
and
not
os
.
path
.
exists
(
keystore
):
error
(
'Please generate a java keystore and place it in
\'
{}
\'
'
.
format
(
keystore
))
error
(
'Please generate a java keystore and place it in
\'
{}
\'
'
.
format
(
keystore
))
STDOUT
=
None
if
args
.
verbose
else
subprocess
.
DEVNULL
STDOUT
=
None
if
args
.
verbose
else
subprocess
.
DEVNULL
...
...
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