├── .github ├── ISSUE_TEMPLATE.md └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── README_CN.md ├── deploy.sh ├── replugin-host-gradle ├── README.md ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── src │ └── main │ ├── groovy │ └── com │ │ └── qihoo360 │ │ └── replugin │ │ └── gradle │ │ ├── compat │ │ ├── ScopeCompat.groovy │ │ └── VariantCompat.groovy │ │ └── host │ │ ├── AppConstant.groovy │ │ ├── RePlugin.groovy │ │ ├── creator │ │ ├── FileCreators.groovy │ │ ├── IFileCreator.groovy │ │ └── impl │ │ │ ├── java │ │ │ └── RePluginHostConfigCreator.groovy │ │ │ └── json │ │ │ ├── PluginBuiltinJsonCreator.groovy │ │ │ ├── PluginInfo.groovy │ │ │ └── PluginInfoParser.groovy │ │ └── handlemanifest │ │ └── ComponentsGenerator.groovy │ └── resources │ └── META-INF │ └── gradle-plugins │ └── replugin-host-gradle.properties ├── replugin-host-library ├── README.md ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── replugin-host-lib │ ├── bintray.gradle │ ├── build.gradle │ ├── replugin-rules.pro │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── aidl │ │ └── com │ │ │ └── qihoo360 │ │ │ ├── loader2 │ │ │ ├── IPlugin.aidl │ │ │ ├── IPluginClient.aidl │ │ │ ├── IPluginHost.aidl │ │ │ ├── PluginBinderInfo.aidl │ │ │ ├── mgr │ │ │ │ └── IServiceConnection.aidl │ │ │ └── sp │ │ │ │ └── IPref.aidl │ │ │ ├── mobilesafe │ │ │ └── svcmanager │ │ │ │ └── IServiceChannel.aidl │ │ │ └── replugin │ │ │ ├── IBinderGetter.aidl │ │ │ ├── component │ │ │ └── service │ │ │ │ └── server │ │ │ │ └── IPluginServiceServer.aidl │ │ │ ├── model │ │ │ └── PluginInfo.aidl │ │ │ └── packages │ │ │ ├── IPluginManagerServer.aidl │ │ │ └── PluginRunningList.aidl │ │ └── java │ │ └── com │ │ └── qihoo360 │ │ ├── i │ │ ├── Factory.java │ │ ├── Factory2.java │ │ ├── IModule.java │ │ ├── IPlugin.java │ │ └── IPluginManager.java │ │ ├── loader │ │ ├── utils │ │ │ ├── LocalBroadcastManager.java │ │ │ ├── PackageUtils.java │ │ │ ├── PatchClassLoaderUtils.java │ │ │ ├── ProcessLocker.java │ │ │ ├── StringUtils.java │ │ │ └── SysUtils.java │ │ └── utils2 │ │ │ └── FilePermissionUtils.java │ │ ├── loader2 │ │ ├── BinderCursor.java │ │ ├── BuildCompat.java │ │ ├── Builder.java │ │ ├── CertUtils.java │ │ ├── Constant.java │ │ ├── DumpUtils.java │ │ ├── Finder.java │ │ ├── FinderBuiltin.java │ │ ├── LaunchModeStates.java │ │ ├── Loader.java │ │ ├── MP.java │ │ ├── PMF.java │ │ ├── Plugin.java │ │ ├── PluginBinderInfo.java │ │ ├── PluginCommImpl.java │ │ ├── PluginContainers.java │ │ ├── PluginContext.java │ │ ├── PluginDesc.java │ │ ├── PluginIntent.java │ │ ├── PluginLibraryInternalProxy.java │ │ ├── PluginManager.java │ │ ├── PluginNativeLibsHelper.java │ │ ├── PluginProcessMain.java │ │ ├── PluginProcessPer.java │ │ ├── PluginProviderStub.java │ │ ├── PluginStatusController.java │ │ ├── PluginTable.java │ │ ├── PmBase.java │ │ ├── PmHostSvc.java │ │ ├── ProcessStates.java │ │ ├── StubProcessManager.java │ │ ├── TaskAffinityStates.java │ │ ├── V5FileInfo.java │ │ ├── V5Finder.java │ │ ├── VMRuntimeCompat.java │ │ ├── alc │ │ │ ├── ActivityController.java │ │ │ └── IActivityWatcher.java │ │ ├── mgr │ │ │ ├── PluginProviderClient.java │ │ │ └── PluginServiceClient.java │ │ └── sp │ │ │ └── PrefImpl.java │ │ ├── mobilesafe │ │ ├── api │ │ │ ├── AppVar.java │ │ │ ├── IPC.java │ │ │ ├── Intents.java │ │ │ ├── Pref.java │ │ │ └── Tasks.java │ │ ├── loader │ │ │ ├── a │ │ │ │ └── DummyActivity.java │ │ │ ├── p │ │ │ │ └── DummyProvider.java │ │ │ └── s │ │ │ │ └── DummyService.java │ │ ├── parser │ │ │ └── manifest │ │ │ │ ├── ManifestParser.java │ │ │ │ ├── XmlHandler.java │ │ │ │ └── bean │ │ │ │ ├── ComponentBean.java │ │ │ │ └── DataBean.java │ │ └── svcmanager │ │ │ ├── ParcelBinder.java │ │ │ ├── PluginServiceManager.java │ │ │ ├── PluginServiceRecord.java │ │ │ ├── PluginServiceReferenceManager.java │ │ │ ├── QihooServiceManager.java │ │ │ ├── ServiceChannelCursor.java │ │ │ ├── ServiceChannelImpl.java │ │ │ ├── ServiceProvider.java │ │ │ └── ServiceWrapper.java │ │ └── replugin │ │ ├── ContextInjector.java │ │ ├── DefaultRePluginCallbacks.java │ │ ├── DefaultRePluginEventCallbacks.java │ │ ├── IHostBinderFetcher.java │ │ ├── PluginDexClassLoader.java │ │ ├── PluginDexClassLoaderPatch.java │ │ ├── RePlugin.java │ │ ├── RePluginApplication.java │ │ ├── RePluginCallbacks.java │ │ ├── RePluginClassLoader.java │ │ ├── RePluginConfig.java │ │ ├── RePluginConstants.java │ │ ├── RePluginEventCallbacks.java │ │ ├── RePluginInternal.java │ │ ├── base │ │ ├── AMSUtils.java │ │ ├── IPC.java │ │ ├── LocalBroadcastHelper.java │ │ └── ThreadUtils.java │ │ ├── component │ │ ├── ComponentList.java │ │ ├── activity │ │ │ ├── ActivityInjector.java │ │ │ └── DynamicClassProxyActivity.java │ │ ├── app │ │ │ └── PluginApplicationClient.java │ │ ├── dummy │ │ │ ├── DummyActivity.java │ │ │ ├── DummyProvider.java │ │ │ ├── DummyReceiver.java │ │ │ ├── DummyService.java │ │ │ └── ForwardActivity.java │ │ ├── process │ │ │ ├── PluginProcessHost.java │ │ │ ├── ProcessPitProviderBase.java │ │ │ ├── ProcessPitProviderLoader0.java │ │ │ ├── ProcessPitProviderLoader1.java │ │ │ ├── ProcessPitProviderP0.java │ │ │ ├── ProcessPitProviderP1.java │ │ │ ├── ProcessPitProviderP2.java │ │ │ ├── ProcessPitProviderPersist.java │ │ │ └── ProcessPitProviderUI.java │ │ ├── provider │ │ │ ├── PluginPitProviderBase.java │ │ │ ├── PluginPitProviderP0.java │ │ │ ├── PluginPitProviderP1.java │ │ │ ├── PluginPitProviderP2.java │ │ │ ├── PluginPitProviderPersist.java │ │ │ ├── PluginPitProviderUI.java │ │ │ ├── PluginProviderClient.java │ │ │ ├── PluginProviderClient2.java │ │ │ └── PluginProviderHelper.java │ │ ├── receiver │ │ │ ├── PluginReceiverHelper.java │ │ │ └── PluginReceiverProxy.java │ │ ├── service │ │ │ ├── PluginServiceClient.java │ │ │ ├── PluginServiceDispatcherManager.java │ │ │ ├── PluginServiceServerFetcher.java │ │ │ ├── ServiceDispatcher.java │ │ │ └── server │ │ │ │ ├── ConnectionBindRecord.java │ │ │ │ ├── IntentBindRecord.java │ │ │ │ ├── PluginPitService.java │ │ │ │ ├── PluginServiceServer.java │ │ │ │ ├── ProcessBindRecord.java │ │ │ │ ├── ProcessRecord.java │ │ │ │ └── ServiceRecord.java │ │ └── utils │ │ │ ├── ApkCommentReader.java │ │ │ ├── IntentMatcherHelper.java │ │ │ └── PluginClientHelper.java │ │ ├── debugger │ │ └── DebuggerReceivers.java │ │ ├── ext │ │ └── parser │ │ │ ├── AbstractApkParser.java │ │ │ ├── ApkParser.java │ │ │ ├── exception │ │ │ └── ParserException.java │ │ │ ├── parser │ │ │ ├── BinaryXmlParser.java │ │ │ ├── StringPoolEntry.java │ │ │ ├── XmlNamespaces.java │ │ │ ├── XmlStreamer.java │ │ │ └── XmlTranslator.java │ │ │ ├── struct │ │ │ ├── ChunkHeader.java │ │ │ ├── ChunkType.java │ │ │ ├── ResourceValue.java │ │ │ ├── StringPool.java │ │ │ ├── StringPoolHeader.java │ │ │ └── xml │ │ │ │ ├── Attribute.java │ │ │ │ ├── Attributes.java │ │ │ │ ├── NullHeader.java │ │ │ │ ├── XmlHeader.java │ │ │ │ ├── XmlNamespaceEndTag.java │ │ │ │ ├── XmlNamespaceStartTag.java │ │ │ │ ├── XmlNodeEndTag.java │ │ │ │ ├── XmlNodeHeader.java │ │ │ │ ├── XmlNodeStartTag.java │ │ │ │ └── XmlResourceMapHeader.java │ │ │ └── utils │ │ │ ├── Buffers.java │ │ │ ├── ParseUtils.java │ │ │ └── xml │ │ │ ├── AggregateTranslator.java │ │ │ ├── CharSequenceTranslator.java │ │ │ ├── CodePointTranslator.java │ │ │ ├── EntityArrays.java │ │ │ ├── LookupTranslator.java │ │ │ ├── NumericEntityEscaper.java │ │ │ ├── UnicodeUnpairedSurrogateRemover.java │ │ │ └── XmlEscaper.java │ │ ├── helper │ │ ├── HostConfigHelper.java │ │ ├── JSONHelper.java │ │ ├── LogDebug.java │ │ └── LogRelease.java │ │ ├── model │ │ ├── PluginInfo.java │ │ └── PluginInfoList.java │ │ ├── packages │ │ ├── PluginFastInstallProvider.java │ │ ├── PluginFastInstallProviderProxy.java │ │ ├── PluginInfoUpdater.java │ │ ├── PluginManagerProxy.java │ │ ├── PluginManagerServer.java │ │ ├── PluginPublishFileGenerator.java │ │ ├── PluginRunningList.java │ │ └── RePluginInstaller.java │ │ └── utils │ │ ├── AssetsUtils.java │ │ ├── Charsets.java │ │ ├── CloseableUtils.java │ │ ├── Dex2OatUtils.java │ │ ├── FileUtils.java │ │ ├── FixOTranslucentOrientation.java │ │ ├── IOUtils.java │ │ ├── InterpretDex2OatHelper.java │ │ ├── ReflectUtils.java │ │ ├── StringBuilderWriter.java │ │ ├── Validate.java │ │ ├── basic │ │ ├── ArrayMap.java │ │ ├── ArraySet.java │ │ ├── ByteConvertor.java │ │ ├── ContainerHelpers.java │ │ ├── MapCollections.java │ │ ├── SecurityUtil.java │ │ └── SimpleArrayMap.java │ │ └── pkg │ │ └── PackageFilesUtil.java └── settings.gradle ├── replugin-plugin-gradle ├── README.md ├── bintray.gradle ├── build.gradle ├── config.gradle ├── config.properties ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── src │ └── main │ ├── groovy │ └── com │ │ └── qihoo360 │ │ └── replugin │ │ └── gradle │ │ └── plugin │ │ ├── AppConstant.groovy │ │ ├── ReClassPlugin.groovy │ │ ├── debugger │ │ └── PluginDebugger.groovy │ │ ├── injector │ │ ├── BaseInjector.groovy │ │ ├── IClassInjector.groovy │ │ ├── Injectors.groovy │ │ ├── identifier │ │ │ ├── GetIdentifierExprEditor.groovy │ │ │ └── GetIdentifierInjector.groovy │ │ ├── loaderactivity │ │ │ └── LoaderActivityInjector.groovy │ │ ├── localbroadcast │ │ │ ├── LocalBroadcastExprEditor.groovy │ │ │ └── LocalBroadcastInjector.groovy │ │ └── provider │ │ │ ├── ProviderExprEditor.groovy │ │ │ ├── ProviderExprEditor2.groovy │ │ │ ├── ProviderInjector.groovy │ │ │ └── ProviderInjector2.groovy │ │ ├── inner │ │ ├── ClassFileVisitor.groovy │ │ ├── CommonData.groovy │ │ ├── ReClassTransform.groovy │ │ └── Util.groovy │ │ ├── manifest │ │ ├── IManifest.groovy │ │ ├── ManifestAPI.groovy │ │ └── ManifestReader.groovy │ │ └── util │ │ └── CmdUtil.groovy │ └── resources │ └── META-INF │ └── gradle-plugins │ └── replugin-plugin-gradle.properties ├── replugin-plugin-library ├── README.md ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── replugin-plugin-lib │ ├── bintray.gradle │ ├── build.gradle │ ├── proguard-rules.pro │ ├── replugin-library-rules.pro │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── aidl │ │ └── com │ │ │ └── qihoo360 │ │ │ ├── loader2 │ │ │ └── IPlugin.aidl │ │ │ └── replugin │ │ │ └── IBinderGetter.aidl │ │ └── java │ │ └── com │ │ └── qihoo360 │ │ └── replugin │ │ ├── Entry.java │ │ ├── MethodInvoker.java │ │ ├── RePlugin.java │ │ ├── RePluginCompat.java │ │ ├── RePluginEnv.java │ │ ├── RePluginFramework.java │ │ ├── RePluginInternal.java │ │ ├── RePluginServiceManager.java │ │ ├── base │ │ └── IPC.java │ │ ├── helper │ │ ├── JSONHelper.java │ │ ├── LogDebug.java │ │ └── LogRelease.java │ │ ├── i │ │ └── IPluginManager.java │ │ ├── loader │ │ ├── PluginResource.java │ │ ├── a │ │ │ ├── PluginActivity.java │ │ │ ├── PluginActivityGroup.java │ │ │ ├── PluginAppCompatActivity.java │ │ │ ├── PluginAppCompatXActivity.java │ │ │ ├── PluginExpandableListActivity.java │ │ │ ├── PluginFragmentActivity.java │ │ │ ├── PluginFragmentXActivity.java │ │ │ ├── PluginListActivity.java │ │ │ ├── PluginPreferenceActivity.java │ │ │ └── PluginTabActivity.java │ │ ├── b │ │ │ └── PluginLocalBroadcastManager.java │ │ ├── p │ │ │ └── PluginProviderClient.java │ │ └── s │ │ │ └── PluginServiceClient.java │ │ ├── model │ │ └── PluginInfo.java │ │ ├── packages │ │ └── PluginRunningList.java │ │ └── utils │ │ ├── ParcelUtils.java │ │ └── ReflectUtils.java └── settings.gradle ├── replugin-sample-extra ├── README.md └── fresco │ ├── FrescoHost │ ├── .gitignore │ ├── app │ │ ├── .gitignore │ │ ├── build.gradle │ │ ├── libs │ │ │ ├── armeabi │ │ │ │ └── libimagepipeline.so │ │ │ ├── drawee-modified-1.7.1.jar │ │ │ ├── fbcore-1.7.1.jar │ │ │ ├── fresco-1.7.1.jar │ │ │ ├── imagepipeline-1.7.1.jar │ │ │ └── imagepipeline-base-1.7.1.jar │ │ ├── proguard-rules.pro │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── assets │ │ │ └── plugins │ │ │ │ └── plugin1.jar │ │ │ ├── java │ │ │ └── com │ │ │ │ ├── facebook │ │ │ │ └── fresco │ │ │ │ │ └── patch │ │ │ │ │ ├── DraweeStyleableCallbackImpl.java │ │ │ │ │ └── FrescoPatch.java │ │ │ │ └── qihoo360 │ │ │ │ └── replugin │ │ │ │ └── fresco │ │ │ │ └── host │ │ │ │ ├── HostApp.java │ │ │ │ ├── HostFrescoActivity.java │ │ │ │ └── MainActivity.java │ │ │ └── res │ │ │ ├── layout │ │ │ ├── activity_host_fresco.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 │ │ │ ├── attrs.xml │ │ │ ├── colors.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle │ └── FrescoPlugin │ ├── .gitignore │ ├── app │ ├── .gitignore │ ├── build.gradle │ ├── libs │ │ ├── armeabi │ │ │ └── libimagepipeline.so │ │ ├── drawee-modified-1.7.1.jar │ │ ├── fbcore-1.7.1.jar │ │ ├── fresco-1.7.1.jar │ │ ├── imagepipeline-1.7.1.jar │ │ └── imagepipeline-base-1.7.1.jar │ ├── proguard-rules.pro │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ └── com │ │ │ ├── facebook │ │ │ └── fresco │ │ │ │ └── patch │ │ │ │ ├── DraweeStyleableCallbackImpl.java │ │ │ │ └── FrescoPatch.java │ │ │ └── qihoo360 │ │ │ └── replugin │ │ │ └── fresco │ │ │ └── plugin │ │ │ ├── MainActivity.java │ │ │ └── PluginApp.java │ │ └── res │ │ ├── layout │ │ └── 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 │ │ ├── attrs.xml │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle ├── replugin-sample ├── README.md ├── host │ ├── app │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── assets │ │ │ ├── external │ │ │ │ ├── README │ │ │ │ └── demo3.apk │ │ │ └── plugins │ │ │ │ ├── demo1.jar │ │ │ │ ├── demo2.jar │ │ │ │ └── webview.jar │ │ │ ├── java │ │ │ └── com │ │ │ │ └── qihoo360 │ │ │ │ └── replugin │ │ │ │ └── sample │ │ │ │ └── host │ │ │ │ ├── FileProvider.java │ │ │ │ ├── MainActivity.java │ │ │ │ ├── PluginFragmentActivity.java │ │ │ │ ├── SampleApplication.java │ │ │ │ └── TimeUtils.java │ │ │ └── res │ │ │ ├── layout │ │ │ ├── activity_main.xml │ │ │ └── activity_plugin_fragment.xml │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_launcher_round.png │ │ │ └── notification_out.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 │ │ │ ├── public.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ │ │ └── xml │ │ │ └── fileprovider_path.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle └── plugin │ ├── plugin-demo1 │ ├── README.md │ ├── app │ │ ├── build.gradle │ │ ├── case.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── aidl │ │ │ └── com │ │ │ │ └── qihoo360 │ │ │ │ └── replugin │ │ │ │ └── sample │ │ │ │ └── demo2 │ │ │ │ └── IDemo2.aidl │ │ │ ├── java │ │ │ └── com │ │ │ │ └── qihoo360 │ │ │ │ └── replugin │ │ │ │ └── sample │ │ │ │ └── demo1 │ │ │ │ ├── BaseActivity.java │ │ │ │ ├── LibMainActivity.java │ │ │ │ ├── MainActivity.java │ │ │ │ ├── MainApp.java │ │ │ │ ├── TestItem.java │ │ │ │ ├── TimeUtils.java │ │ │ │ ├── activity │ │ │ │ ├── file_provider │ │ │ │ │ ├── BitmapUtils.java │ │ │ │ │ └── FileProviderActivity.java │ │ │ │ ├── for_result │ │ │ │ │ └── ForResultActivity.java │ │ │ │ ├── intent_filter │ │ │ │ │ └── IntentFilterDemoActivity1.java │ │ │ │ ├── notify_test │ │ │ │ │ └── NotifyActivity.java │ │ │ │ ├── preference │ │ │ │ │ ├── PrefActivity1.java │ │ │ │ │ └── PrefActivity2.java │ │ │ │ ├── single_instance │ │ │ │ │ └── TIActivity1.java │ │ │ │ ├── single_top │ │ │ │ │ └── SingleTopActivity1.java │ │ │ │ ├── standard │ │ │ │ │ └── StandardActivity.java │ │ │ │ ├── task_affinity │ │ │ │ │ ├── TAActivity1.java │ │ │ │ │ ├── TAActivity2.java │ │ │ │ │ ├── TAActivity3.java │ │ │ │ │ ├── TAActivity4.java │ │ │ │ │ └── package-info.java │ │ │ │ ├── task_affinity_2 │ │ │ │ │ ├── TA2Activity1.java │ │ │ │ │ ├── TA2Activity2.java │ │ │ │ │ ├── TA2Activity3.java │ │ │ │ │ ├── TA2Activity4.java │ │ │ │ │ └── package-info.java │ │ │ │ ├── theme │ │ │ │ │ ├── ThemeBlackNoTitleBarActivity.java │ │ │ │ │ ├── ThemeBlackNoTitleBarFullscreenActivity.java │ │ │ │ │ └── ThemeDialogActivity.java │ │ │ │ └── webview │ │ │ │ │ └── WebViewActivity.java │ │ │ │ ├── fragment │ │ │ │ ├── DemoCodeFragment.java │ │ │ │ └── DemoFragment.java │ │ │ │ ├── provider │ │ │ │ ├── FileProvider.java │ │ │ │ └── Provider2.java │ │ │ │ ├── receivers │ │ │ │ └── PluginDemo1Receiver.java │ │ │ │ ├── service │ │ │ │ ├── PluginDemoAppService.java │ │ │ │ ├── PluginDemoService1.java │ │ │ │ └── PluginDemoService2.java │ │ │ │ ├── support │ │ │ │ ├── LogX.java │ │ │ │ └── NotifyUtils.java │ │ │ │ └── webview │ │ │ │ ├── IWebPage.java │ │ │ │ ├── ViewProxy.java │ │ │ │ └── WebPageProxy.java │ │ │ └── res │ │ │ ├── layout │ │ │ ├── content_lib_main.xml │ │ │ ├── layout_notify.xml │ │ │ ├── lib_activity_main.xml │ │ │ ├── main.xml │ │ │ ├── main_fragment.xml │ │ │ ├── simple.xml │ │ │ ├── simple_2.xml │ │ │ └── simple_4.xml │ │ │ ├── mipmap-xhdpi │ │ │ └── app_icon.png │ │ │ ├── values │ │ │ └── strings.xml │ │ │ └── xml │ │ │ ├── fileprovider_path.xml │ │ │ └── pref_headers.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle │ ├── plugin-demo2 │ ├── README.md │ ├── app │ │ ├── build.gradle │ │ ├── case.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── aidl │ │ │ └── com │ │ │ │ └── qihoo360 │ │ │ │ └── replugin │ │ │ │ └── sample │ │ │ │ └── demo2 │ │ │ │ └── IDemo2.aidl │ │ │ ├── java │ │ │ └── com │ │ │ │ └── qihoo360 │ │ │ │ └── replugin │ │ │ │ └── sample │ │ │ │ └── demo2 │ │ │ │ ├── Demo2Impl.java │ │ │ │ ├── MainActivity.java │ │ │ │ ├── MainApp.java │ │ │ │ ├── activity │ │ │ │ ├── appcompat │ │ │ │ │ └── AppCompatActivityDemo.java │ │ │ │ └── for_result │ │ │ │ │ └── ForResultActivity.java │ │ │ │ ├── databinding │ │ │ │ ├── DataBindingActivity.java │ │ │ │ └── Entry.java │ │ │ │ ├── receivers │ │ │ │ └── PluginDemo2Receiver.java │ │ │ │ ├── service │ │ │ │ └── PluginDemo2Service.java │ │ │ │ ├── support │ │ │ │ └── LogX.java │ │ │ │ └── testcase │ │ │ │ └── TestMultiDex.java │ │ │ └── res │ │ │ ├── layout │ │ │ ├── databinding_test.xml │ │ │ └── from_demo1.xml │ │ │ ├── mipmap-xhdpi │ │ │ └── app_icon.png │ │ │ └── values │ │ │ └── strings.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle │ ├── plugin-demo3-kotlin │ ├── README.md │ ├── app │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── aidl │ │ │ └── com │ │ │ │ └── qihoo360 │ │ │ │ └── replugin │ │ │ │ └── sample │ │ │ │ └── demo2 │ │ │ │ └── IDemo2.aidl │ │ │ ├── java │ │ │ └── com │ │ │ │ └── qihoo360 │ │ │ │ └── replugin │ │ │ │ └── sample │ │ │ │ └── demo3 │ │ │ │ ├── BaseActivity.kt │ │ │ │ ├── MainActivity.kt │ │ │ │ ├── MainApp.kt │ │ │ │ ├── TestItem.kt │ │ │ │ ├── activity │ │ │ │ └── theme │ │ │ │ │ └── ThemeBlackNoTitleBarActivity.kt │ │ │ │ ├── receivers │ │ │ │ └── PluginDemo3Receiver.kt │ │ │ │ ├── service │ │ │ │ └── PluginDemoService1.kt │ │ │ │ └── support │ │ │ │ └── LogX.kt │ │ │ └── res │ │ │ ├── layout │ │ │ ├── main.xml │ │ │ ├── main_fragment.xml │ │ │ └── simple.xml │ │ │ ├── mipmap-xhdpi │ │ │ └── app_icon.png │ │ │ └── values │ │ │ └── strings.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle │ └── plugin-webview │ ├── README.md │ ├── app │ ├── build.gradle │ ├── proguard-rules.pro │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ └── com │ │ │ └── qihoo360 │ │ │ └── replugin │ │ │ └── sample │ │ │ └── webview │ │ │ ├── MainActivity.java │ │ │ ├── MainApp.java │ │ │ ├── common │ │ │ ├── CommonWebChromeClient.java │ │ │ ├── CommonWebView.java │ │ │ └── CommonWebViewClient.java │ │ │ ├── env │ │ │ └── Env.java │ │ │ ├── utils │ │ │ ├── ReflectUtil.java │ │ │ └── WebViewResourceHelper.java │ │ │ └── views │ │ │ ├── SimpleWebPage.java │ │ │ └── SimpleWebView.java │ │ └── res │ │ ├── drawable │ │ └── ic_launcher.png │ │ ├── layout │ │ ├── web_page.xml │ │ └── webview.xml │ │ └── values │ │ ├── colors.xml │ │ └── strings.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle ├── rp-config.gradle └── rp-publish.gradle /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | #### 问题详细描述 Detailed description of the problem 2 | 3 | 4 | #### 复现问题步骤 Steps to reproduce the problem 5 | 1. 6 | 2. 7 | 8 | #### 其它重要信息 Other important information 9 | 10 | replugin-host-lib/gradle Version: 11 | rePlugin-plugin-lib/gradle Version: 12 | 13 | Android API Version: 14 | Android 手机型号&ROM(Phone model & ROM): 15 | 16 | #### Logcat上下文 Logcat context 17 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | #### 要解决的问题 Describe the problem to be solved 2 | 1. 3 | 2. 4 | 5 | #### 要解决的Issue编号(可多个) Associated issue number (multiple) 6 | # -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | 欢迎关注和使用RePlugin。为了让解决问题、贡献代码的效率更高,请务必按照下面流程来做。 2 | 3 | ## 有关Issue 4 | 5 | 如果遇到接入上的问题,请随时提出**【有效的】**Issue。 6 | 7 | #### 如果是问题反馈 8 | 9 | > 出于效率考虑,请**务必按照 Issue模板 所列来完整的填写反馈**(我们已自动帮您建立模板,您在写新Issue时会有,您也可以[点击此处查看模板内容](https://github.com/Qihoo360/RePlugin/blob/dev/.github/ISSUE_TEMPLATE.md)) 10 | > 11 | > 注意:**未按照模板填写,且不能帮助我们定位问题的,我们将其标记为“Invalid”,并直接关闭,不会进一步问询。直到按照完整模板填写后,再行Reopen**。 12 | > 13 | > 此外,我们都希望提出的问题是**“高质量的”**。因此,请[点击此处阅读《提出Issue》](https://github.com/Qihoo360/RePlugin/wiki/%E6%8F%90%E5%87%BAIssue)一文,来详细了解提交Issue的最佳实践,帮助更快的解决您遇到的问题。 14 | 15 | #### 如果是意见和建议 16 | 17 | 我们的Issue模板只针对“问题反馈”而设计。而若您在RePlugin中有一些新的想法想讨论的话,可“无需按照Issue模板”来提,但请留意: 18 | 19 | 1. 请尽量将您的建议、提出建议的原因等描述清楚。不要只写个标题(除非这个标题让人一看就全懂) 20 | 2. 如果可能,请尽可能发动所有牛人的力量,共同参与讨论,并由社区(尤其是您自己)提出Pull Request,帮助所有人解决问题 21 | 3. 我们(以及社区大牛)会对您提的建议做评估,并将其贴上标签并待完成。有些建议虽然很好,但由于时间和精力关系,可能不会很快实现,对此我们不能、也不会承诺最终时间。 22 | 23 | 如果提出的Issue是“模棱两可”、无法看懂的,在一次回复没有答复后,我们可能将其标记为Invalid,并直接关闭。还请理解。 24 | 25 | ## 有关 Pull Request 26 | 27 | 当然,和Issue相比,我们非常欢迎您研究RePlugin的源码,发现相应的问题和改善方案,并提交自己的Pull Request。**高质量的PR将有助于打造自己的技术品牌,好处很多**。 28 | 29 | 在提出Pull Request之前,**建议请先提下Issue,这样可以在编写代码前,和大家做较为充分的讨论**,以免在后期出现“大量修改”的情况。 30 | 31 | > 有关如何完成一个“高质量”的Pull Request,请[点击此处阅读《贡献力量》](https://github.com/Qihoo360/RePlugin/wiki/%E8%B4%A1%E7%8C%AE%E5%8A%9B%E9%87%8F)一文了解更多。 32 | 33 | > 如果想知道哪些“牛人”为RePlugin做出了杰出贡献,请[点击此处阅读《金牌贡献者》](https://github.com/Qihoo360/RePlugin/wiki/%E9%87%91%E7%89%8C%E8%B4%A1%E7%8C%AE%E8%80%85),看看哪些您熟知的人也在其中。 34 | -------------------------------------------------------------------------------- /replugin-host-gradle/README.md: -------------------------------------------------------------------------------- 1 | # RePlugin Host Gradle 2 | 3 | RePlugin Host Gradle是一个Gradle插件,由 **主程序** 负责引入。 4 | 5 | 该Gradle插件主要负责在主程序的编译期中做一些事情,此外,开发者可通过修改其属性而做一些自定义的操作。 6 | 7 | 大致包括: 8 | 9 | * 生成带 RePlugin 插件坑位的 AndroidManifest.xml(允许自定义数量) 10 | * 生成HostBuildConfig类,方便插件框架读取并自定义其属性 11 | 12 | 开发者需要依赖此Gradle插件,以实现对RePlugin的接入。请参见WiKi以了解接入方法。 13 | 14 | 有关RePlugin Host Gradle的详细描述,请访问我们的WiKi,以了解更多的内容。 15 | (文档正在完善,请耐心等待) -------------------------------------------------------------------------------- /replugin-host-gradle/build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2017 Qihoo 360 Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | plugins { 18 | id 'java' 19 | id 'groovy' 20 | id 'maven-publish' 21 | } 22 | 23 | repositories { 24 | google() 25 | mavenCentral() 26 | } 27 | 28 | dependencies { 29 | implementation 'com.android.tools.build:gradle:7.4.2' 30 | implementation 'org.json:json:20160212' 31 | implementation 'org.codehaus.groovy:groovy:2.4.7' 32 | implementation 'com.squareup:javapoet:1.5.1' 33 | 34 | implementation gradleApi() 35 | implementation localGroovy() 36 | 37 | implementation 'com.google.gradle:osdetector-gradle-plugin:1.2.1' 38 | implementation 'net.dongliu:apk-parser:2.2.0' 39 | } 40 | 41 | project.ext.RP_ARTIFACT_ID = 'replugin-host-gradle' 42 | apply from: '../rp-publish.gradle' -------------------------------------------------------------------------------- /replugin-host-gradle/gradle.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2005-2017 Qihoo 360 Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | # use this file except in compliance with the License. You may obtain a copy of 6 | # the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed To in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | # License for the specific language governing permissions and limitations under 14 | # the License. 15 | # 16 | 17 | # Project-wide Gradle settings. 18 | 19 | # IDE (e.g. Android Studio) users: 20 | # Gradle settings configured through the IDE *will override* 21 | # any settings specified in this file. 22 | 23 | # For more details on how to configure your build environment visit 24 | # http://www.gradle.org/docs/current/userguide/build_environment.html 25 | 26 | # Specifies the JVM arguments used for the daemon process. 27 | # The setting is particularly useful for tweaking memory settings. 28 | org.gradle.jvmargs=-Xmx1536m 29 | 30 | # When configured, Gradle will run in incubating parallel mode. 31 | # This option should only be used with decoupled projects. More details, visit 32 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 33 | # org.gradle.parallel=true 34 | -------------------------------------------------------------------------------- /replugin-host-gradle/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-host-gradle/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /replugin-host-gradle/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2005-2017 Qihoo 360 Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | # use this file except in compliance with the License. You may obtain a copy of 6 | # the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed To in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | # License for the specific language governing permissions and limitations under 14 | # the License. 15 | # 16 | 17 | #Mon Dec 28 10:00:20 PST 2015 18 | distributionBase=GRADLE_USER_HOME 19 | distributionPath=wrapper/dists 20 | zipStoreBase=GRADLE_USER_HOME 21 | zipStorePath=wrapper/dists 22 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip 23 | -------------------------------------------------------------------------------- /replugin-host-gradle/src/main/groovy/com/qihoo360/replugin/gradle/compat/ScopeCompat.groovy: -------------------------------------------------------------------------------- 1 | package com.qihoo360.replugin.gradle.compat 2 | 3 | /** 4 | * @author hyongbai 5 | */ 6 | class ScopeCompat { 7 | static def getAdbExecutable(def scope) { 8 | final MetaClass scopeClz = scope.metaClass 9 | if (scopeClz.hasProperty(scope, "androidBuilder")) { 10 | return scope.androidBuilder.sdkInfo.adb 11 | } 12 | if (scopeClz.hasProperty(scope, "sdkComponents")) { 13 | return scope.sdkComponents.adbExecutableProvider.get() 14 | } 15 | } 16 | 17 | // TODO: getBuilderTarget 18 | // static def getBuilderTarget(def scope, def target){ 19 | // final MetaClass scopeClz = scope.metaClass 20 | // 21 | // if (scopeClz.hasProperty(scope, "androidBuilder")) { 22 | // return scope.getAndroidBuilder().getTarget().getPath(target) //IAndroidTarget.ANDROID_JAR 23 | // } 24 | // 25 | // return globalScope.getAndroidBuilder().getTarget().getPath(IAndroidTarget.ANDROID_JAR) 26 | // } 27 | 28 | // static def getAndroidJar(def scope){ 29 | // final MetaClass scopeClz = scope.metaClass 30 | // 31 | // if (scopeClz.hasProperty(scope, "androidBuilder")) { 32 | // return scope.getAndroidBuilder().getTarget().getPath(IAndroidTarget.ANDROID_JAR) 33 | // } 34 | // if (scopeClz.hasProperty(scope, "sdkComponents")) { 35 | // return scope.sdkComponents.androidJarProvider.get().getAbsolutePath() 36 | // } 37 | // } 38 | } -------------------------------------------------------------------------------- /replugin-host-gradle/src/main/groovy/com/qihoo360/replugin/gradle/compat/VariantCompat.groovy: -------------------------------------------------------------------------------- 1 | package com.qihoo360.replugin.gradle.compat 2 | 3 | import org.gradle.api.Task 4 | 5 | /** 6 | * @author hyongbai 7 | */ 8 | class VariantCompat { 9 | static def getAssembleTask(def variant) { 10 | return compatGetTask(variant, "getAssembleProvider", "getAssemble") 11 | } 12 | 13 | static def getMergeAssetsTask(def variant) { 14 | return compatGetTask(variant, "getMergeAssetsProvider", "getMergeAssets") 15 | } 16 | 17 | static def getGenerateBuildConfigTask(def variant) { 18 | return compatGetTask(variant, "getGenerateBuildConfigProvider", "getGenerateBuildConfig") 19 | } 20 | 21 | static def getProcessManifestTask(def variant) { 22 | return compatGetTask(variant, "getProcessManifestProvider", "getProcessManifest") 23 | } 24 | 25 | static def compatGetTask(def variant, String... candidates) { 26 | candidates?.findResult { 27 | variant.metaClass.respondsTo(variant, it).with { 28 | if (!it.isEmpty()) return it 29 | } 30 | }?.find { 31 | it.getParameterTypes().length == 0 32 | }?.invoke(variant)?.with { 33 | //TODO: check if is provider!!! 34 | Task.class.isInstance(it) ? it : it?.get() 35 | } 36 | } 37 | 38 | } -------------------------------------------------------------------------------- /replugin-host-gradle/src/main/groovy/com/qihoo360/replugin/gradle/host/AppConstant.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2017 Qihoo 360 Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package com.qihoo360.replugin.gradle.host 18 | 19 | /** 20 | * 程序常量定义区 21 | * @author RePlugin Team 22 | */ 23 | class AppConstant { 24 | 25 | /** 版本号 */ 26 | def static final VER = "${RP_VERSION}" 27 | 28 | /** 打印信息时候的前缀 */ 29 | def static final TAG = "< replugin-host-v${VER} >" 30 | 31 | /** 外部用户配置信息 */ 32 | def static final USER_CONFIG = "repluginHostConfig" 33 | 34 | /** 用户Task组 */ 35 | def static final TASKS_GROUP = "replugin-plugin" 36 | 37 | /** Task前缀 */ 38 | def static final TASKS_PREFIX = "rp" 39 | 40 | /** 用户Task:安装插件 */ 41 | def static final TASK_SHOW_PLUGIN = TASKS_PREFIX + "ShowPlugins" 42 | 43 | /** 用户Task:Generate任务 */ 44 | def static final TASK_GENERATE = TASKS_PREFIX + "Generate" 45 | 46 | 47 | private AppConstant() {} 48 | } 49 | -------------------------------------------------------------------------------- /replugin-host-gradle/src/main/groovy/com/qihoo360/replugin/gradle/host/creator/IFileCreator.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2017 Qihoo 360 Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package com.qihoo360.replugin.gradle.host.creator; 18 | 19 | /** 20 | * @author RePlugin Team 21 | */ 22 | public interface IFileCreator { 23 | 24 | /** 25 | * 要生成的文件所在目录 26 | */ 27 | File getFileDir() 28 | 29 | /** 30 | * 要生成的文件的名称 31 | */ 32 | String getFileName() 33 | 34 | /** 35 | * 要生成的文件内容 36 | */ 37 | String getFileContent() 38 | } 39 | -------------------------------------------------------------------------------- /replugin-host-gradle/src/main/groovy/com/qihoo360/replugin/gradle/host/creator/impl/json/PluginInfo.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2017 Qihoo 360 Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package com.qihoo360.replugin.gradle.host.creator.impl.json 18 | 19 | /** 20 | * 插件信息模型 21 | * @author RePlugin Team 22 | */ 23 | class PluginInfo { 24 | 25 | /** 插件文件路径 */ 26 | def path 27 | /** 插件包名 */ 28 | def pkg 29 | /** 插件名 */ 30 | def name 31 | /** 插件最低兼容版本 */ 32 | Long low 33 | /** 插件最高兼容版本 */ 34 | Long high 35 | /** 插件版本号 */ 36 | Long ver 37 | /** 框架版本号 */ 38 | Long frm 39 | 40 | } 41 | -------------------------------------------------------------------------------- /replugin-host-gradle/src/main/resources/META-INF/gradle-plugins/replugin-host-gradle.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2005-2017 Qihoo 360 Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | # use this file except in compliance with the License. You may obtain a copy of 6 | # the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed To in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | # License for the specific language governing permissions and limitations under 14 | # the License. 15 | # 16 | implementation-class=com.qihoo360.replugin.gradle.host.Replugin 17 | -------------------------------------------------------------------------------- /replugin-host-library/README.md: -------------------------------------------------------------------------------- 1 | # RePlugin Host Library 2 | 3 | RePlugin Host Library是一个Java工程,由 **主程序** 负责引入。 4 | 5 | 几乎所有和RePlugin相关的代码都在其中,是核心工程。 6 | 7 | 开发者需要依赖此Library,以实现对RePlugin的接入。请参见WiKi以了解接入方法。 8 | 9 | 有关RePlugin Host Library的详细描述,请访问我们的WiKi,以了解更多的内容。 -------------------------------------------------------------------------------- /replugin-host-library/build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2017 Qihoo 360 Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 18 | plugins { 19 | id 'com.android.application' version '7.4.2' apply false 20 | id 'maven-publish' 21 | } 22 | 23 | configure(allprojects - project(':replugin-host-lib')) { 24 | println "applying java plugin to $project" 25 | apply plugin: 'java-library' 26 | } 27 | -------------------------------------------------------------------------------- /replugin-host-library/gradle.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2005-2017 Qihoo 360 Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | # use this file except in compliance with the License. You may obtain a copy of 6 | # the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed To in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | # License for the specific language governing permissions and limitations under 14 | # the License. 15 | # 16 | 17 | # Project-wide Gradle settings. 18 | 19 | # IDE (e.g. Android Studio) users: 20 | # Gradle settings configured through the IDE *will override* 21 | # any settings specified in this file. 22 | 23 | # For more details on how to configure your build environment visit 24 | # http://www.gradle.org/docs/current/userguide/build_environment.html 25 | 26 | # Specifies the JVM arguments used for the daemon process. 27 | # The setting is particularly useful for tweaking memory settings. 28 | org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 29 | 30 | # When configured, Gradle will run in incubating parallel mode. 31 | # This option should only be used with decoupled projects. More details, visit 32 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 33 | # org.gradle.parallel=true 34 | -------------------------------------------------------------------------------- /replugin-host-library/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-host-library/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /replugin-host-library/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2005-2017 Qihoo 360 Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | # use this file except in compliance with the License. You may obtain a copy of 6 | # the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed To in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | # License for the specific language governing permissions and limitations under 14 | # the License. 15 | # 16 | 17 | #Fri Mar 03 10:15:50 CST 2017 18 | distributionBase=GRADLE_USER_HOME 19 | distributionPath=wrapper/dists 20 | zipStoreBase=GRADLE_USER_HOME 21 | zipStorePath=wrapper/dists 22 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip 23 | -------------------------------------------------------------------------------- /replugin-host-library/replugin-host-lib/src/main/aidl/com/qihoo360/loader2/IPlugin.aidl: -------------------------------------------------------------------------------- 1 | package com.qihoo360.loader2; 2 | 3 | /** 4 | * @author RePlugin Team 5 | */ 6 | interface IPlugin { 7 | 8 | IBinder query(String name); 9 | } 10 | -------------------------------------------------------------------------------- /replugin-host-library/replugin-host-lib/src/main/aidl/com/qihoo360/loader2/IPluginClient.aidl: -------------------------------------------------------------------------------- 1 | package com.qihoo360.loader2; 2 | 3 | import com.qihoo360.replugin.component.service.server.IPluginServiceServer; 4 | 5 | /** 6 | * @author RePlugin Team 7 | */ 8 | interface IPluginClient { 9 | 10 | // 参数 plugin, process 可能有冗余,目前临时使用,后续可能优化 11 | String allocActivityContainer(String plugin, int process, String target, in Intent intent); 12 | 13 | // 参数 plugin 用来处理多插件单进程情况 14 | IBinder queryBinder(String plugin, String binder); 15 | 16 | void releaseBinder(); 17 | 18 | oneway void sendIntent(in Intent intent); 19 | 20 | void sendIntentSync(in Intent intent); 21 | 22 | int sumActivities(); 23 | 24 | IPluginServiceServer fetchServiceServer(); 25 | 26 | /** 27 | * 插件收到广播 28 | * 29 | * @param plugin 插件名称 30 | * @param receiver Receiver 名称 31 | * @param Intent 广播的 Intent 数据 32 | */ 33 | void onReceive(String plugin, String receiver, in Intent intent); 34 | 35 | /** 36 | * dump通过插件化框架启动起来的Service信息 37 | */ 38 | String dumpServices(); 39 | 40 | /** 41 | * dump插件化框架中存储的详细Activity坑位映射表 42 | */ 43 | String dumpActivities(); 44 | } -------------------------------------------------------------------------------- /replugin-host-library/replugin-host-lib/src/main/aidl/com/qihoo360/loader2/PluginBinderInfo.aidl: -------------------------------------------------------------------------------- 1 | package com.qihoo360.loader2; 2 | 3 | parcelable PluginBinderInfo; -------------------------------------------------------------------------------- /replugin-host-library/replugin-host-lib/src/main/aidl/com/qihoo360/loader2/mgr/IServiceConnection.aidl: -------------------------------------------------------------------------------- 1 | // IServiceConnection.aidl 2 | // Same as android.app.IServiceConnection 3 | package com.qihoo360.loader2.mgr; 4 | 5 | import android.content.ComponentName; 6 | 7 | /** @hide */ 8 | oneway interface IServiceConnection { 9 | void connected(in ComponentName name, IBinder service); 10 | } 11 | -------------------------------------------------------------------------------- /replugin-host-library/replugin-host-lib/src/main/aidl/com/qihoo360/loader2/sp/IPref.aidl: -------------------------------------------------------------------------------- 1 | package com.qihoo360.loader2.sp; 2 | 3 | import android.os.Bundle; 4 | 5 | /** 6 | * @author RePlugin Team 7 | */ 8 | interface IPref { 9 | 10 | String get(String category, String key, String defValue); 11 | 12 | void set(String category, String key, String value); 13 | 14 | Bundle getAll(String category); 15 | } 16 | -------------------------------------------------------------------------------- /replugin-host-library/replugin-host-lib/src/main/aidl/com/qihoo360/mobilesafe/svcmanager/IServiceChannel.aidl: -------------------------------------------------------------------------------- 1 | package com.qihoo360.mobilesafe.svcmanager; 2 | 3 | import com.qihoo360.replugin.IBinderGetter; 4 | 5 | interface IServiceChannel { 6 | 7 | IBinder getService(String serviceName); 8 | 9 | void addService(String serviceName, IBinder service); 10 | 11 | void addServiceDelayed(String serviceName, IBinderGetter getter); 12 | 13 | void removeService(String serviceName); 14 | 15 | IBinder getPluginService(String pluginName, String serviceName, IBinder deathMonitor); 16 | 17 | void onPluginServiceRefReleased(String pluginName, String serviceName); 18 | } -------------------------------------------------------------------------------- /replugin-host-library/replugin-host-lib/src/main/aidl/com/qihoo360/replugin/IBinderGetter.aidl: -------------------------------------------------------------------------------- 1 | package com.qihoo360.replugin; 2 | 3 | /** 4 | * Binder的获取器,可用于延迟加载IBinder的情况。 5 | *

6 | * 目前用于: 7 | *

8 | * * RePlugin.registerGlobalBinderDelayed 9 | * 10 | * @author RePlugin Team 11 | */ 12 | interface IBinderGetter { 13 | 14 | /** 15 | * 获取IBinder对象 16 | */ 17 | IBinder get(); 18 | } 19 | -------------------------------------------------------------------------------- /replugin-host-library/replugin-host-lib/src/main/aidl/com/qihoo360/replugin/component/service/server/IPluginServiceServer.aidl: -------------------------------------------------------------------------------- 1 | package com.qihoo360.replugin.component.service.server; 2 | 3 | import android.content.ComponentName; 4 | import android.os.Messenger; 5 | 6 | import com.qihoo360.loader2.mgr.IServiceConnection; 7 | 8 | /** 9 | * 负责Server端的服务调度、提供等工作,是服务的提供方,核心类之一 10 | * 11 | * @hide 框架内部使用 12 | * @author RePlugin Team 13 | */ 14 | interface IPluginServiceServer { 15 | ComponentName startService(in Intent intent, in Messenger client); 16 | int stopService(in Intent intent, in Messenger client); 17 | 18 | int bindService(in Intent intent, in IServiceConnection conn, int flags, in Messenger client); 19 | boolean unbindService(in IServiceConnection conn); 20 | 21 | String dump(); 22 | } -------------------------------------------------------------------------------- /replugin-host-library/replugin-host-lib/src/main/aidl/com/qihoo360/replugin/model/PluginInfo.aidl: -------------------------------------------------------------------------------- 1 | package com.qihoo360.replugin.model; 2 | 3 | parcelable PluginInfo; -------------------------------------------------------------------------------- /replugin-host-library/replugin-host-lib/src/main/aidl/com/qihoo360/replugin/packages/PluginRunningList.aidl: -------------------------------------------------------------------------------- 1 | package com.qihoo360.replugin.packages; 2 | 3 | parcelable PluginRunningList; -------------------------------------------------------------------------------- /replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/i/IModule.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2017 Qihoo 360 Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package com.qihoo360.i; 18 | 19 | /** 20 | * 所有可查询的接口都从此interface继承 21 | * 在插件体系中,module是一种略高于interface的概念 22 | * 一个插件可导出一个到多个module,这些module可输出自己业务的各种interface 23 | * 24 | * @author RePlugin Team 25 | * 26 | */ 27 | public interface IModule { 28 | 29 | /** 30 | * 万能接口:当不能升级adapter.jar的时候再考虑使用 31 | * @param args 32 | * @return 33 | */ 34 | Object invoke(Object...args); 35 | } 36 | -------------------------------------------------------------------------------- /replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/i/IPlugin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2017 Qihoo 360 Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package com.qihoo360.i; 18 | 19 | 20 | /** 21 | * 此接口由插件负责导出 22 | * 表示一个具体的物理上的插件实体,例如barcode.jar 23 | * 具体导出细节可看Factory 24 | * 25 | * @author RePlugin Team 26 | * 27 | */ 28 | public interface IPlugin { 29 | 30 | /** 31 | * @param c 需要查询的interface的类 32 | * @return 33 | */ 34 | IModule query(Class c); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/loader/utils/PackageUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2017 Qihoo 360 Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package com.qihoo360.loader.utils; 18 | 19 | import android.content.pm.PackageInfo; 20 | import android.content.pm.PackageManager; 21 | 22 | import com.qihoo360.replugin.helper.LogDebug; 23 | 24 | /** 25 | * @author RePlugin Team 26 | */ 27 | public class PackageUtils { 28 | 29 | /** 30 | * 获取PackageInfo对象 31 | *

32 | * 注:getPackageArchiveInfo Android 2.x上,可能拿不到signatures,本可以通过反射去获取,但是考虑到会触发Android 的灰/黑名单,这个方法就不再继续适配2.X了 33 | * 34 | * @return 35 | */ 36 | public static PackageInfo getPackageArchiveInfo(PackageManager pm, String pkgFilePath, int flags) { 37 | PackageInfo info = null; 38 | try { 39 | info = pm.getPackageArchiveInfo(pkgFilePath, flags); 40 | } catch (Throwable e) { 41 | if (LogDebug.LOG) { 42 | e.printStackTrace(); 43 | } 44 | } 45 | 46 | return info; 47 | } 48 | } -------------------------------------------------------------------------------- /replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/loader2/ProcessStates.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2017 Qihoo 360 Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package com.qihoo360.loader2; 18 | 19 | /** 20 | * 保存自定义进程中,每个进程里的坑位信息 21 | * 22 | * @author RePlugin Team 23 | */ 24 | 25 | class ProcessStates { 26 | 27 | /** 28 | * 保存非默认 TaskAffinity 下,坑位的状态信息。 29 | */ 30 | TaskAffinityStates mTaskAffinityStates = new TaskAffinityStates(); 31 | 32 | /** 33 | * 保存默认 TaskAffinity 下,坑位的状态信息。 34 | */ 35 | LaunchModeStates mLaunchModeStates = new LaunchModeStates(); 36 | } 37 | -------------------------------------------------------------------------------- /replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/mobilesafe/api/AppVar.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2017 Qihoo 360 Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package com.qihoo360.mobilesafe.api; 18 | 19 | import android.content.Context; 20 | 21 | /** 22 | * @author RePlugin Team 23 | */ 24 | public class AppVar { 25 | 26 | /** 27 | * API模块内部使用,记得初始化 28 | */ 29 | public static Context sAppContext; 30 | } 31 | -------------------------------------------------------------------------------- /replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/mobilesafe/loader/s/DummyService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2017 Qihoo 360 Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package com.qihoo360.mobilesafe.loader.s; 18 | 19 | import android.app.Service; 20 | import android.content.Intent; 21 | import android.os.IBinder; 22 | 23 | /** 24 | * @author RePlugin Team 25 | */ 26 | public class DummyService extends Service { 27 | 28 | @Override 29 | public IBinder onBind(Intent intent) { 30 | return null; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/mobilesafe/parser/manifest/bean/ComponentBean.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2017 Qihoo 360 Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package com.qihoo360.mobilesafe.parser.manifest.bean; 18 | 19 | import android.content.IntentFilter; 20 | 21 | import java.util.List; 22 | 23 | /** 24 | * @author RePlugin Team 25 | */ 26 | public class ComponentBean { 27 | 28 | public String name; 29 | public List intentFilters; 30 | 31 | @Override 32 | public String toString() { 33 | return String.format("{name:%s, intent-filter.size():%s}", name, intentFilters.size()); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/DefaultRePluginCallbacks.java: -------------------------------------------------------------------------------- 1 | package com.qihoo360.replugin; 2 | 3 | import android.content.Context; 4 | 5 | /** 6 | * @deprecated Use RePluginCallbacks instead 7 | * @see RePluginCallbacks 8 | * @author RePlugin Team 9 | */ 10 | 11 | public class DefaultRePluginCallbacks extends RePluginCallbacks { 12 | 13 | /** 14 | * @deprecated Use RePluginCallbacks instead 15 | * @see RePluginCallbacks#RePluginCallbacks(Context) 16 | */ 17 | public DefaultRePluginCallbacks(Context context) { 18 | super(context); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/DefaultRePluginEventCallbacks.java: -------------------------------------------------------------------------------- 1 | package com.qihoo360.replugin; 2 | 3 | import android.content.Context; 4 | 5 | /** 6 | * @deprecated Use RePluginEventCallbacks instead 7 | * @see RePluginEventCallbacks 8 | * @author RePlugin Team 9 | */ 10 | 11 | public class DefaultRePluginEventCallbacks extends RePluginEventCallbacks { 12 | 13 | /** 14 | * @deprecated Use RePluginEventCallbacks instead 15 | * @see RePluginEventCallbacks#RePluginEventCallbacks(Context) 16 | */ 17 | public DefaultRePluginEventCallbacks(Context context) { 18 | super(context); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/IHostBinderFetcher.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2017 Qihoo 360 Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package com.qihoo360.replugin; 18 | 19 | import android.os.IBinder; 20 | 21 | /** 22 | * 用来实现主程序提供IBinder给其他插件 23 | *

24 | * 插件获取方法:Factory.query("main", "IShare"),返回值:IBinder 25 | *

26 | * TODO 未来会废弃Factory类,并做些调整 27 | * 28 | * @author RePlugin Team 29 | */ 30 | public interface IHostBinderFetcher { 31 | 32 | /** 33 | * 主程序需实现此方法,来返回一个IBinder对象,供插件使用 34 | * 35 | * @param module 模块名 36 | * @return 一个IBinder对象 37 | */ 38 | IBinder query(String module); 39 | } 40 | -------------------------------------------------------------------------------- /replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/base/AMSUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2017 Qihoo 360 Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package com.qihoo360.replugin.base; 18 | 19 | import android.app.ActivityManager; 20 | import android.content.Context; 21 | 22 | import java.util.List; 23 | 24 | /** 25 | * 和ActivityManagerService快速封装的一些接口 26 | * 27 | * @author RePlugin Team 28 | */ 29 | 30 | public class AMSUtils { 31 | 32 | /** 33 | * 无需抛出异常而调用getRunningAppProcesses方法 34 | * @param context context对象 35 | * @return RunningAppProcessInfo列表 36 | */ 37 | public static List getRunningAppProcessesNoThrows(Context context) { 38 | try { 39 | ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); 40 | return am.getRunningAppProcesses(); 41 | } catch (Throwable e) { 42 | // 可能AMS挂了,但最多返回空列表即可。毕竟不是很重要的流程 43 | e.printStackTrace(); 44 | } 45 | return null; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/component/dummy/DummyService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2017 Qihoo 360 Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package com.qihoo360.replugin.component.dummy; 18 | 19 | import android.app.Service; 20 | import android.content.ComponentName; 21 | import android.content.Intent; 22 | import android.os.IBinder; 23 | 24 | /** 25 | * 表示一个“仿造的”Service,启动后什么事情也不做

26 | * 此类可防止系统调用插件时因类找不到而崩溃。请参见 registerHookingClass 的说明 27 | * 28 | * @see com.qihoo360.replugin.RePlugin#registerHookingClass(String, ComponentName, Class) 29 | * @author RePlugin Team 30 | */ 31 | public class DummyService extends Service { 32 | 33 | @Override 34 | public void onCreate() { 35 | super.onCreate(); 36 | stopSelf(); 37 | } 38 | 39 | @Override 40 | public IBinder onBind(Intent intent) { 41 | return null; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/component/process/ProcessPitProviderLoader0.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2017 Qihoo 360 Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package com.qihoo360.replugin.component.process; 18 | 19 | /** 20 | * @author RePlugin Team 21 | */ 22 | public class ProcessPitProviderLoader0 extends ProcessPitProviderBase { 23 | 24 | } 25 | -------------------------------------------------------------------------------- /replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/component/process/ProcessPitProviderLoader1.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2017 Qihoo 360 Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package com.qihoo360.replugin.component.process; 18 | 19 | /** 20 | * @author RePlugin Team 21 | */ 22 | public class ProcessPitProviderLoader1 extends ProcessPitProviderBase { 23 | 24 | } 25 | -------------------------------------------------------------------------------- /replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/component/process/ProcessPitProviderP0.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2017 Qihoo 360 Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package com.qihoo360.replugin.component.process; 18 | 19 | /** 20 | * @author RePlugin Team 21 | */ 22 | public class ProcessPitProviderP0 extends ProcessPitProviderBase { 23 | } 24 | -------------------------------------------------------------------------------- /replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/component/process/ProcessPitProviderP1.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2017 Qihoo 360 Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package com.qihoo360.replugin.component.process; 18 | 19 | /** 20 | * @author RePlugin Team 21 | */ 22 | public class ProcessPitProviderP1 extends ProcessPitProviderBase { 23 | } 24 | -------------------------------------------------------------------------------- /replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/component/process/ProcessPitProviderP2.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2017 Qihoo 360 Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package com.qihoo360.replugin.component.process; 18 | 19 | /** 20 | * @author RePlugin Team 21 | */ 22 | public class ProcessPitProviderP2 extends ProcessPitProviderBase { 23 | } 24 | -------------------------------------------------------------------------------- /replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/component/process/ProcessPitProviderUI.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2017 Qihoo 360 Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package com.qihoo360.replugin.component.process; 18 | 19 | /** 20 | * @author RePlugin Team 21 | */ 22 | public class ProcessPitProviderUI extends ProcessPitProviderBase { 23 | 24 | } 25 | -------------------------------------------------------------------------------- /replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/component/provider/PluginPitProviderP0.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2017 Qihoo 360 Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package com.qihoo360.replugin.component.provider; 18 | 19 | /** 20 | * ProcessPitProviderLoader0 21 | * 22 | * @author RePlugin Team 23 | */ 24 | public class PluginPitProviderP0 extends PluginPitProviderBase { 25 | public static final String AUTHORITY = AUTHORITY_PREFIX + "0"; 26 | 27 | public PluginPitProviderP0() { 28 | super(AUTHORITY); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/component/provider/PluginPitProviderP1.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2017 Qihoo 360 Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package com.qihoo360.replugin.component.provider; 18 | 19 | /** 20 | * ProcessPitProviderLoader1 21 | * 22 | * @author RePlugin Team 23 | */ 24 | public class PluginPitProviderP1 extends PluginPitProviderBase { 25 | public static final String AUTHORITY = AUTHORITY_PREFIX + "1"; 26 | 27 | public PluginPitProviderP1() { 28 | super(AUTHORITY); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/component/provider/PluginPitProviderP2.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2017 Qihoo 360 Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package com.qihoo360.replugin.component.provider; 18 | 19 | /** 20 | * ProcessProviderLoader2 21 | * 22 | * @author RePlugin Team 23 | */ 24 | public class PluginPitProviderP2 extends PluginPitProviderBase { 25 | public static final String AUTHORITY = AUTHORITY_PREFIX + "2"; 26 | 27 | public PluginPitProviderP2() { 28 | super(AUTHORITY); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/component/provider/PluginPitProviderPersist.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2017 Qihoo 360 Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package com.qihoo360.replugin.component.provider; 18 | 19 | /** 20 | * @author RePlugin Team 21 | */ 22 | public class PluginPitProviderPersist extends PluginPitProviderBase { 23 | public static final String AUTHORITY = AUTHORITY_PREFIX + "PSP"; 24 | 25 | public PluginPitProviderPersist() { 26 | super(AUTHORITY); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/component/provider/PluginPitProviderUI.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2017 Qihoo 360 Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package com.qihoo360.replugin.component.provider; 18 | 19 | /** 20 | * @author RePlugin Team 21 | */ 22 | public class PluginPitProviderUI extends PluginPitProviderBase { 23 | public static final String AUTHORITY = AUTHORITY_PREFIX + "UIP"; 24 | 25 | public PluginPitProviderUI() { 26 | super(AUTHORITY); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /replugin-host-library/settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2017 Qihoo 360 Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | pluginManagement { 17 | repositories { 18 | google() 19 | mavenCentral() 20 | gradlePluginPortal() 21 | mavenLocal() 22 | maven { 23 | allowInsecureProtocol = true 24 | url "http://maven.geelib.360.cn/nexus/repository/replugin/"} 25 | } 26 | } 27 | dependencyResolutionManagement { 28 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) 29 | repositories { 30 | google() 31 | mavenCentral() 32 | mavenLocal() 33 | maven { 34 | allowInsecureProtocol = true 35 | url "http://maven.geelib.360.cn/nexus/repository/replugin/"} 36 | } 37 | } 38 | 39 | rootProject.name = "replugin-host-library" 40 | include ':replugin-host-lib' 41 | -------------------------------------------------------------------------------- /replugin-plugin-gradle/README.md: -------------------------------------------------------------------------------- 1 | # RePlugin Plugin Gradle 2 | 3 | RePlugin Plugin Gradle是一个Gradle插件,由 **插件** 负责引入。 4 | 5 | 该Gradle插件主要负责在插件的编译期中做一些事情,是“动态编译方案”的主要实现者。此外,开发者可通过修改其属性而做一些自定义的操作。 6 | 7 | 大致包括: 8 | 9 | * 动态修改主要调用代码,改为调用RePlugin Plugin Gradle(如Activity的继承、Provider的重定向等) 10 | 11 | 开发者需要依赖此Gradle插件,以实现对RePlugin的接入。请参见WiKi以了解接入方法。 12 | 13 | 有关RePlugin Host Gradle的详细描述,请访问我们的WiKi,以了解更多的内容。 14 | (文档正在完善,请耐心等待) -------------------------------------------------------------------------------- /replugin-plugin-gradle/config.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2017 Qihoo 360 Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | * 16 | */ 17 | 18 | ext { 19 | config = this.&readConfig() 20 | } 21 | 22 | def readConfig() { 23 | Properties configProperties = new Properties() 24 | file('config.properties').withInputStream { 25 | configProperties.load(it) 26 | } 27 | configProperties 28 | } 29 | 30 | -------------------------------------------------------------------------------- /replugin-plugin-gradle/config.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2005-2017 Qihoo 360 Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | # use this file except in compliance with the License. You may obtain a copy of 6 | # the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed To in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | # License for the specific language governing permissions and limitations under 14 | # the License. 15 | # 16 | # 17 | 18 | repoUrl = 19 | 20 | groupId = com.qihoo360.replugin 21 | artifactId = replugin-plugin-gradle 22 | 23 | # --- android config --- 24 | compileSdkVersion = 21 25 | buildToolsVersion = 23.0.3 26 | minSdkVersion = 10 27 | targetSdkVersion = 21 28 | 29 | # --- user info --- 30 | # 注意:1、仅研发一组同事能修改此URL; 31 | # 2、切勿去除,以免误上传到Maven中心库,引发代码泄露危机。 32 | username = 33 | password = 34 | 35 | -------------------------------------------------------------------------------- /replugin-plugin-gradle/gradle.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2005-2017 Qihoo 360 Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | # use this file except in compliance with the License. You may obtain a copy of 6 | # the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed To in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | # License for the specific language governing permissions and limitations under 14 | # the License. 15 | # 16 | # 17 | 18 | # Project-wide Gradle settings. 19 | 20 | # IDE (e.g. Android Studio) users: 21 | # Gradle settings configured through the IDE *will override* 22 | # any settings specified in this file. 23 | 24 | # For more details on how to configure your build environment visit 25 | # http://www.gradle.org/docs/current/userguide/build_environment.html 26 | 27 | # Specifies the JVM arguments used for the daemon process. 28 | # The setting is particularly useful for tweaking memory settings. 29 | org.gradle.jvmargs=-Xmx1536m 30 | 31 | # When configured, Gradle will run in incubating parallel mode. 32 | # This option should only be used with decoupled projects. More details, visit 33 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 34 | # org.gradle.parallel=true 35 | -------------------------------------------------------------------------------- /replugin-plugin-gradle/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-plugin-gradle/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /replugin-plugin-gradle/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2005-2017 Qihoo 360 Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | # use this file except in compliance with the License. You may obtain a copy of 6 | # the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed To in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | # License for the specific language governing permissions and limitations under 14 | # the License. 15 | # 16 | # 17 | 18 | #Mon Dec 28 10:00:20 PST 2015 19 | distributionBase=GRADLE_USER_HOME 20 | distributionPath=wrapper/dists 21 | zipStoreBase=GRADLE_USER_HOME 22 | zipStorePath=wrapper/dists 23 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip 24 | -------------------------------------------------------------------------------- /replugin-plugin-gradle/src/main/groovy/com/qihoo360/replugin/gradle/plugin/injector/BaseInjector.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2017 Qihoo 360 Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | * 16 | */ 17 | 18 | package com.qihoo360.replugin.gradle.plugin.injector 19 | 20 | import org.gradle.api.Project 21 | 22 | /** 23 | * @author RePlugin Team 24 | */ 25 | public abstract class BaseInjector implements IClassInjector { 26 | 27 | protected Project project 28 | 29 | protected String variantDir 30 | 31 | @Override 32 | public Object name() { 33 | return getClass().getSimpleName() 34 | } 35 | 36 | public void setProject(Project project) { 37 | this.project = project; 38 | } 39 | 40 | public void setVariantDir(String variantDir) { 41 | this.variantDir = variantDir; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /replugin-plugin-gradle/src/main/groovy/com/qihoo360/replugin/gradle/plugin/injector/IClassInjector.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2017 Qihoo 360 Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | * 16 | */ 17 | 18 | package com.qihoo360.replugin.gradle.plugin.injector 19 | 20 | import javassist.ClassPool 21 | import org.gradle.api.Project 22 | 23 | /** 24 | * @author RePlugin Team 25 | */ 26 | interface IClassInjector { 27 | 28 | /** 29 | * 设置project对象 30 | * @param project 31 | */ 32 | void setProject(Project project) 33 | 34 | /** 35 | * 设置variant目录关键串 36 | * @param variantDir 37 | */ 38 | void setVariantDir(String variantDir) 39 | /** 40 | * 注入器名称 41 | */ 42 | def name() 43 | 44 | /** 45 | * 对 dir 目录中的 Class 进行注入 46 | */ 47 | def injectClass(ClassPool pool, String dir, Map config) 48 | 49 | } 50 | -------------------------------------------------------------------------------- /replugin-plugin-gradle/src/main/groovy/com/qihoo360/replugin/gradle/plugin/inner/CommonData.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2017 Qihoo 360 Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | * 16 | */ 17 | 18 | package com.qihoo360.replugin.gradle.plugin.inner 19 | 20 | /** 21 | * @author RePlugin Team 22 | */ 23 | public class CommonData { 24 | 25 | /** 保存类文件名和 class 文件路径的关系 */ 26 | def static classAndPath = [:] 27 | 28 | /** App Module 的名称, 如 ':app', 传 '' 时,使用项目根目录为 App Module */ 29 | def static String appModule 30 | 31 | def static String appPackage 32 | 33 | /** 执行 LoaderActivity 替换时,不需要替换的 Activity */ 34 | def static ignoredActivities = [] 35 | 36 | def static putClassAndPath(def className, def classFilePath) { 37 | classAndPath.put(className, classFilePath) 38 | } 39 | 40 | def static getClassPath(def className) { 41 | return classAndPath.get(className) 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /replugin-plugin-gradle/src/main/groovy/com/qihoo360/replugin/gradle/plugin/manifest/IManifest.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2017 Qihoo 360 Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | * 16 | */ 17 | 18 | package com.qihoo360.replugin.gradle.plugin.manifest; 19 | 20 | /** 21 | * @author RePlugin Team 22 | */ 23 | public interface IManifest { 24 | 25 | /** 26 | * 获取 AndroidManifest 中声明的所有 Activity 27 | */ 28 | List getActivities() 29 | 30 | /** 31 | * 应用程序包名 32 | */ 33 | String getPackageName() 34 | } 35 | -------------------------------------------------------------------------------- /replugin-plugin-gradle/src/main/resources/META-INF/gradle-plugins/replugin-plugin-gradle.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2005-2017 Qihoo 360 Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | # use this file except in compliance with the License. You may obtain a copy of 6 | # the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed To in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | # License for the specific language governing permissions and limitations under 14 | # the License. 15 | # 16 | # 17 | 18 | implementation-class=com.qihoo360.replugin.gradle.plugin.ReClassPlugin -------------------------------------------------------------------------------- /replugin-plugin-library/README.md: -------------------------------------------------------------------------------- 1 | # RePlugin Plugin Library 2 | 3 | RePlugin Plugin Library是一个Java工程,由 **插件** 负责引入。 4 | 5 | 该类主要提供通过“Java反射”来调用主程序中 RePlugin Host Library 的相关接口,并提供“双向通信”的能力。 6 | 7 | 开发者需要依赖此Library,以让您的单品工程变成“插件”。请参见WiKi以了解接入方法。 8 | 9 | 有关RePlugin Plugin Library的详细描述,请访问我们的WiKi,以了解更多的内容。 -------------------------------------------------------------------------------- /replugin-plugin-library/build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2017 Qihoo 360 Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 18 | 19 | plugins { 20 | id 'com.android.application' version '7.4.2' apply false 21 | id 'maven-publish' 22 | id "com.jfrog.bintray" version "1.+" 23 | } 24 | 25 | configure(allprojects - project(':replugin-plugin-lib')) { 26 | println "applying java plugin to $project" 27 | apply plugin: 'java-library' 28 | } 29 | 30 | java { 31 | sourceCompatibility = JavaVersion.VERSION_1_8 32 | targetCompatibility = JavaVersion.VERSION_1_8 33 | } 34 | -------------------------------------------------------------------------------- /replugin-plugin-library/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-plugin-library/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /replugin-plugin-library/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2005-2017 Qihoo 360 Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | # use this file except in compliance with the License. You may obtain a copy of 6 | # the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed To in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | # License for the specific language governing permissions and limitations under 14 | # the License. 15 | # 16 | 17 | #Wed Aug 31 14:09:54 CST 2016 18 | distributionBase=GRADLE_USER_HOME 19 | distributionPath=wrapper/dists 20 | zipStoreBase=GRADLE_USER_HOME 21 | zipStorePath=wrapper/dists 22 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip 23 | -------------------------------------------------------------------------------- /replugin-plugin-library/replugin-plugin-lib/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 ./sdk/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 | -repackageclasses 'library' 27 | 28 | -keep class com.qihoo360.replugin.loader.a.** { public *; } 29 | -keep class com.qihoo360.replugin.loader.b.** { public *; } 30 | -keep class com.qihoo360.replugin.loader.p.** { public *; } 31 | -keep class com.qihoo360.replugin.loader.s.** { public *; } 32 | -keep class com.qihoo360.replugin.base.IPC { public *; } 33 | -keep class com.qihoo360.replugin.Entry { *; } 34 | -keep class com.qihoo360.replugin.RePlugin { public *; } 35 | -keep class com.qihoo360.replugin.model.PluginInfo { public *; } 36 | 37 | -------------------------------------------------------------------------------- /replugin-plugin-library/replugin-plugin-lib/replugin-library-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in ./sdk/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 | -keep class com.qihoo360.replugin.Entry { *; } 27 | -------------------------------------------------------------------------------- /replugin-plugin-library/replugin-plugin-lib/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /replugin-plugin-library/replugin-plugin-lib/src/main/aidl/com/qihoo360/loader2/IPlugin.aidl: -------------------------------------------------------------------------------- 1 | package com.qihoo360.loader2; 2 | 3 | /** 4 | * @author RePlugin Team 5 | */ 6 | interface IPlugin { 7 | 8 | IBinder query(String name); 9 | } 10 | -------------------------------------------------------------------------------- /replugin-plugin-library/replugin-plugin-lib/src/main/aidl/com/qihoo360/replugin/IBinderGetter.aidl: -------------------------------------------------------------------------------- 1 | package com.qihoo360.replugin; 2 | 3 | /** 4 | * Binder的获取器,可用于延迟加载IBinder的情况。 5 | *

6 | * 目前用于: 7 | *

8 | * * RePlugin.registerGlobalBinderDelayed 9 | * 10 | * @author RePlugin Team 11 | */ 12 | interface IBinderGetter { 13 | 14 | /** 15 | * 获取IBinder对象 16 | */ 17 | IBinder get(); 18 | } 19 | -------------------------------------------------------------------------------- /replugin-plugin-library/replugin-plugin-lib/src/main/java/com/qihoo360/replugin/i/IPluginManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2017 Qihoo 360 Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package com.qihoo360.replugin.i; 18 | 19 | 20 | /** 21 | * 负责插件和插件之间的interface互通,可通过插件Entry得到,也可通过wrapper类Factory直接调用 22 | * 23 | * @author RePlugin Team 24 | */ 25 | public interface IPluginManager { 26 | 27 | /** 28 | * 自动分配插件进程 29 | */ 30 | int PROCESS_AUTO = Integer.MIN_VALUE; 31 | 32 | /** 33 | * UI进程 34 | */ 35 | int PROCESS_UI = -1; 36 | 37 | /** 38 | * 常驻进程 39 | */ 40 | int PROCESS_PERSIST = -2; 41 | } 42 | -------------------------------------------------------------------------------- /replugin-plugin-library/settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2017 Qihoo 360 Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | pluginManagement { 17 | repositories { 18 | google() 19 | mavenCentral() 20 | gradlePluginPortal() 21 | mavenLocal() 22 | maven { 23 | allowInsecureProtocol = true 24 | url "http://maven.geelib.360.cn/nexus/repository/replugin/"} 25 | } 26 | } 27 | dependencyResolutionManagement { 28 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) 29 | repositories { 30 | google() 31 | mavenCentral() 32 | mavenLocal() 33 | maven { 34 | allowInsecureProtocol = true 35 | url "http://maven.geelib.360.cn/nexus/repository/replugin/"} 36 | } 37 | } 38 | 39 | rootProject.name = "replugin-plugin-library" 40 | include ':replugin-plugin-lib' -------------------------------------------------------------------------------- /replugin-sample-extra/README.md: -------------------------------------------------------------------------------- 1 | # replugin-sample-extra 中是一些更高级的示例 2 | 3 | 其中,replugin-sample-extra/fresco 是对 Fresco 的使用,实现了宿主和插件公用一份Fresco代码。 4 | 5 | FrescoHost是宿主代码,FrescoPlugin是插件代码。 6 | -------------------------------------------------------------------------------- /replugin-sample-extra/fresco/FrescoHost/.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 | -------------------------------------------------------------------------------- /replugin-sample-extra/fresco/FrescoHost/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /replugin-sample-extra/fresco/FrescoHost/app/libs/armeabi/libimagepipeline.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample-extra/fresco/FrescoHost/app/libs/armeabi/libimagepipeline.so -------------------------------------------------------------------------------- /replugin-sample-extra/fresco/FrescoHost/app/libs/drawee-modified-1.7.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample-extra/fresco/FrescoHost/app/libs/drawee-modified-1.7.1.jar -------------------------------------------------------------------------------- /replugin-sample-extra/fresco/FrescoHost/app/libs/fbcore-1.7.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample-extra/fresco/FrescoHost/app/libs/fbcore-1.7.1.jar -------------------------------------------------------------------------------- /replugin-sample-extra/fresco/FrescoHost/app/libs/fresco-1.7.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample-extra/fresco/FrescoHost/app/libs/fresco-1.7.1.jar -------------------------------------------------------------------------------- /replugin-sample-extra/fresco/FrescoHost/app/libs/imagepipeline-1.7.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample-extra/fresco/FrescoHost/app/libs/imagepipeline-1.7.1.jar -------------------------------------------------------------------------------- /replugin-sample-extra/fresco/FrescoHost/app/libs/imagepipeline-base-1.7.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample-extra/fresco/FrescoHost/app/libs/imagepipeline-base-1.7.1.jar -------------------------------------------------------------------------------- /replugin-sample-extra/fresco/FrescoHost/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 D:\Android\android-sdk/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 | -------------------------------------------------------------------------------- /replugin-sample-extra/fresco/FrescoHost/app/src/main/assets/plugins/plugin1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Qihoo360/RePlugin/36db020bf1908236c00306540c2021a648d04a06/replugin-sample-extra/fresco/FrescoHost/app/src/main/assets/plugins/plugin1.jar -------------------------------------------------------------------------------- /replugin-sample-extra/fresco/FrescoHost/app/src/main/java/com/facebook/fresco/patch/FrescoPatch.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2017 Qihoo 360 Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package com.facebook.fresco.patch; 18 | 19 | import android.content.Context; 20 | 21 | import com.facebook.drawee.generic.GenericDraweeHierarchyInflater; 22 | import com.facebook.drawee.view.SimpleDraweeView; 23 | 24 | /** 25 | * 为 “自己编译好的fresco drawee 模块(对应drawee-modified-1.7.1.jar)” 设置回调接口 26 | * 27 | * @author RePlugin Team 28 | */ 29 | public class FrescoPatch { 30 | 31 | /** 32 | * 初始化 33 | *

34 | * 为SimpleDraweeView设置回调 35 | * 为GenericDraweeHierarchyInflater设置回调 36 | */ 37 | public static void initialize(Context context) { 38 | DraweeStyleableCallbackImpl draweeStyleableCallback = new DraweeStyleableCallbackImpl(context); 39 | SimpleDraweeView.setDraweeStyleableCallback(draweeStyleableCallback); 40 | GenericDraweeHierarchyInflater.setDraweeStyleableCallback(draweeStyleableCallback); 41 | } 42 | } -------------------------------------------------------------------------------- /replugin-sample-extra/fresco/FrescoHost/app/src/main/java/com/qihoo360/replugin/fresco/host/HostFrescoActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2017 Qihoo 360 Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package com.qihoo360.replugin.fresco.host; 18 | 19 | import android.net.Uri; 20 | import android.os.Bundle; 21 | import android.support.v7.app.AppCompatActivity; 22 | 23 | import com.facebook.drawee.view.SimpleDraweeView; 24 | 25 | /** 26 | * 宿主中使用fresco 27 | * 28 | * @author RePlugin Team 29 | */ 30 | public class HostFrescoActivity extends AppCompatActivity { 31 | 32 | private static final String IMAGE_URL = "https://img1.doubanio.com/view/photo/large/public/p2504463708.jpg"; 33 | 34 | @Override 35 | protected void onCreate(Bundle savedInstanceState) { 36 | super.onCreate(savedInstanceState); 37 | setContentView(R.layout.activity_host_fresco); 38 | 39 | SimpleDraweeView draweeView = (SimpleDraweeView) findViewById(R.id.image); 40 | draweeView.setImageURI(Uri.parse(IMAGE_URL)); 41 | } 42 | } -------------------------------------------------------------------------------- /replugin-sample-extra/fresco/FrescoHost/app/src/main/res/layout/activity_host_fresco.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 13 | 14 | -------------------------------------------------------------------------------- /replugin-sample-extra/fresco/FrescoHost/app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 15 | 16 |