Skip to content

Commit

Permalink
init commit
Browse files Browse the repository at this point in the history
  • Loading branch information
luoyesiqiu committed Jan 13, 2022
0 parents commit 686d6eb
Show file tree
Hide file tree
Showing 104 changed files with 5,342 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .gitignore
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
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

116 changes: 116 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions README.md
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
```
24 changes: 24 additions & 0 deletions build.gradle
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
}
1 change: 1 addition & 0 deletions dpt/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
17 changes: 17 additions & 0 deletions dpt/build.gradle
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'
}
Binary file added dpt/libs/ManifestEditor-1.0.2.jar
Binary file not shown.
Binary file added dpt/libs/dx.jar
Binary file not shown.
Binary file added dpt/shell/dex/classes.dex
Binary file not shown.
Binary file added dpt/shell/libs/arm64-v8a/libdpt.so
Binary file not shown.
Binary file added dpt/shell/libs/armeabi-v7a/libdpt.so
Binary file not shown.
12 changes: 12 additions & 0 deletions dpt/src/main/java/com/luoye/dpt/Const.java
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;
}
46 changes: 46 additions & 0 deletions dpt/src/main/java/com/luoye/dpt/Dpt.java
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());
}
}
8 changes: 8 additions & 0 deletions dpt/src/main/java/com/luoye/dpt/Global.java
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 = "";
}
Loading

0 comments on commit 686d6eb

Please sign in to comment.