├── Demo ├── .gitignore ├── .idea │ ├── compiler.xml │ ├── copyright │ │ └── profiles_settings.xml │ ├── gradle.xml │ ├── misc.xml │ ├── modules.xml │ └── runConfigurations.xml ├── app │ ├── .gitignore │ ├── app-release.apk │ ├── build.gradle │ ├── proguard-rules.pro │ └── src │ │ ├── androidTest │ │ └── java │ │ │ └── demon │ │ │ └── demo │ │ │ └── ExampleInstrumentedTest.java │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ │ └── demon │ │ │ │ └── demo │ │ │ │ ├── GlideUtil.java │ │ │ │ ├── ImageActivity.java │ │ │ │ ├── MainActivity.java │ │ │ │ ├── MyApplication.java │ │ │ │ └── NetStateReceiver.java │ │ └── res │ │ │ ├── layout │ │ │ ├── activity_image.xml │ │ │ └── activity_main.xml │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ └── values │ │ │ ├── colors.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ │ └── test │ │ └── java │ │ └── demon │ │ └── demo │ │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle ├── DexShellTool ├── .idea │ ├── encodings.xml │ ├── misc.xml │ ├── modules.xml │ └── workspace.xml ├── DexShellTool.iml ├── force │ ├── classes.dex │ ├── demo.apk │ └── shell.dex ├── out │ └── production │ │ └── DexShellTool │ │ └── DexShellTool.class └── src │ └── DexShellTool.java ├── MyUnshell ├── .gitignore ├── .idea │ ├── compiler.xml │ ├── copyright │ │ └── profiles_settings.xml │ ├── encodings.xml │ ├── gradle.xml │ ├── inspectionProfiles │ │ ├── Project_Default.xml │ │ └── profiles_settings.xml │ ├── misc.xml │ ├── modules.xml │ └── runConfigurations.xml ├── app │ ├── .gitignore │ ├── app-release.apk │ ├── build.gradle │ ├── proguard-rules.pro │ └── src │ │ ├── androidTest │ │ └── java │ │ │ └── demon │ │ │ └── myunshell │ │ │ └── ExampleInstrumentedTest.java │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ │ └── demon │ │ │ │ └── myunshell │ │ │ │ ├── ProxyApplication.java │ │ │ │ └── RefInvoke.java │ │ └── res │ │ │ ├── layout │ │ │ ├── activity_image.xml │ │ │ └── activity_main.xml │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ └── values │ │ │ ├── colors.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ │ └── test │ │ └── java │ │ └── demon │ │ └── myunshell │ │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle ├── README.md └── Tools ├── DeMon.jks ├── shell.apk ├── shelldemo.apk ├── sign.bat └── 说明.txt /Demo/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .externalNativeBuild 10 | -------------------------------------------------------------------------------- /Demo/.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /Demo/.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Demo/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | -------------------------------------------------------------------------------- /Demo/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 19 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 46 | 47 | 48 | 49 | 50 | 51 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /Demo/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Demo/.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /Demo/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /Demo/app/app-release.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iDeMonnnnnn/Shell/dd3ba2ebfdb488596fcf5c1e96c51888f572b1fa/Demo/app/app-release.apk -------------------------------------------------------------------------------- /Demo/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 26 5 | buildToolsVersion "26.0.1" 6 | defaultConfig { 7 | applicationId "demon.demo" 8 | minSdkVersion 16 9 | targetSdkVersion 26 10 | versionCode 1 11 | versionName "1.0" 12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | compile fileTree(dir: 'libs', include: ['*.jar']) 24 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 25 | exclude group: 'com.android.support', module: 'support-annotations' 26 | }) 27 | compile 'com.android.support:appcompat-v7:26.+' 28 | compile 'com.android.support.constraint:constraint-layout:1.0.2' 29 | testCompile 'junit:junit:4.12' 30 | compile 'com.github.bumptech.glide:glide:3.6.1' 31 | } 32 | -------------------------------------------------------------------------------- /Demo/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in E:\AndroidSDK/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Uncomment this to preserve the line number information for 20 | # debugging stack traces. 21 | #-keepattributes SourceFile,LineNumberTable 22 | 23 | # If you keep the line number information, uncomment this to 24 | # hide the original source file name. 25 | #-renamesourcefileattribute SourceFile 26 | -------------------------------------------------------------------------------- /Demo/app/src/androidTest/java/demon/demo/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package demon.demo; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("demon.demo", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Demo/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Demo/app/src/main/java/demon/demo/GlideUtil.java: -------------------------------------------------------------------------------- 1 | package demon.demo; 2 | 3 | import android.content.Context; 4 | import android.widget.ImageView; 5 | 6 | import com.bumptech.glide.Glide; 7 | 8 | /** 9 | * Created by DeMon on 2017/10/17. 10 | */ 11 | 12 | public class GlideUtil { 13 | 14 | /** 15 | * 根据图片url将图片显示在img控件上 16 | * 17 | * @param context 所属的Context 18 | * @param url 图片url 19 | * @param img ImageView控件 20 | */ 21 | public static void setImage(Context context, String url, ImageView img) { 22 | Glide.with(context).load(url).dontAnimate().fitCenter().placeholder(R.mipmap.ic_launcher_round).into(img); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Demo/app/src/main/java/demon/demo/ImageActivity.java: -------------------------------------------------------------------------------- 1 | package demon.demo; 2 | 3 | import android.content.IntentFilter; 4 | import android.net.ConnectivityManager; 5 | import android.os.Bundle; 6 | import android.support.v7.app.AppCompatActivity; 7 | import android.widget.ImageView; 8 | 9 | public class ImageActivity extends AppCompatActivity { 10 | 11 | 12 | private NetStateReceiver receiver = new NetStateReceiver(); 13 | 14 | @Override 15 | protected void onCreate(Bundle savedInstanceState) { 16 | super.onCreate(savedInstanceState); 17 | setContentView(R.layout.activity_image); 18 | 19 | IntentFilter filter = new IntentFilter(); 20 | filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION); 21 | registerReceiver(receiver, filter); 22 | receiver.onReceive(this, null); 23 | 24 | ImageView image = (ImageView) findViewById(R.id.image); 25 | GlideUtil.setImage(this, "http://omuzv9mvf.bkt.clouddn.com/D.png", image); 26 | } 27 | 28 | @Override 29 | protected void onDestroy() { 30 | super.onDestroy(); 31 | this.unregisterReceiver(receiver); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Demo/app/src/main/java/demon/demo/MainActivity.java: -------------------------------------------------------------------------------- 1 | package demon.demo; 2 | 3 | 4 | import android.content.Intent; 5 | import android.os.Bundle; 6 | import android.support.v7.app.AppCompatActivity; 7 | import android.view.View; 8 | import android.widget.Button; 9 | import android.widget.TextView; 10 | 11 | 12 | public class MainActivity extends AppCompatActivity { 13 | 14 | 15 | @Override 16 | protected void onCreate(Bundle savedInstanceState) { 17 | super.onCreate(savedInstanceState); 18 | setContentView(R.layout.activity_main); 19 | 20 | TextView text = (TextView) findViewById(R.id.text); 21 | text.setText("当前包名为:" + getAppInfo()); 22 | 23 | Button button = (Button) findViewById(R.id.button); 24 | button.setOnClickListener(new View.OnClickListener() { 25 | @Override 26 | public void onClick(View view) { 27 | startActivity(new Intent(MainActivity.this, ImageActivity.class)); 28 | } 29 | }); 30 | } 31 | 32 | 33 | /** 34 | * 获取当前包名 35 | * 36 | * @return 37 | */ 38 | private String getAppInfo() { 39 | try { 40 | String pkName = this.getPackageName(); 41 | return pkName; 42 | } catch (Exception e) { 43 | } 44 | return null; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Demo/app/src/main/java/demon/demo/MyApplication.java: -------------------------------------------------------------------------------- 1 | package demon.demo; 2 | 3 | import android.app.Application; 4 | import android.util.Log; 5 | 6 | public class MyApplication extends Application { 7 | 8 | @Override 9 | public void onCreate() { 10 | super.onCreate(); 11 | Log.i("demo", "apk onCreate:" + this); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /Demo/app/src/main/java/demon/demo/NetStateReceiver.java: -------------------------------------------------------------------------------- 1 | package demon.demo; 2 | 3 | import android.app.AlertDialog; 4 | import android.content.BroadcastReceiver; 5 | import android.content.Context; 6 | import android.content.Intent; 7 | import android.net.ConnectivityManager; 8 | import android.net.NetworkInfo; 9 | 10 | /** 11 | * Created by DeMon on 2017/10/17. 12 | */ 13 | 14 | public class NetStateReceiver extends BroadcastReceiver { 15 | 16 | @Override 17 | public void onReceive(final Context context, Intent arg) { 18 | ConnectivityManager manager = (ConnectivityManager) context. 19 | getSystemService(Context.CONNECTIVITY_SERVICE); 20 | if (manager != null) { 21 | NetworkInfo gprs = manager.getNetworkInfo(ConnectivityManager.TYPE_MOBILE); 22 | NetworkInfo wifi = manager.getNetworkInfo(ConnectivityManager.TYPE_WIFI); 23 | if (!gprs.isConnected() && !wifi.isConnected()) { 24 | AlertDialog.Builder ab = new AlertDialog.Builder(context); 25 | ab.setTitle("网络不可用"); 26 | ab.setMessage("请检查网络状态!"); 27 | ab.create().show(); 28 | } 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /Demo/app/src/main/res/layout/activity_image.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 14 | 15 | -------------------------------------------------------------------------------- /Demo/app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 15 | 16 |