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
00d655f3
Commit
00d655f3
authored
Jan 22, 2018
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update proguard to minimize APK size
parent
821726e7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
3 deletions
+17
-3
proguard-rules.pro
proguard-rules.pro
+3
-1
ZipUtils.java
src/main/java/com/topjohnwu/magisk/utils/ZipUtils.java
+14
-2
No files found.
proguard-rules.pro
View file @
00d655f3
...
...
@@ -20,7 +20,9 @@
-
keepnames
class
**
{
*
;
}
# BouncyCastle
-
keep
class
org
.
bouncycastle
.
jcajce
.
provider
.
**
{
*
;
}
-
keep
class
org
.
bouncycastle
.
jcajce
.
provider
.
asymmetric
.
rsa
.
**
SHA1
**
{
*
;
}
-
keep
class
org
.
bouncycastle
.
jcajce
.
provider
.
asymmetric
.
RSA
**
{
*
;
}
-
keep
class
org
.
bouncycastle
.
jcajce
.
provider
.
digest
.
SHA1
**
{
*
;
}
-
dontwarn
javax
.
naming
.
**
# Gson
...
...
src/main/java/com/topjohnwu/magisk/utils/ZipUtils.java
View file @
00d655f3
...
...
@@ -7,10 +7,12 @@ import com.topjohnwu.crypto.SignAPK;
import
com.topjohnwu.magisk.MagiskManager
;
import
java.io.BufferedInputStream
;
import
java.io.BufferedOutputStream
;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.FileOutputStream
;
import
java.io.InputStream
;
import
java.io.OutputStream
;
import
java.util.zip.ZipEntry
;
import
java.util.zip.ZipInputStream
;
...
...
@@ -56,14 +58,24 @@ public class ZipUtils {
}
public
static
void
signZip
(
InputStream
is
,
File
output
,
boolean
minSign
)
throws
Exception
{
signZip
(
new
JarMap
(
is
,
false
),
output
,
minSign
);
try
(
JarMap
map
=
new
JarMap
(
is
,
false
))
{
signZip
(
map
,
output
,
minSign
);
}
}
public
static
void
signZip
(
File
input
,
File
output
,
boolean
minSign
)
throws
Exception
{
signZip
(
new
JarMap
(
input
,
false
),
output
,
minSign
);
try
(
JarMap
map
=
new
JarMap
(
input
,
false
))
{
signZip
(
map
,
output
,
minSign
);
}
}
public
static
void
signZip
(
JarMap
input
,
File
output
,
boolean
minSign
)
throws
Exception
{
try
(
BufferedOutputStream
out
=
new
BufferedOutputStream
(
new
FileOutputStream
(
output
)))
{
signZip
(
input
,
out
,
minSign
);
}
}
public
static
void
signZip
(
JarMap
input
,
OutputStream
output
,
boolean
minSign
)
throws
Exception
{
AssetManager
assets
=
MagiskManager
.
get
().
getAssets
();
SignAPK
.
signZip
(
assets
.
open
(
Const
.
PUBLIC_KEY_NAME
),
assets
.
open
(
Const
.
PRIVATE_KEY_NAME
),
...
...
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