-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
*.iml | ||
.gradle | ||
/local.properties | ||
/.idea/caches | ||
/.idea/libraries | ||
/.idea/modules.xml | ||
/.idea/workspace.xml | ||
/.idea/navEditor.xml | ||
/.idea/assetWizardSettings.xml | ||
.DS_Store | ||
/build | ||
/captures | ||
.externalNativeBuild | ||
.cxx | ||
local.properties |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# dpt-shell | ||
|
||
## 介绍 | ||
|
||
函数抽取壳,目前支持Android6~10 | ||
|
||
## 用法 | ||
|
||
下载executable.zip,解压,执行: | ||
|
||
``` | ||
java -jar dpt.jar /path/to/apk | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// 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:4.1.0" | ||
|
||
// 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 | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
plugins { | ||
id 'java-library' | ||
} | ||
|
||
java { | ||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
targetCompatibility = JavaVersion.VERSION_1_8 | ||
} | ||
|
||
dependencies { | ||
implementation fileTree(dir:'libs',include:['*.jar']) | ||
implementation 'de.upb.cs.swt:axml:2.1.1' | ||
implementation 'org.slf4j:slf4j-api:1.7.30' | ||
implementation 'org.slf4j:slf4j-simple:1.7.30' | ||
implementation group: 'net.lingala.zip4j', name: 'zip4j', version: '2.6.4' | ||
implementation group: 'org.bouncycastle', name: 'bcprov-ext-jdk16', version: '1.46' | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.luoye.dpt; | ||
|
||
/** | ||
* @author luoyesiqiu | ||
*/ | ||
public class Const { | ||
|
||
public static final String ROOT_OF_OUT_DIR = System.getProperty("java.io.tmpdir"); | ||
public static final String PROXY_APPLICATION_NAME = "com.luoyesiqiu.shell.ProxyApplication"; | ||
public static final String PROXY_COMPONENT_FACTORY = "com.luoyesiqiu.shell.ProxyComponentFactory"; | ||
public static final short MULTI_DEX_CODE_VERSION = 1; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package com.luoye.dpt; | ||
|
||
import com.luoye.dpt.util.*; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import java.io.File; | ||
|
||
public class Dpt { | ||
private static final Logger logger = LoggerFactory.getLogger(Dpt.class.getSimpleName()); | ||
public static void main(String[] args) { | ||
if(args.length < 1){ | ||
usage(); | ||
return; | ||
} | ||
try { | ||
processApk(args[0]); | ||
} catch (Exception e){ | ||
e.printStackTrace(); | ||
} | ||
} | ||
|
||
private static void usage(){ | ||
System.err.println("Usage:\n\tjava -jar dpt.jar [--log] <ApkFile>"); | ||
} | ||
|
||
private static void processApk(String apkPath){ | ||
ApkUtils.deleteOutDir(); | ||
ApkUtils.extract(apkPath,ApkUtils.getOutDir().getAbsolutePath()); | ||
Global.packageName = ManifestUtils.getPackageName(ApkUtils.getOutDir() + File.separator + "AndroidManifest.xml"); | ||
ApkUtils.extractDexCode(ApkUtils.getOutDir().getAbsolutePath()); | ||
ApkUtils.saveApplicationName(ApkUtils.getOutDir().getAbsolutePath()); | ||
ApkUtils.writeProxyAppName(); | ||
boolean needWrite = ApkUtils.saveAppComponentFactory(ApkUtils.getOutDir().getAbsolutePath()); | ||
if(needWrite) { | ||
ApkUtils.writeProxyComponentFactoryName(); | ||
} | ||
ApkUtils.setExtractNativeLibs(); | ||
ApkUtils.addProxyDex(ApkUtils.getOutDir().getAbsolutePath()); | ||
|
||
ApkUtils.deleteMetaData(); | ||
ApkUtils.copyShellLibs(new File("shell/libs")); | ||
File apkFile = new File(apkPath); | ||
File newApkFile = new File(apkFile.getParent() , ApkUtils.getNewApkName(apkFile.getName())); | ||
ApkUtils.compress(ApkUtils.getOutDir().getAbsolutePath(),newApkFile.getAbsolutePath()); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.luoye.dpt; | ||
|
||
/** | ||
* @author luoyesiqiu | ||
*/ | ||
public class Global { | ||
public static String packageName = ""; | ||
} |