Permalink
Browse files

version1.0

  • Loading branch information...
0 parents commit 805069587cf14a1e7016b6772b07dadbb1e14dc4 mochuan.zhb committed Jun 30, 2016
Showing with 4,001 additions and 0 deletions.
  1. BIN 1.png
  2. BIN 2.png
  3. BIN 3.PNG
  4. BIN 4.PNG
  5. BIN 5.PNG
  6. BIN 6.PNG
  7. BIN 7.PNG
  8. BIN 8.PNG
  9. +9 −0 InstantRunSourceCode/.classpath
  10. +33 −0 InstantRunSourceCode/.project
  11. +31 −0 InstantRunSourceCode/AndroidManifest.xml
  12. BIN InstantRunSourceCode/assets/BusinessLayoutDemo.apk
  13. +6 −0 InstantRunSourceCode/gen/com/example/businesslayoutdemo/ff/BuildConfig.java
  14. BIN InstantRunSourceCode/ic_launcher-web.png
  15. +20 −0 InstantRunSourceCode/proguard-project.txt
  16. +14 −0 InstantRunSourceCode/project.properties
  17. +43 −0 InstantRunSourceCode/src/com/android/tools/fd/common/Log.java
  18. +18 −0 InstantRunSourceCode/src/com/android/tools/fd/common/ProtocolConstants.java
  19. +47 −0 InstantRunSourceCode/src/com/android/tools/fd/runtime/AbstractPatchesLoaderImpl.java
  20. +251 −0 InstantRunSourceCode/src/com/android/tools/fd/runtime/AndroidInstantRuntime.java
  21. +17 −0 InstantRunSourceCode/src/com/android/tools/fd/runtime/AppInfo.java
  22. +50 −0 InstantRunSourceCode/src/com/android/tools/fd/runtime/ApplicationPatch.java
  23. +25 −0 InstantRunSourceCode/src/com/android/tools/fd/runtime/BasicType.java
  24. +249 −0 InstantRunSourceCode/src/com/android/tools/fd/runtime/BootstrapApplication.java
  25. +556 −0 InstantRunSourceCode/src/com/android/tools/fd/runtime/FileManager.java
  26. +6 −0 InstantRunSourceCode/src/com/android/tools/fd/runtime/IncrementalChange.java
  27. +94 −0 InstantRunSourceCode/src/com/android/tools/fd/runtime/IncrementalClassLoader.java
  28. +7 −0 InstantRunSourceCode/src/com/android/tools/fd/runtime/InstantReloadException.java
  29. +427 −0 InstantRunSourceCode/src/com/android/tools/fd/runtime/MonkeyPatcher.java
  30. +5 −0 InstantRunSourceCode/src/com/android/tools/fd/runtime/PatchesLoader.java
  31. +18 −0 InstantRunSourceCode/src/com/android/tools/fd/runtime/PatchesLoaderDumper.java
  32. +30 −0 InstantRunSourceCode/src/com/android/tools/fd/runtime/Paths.java
  33. +215 −0 InstantRunSourceCode/src/com/android/tools/fd/runtime/Restarter.java
  34. +481 −0 InstantRunSourceCode/src/com/android/tools/fd/runtime/Server.java
  35. +18 −0 InstantRunSourceCode/src/com/android/tools/ir/api/DisableInstantRun.java
  36. +1,331 −0 README.md
  37. BIN classloader.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="gen"/>
+ <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
+ <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
+ <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
+ <classpathentry kind="output" path="bin/classes"/>
+</classpath>
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>InstantRunTest</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.android.ide.eclipse.adt.ApkBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>com.android.ide.eclipse.adt.AndroidNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.example.businesslayoutdemo.ff"
+ android:versionCode="1"
+ android:versionName="1.0" >
+
+ <uses-sdk
+ android:minSdkVersion="14"
+ android:targetSdkVersion="21" />
+
+ <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
+ <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
+ <uses-permission android:name="android.permission.INTERNET" />
+
+ <application
+ android:name="net.mobctrl.hostapk.application.HostApplication"
+ android:allowBackup="true" >
+ <activity android:name="com.example.businesslayoutdemo.MainActivity" >
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+ <activity android:name="com.example.businesslayoutdemo.DynamicActivity" >
+ </activity>
+ <activity android:name="com.example.businesslayoutdemo.recyclerview.RecyclerViewActivity" >
+ </activity>
+ </application>
+
+</manifest>
Binary file not shown.
@@ -0,0 +1,6 @@
+/** Automatically generated file. DO NOT MODIFY */
+package com.example.businesslayoutdemo.ff;
+
+public final class BuildConfig {
+ public final static boolean DEBUG = true;
+}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,20 @@
+# To enable ProGuard in your project, edit project.properties
+# to define the proguard.config property as described in that file.
+#
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in ${sdk.dir}/tools/proguard/proguard-android.txt
+# You can edit the include path and order by changing the ProGuard
+# include property in project.properties.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# Add any project specific keep options here:
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
@@ -0,0 +1,14 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must be checked in Version Control Systems.
+#
+# To customize properties used by the Ant build system edit
+# "ant.properties", and override values to adapt the script to your
+# project structure.
+#
+# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
+#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
+
+# Project target.
+target=android-22
@@ -0,0 +1,43 @@
+/* */ package com.android.tools.fd.common;
+/* */
+/* */ import java.util.logging.Level;
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */ public class Log
+/* */ {
+/* 27 */ public static Logging logging = null;
+/* */
+/* */ public static abstract interface Logging
+/* */ {
+/* */ public abstract void log(Level paramLevel, String paramString);
+/* */
+/* */ public abstract boolean isLoggable(Level paramLevel);
+/* */
+/* */ public abstract void log(Level paramLevel, String paramString, Throwable paramThrowable);
+/* */ }
+/* */ }
+
+
+/* Location: D:\decodeapk\new_aliptrip\instant-run.jar!\com\android\tools\fd\common\Log.class
+ * Java compiler version: 6 (50.0)
+ * JD-Core Version: 0.7.1
+ */
@@ -0,0 +1,18 @@
+package com.android.tools.fd.common;
+
+public abstract interface ProtocolConstants
+{
+ public static final long PROTOCOL_IDENTIFIER = 890269988L;
+ public static final int PROTOCOL_VERSION = 4;
+ public static final int MESSAGE_PATCHES = 1;
+ public static final int MESSAGE_PING = 2;
+ public static final int MESSAGE_PATH_EXISTS = 3;
+ public static final int MESSAGE_PATH_CHECKSUM = 4;
+ public static final int MESSAGE_RESTART_ACTIVITY = 5;
+ public static final int MESSAGE_SHOW_TOAST = 6;
+ public static final int MESSAGE_EOF = 7;
+ public static final int UPDATE_MODE_NONE = 0;
+ public static final int UPDATE_MODE_HOT_SWAP = 1;
+ public static final int UPDATE_MODE_WARM_SWAP = 2;
+ public static final int UPDATE_MODE_COLD_SWAP = 3;
+}
@@ -0,0 +1,47 @@
+package com.android.tools.fd.runtime;
+
+import com.android.tools.fd.common.Log;
+import com.android.tools.fd.common.Log.Logging;
+import java.lang.reflect.Field;
+import java.util.logging.Level;
+
+public abstract class AbstractPatchesLoaderImpl implements PatchesLoader {
+ public abstract String[] getPatchedClasses();
+
+ public boolean load() {
+ try {
+ for (String className : getPatchedClasses()) {
+ ClassLoader cl = getClass().getClassLoader();
+ Class<?> aClass = cl.loadClass(className + "$override");
+ Object o = aClass.newInstance();
+ Class<?> originalClass = cl.loadClass(className);
+ Field changeField = originalClass.getDeclaredField("$change");
+
+ changeField.setAccessible(true);
+
+ Object previous = changeField.get(null);
+ if (previous != null) {
+ Field isObsolete = previous.getClass().getDeclaredField(
+ "$obsolete");
+ if (isObsolete != null) {
+ isObsolete.set(null, Boolean.valueOf(true));
+ }
+ }
+ changeField.set(null, o);
+ if ((Log.logging != null)
+ && (Log.logging.isLoggable(Level.FINE))) {
+ Log.logging.log(Level.FINE, String.format("patched %s",
+ new Object[] { className }));
+ }
+ }
+ } catch (Exception e) {
+ if (Log.logging != null) {
+ Log.logging.log(Level.SEVERE, String.format(
+ "Exception while patching %s",
+ new Object[] { "foo.bar" }), e);
+ }
+ return false;
+ }
+ return true;
+ }
+}
Oops, something went wrong.

0 comments on commit 8050695

Please sign in to comment.