diff --git a/replugin-sample-extra/README.md b/replugin-sample-extra/README.md
new file mode 100644
index 00000000..e67e6cb6
--- /dev/null
+++ b/replugin-sample-extra/README.md
@@ -0,0 +1,5 @@
+# replugin-sample-extra 中是一些更高级的示例
+
+其中,replugin-sample-extra/fresco 是对 Fresco 的使用,实现了宿主和插件公用一份Fresco代码。
+
+FrescoHost是宿主代码,FrescoPlugin是插件代码。
diff --git a/replugin-sample-extra/fresco/FrescoHost/.gitignore b/replugin-sample-extra/fresco/FrescoHost/.gitignore
new file mode 100644
index 00000000..39fb081a
--- /dev/null
+++ b/replugin-sample-extra/fresco/FrescoHost/.gitignore
@@ -0,0 +1,9 @@
+*.iml
+.gradle
+/local.properties
+/.idea/workspace.xml
+/.idea/libraries
+.DS_Store
+/build
+/captures
+.externalNativeBuild
diff --git a/replugin-sample-extra/fresco/FrescoHost/app/.gitignore b/replugin-sample-extra/fresco/FrescoHost/app/.gitignore
new file mode 100644
index 00000000..796b96d1
--- /dev/null
+++ b/replugin-sample-extra/fresco/FrescoHost/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/replugin-sample-extra/fresco/FrescoHost/app/build.gradle b/replugin-sample-extra/fresco/FrescoHost/app/build.gradle
new file mode 100644
index 00000000..87387be3
--- /dev/null
+++ b/replugin-sample-extra/fresco/FrescoHost/app/build.gradle
@@ -0,0 +1,76 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 26
+ buildToolsVersion "26.0.2"
+
+ defaultConfig {
+ applicationId "com.qihoo360.replugin.fresco.host"
+ minSdkVersion 14
+ targetSdkVersion 26
+ versionCode 1
+ versionName "1.0"
+ testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ }
+ }
+
+ sourceSets {
+ main {
+ jniLibs.srcDirs = ['libs']
+ }
+ }
+}
+
+/*
+ * Copyright (C) 2005-2017 Qihoo 360 Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed To in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+// ATTENTION!!! Must be PLACED AFTER "android{}" to read the applicationId
+apply plugin: 'replugin-host-gradle'
+
+/**
+ * 配置项均为可选配置,默认无需添加
+ * 更多可选配置项参见replugin-host-gradle的RepluginConfig类
+ * 可更改配置项参见 自动生成RePluginHostConfig.java
+ */
+repluginHostConfig {
+
+ /**
+ * 是否使用 AppCompat 库
+ * 不需要个性化配置时,无需添加
+ */
+ useAppCompat = true
+}
+
+dependencies {
+ compile 'com.qihoo360.replugin:replugin-host-lib:2.2.1'
+
+ compile fileTree(dir: 'libs', include: ['*.jar'])
+ androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
+ exclude group: 'com.android.support', module: 'support-annotations'
+ })
+
+ compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
+ testCompile 'junit:junit:4.12'
+
+ // fresco依赖bolts-android
+ compile "com.parse.bolts:bolts-android:1.4.0"
+}
diff --git a/replugin-sample-extra/fresco/FrescoHost/app/libs/armeabi/libimagepipeline.so b/replugin-sample-extra/fresco/FrescoHost/app/libs/armeabi/libimagepipeline.so
new file mode 100644
index 00000000..cff4884f
Binary files /dev/null and b/replugin-sample-extra/fresco/FrescoHost/app/libs/armeabi/libimagepipeline.so differ
diff --git a/replugin-sample-extra/fresco/FrescoHost/app/libs/drawee-modified-1.7.1.jar b/replugin-sample-extra/fresco/FrescoHost/app/libs/drawee-modified-1.7.1.jar
new file mode 100644
index 00000000..b514d339
Binary files /dev/null and b/replugin-sample-extra/fresco/FrescoHost/app/libs/drawee-modified-1.7.1.jar differ
diff --git a/replugin-sample-extra/fresco/FrescoHost/app/libs/fbcore-1.7.1.jar b/replugin-sample-extra/fresco/FrescoHost/app/libs/fbcore-1.7.1.jar
new file mode 100644
index 00000000..ce0053ff
Binary files /dev/null and b/replugin-sample-extra/fresco/FrescoHost/app/libs/fbcore-1.7.1.jar differ
diff --git a/replugin-sample-extra/fresco/FrescoHost/app/libs/fresco-1.7.1.jar b/replugin-sample-extra/fresco/FrescoHost/app/libs/fresco-1.7.1.jar
new file mode 100644
index 00000000..7190ef51
Binary files /dev/null and b/replugin-sample-extra/fresco/FrescoHost/app/libs/fresco-1.7.1.jar differ
diff --git a/replugin-sample-extra/fresco/FrescoHost/app/libs/imagepipeline-1.7.1.jar b/replugin-sample-extra/fresco/FrescoHost/app/libs/imagepipeline-1.7.1.jar
new file mode 100644
index 00000000..51e2b542
Binary files /dev/null and b/replugin-sample-extra/fresco/FrescoHost/app/libs/imagepipeline-1.7.1.jar differ
diff --git a/replugin-sample-extra/fresco/FrescoHost/app/libs/imagepipeline-base-1.7.1.jar b/replugin-sample-extra/fresco/FrescoHost/app/libs/imagepipeline-base-1.7.1.jar
new file mode 100644
index 00000000..d48eff6e
Binary files /dev/null and b/replugin-sample-extra/fresco/FrescoHost/app/libs/imagepipeline-base-1.7.1.jar differ
diff --git a/replugin-sample-extra/fresco/FrescoHost/app/proguard-rules.pro b/replugin-sample-extra/fresco/FrescoHost/app/proguard-rules.pro
new file mode 100644
index 00000000..d14c450f
--- /dev/null
+++ b/replugin-sample-extra/fresco/FrescoHost/app/proguard-rules.pro
@@ -0,0 +1,25 @@
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in D:\Android\android-sdk/tools/proguard/proguard-android.txt
+# You can edit the include path and order by changing the proguardFiles
+# directive in build.gradle.
+#
+# 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 *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
diff --git a/replugin-sample-extra/fresco/FrescoHost/app/src/main/AndroidManifest.xml b/replugin-sample-extra/fresco/FrescoHost/app/src/main/AndroidManifest.xml
new file mode 100644
index 00000000..d716e32a
--- /dev/null
+++ b/replugin-sample-extra/fresco/FrescoHost/app/src/main/AndroidManifest.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/replugin-sample-extra/fresco/FrescoHost/app/src/main/assets/plugins/plugin1.jar b/replugin-sample-extra/fresco/FrescoHost/app/src/main/assets/plugins/plugin1.jar
new file mode 100644
index 00000000..e41d11b0
Binary files /dev/null and b/replugin-sample-extra/fresco/FrescoHost/app/src/main/assets/plugins/plugin1.jar differ
diff --git a/replugin-sample-extra/fresco/FrescoHost/app/src/main/java/com/facebook/fresco/patch/DraweeStyleableCallbackImpl.java b/replugin-sample-extra/fresco/FrescoHost/app/src/main/java/com/facebook/fresco/patch/DraweeStyleableCallbackImpl.java
new file mode 100644
index 00000000..5cae30e5
--- /dev/null
+++ b/replugin-sample-extra/fresco/FrescoHost/app/src/main/java/com/facebook/fresco/patch/DraweeStyleableCallbackImpl.java
@@ -0,0 +1,293 @@
+/*
+ * Copyright (C) 2005-2017 Qihoo 360 Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed To in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.facebook.fresco.patch;
+
+import android.content.Context;
+
+import com.facebook.drawee.generic.DraweeStyleableCallback;
+
+import java.lang.reflect.Field;
+
+/**
+ * DraweeStyleableCallbackImpl
+ *
+ * 自定义属性回调接口
+ *
+ * @author RePlugin Team
+ */
+public class DraweeStyleableCallbackImpl implements DraweeStyleableCallback {
+
+ private Context mContext;
+
+ DraweeStyleableCallbackImpl(Context context) {
+ this.mContext = context;
+ }
+
+ /**
+ * 反射得到样式表数组,如:R.styleable.SimpleDraweeView
+ *
+ * @param context
+ * @param name
+ * @return
+ */
+ private static int[] getStyleableArray(Context context, String name) {
+ try {
+ String className = context.getPackageName() + ".R$styleable";
+ Field[] fields = Class.forName(className).getFields();
+ for (Field field : fields) {
+ if (field.getName().equals(name)) {
+ return (int[]) field.get(null);
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ return null;
+ }
+
+ /**
+ * 反射得到样式表数组下的具体资源,如:R.styleable.GenericDraweeHierarchy_placeholderImage
+ *
+ * @param context
+ * @param styleableName
+ * @param styleableFieldName
+ * @return
+ */
+ private static int getStyleableFieldId(Context context, String styleableName, String styleableFieldName) {
+ String className = context.getPackageName() + ".R";
+ String type = "styleable";
+ String name = styleableName + "_" + styleableFieldName;
+
+ try {
+ Class> cla = Class.forName(className);
+ for (Class> childClass : cla.getClasses()) {
+ String simpleName = childClass.getSimpleName();
+ if (simpleName.equals(type)) {
+ for (Field field : childClass.getFields()) {
+ String fieldName = field.getName();
+ if (fieldName.equals(name)) {
+ return (int) field.get(null);
+ }
+ }
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ return 0;
+ }
+
+ @Override
+ public int[] getSimpleDraweeView() {
+ // 替代 R.styleable.SimpleDraweeView;
+ return getStyleableArray(mContext, "SimpleDraweeView");
+ }
+
+ @Override
+ public int[] getGenericDraweeHierarchy() {
+ // 替代 R.styleable.GenericDraweeHierarchy;
+ return getStyleableArray(mContext, "GenericDraweeHierarchy");
+ }
+
+ @Override
+ public int getActualImageScaleType() {
+ // 替代 R.styleable.GenericDraweeHierarchy_actualImageScaleType;
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "actualImageScaleType");
+ }
+
+ @Override
+ public int getPlaceholderImage() {
+ // 替代:R.styleable.GenericDraweeHierarchy_placeholderImage
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "placeholderImage");
+ }
+
+ @Override
+ public int getPressedStateOverlayImage() {
+ // 替代:R.styleable.GenericDraweeHierarchy_pressedStateOverlayImage
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "pressedStateOverlayImage");
+ }
+
+ @Override
+ public int getProgressBarImage() {
+ // R.styleable.GenericDraweeHierarchy_progressBarImage;
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "progressBarImage");
+ }
+
+ @Override
+ public int getFadeDuration() {
+ // R.styleable.GenericDraweeHierarchy_fadeDuration;
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "fadeDuration");
+ }
+
+ @Override
+ public int getViewAspectRatio() {
+ // R.styleable.GenericDraweeHierarchy_viewAspectRatio;
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "viewAspectRatio");
+ }
+
+ @Override
+ public int getPlaceholderImageScaleType() {
+ // R.styleable.GenericDraweeHierarchy_placeholderImageScaleType;
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "placeholderImageScaleType");
+ }
+
+ @Override
+ public int getRetryImage() {
+ // R.styleable.GenericDraweeHierarchy_retryImage;
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "retryImage");
+ }
+
+ @Override
+ public int getRetryImageScaleType() {
+ // R.styleable.GenericDraweeHierarchy_retryImageScaleType;
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "retryImageScaleType");
+ }
+
+ @Override
+ public int getFailureImage() {
+ // return R.styleable.GenericDraweeHierarchy_failureImage;
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "failureImage");
+ }
+
+ @Override
+ public int getFailureImageScaleType() {
+ // R.styleable.GenericDraweeHierarchy_failureImageScaleType;
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "failureImageScaleType");
+ }
+
+ @Override
+ public int getProgressBarImageScaleType() {
+ // R.styleable.GenericDraweeHierarchy_progressBarImageScaleType;
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "progressBarImageScaleType");
+ }
+
+ @Override
+ public int getProgressBarAutoRotateInterval() {
+ // R.styleable.GenericDraweeHierarchy_progressBarAutoRotateInterval;
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "progressBarAutoRotateInterval");
+ }
+
+ @Override
+ public int getBackgroundImage() {
+ // R.styleable.GenericDraweeHierarchy_backgroundImage;
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "backgroundImage");
+ }
+
+ @Override
+ public int getOverlayImage() {
+ // R.styleable.GenericDraweeHierarchy_overlayImage;
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "overlayImage");
+ }
+
+ @Override
+ public int getRoundAsCircle() {
+ // R.styleable.GenericDraweeHierarchy_roundAsCircle;
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "roundAsCircle");
+ }
+
+ @Override
+ public int getRoundedCornerRadius() {
+ // R.styleable.GenericDraweeHierarchy_roundedCornerRadius;
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "roundedCornerRadius");
+ }
+
+ @Override
+ public int getRoundTopLeft() {
+ // R.styleable.GenericDraweeHierarchy_roundTopLeft;
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "roundTopLeft");
+ }
+
+ @Override
+ public int getRoundTopRight() {
+ // R.styleable.GenericDraweeHierarchy_roundTopRight;
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "roundTopRight");
+ }
+
+ @Override
+ public int getRoundBottomLeft() {
+ // R.styleable.GenericDraweeHierarchy_roundBottomLeft;
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "roundBottomLeft");
+ }
+
+ @Override
+ public int getRoundBottomRight() {
+ // R.styleable.GenericDraweeHierarchy_roundBottomRight;
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "roundBottomRight");
+ }
+
+ @Override
+ public int getRoundTopStart() {
+ // R.styleable.GenericDraweeHierarchy_roundTopStart;
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "roundTopStart");
+ }
+
+ @Override
+ public int getRoundTopEnd() {
+ // R.styleable.GenericDraweeHierarchy_roundTopEnd;
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "roundTopEnd");
+ }
+
+ @Override
+ public int getRoundBottomStart() {
+ // R.styleable.GenericDraweeHierarchy_roundBottomStart;
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "roundBottomStart");
+ }
+
+ @Override
+ public int getRoundBottomEnd() {
+ // R.styleable.GenericDraweeHierarchy_roundBottomEnd;
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "roundBottomEnd");
+ }
+
+ @Override
+ public int getRoundWithOverlayColor() {
+ // R.styleable.GenericDraweeHierarchy_roundWithOverlayColor;
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "roundWithOverlayColor");
+ }
+
+ @Override
+ public int getRoundingBorderWidth() {
+ // R.styleable.GenericDraweeHierarchy_roundingBorderWidth;
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "roundingBorderWidth");
+ }
+
+ @Override
+ public int getRoundingBorderColor() {
+ // R.styleable.GenericDraweeHierarchy_roundingBorderColor;
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "roundingBorderColor");
+ }
+
+ @Override
+ public int getRoundingBorderPadding() {
+ // R.styleable.GenericDraweeHierarchy_roundingBorderPadding;
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "roundingBorderPadding");
+ }
+
+ @Override
+ public int getActualImageUri() {
+ // R.styleable.SimpleDraweeView_actualImageUri;
+ return getStyleableFieldId(mContext, "SimpleDraweeView", "actualImageUri");
+ }
+
+ @Override
+ public int getActualImageResource() {
+ // R.styleable.SimpleDraweeView_actualImageResource;
+ return getStyleableFieldId(mContext, "SimpleDraweeView", "actualImageResource");
+ }
+}
\ No newline at end of file
diff --git a/replugin-sample-extra/fresco/FrescoHost/app/src/main/java/com/facebook/fresco/patch/FrescoPatch.java b/replugin-sample-extra/fresco/FrescoHost/app/src/main/java/com/facebook/fresco/patch/FrescoPatch.java
new file mode 100644
index 00000000..c295a790
--- /dev/null
+++ b/replugin-sample-extra/fresco/FrescoHost/app/src/main/java/com/facebook/fresco/patch/FrescoPatch.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2005-2017 Qihoo 360 Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed To in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.facebook.fresco.patch;
+
+import android.content.Context;
+
+import com.facebook.drawee.generic.GenericDraweeHierarchyInflater;
+import com.facebook.drawee.view.SimpleDraweeView;
+
+/**
+ * 为 “自己编译好的fresco drawee 模块(对应drawee-modified-1.7.1.jar)” 设置回调接口
+ *
+ * @author RePlugin Team
+ */
+public class FrescoPatch {
+
+ /**
+ * 初始化
+ *
+ * 为SimpleDraweeView设置回调
+ * 为GenericDraweeHierarchyInflater设置回调
+ */
+ public static void initialize(Context context) {
+ DraweeStyleableCallbackImpl draweeStyleableCallback = new DraweeStyleableCallbackImpl(context);
+ SimpleDraweeView.setDraweeStyleableCallback(draweeStyleableCallback);
+ GenericDraweeHierarchyInflater.setDraweeStyleableCallback(draweeStyleableCallback);
+ }
+}
\ No newline at end of file
diff --git a/replugin-sample-extra/fresco/FrescoHost/app/src/main/java/com/qihoo360/replugin/fresco/host/HostApp.java b/replugin-sample-extra/fresco/FrescoHost/app/src/main/java/com/qihoo360/replugin/fresco/host/HostApp.java
new file mode 100644
index 00000000..b18b24dd
--- /dev/null
+++ b/replugin-sample-extra/fresco/FrescoHost/app/src/main/java/com/qihoo360/replugin/fresco/host/HostApp.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2005-2017 Qihoo 360 Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed To in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.qihoo360.replugin.fresco.host;
+
+import com.facebook.drawee.backends.pipeline.Fresco;
+import com.facebook.fresco.patch.FrescoPatch;
+import com.qihoo360.replugin.RePluginApplication;
+import com.qihoo360.replugin.RePluginConfig;
+
+/**
+ * HostApp
+ *
+ * @author RePlugin Team
+ */
+public class HostApp extends RePluginApplication {
+
+ @Override
+ public void onCreate() {
+ super.onCreate();
+
+ // 初始化Fresco
+ Fresco.initialize(this);
+
+ // 初始化FrescoPath
+ FrescoPatch.initialize(this);
+ }
+
+ /**
+ * RePlugin允许提供各种“自定义”的行为,让您“无需修改源代码”,即可实现相应的功能
+ */
+ @Override
+ protected RePluginConfig createConfig() {
+ RePluginConfig c = new RePluginConfig();
+
+ // 允许“插件使用宿主类”
+ // 打开这个开关之后,当插件ClassLoader找不到类时,会去看宿主是否有这个类
+ // 从而,实现插件复用宿主中的Java类
+ c.setUseHostClassIfNotFound(true);
+
+ return c;
+ }
+}
\ No newline at end of file
diff --git a/replugin-sample-extra/fresco/FrescoHost/app/src/main/java/com/qihoo360/replugin/fresco/host/HostFrescoActivity.java b/replugin-sample-extra/fresco/FrescoHost/app/src/main/java/com/qihoo360/replugin/fresco/host/HostFrescoActivity.java
new file mode 100644
index 00000000..74cbaae5
--- /dev/null
+++ b/replugin-sample-extra/fresco/FrescoHost/app/src/main/java/com/qihoo360/replugin/fresco/host/HostFrescoActivity.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2005-2017 Qihoo 360 Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed To in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.qihoo360.replugin.fresco.host;
+
+import android.net.Uri;
+import android.os.Bundle;
+import android.support.v7.app.AppCompatActivity;
+
+import com.facebook.drawee.view.SimpleDraweeView;
+
+/**
+ * 宿主中使用fresco
+ *
+ * @author RePlugin Team
+ */
+public class HostFrescoActivity extends AppCompatActivity {
+
+ private static final String IMAGE_URL = "https://img1.doubanio.com/view/photo/large/public/p2504463708.jpg";
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_host_fresco);
+
+ SimpleDraweeView draweeView = (SimpleDraweeView) findViewById(R.id.image);
+ draweeView.setImageURI(Uri.parse(IMAGE_URL));
+ }
+}
\ No newline at end of file
diff --git a/replugin-sample-extra/fresco/FrescoHost/app/src/main/java/com/qihoo360/replugin/fresco/host/MainActivity.java b/replugin-sample-extra/fresco/FrescoHost/app/src/main/java/com/qihoo360/replugin/fresco/host/MainActivity.java
new file mode 100644
index 00000000..177d0703
--- /dev/null
+++ b/replugin-sample-extra/fresco/FrescoHost/app/src/main/java/com/qihoo360/replugin/fresco/host/MainActivity.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2005-2017 Qihoo 360 Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed To in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.qihoo360.replugin.fresco.host;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Looper;
+import android.os.Message;
+import android.support.v7.app.AppCompatActivity;
+import android.util.Log;
+import android.view.View;
+import android.widget.Button;
+
+import com.qihoo360.replugin.RePlugin;
+
+/**
+ * @author RePlugin Team
+ */
+public class MainActivity extends AppCompatActivity {
+
+ private Button mButton1;
+ private Button mButton2;
+
+ Handler mHandler = new Handler(Looper.getMainLooper()) {
+
+ @Override
+ public void handleMessage(Message msg) {
+ super.handleMessage(msg);
+ RePlugin.startActivity(MainActivity.this, new Intent(), "plugin1", "com.qihoo360.replugin.fresco.plugin.MainActivity");
+ }
+ };
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+
+ mButton1 = (Button) findViewById(R.id.button1);
+ mButton2 = (Button) findViewById(R.id.button2);
+
+ mButton1.setOnClickListener(new View.OnClickListener() {
+
+ @Override
+ public void onClick(View view) {
+ startActivity(new Intent(MainActivity.this, HostFrescoActivity.class));
+ }
+ });
+
+ mButton2.setOnClickListener(new View.OnClickListener() {
+
+ @Override
+ public void onClick(View view) {
+
+ new Thread() {
+ @Override
+ public void run() {
+ super.run();
+
+ long begin = System.currentTimeMillis();
+ RePlugin.preload("plugin1");
+ Log.d("FrescoHost", "preload use:" + (System.currentTimeMillis() - begin));
+
+ mHandler.sendEmptyMessage(-1);
+ }
+ }.start();
+ }
+ });
+ }
+}
\ No newline at end of file
diff --git a/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/layout/activity_host_fresco.xml b/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/layout/activity_host_fresco.xml
new file mode 100644
index 00000000..4bceeaef
--- /dev/null
+++ b/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/layout/activity_host_fresco.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/layout/activity_main.xml b/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/layout/activity_main.xml
new file mode 100644
index 00000000..bdd222cb
--- /dev/null
+++ b/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/layout/activity_main.xml
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/mipmap-hdpi/ic_launcher.png b/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 00000000..cde69bcc
Binary files /dev/null and b/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
new file mode 100644
index 00000000..9a078e3e
Binary files /dev/null and b/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ
diff --git a/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/mipmap-mdpi/ic_launcher.png b/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 00000000..c133a0cb
Binary files /dev/null and b/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
new file mode 100644
index 00000000..efc028a6
Binary files /dev/null and b/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ
diff --git a/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 00000000..bfa42f0e
Binary files /dev/null and b/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
new file mode 100644
index 00000000..3af2608a
Binary files /dev/null and b/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ
diff --git a/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 00000000..324e72cd
Binary files /dev/null and b/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
new file mode 100644
index 00000000..9bec2e62
Binary files /dev/null and b/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ
diff --git a/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644
index 00000000..aee44e13
Binary files /dev/null and b/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
new file mode 100644
index 00000000..34947cd6
Binary files /dev/null and b/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ
diff --git a/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/values/attrs.xml b/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/values/attrs.xml
new file mode 100644
index 00000000..7c9c62bc
--- /dev/null
+++ b/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/values/attrs.xml
@@ -0,0 +1,235 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/values/colors.xml b/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/values/colors.xml
new file mode 100644
index 00000000..3ab3e9cb
--- /dev/null
+++ b/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/values/colors.xml
@@ -0,0 +1,6 @@
+
+
+ #3F51B5
+ #303F9F
+ #FF4081
+
diff --git a/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/values/strings.xml b/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/values/strings.xml
new file mode 100644
index 00000000..14ce275d
--- /dev/null
+++ b/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/values/strings.xml
@@ -0,0 +1,3 @@
+
+ FrescoHost
+
diff --git a/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/values/styles.xml b/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/values/styles.xml
new file mode 100644
index 00000000..5885930d
--- /dev/null
+++ b/replugin-sample-extra/fresco/FrescoHost/app/src/main/res/values/styles.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
diff --git a/replugin-sample-extra/fresco/FrescoHost/build.gradle b/replugin-sample-extra/fresco/FrescoHost/build.gradle
new file mode 100644
index 00000000..8694d590
--- /dev/null
+++ b/replugin-sample-extra/fresco/FrescoHost/build.gradle
@@ -0,0 +1,23 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+
+buildscript {
+ repositories {
+ jcenter()
+ }
+ dependencies {
+ classpath 'com.android.tools.build:gradle:2.3.0'
+ classpath 'com.qihoo360.replugin:replugin-host-gradle:2.2.1'
+ // NOTE: Do not place your application dependencies here; they belong
+ // in the individual module build.gradle files
+ }
+}
+
+allprojects {
+ repositories {
+ jcenter()
+ }
+}
+
+task clean(type: Delete) {
+ delete rootProject.buildDir
+}
diff --git a/replugin-sample-extra/fresco/FrescoHost/gradle.properties b/replugin-sample-extra/fresco/FrescoHost/gradle.properties
new file mode 100644
index 00000000..aac7c9b4
--- /dev/null
+++ b/replugin-sample-extra/fresco/FrescoHost/gradle.properties
@@ -0,0 +1,17 @@
+# Project-wide Gradle settings.
+
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+org.gradle.jvmargs=-Xmx1536m
+
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true
diff --git a/replugin-sample-extra/fresco/FrescoHost/gradle/wrapper/gradle-wrapper.jar b/replugin-sample-extra/fresco/FrescoHost/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 00000000..13372aef
Binary files /dev/null and b/replugin-sample-extra/fresco/FrescoHost/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/replugin-sample-extra/fresco/FrescoHost/gradle/wrapper/gradle-wrapper.properties b/replugin-sample-extra/fresco/FrescoHost/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 00000000..5ff3c91a
--- /dev/null
+++ b/replugin-sample-extra/fresco/FrescoHost/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Fri Jan 05 17:10:53 CST 2018
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
diff --git a/replugin-sample-extra/fresco/FrescoHost/gradlew b/replugin-sample-extra/fresco/FrescoHost/gradlew
new file mode 100644
index 00000000..9d82f789
--- /dev/null
+++ b/replugin-sample-extra/fresco/FrescoHost/gradlew
@@ -0,0 +1,160 @@
+#!/usr/bin/env bash
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn ( ) {
+ echo "$*"
+}
+
+die ( ) {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+esac
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
+function splitJvmOpts() {
+ JVM_OPTS=("$@")
+}
+eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
+JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+
+exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
diff --git a/replugin-sample-extra/fresco/FrescoHost/gradlew.bat b/replugin-sample-extra/fresco/FrescoHost/gradlew.bat
new file mode 100644
index 00000000..8a0b282a
--- /dev/null
+++ b/replugin-sample-extra/fresco/FrescoHost/gradlew.bat
@@ -0,0 +1,90 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windowz variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+if "%@eval[2+2]" == "4" goto 4NT_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+goto execute
+
+:4NT_args
+@rem Get arguments from the 4NT Shell from JP Software
+set CMD_LINE_ARGS=%$
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/replugin-sample-extra/fresco/FrescoHost/settings.gradle b/replugin-sample-extra/fresco/FrescoHost/settings.gradle
new file mode 100644
index 00000000..e7b4def4
--- /dev/null
+++ b/replugin-sample-extra/fresco/FrescoHost/settings.gradle
@@ -0,0 +1 @@
+include ':app'
diff --git a/replugin-sample-extra/fresco/FrescoPlugin/.gitignore b/replugin-sample-extra/fresco/FrescoPlugin/.gitignore
new file mode 100644
index 00000000..39fb081a
--- /dev/null
+++ b/replugin-sample-extra/fresco/FrescoPlugin/.gitignore
@@ -0,0 +1,9 @@
+*.iml
+.gradle
+/local.properties
+/.idea/workspace.xml
+/.idea/libraries
+.DS_Store
+/build
+/captures
+.externalNativeBuild
diff --git a/replugin-sample-extra/fresco/FrescoPlugin/app/.gitignore b/replugin-sample-extra/fresco/FrescoPlugin/app/.gitignore
new file mode 100644
index 00000000..796b96d1
--- /dev/null
+++ b/replugin-sample-extra/fresco/FrescoPlugin/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/replugin-sample-extra/fresco/FrescoPlugin/app/build.gradle b/replugin-sample-extra/fresco/FrescoPlugin/app/build.gradle
new file mode 100644
index 00000000..a1d7b976
--- /dev/null
+++ b/replugin-sample-extra/fresco/FrescoPlugin/app/build.gradle
@@ -0,0 +1,55 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 26
+ buildToolsVersion "26.0.2"
+
+ defaultConfig {
+ applicationId "com.qihoo360.replugin.fresco.plugin"
+ minSdkVersion 14
+ targetSdkVersion 26
+ versionCode 1
+ versionName "1.0"
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ }
+ }
+
+ sourceSets {
+ main {
+ jniLibs.srcDirs = ['libs']
+ }
+ }
+}
+
+apply plugin: 'replugin-plugin-gradle'
+
+dependencies {
+ compile 'com.qihoo360.replugin:replugin-plugin-lib:2.2.1'
+
+ compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
+
+ /** provided or compile */
+ if (rootProject.ext.isPlugin) {
+ // 作为插件,provided 方式引入
+ provided "com.parse.bolts:bolts-android:1.4.0"
+ provided files('libs/drawee-modified-1.7.1.jar')
+ provided files('libs/fbcore-1.7.1.jar')
+ provided files('libs/fresco-1.7.1.jar')
+ provided files('libs/imagepipeline-1.7.1.jar')
+ provided files('libs/imagepipeline-base-1.7.1.jar')
+ } else {
+ // 作为单品,compile 进 APK
+ compile "com.parse.bolts:bolts-android:1.4.0"
+
+ compile files('libs/fresco-1.7.1.jar')
+ compile files('libs/fbcore-1.7.1.jar')
+ compile files('libs/drawee-modified-1.7.1.jar')
+ compile files('libs/imagepipeline-1.7.1.jar')
+ compile files('libs/imagepipeline-base-1.7.1.jar')
+ }
+}
\ No newline at end of file
diff --git a/replugin-sample-extra/fresco/FrescoPlugin/app/libs/armeabi/libimagepipeline.so b/replugin-sample-extra/fresco/FrescoPlugin/app/libs/armeabi/libimagepipeline.so
new file mode 100644
index 00000000..cff4884f
Binary files /dev/null and b/replugin-sample-extra/fresco/FrescoPlugin/app/libs/armeabi/libimagepipeline.so differ
diff --git a/replugin-sample-extra/fresco/FrescoPlugin/app/libs/drawee-modified-1.7.1.jar b/replugin-sample-extra/fresco/FrescoPlugin/app/libs/drawee-modified-1.7.1.jar
new file mode 100644
index 00000000..07b44c95
Binary files /dev/null and b/replugin-sample-extra/fresco/FrescoPlugin/app/libs/drawee-modified-1.7.1.jar differ
diff --git a/replugin-sample-extra/fresco/FrescoPlugin/app/libs/fbcore-1.7.1.jar b/replugin-sample-extra/fresco/FrescoPlugin/app/libs/fbcore-1.7.1.jar
new file mode 100644
index 00000000..018cd774
Binary files /dev/null and b/replugin-sample-extra/fresco/FrescoPlugin/app/libs/fbcore-1.7.1.jar differ
diff --git a/replugin-sample-extra/fresco/FrescoPlugin/app/libs/fresco-1.7.1.jar b/replugin-sample-extra/fresco/FrescoPlugin/app/libs/fresco-1.7.1.jar
new file mode 100644
index 00000000..7a7fb90b
Binary files /dev/null and b/replugin-sample-extra/fresco/FrescoPlugin/app/libs/fresco-1.7.1.jar differ
diff --git a/replugin-sample-extra/fresco/FrescoPlugin/app/libs/imagepipeline-1.7.1.jar b/replugin-sample-extra/fresco/FrescoPlugin/app/libs/imagepipeline-1.7.1.jar
new file mode 100644
index 00000000..0bd9cbb8
Binary files /dev/null and b/replugin-sample-extra/fresco/FrescoPlugin/app/libs/imagepipeline-1.7.1.jar differ
diff --git a/replugin-sample-extra/fresco/FrescoPlugin/app/libs/imagepipeline-base-1.7.1.jar b/replugin-sample-extra/fresco/FrescoPlugin/app/libs/imagepipeline-base-1.7.1.jar
new file mode 100644
index 00000000..918727dc
Binary files /dev/null and b/replugin-sample-extra/fresco/FrescoPlugin/app/libs/imagepipeline-base-1.7.1.jar differ
diff --git a/replugin-sample-extra/fresco/FrescoPlugin/app/proguard-rules.pro b/replugin-sample-extra/fresco/FrescoPlugin/app/proguard-rules.pro
new file mode 100644
index 00000000..d14c450f
--- /dev/null
+++ b/replugin-sample-extra/fresco/FrescoPlugin/app/proguard-rules.pro
@@ -0,0 +1,25 @@
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in D:\Android\android-sdk/tools/proguard/proguard-android.txt
+# You can edit the include path and order by changing the proguardFiles
+# directive in build.gradle.
+#
+# 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 *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
diff --git a/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/AndroidManifest.xml b/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/AndroidManifest.xml
new file mode 100644
index 00000000..18e2a1eb
--- /dev/null
+++ b/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/AndroidManifest.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/java/com/facebook/fresco/patch/DraweeStyleableCallbackImpl.java b/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/java/com/facebook/fresco/patch/DraweeStyleableCallbackImpl.java
new file mode 100644
index 00000000..5cae30e5
--- /dev/null
+++ b/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/java/com/facebook/fresco/patch/DraweeStyleableCallbackImpl.java
@@ -0,0 +1,293 @@
+/*
+ * Copyright (C) 2005-2017 Qihoo 360 Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed To in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.facebook.fresco.patch;
+
+import android.content.Context;
+
+import com.facebook.drawee.generic.DraweeStyleableCallback;
+
+import java.lang.reflect.Field;
+
+/**
+ * DraweeStyleableCallbackImpl
+ *
+ * 自定义属性回调接口
+ *
+ * @author RePlugin Team
+ */
+public class DraweeStyleableCallbackImpl implements DraweeStyleableCallback {
+
+ private Context mContext;
+
+ DraweeStyleableCallbackImpl(Context context) {
+ this.mContext = context;
+ }
+
+ /**
+ * 反射得到样式表数组,如:R.styleable.SimpleDraweeView
+ *
+ * @param context
+ * @param name
+ * @return
+ */
+ private static int[] getStyleableArray(Context context, String name) {
+ try {
+ String className = context.getPackageName() + ".R$styleable";
+ Field[] fields = Class.forName(className).getFields();
+ for (Field field : fields) {
+ if (field.getName().equals(name)) {
+ return (int[]) field.get(null);
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ return null;
+ }
+
+ /**
+ * 反射得到样式表数组下的具体资源,如:R.styleable.GenericDraweeHierarchy_placeholderImage
+ *
+ * @param context
+ * @param styleableName
+ * @param styleableFieldName
+ * @return
+ */
+ private static int getStyleableFieldId(Context context, String styleableName, String styleableFieldName) {
+ String className = context.getPackageName() + ".R";
+ String type = "styleable";
+ String name = styleableName + "_" + styleableFieldName;
+
+ try {
+ Class> cla = Class.forName(className);
+ for (Class> childClass : cla.getClasses()) {
+ String simpleName = childClass.getSimpleName();
+ if (simpleName.equals(type)) {
+ for (Field field : childClass.getFields()) {
+ String fieldName = field.getName();
+ if (fieldName.equals(name)) {
+ return (int) field.get(null);
+ }
+ }
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ return 0;
+ }
+
+ @Override
+ public int[] getSimpleDraweeView() {
+ // 替代 R.styleable.SimpleDraweeView;
+ return getStyleableArray(mContext, "SimpleDraweeView");
+ }
+
+ @Override
+ public int[] getGenericDraweeHierarchy() {
+ // 替代 R.styleable.GenericDraweeHierarchy;
+ return getStyleableArray(mContext, "GenericDraweeHierarchy");
+ }
+
+ @Override
+ public int getActualImageScaleType() {
+ // 替代 R.styleable.GenericDraweeHierarchy_actualImageScaleType;
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "actualImageScaleType");
+ }
+
+ @Override
+ public int getPlaceholderImage() {
+ // 替代:R.styleable.GenericDraweeHierarchy_placeholderImage
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "placeholderImage");
+ }
+
+ @Override
+ public int getPressedStateOverlayImage() {
+ // 替代:R.styleable.GenericDraweeHierarchy_pressedStateOverlayImage
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "pressedStateOverlayImage");
+ }
+
+ @Override
+ public int getProgressBarImage() {
+ // R.styleable.GenericDraweeHierarchy_progressBarImage;
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "progressBarImage");
+ }
+
+ @Override
+ public int getFadeDuration() {
+ // R.styleable.GenericDraweeHierarchy_fadeDuration;
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "fadeDuration");
+ }
+
+ @Override
+ public int getViewAspectRatio() {
+ // R.styleable.GenericDraweeHierarchy_viewAspectRatio;
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "viewAspectRatio");
+ }
+
+ @Override
+ public int getPlaceholderImageScaleType() {
+ // R.styleable.GenericDraweeHierarchy_placeholderImageScaleType;
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "placeholderImageScaleType");
+ }
+
+ @Override
+ public int getRetryImage() {
+ // R.styleable.GenericDraweeHierarchy_retryImage;
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "retryImage");
+ }
+
+ @Override
+ public int getRetryImageScaleType() {
+ // R.styleable.GenericDraweeHierarchy_retryImageScaleType;
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "retryImageScaleType");
+ }
+
+ @Override
+ public int getFailureImage() {
+ // return R.styleable.GenericDraweeHierarchy_failureImage;
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "failureImage");
+ }
+
+ @Override
+ public int getFailureImageScaleType() {
+ // R.styleable.GenericDraweeHierarchy_failureImageScaleType;
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "failureImageScaleType");
+ }
+
+ @Override
+ public int getProgressBarImageScaleType() {
+ // R.styleable.GenericDraweeHierarchy_progressBarImageScaleType;
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "progressBarImageScaleType");
+ }
+
+ @Override
+ public int getProgressBarAutoRotateInterval() {
+ // R.styleable.GenericDraweeHierarchy_progressBarAutoRotateInterval;
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "progressBarAutoRotateInterval");
+ }
+
+ @Override
+ public int getBackgroundImage() {
+ // R.styleable.GenericDraweeHierarchy_backgroundImage;
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "backgroundImage");
+ }
+
+ @Override
+ public int getOverlayImage() {
+ // R.styleable.GenericDraweeHierarchy_overlayImage;
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "overlayImage");
+ }
+
+ @Override
+ public int getRoundAsCircle() {
+ // R.styleable.GenericDraweeHierarchy_roundAsCircle;
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "roundAsCircle");
+ }
+
+ @Override
+ public int getRoundedCornerRadius() {
+ // R.styleable.GenericDraweeHierarchy_roundedCornerRadius;
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "roundedCornerRadius");
+ }
+
+ @Override
+ public int getRoundTopLeft() {
+ // R.styleable.GenericDraweeHierarchy_roundTopLeft;
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "roundTopLeft");
+ }
+
+ @Override
+ public int getRoundTopRight() {
+ // R.styleable.GenericDraweeHierarchy_roundTopRight;
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "roundTopRight");
+ }
+
+ @Override
+ public int getRoundBottomLeft() {
+ // R.styleable.GenericDraweeHierarchy_roundBottomLeft;
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "roundBottomLeft");
+ }
+
+ @Override
+ public int getRoundBottomRight() {
+ // R.styleable.GenericDraweeHierarchy_roundBottomRight;
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "roundBottomRight");
+ }
+
+ @Override
+ public int getRoundTopStart() {
+ // R.styleable.GenericDraweeHierarchy_roundTopStart;
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "roundTopStart");
+ }
+
+ @Override
+ public int getRoundTopEnd() {
+ // R.styleable.GenericDraweeHierarchy_roundTopEnd;
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "roundTopEnd");
+ }
+
+ @Override
+ public int getRoundBottomStart() {
+ // R.styleable.GenericDraweeHierarchy_roundBottomStart;
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "roundBottomStart");
+ }
+
+ @Override
+ public int getRoundBottomEnd() {
+ // R.styleable.GenericDraweeHierarchy_roundBottomEnd;
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "roundBottomEnd");
+ }
+
+ @Override
+ public int getRoundWithOverlayColor() {
+ // R.styleable.GenericDraweeHierarchy_roundWithOverlayColor;
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "roundWithOverlayColor");
+ }
+
+ @Override
+ public int getRoundingBorderWidth() {
+ // R.styleable.GenericDraweeHierarchy_roundingBorderWidth;
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "roundingBorderWidth");
+ }
+
+ @Override
+ public int getRoundingBorderColor() {
+ // R.styleable.GenericDraweeHierarchy_roundingBorderColor;
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "roundingBorderColor");
+ }
+
+ @Override
+ public int getRoundingBorderPadding() {
+ // R.styleable.GenericDraweeHierarchy_roundingBorderPadding;
+ return getStyleableFieldId(mContext, "GenericDraweeHierarchy", "roundingBorderPadding");
+ }
+
+ @Override
+ public int getActualImageUri() {
+ // R.styleable.SimpleDraweeView_actualImageUri;
+ return getStyleableFieldId(mContext, "SimpleDraweeView", "actualImageUri");
+ }
+
+ @Override
+ public int getActualImageResource() {
+ // R.styleable.SimpleDraweeView_actualImageResource;
+ return getStyleableFieldId(mContext, "SimpleDraweeView", "actualImageResource");
+ }
+}
\ No newline at end of file
diff --git a/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/java/com/facebook/fresco/patch/FrescoPatch.java b/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/java/com/facebook/fresco/patch/FrescoPatch.java
new file mode 100644
index 00000000..c295a790
--- /dev/null
+++ b/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/java/com/facebook/fresco/patch/FrescoPatch.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2005-2017 Qihoo 360 Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed To in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.facebook.fresco.patch;
+
+import android.content.Context;
+
+import com.facebook.drawee.generic.GenericDraweeHierarchyInflater;
+import com.facebook.drawee.view.SimpleDraweeView;
+
+/**
+ * 为 “自己编译好的fresco drawee 模块(对应drawee-modified-1.7.1.jar)” 设置回调接口
+ *
+ * @author RePlugin Team
+ */
+public class FrescoPatch {
+
+ /**
+ * 初始化
+ *
+ * 为SimpleDraweeView设置回调
+ * 为GenericDraweeHierarchyInflater设置回调
+ */
+ public static void initialize(Context context) {
+ DraweeStyleableCallbackImpl draweeStyleableCallback = new DraweeStyleableCallbackImpl(context);
+ SimpleDraweeView.setDraweeStyleableCallback(draweeStyleableCallback);
+ GenericDraweeHierarchyInflater.setDraweeStyleableCallback(draweeStyleableCallback);
+ }
+}
\ No newline at end of file
diff --git a/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/java/com/qihoo360/replugin/fresco/plugin/MainActivity.java b/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/java/com/qihoo360/replugin/fresco/plugin/MainActivity.java
new file mode 100644
index 00000000..5b65500f
--- /dev/null
+++ b/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/java/com/qihoo360/replugin/fresco/plugin/MainActivity.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2005-2017 Qihoo 360 Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed To in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.qihoo360.replugin.fresco.plugin;
+
+import android.net.Uri;
+import android.os.Bundle;
+import android.support.v7.app.AppCompatActivity;
+
+import com.facebook.drawee.view.SimpleDraweeView;
+
+/**
+ * @author RePlugin Team
+ */
+public class MainActivity extends AppCompatActivity {
+
+ private static final String IMAGE_URL = "https://img1.doubanio.com/lpic/s3743777.jpg";
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+
+ SimpleDraweeView simpleDraweeView = (SimpleDraweeView) findViewById(R.id.image);
+ Uri uri = Uri.parse(IMAGE_URL);
+ simpleDraweeView.setImageURI(uri);
+ }
+}
\ No newline at end of file
diff --git a/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/java/com/qihoo360/replugin/fresco/plugin/PluginApp.java b/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/java/com/qihoo360/replugin/fresco/plugin/PluginApp.java
new file mode 100644
index 00000000..ab503a56
--- /dev/null
+++ b/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/java/com/qihoo360/replugin/fresco/plugin/PluginApp.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2005-2017 Qihoo 360 Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed To in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.qihoo360.replugin.fresco.plugin;
+
+import android.app.Application;
+
+import com.facebook.drawee.backends.pipeline.Fresco;
+import com.facebook.fresco.patch.FrescoPatch;
+
+/**
+ * @author RePlugin Team
+ */
+public class PluginApp extends Application {
+
+ @Override
+ public void onCreate() {
+ super.onCreate();
+
+ Fresco.initialize(this);
+ FrescoPatch.initialize(this);
+ }
+}
diff --git a/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/layout/activity_main.xml b/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/layout/activity_main.xml
new file mode 100644
index 00000000..7daf4e5d
--- /dev/null
+++ b/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/layout/activity_main.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/mipmap-hdpi/ic_launcher.png b/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 00000000..cde69bcc
Binary files /dev/null and b/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
new file mode 100644
index 00000000..9a078e3e
Binary files /dev/null and b/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ
diff --git a/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/mipmap-mdpi/ic_launcher.png b/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 00000000..c133a0cb
Binary files /dev/null and b/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
new file mode 100644
index 00000000..efc028a6
Binary files /dev/null and b/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ
diff --git a/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 00000000..bfa42f0e
Binary files /dev/null and b/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
new file mode 100644
index 00000000..3af2608a
Binary files /dev/null and b/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ
diff --git a/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 00000000..324e72cd
Binary files /dev/null and b/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
new file mode 100644
index 00000000..9bec2e62
Binary files /dev/null and b/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ
diff --git a/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644
index 00000000..aee44e13
Binary files /dev/null and b/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
new file mode 100644
index 00000000..34947cd6
Binary files /dev/null and b/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ
diff --git a/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/values/attrs.xml b/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/values/attrs.xml
new file mode 100644
index 00000000..7c9c62bc
--- /dev/null
+++ b/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/values/attrs.xml
@@ -0,0 +1,235 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/values/colors.xml b/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/values/colors.xml
new file mode 100644
index 00000000..ccbc6416
--- /dev/null
+++ b/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/values/colors.xml
@@ -0,0 +1,6 @@
+
+
+ #3C3C3B
+ #000000
+ #FF4081
+
diff --git a/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/values/strings.xml b/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/values/strings.xml
new file mode 100644
index 00000000..7d544b67
--- /dev/null
+++ b/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/values/strings.xml
@@ -0,0 +1,3 @@
+
+ FrescoPlugin
+
diff --git a/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/values/styles.xml b/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/values/styles.xml
new file mode 100644
index 00000000..5885930d
--- /dev/null
+++ b/replugin-sample-extra/fresco/FrescoPlugin/app/src/main/res/values/styles.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
diff --git a/replugin-sample-extra/fresco/FrescoPlugin/build.gradle b/replugin-sample-extra/fresco/FrescoPlugin/build.gradle
new file mode 100644
index 00000000..652428c0
--- /dev/null
+++ b/replugin-sample-extra/fresco/FrescoPlugin/build.gradle
@@ -0,0 +1,32 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+
+buildscript {
+ repositories {
+ jcenter()
+ }
+ dependencies {
+ classpath 'com.android.tools.build:gradle:2.3.0'
+ classpath 'com.qihoo360.replugin:replugin-plugin-gradle:2.2.1'
+
+ // NOTE: Do not place your application dependencies here; they belong
+ // in the individual module build.gradle files
+ }
+}
+
+/**
+ * 作为插件运行,设置为true;作为单独APK运行,设置为false
+ *
+ */
+project.ext {
+ isPlugin = true
+}
+
+allprojects {
+ repositories {
+ jcenter()
+ }
+}
+
+task clean(type: Delete) {
+ delete rootProject.buildDir
+}
\ No newline at end of file
diff --git a/replugin-sample-extra/fresco/FrescoPlugin/gradle.properties b/replugin-sample-extra/fresco/FrescoPlugin/gradle.properties
new file mode 100644
index 00000000..aac7c9b4
--- /dev/null
+++ b/replugin-sample-extra/fresco/FrescoPlugin/gradle.properties
@@ -0,0 +1,17 @@
+# Project-wide Gradle settings.
+
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+org.gradle.jvmargs=-Xmx1536m
+
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true
diff --git a/replugin-sample-extra/fresco/FrescoPlugin/gradle/wrapper/gradle-wrapper.jar b/replugin-sample-extra/fresco/FrescoPlugin/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 00000000..13372aef
Binary files /dev/null and b/replugin-sample-extra/fresco/FrescoPlugin/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/replugin-sample-extra/fresco/FrescoPlugin/gradle/wrapper/gradle-wrapper.properties b/replugin-sample-extra/fresco/FrescoPlugin/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 00000000..94b50d3e
--- /dev/null
+++ b/replugin-sample-extra/fresco/FrescoPlugin/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Fri Jan 05 16:45:51 CST 2018
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
diff --git a/replugin-sample-extra/fresco/FrescoPlugin/gradlew b/replugin-sample-extra/fresco/FrescoPlugin/gradlew
new file mode 100644
index 00000000..9d82f789
--- /dev/null
+++ b/replugin-sample-extra/fresco/FrescoPlugin/gradlew
@@ -0,0 +1,160 @@
+#!/usr/bin/env bash
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn ( ) {
+ echo "$*"
+}
+
+die ( ) {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+esac
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
+function splitJvmOpts() {
+ JVM_OPTS=("$@")
+}
+eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
+JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+
+exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
diff --git a/replugin-sample-extra/fresco/FrescoPlugin/gradlew.bat b/replugin-sample-extra/fresco/FrescoPlugin/gradlew.bat
new file mode 100644
index 00000000..8a0b282a
--- /dev/null
+++ b/replugin-sample-extra/fresco/FrescoPlugin/gradlew.bat
@@ -0,0 +1,90 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windowz variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+if "%@eval[2+2]" == "4" goto 4NT_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+goto execute
+
+:4NT_args
+@rem Get arguments from the 4NT Shell from JP Software
+set CMD_LINE_ARGS=%$
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/replugin-sample-extra/fresco/FrescoPlugin/settings.gradle b/replugin-sample-extra/fresco/FrescoPlugin/settings.gradle
new file mode 100644
index 00000000..e7b4def4
--- /dev/null
+++ b/replugin-sample-extra/fresco/FrescoPlugin/settings.gradle
@@ -0,0 +1 @@
+include ':app'