forked from topjohnwu/Magisk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
91 changed files
with
1,675 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,18 @@ | ||
out/ | ||
obj/ | ||
libs/ | ||
/out | ||
/obj | ||
/libs | ||
*.zip | ||
*.jks | ||
*.apk | ||
|
||
# Built binaries | ||
ziptools/zipadjust | ||
|
||
# Android Studio / Gradle | ||
*.iml | ||
.gradle | ||
/local.properties | ||
/.idea | ||
/build | ||
/captures | ||
.externalNativeBuild |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,27 @@ | ||
[submodule "jni/selinux"] | ||
path = jni/external/selinux | ||
path = core/jni/external/selinux | ||
url = https://github.com/topjohnwu/selinux.git | ||
[submodule "jni/su"] | ||
path = jni/su | ||
path = core/jni/su | ||
url = https://github.com/topjohnwu/MagiskSU.git | ||
[submodule "jni/magiskpolicy"] | ||
path = jni/magiskpolicy | ||
path = core/jni/magiskpolicy | ||
url = https://github.com/topjohnwu/magiskpolicy.git | ||
[submodule "MagiskManager"] | ||
path = java | ||
path = app | ||
url = https://github.com/topjohnwu/MagiskManager.git | ||
[submodule "jni/busybox"] | ||
path = jni/external/busybox | ||
path = core/jni/external/busybox | ||
url = https://github.com/topjohnwu/ndk-busybox.git | ||
[submodule "jni/external/dtc"] | ||
path = jni/external/dtc | ||
path = core/jni/external/dtc | ||
url = https://github.com/dgibson/dtc | ||
[submodule "jni/external/lz4"] | ||
path = jni/external/lz4 | ||
path = core/jni/external/lz4 | ||
url = https://github.com/lz4/lz4.git | ||
[submodule "jni/external/bzip2"] | ||
path = jni/external/bzip2 | ||
path = core/jni/external/bzip2 | ||
url = https://github.com/nemequ/bzip2.git | ||
[submodule "jni/external/xz"] | ||
path = jni/external/xz | ||
path = core/jni/external/xz | ||
url = https://github.com/xz-mirror/xz.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Top-level build file where you can add configuration options common to all sub-projects/modules. | ||
|
||
buildscript { | ||
|
||
repositories { | ||
google() | ||
jcenter() | ||
} | ||
dependencies { | ||
classpath 'com.android.tools.build:gradle:3.0.1' | ||
|
||
|
||
// NOTE: Do not place your application dependencies here; they belong | ||
// in the individual module build.gradle files | ||
} | ||
} | ||
|
||
allprojects { | ||
repositories { | ||
google() | ||
jcenter() | ||
} | ||
} | ||
|
||
task clean(type: Delete) { | ||
delete rootProject.buildDir | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
apply plugin: 'com.android.library' | ||
|
||
android { | ||
compileSdkVersion 27 | ||
|
||
externalNativeBuild { | ||
ndkBuild { | ||
path 'jni/Android.mk' | ||
} | ||
} | ||
|
||
defaultConfig { | ||
externalNativeBuild { | ||
ndkBuild { | ||
// Passes an optional argument to ndk-build. | ||
arguments "COMPILEALL=true" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Submodule busybox
updated
from 000000 to e3a1a4
Submodule bzip2
updated
from 000000 to 67d818
Submodule dtc
updated
from 000000 to 22a65c
File renamed without changes.
File renamed without changes.
File renamed without changes.
Submodule lz4
updated
from 000000 to c10863
Submodule selinux
updated
from 000000 to 2fefdf
File renamed without changes.
File renamed without changes.
File renamed without changes.
Submodule xz
updated
from 000000 to 3d566c
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Submodule magiskpolicy
updated
from 000000 to d7a612
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Submodule su
updated
from 000000 to a9d966
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<manifest package="com.topjohnwu.native.magisk" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
apply plugin: 'java-library' | ||
|
||
apply plugin: 'com.github.johnrengelman.shadow' | ||
apply plugin: 'java' | ||
|
||
sourceCompatibility = "1.8" | ||
targetCompatibility = "1.8" | ||
|
||
jar { | ||
manifest { | ||
attributes 'Main-Class': 'com.topjohnwu.crypto.ZipSigner' | ||
} | ||
} | ||
|
||
shadowJar { | ||
baseName = 'zipsigner' | ||
classifier = null | ||
version = 1.1 | ||
} | ||
|
||
buildscript { | ||
repositories { | ||
jcenter() | ||
} | ||
dependencies { | ||
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.1' | ||
} | ||
} | ||
|
||
repositories { | ||
jcenter() | ||
} | ||
|
||
dependencies { | ||
implementation fileTree(include: ['*.jar'], dir: 'libs') | ||
implementation 'org.bouncycastle:bcprov-jdk15on:1.58' | ||
implementation 'org.bouncycastle:bcpkix-jdk15on:1.58' | ||
} |
34 changes: 34 additions & 0 deletions
34
crypto/src/main/java/com/topjohnwu/crypto/ByteArrayStream.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.topjohnwu.crypto; | ||
|
||
import java.io.ByteArrayInputStream; | ||
import java.io.ByteArrayOutputStream; | ||
import java.io.IOException; | ||
import java.io.InputStream; | ||
import java.io.OutputStream; | ||
|
||
public class ByteArrayStream extends ByteArrayOutputStream { | ||
public byte[] getBuf() { | ||
return buf; | ||
} | ||
public synchronized void readFrom(InputStream is) { | ||
readFrom(is, Integer.MAX_VALUE); | ||
} | ||
public synchronized void readFrom(InputStream is, int len) { | ||
int read; | ||
byte buffer[] = new byte[4096]; | ||
try { | ||
while ((read = is.read(buffer, 0, len < buffer.length ? len : buffer.length)) > 0) { | ||
write(buffer, 0, read); | ||
len -= read; | ||
} | ||
} catch (IOException e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
public synchronized void writeTo(OutputStream out, int off, int len) throws IOException { | ||
out.write(buf, off, len); | ||
} | ||
public ByteArrayInputStream getInputStream() { | ||
return new ByteArrayInputStream(buf, 0, count); | ||
} | ||
} |
Oops, something went wrong.