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
a079966f
Commit
a079966f
authored
Oct 17, 2020
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate to AGP 4.1.0
parent
468796c2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
24 deletions
+9
-24
proguard-rules.pro
app/proguard-rules.pro
+0
-6
build.gradle.kts
build.gradle.kts
+5
-3
build.py
build.py
+4
-13
build.gradle.kts
native/build.gradle.kts
+0
-2
No files found.
app/proguard-rules.pro
View file @
a079966f
...
...
@@ -35,12 +35,6 @@
void
onResponse
(
org
.
json
.
JSONObject
);
}
# Fragments
# TODO: Remove when AGP 4.1 release
# https://issuetracker.google.com/issues/142601969
-
keep
,
allowobfuscation
class
*
extends
androidx
.
fragment
.
app
.
Fragment
-
keepnames
class
androidx
.
navigation
.
fragment
.
NavHostFragment
# Strip Timber verbose and debug logging
-
assumenosideeffects
class
timber
.
log
.
Timber
.
Tree
{
public
void
v
(
**
);
...
...
build.gradle.kts
View file @
a079966f
...
...
@@ -37,7 +37,7 @@ fun Task.applyOptimize() = doLast {
val
aapt2
=
Paths
.
get
(
project
.
android
.
sdkDirectory
.
path
,
"build-tools"
,
project
.
android
.
buildToolsVersion
,
"aapt2"
)
val
zip
=
Paths
.
get
(
project
.
buildDir
.
path
,
"intermediates"
,
"
processed_res"
,
"release"
,
"out"
,
"resources-release
.ap_"
)
"
shrunk_processed_res"
,
"release"
,
"resources-release-stripped
.ap_"
)
val
optimized
=
File
(
"${zip}.opt"
)
val
cmd
=
exec
{
commandLine
(
aapt2
,
"optimize"
,
"--collapse-resource-names"
,
...
...
@@ -45,6 +45,7 @@ fun Task.applyOptimize() = doLast {
isIgnoreExitValue
=
true
}
if
(
cmd
.
exitValue
==
0
)
{
zip
.
toFile
().
delete
()
optimized
.
renameTo
(
zip
.
toFile
())
}
}
...
...
@@ -63,6 +64,7 @@ subprojects {
android
.
apply
{
compileSdkVersion
(
30
)
buildToolsVersion
=
"30.0.2"
ndkPath
=
"${System.getenv("
ANDROID_HOME
")}/ndk/magisk"
defaultConfig
{
if
(
minSdkVersion
==
null
)
...
...
@@ -87,8 +89,8 @@ subprojects {
}
tasks
.
whenTaskAdded
{
if
(
name
==
"
processReleaseResourc
es"
)
{
finalizedBy
(
tasks
.
create
(
"optimizeReleaseRes
ources
"
).
applyOptimize
())
if
(
name
==
"
shrinkReleaseR
es"
)
{
finalizedBy
(
tasks
.
create
(
"optimizeReleaseRes"
).
applyOptimize
())
}
}
...
...
build.py
View file @
a079966f
...
...
@@ -55,8 +55,8 @@ arch64 = ['arm64-v8a', 'x86_64']
support_targets
=
[
'magisk'
,
'magiskinit'
,
'magiskboot'
,
'magiskpolicy'
,
'resetprop'
,
'busybox'
,
'test'
]
default_targets
=
[
'magisk'
,
'magiskinit'
,
'magiskboot'
,
'busybox'
]
ndk_ver
=
'21
c
'
ndk_ver_full
=
'21.
2.6472646
'
ndk_ver
=
'21
d
'
ndk_ver_full
=
'21.
3.6528147
'
ndk_root
=
op
.
join
(
os
.
environ
[
'ANDROID_HOME'
],
'ndk'
)
ndk_path
=
op
.
join
(
ndk_root
,
'magisk'
)
...
...
@@ -285,8 +285,8 @@ def dump_bin_headers():
def
build_binary
(
args
):
# Verify NDK install
props
=
parse_props
(
op
.
join
(
ndk_path
,
'source.properties'
))
if
'Pkg.Revision.orig'
not
in
props
or
props
[
'Pkg.Revision.orig
'
]
!=
ndk_ver_full
:
error
(
'Incorrect NDK. Please
setup
NDK with "build.py ndk"'
)
if
props
[
'Pkg.Revision
'
]
!=
ndk_ver_full
:
error
(
'Incorrect NDK. Please
install/upgrade
NDK with "build.py ndk"'
)
if
args
.
target
:
args
.
target
=
set
(
args
.
target
)
&
set
(
support_targets
)
...
...
@@ -550,15 +550,6 @@ def setup_ndk(args):
for
path
in
copy_tree
(
src_dir
,
lib_dir
):
vprint
(
f
'Replaced {path}'
)
# Rewrite source.properties
src_prop
=
op
.
join
(
ndk_path
,
'source.properties'
)
props
=
parse_props
(
src_prop
)
props
[
'Pkg.Revision.orig'
]
=
props
[
'Pkg.Revision'
]
props
[
'Pkg.Revision'
]
=
'99.99.99'
with
open
(
src_prop
,
'w'
)
as
p
:
for
key
,
val
in
props
.
items
():
print
(
f
'{key} = {val}'
,
file
=
p
)
def
build_all
(
args
):
vars
(
args
)[
'target'
]
=
[]
...
...
native/build.gradle.kts
View file @
a079966f
...
...
@@ -4,8 +4,6 @@ plugins {
android
{
ndkVersion
=
"99.99.99"
externalNativeBuild
{
ndkBuild
{
path
(
"jni/Android.mk"
)
...
...
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