├── .commitlintrc.yml ├── .github ├── actions │ ├── post-build │ │ └── action.yml │ └── pre-build │ │ └── action.yml └── workflows │ ├── check-build-test.yml │ └── release.yml ├── .gitignore ├── .idea └── codeStyles │ ├── Project.xml │ └── codeStyleConfig.xml ├── CONTRIBUTING.md ├── LICENSE.txt ├── PRIVACY.md ├── README.md ├── build.gradle ├── buildScripts └── gradle │ ├── common.gradle │ ├── fix_issue_1263.gradle │ ├── maven.gradle │ └── versions.properties ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── pics └── run-sample-host-in-ide.png ├── projects ├── sample │ ├── README.md │ ├── dynamic-apk │ │ ├── sample-hello-api-holder │ │ │ ├── .gitignore │ │ │ ├── README.md │ │ │ ├── build.gradle │ │ │ ├── proguard-rules.pro │ │ │ └── src │ │ │ │ └── main │ │ │ │ ├── AndroidManifest.xml │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── tencent │ │ │ │ └── shadow │ │ │ │ └── sample │ │ │ │ └── apk │ │ │ │ └── hello │ │ │ │ ├── DynamicHello.java │ │ │ │ ├── HelloImplLoader.java │ │ │ │ └── HelloWorldUpdater.java │ │ ├── sample-hello-api │ │ │ ├── .gitignore │ │ │ ├── README.md │ │ │ ├── build.gradle │ │ │ ├── proguard-rules.pro │ │ │ └── src │ │ │ │ └── main │ │ │ │ ├── AndroidManifest.xml │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── tencent │ │ │ │ └── shadow │ │ │ │ └── sample │ │ │ │ └── api │ │ │ │ └── hello │ │ │ │ ├── HelloFactory.java │ │ │ │ ├── IHelloWorld.java │ │ │ │ └── IHelloWorldImpl.java │ │ ├── sample-hello-apk │ │ │ ├── .gitignore │ │ │ ├── build.gradle │ │ │ ├── proguard-rules.pro │ │ │ └── src │ │ │ │ └── main │ │ │ │ ├── AndroidManifest.xml │ │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── tencent │ │ │ │ │ └── shadow │ │ │ │ │ ├── dynamic │ │ │ │ │ └── impl │ │ │ │ │ │ ├── HelloFactoryImpl.java │ │ │ │ │ │ └── WhiteList.java │ │ │ │ │ └── sample │ │ │ │ │ └── api │ │ │ │ │ └── hello │ │ │ │ │ └── SampleHelloWorld.java │ │ │ │ └── res │ │ │ │ └── layout │ │ │ │ └── activity_load_plugin.xml │ │ └── sample-hello-host │ │ │ ├── .gitignore │ │ │ ├── build.gradle │ │ │ ├── proguard-rules.pro │ │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ └── java │ │ │ └── com │ │ │ └── tencent │ │ │ └── shadow │ │ │ └── sample │ │ │ └── host │ │ │ ├── AndroidLogLoggerFactory.java │ │ │ ├── HostApplication.java │ │ │ ├── MainActivity.java │ │ │ ├── PluginHelper.java │ │ │ └── api │ │ │ ├── FixedPathPmUpdater.java │ │ │ └── HelloWorldApiHolder.java │ ├── maven │ │ ├── host-project │ │ │ ├── .gitignore │ │ │ ├── build.gradle │ │ │ ├── gradle.properties │ │ │ ├── gradle │ │ │ │ └── wrapper │ │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ │ └── gradle-wrapper.properties │ │ │ ├── gradlew │ │ │ ├── gradlew.bat │ │ │ ├── introduce-shadow-lib │ │ │ │ ├── .gitignore │ │ │ │ ├── build.gradle │ │ │ │ ├── proguard-rules.pro │ │ │ │ └── src │ │ │ │ │ └── main │ │ │ │ │ ├── AndroidManifest.xml │ │ │ │ │ ├── java │ │ │ │ │ └── com │ │ │ │ │ │ └── tencent │ │ │ │ │ │ └── shadow │ │ │ │ │ │ └── sample │ │ │ │ │ │ └── introduce_shadow_lib │ │ │ │ │ │ ├── AndroidLoggerFactory.java │ │ │ │ │ │ ├── FixedPathPmUpdater.java │ │ │ │ │ │ ├── InitApplication.java │ │ │ │ │ │ └── MainPluginProcessService.java │ │ │ │ │ └── res │ │ │ │ │ └── values │ │ │ │ │ └── themes.xml │ │ │ ├── sample-host │ │ │ │ ├── .gitignore │ │ │ │ ├── build.gradle │ │ │ │ ├── proguard-rules.pro │ │ │ │ └── src │ │ │ │ │ └── main │ │ │ │ │ ├── AndroidManifest.xml │ │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── tencent │ │ │ │ │ └── shadow │ │ │ │ │ └── sample │ │ │ │ │ └── host │ │ │ │ │ ├── MainActivity.java │ │ │ │ │ └── MyApplication.java │ │ │ └── settings.gradle │ │ ├── manager-project │ │ │ ├── .gitignore │ │ │ ├── build.gradle │ │ │ ├── gradle.properties │ │ │ ├── gradle │ │ │ │ └── wrapper │ │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ │ └── gradle-wrapper.properties │ │ │ ├── gradlew │ │ │ ├── gradlew.bat │ │ │ ├── sample-manager │ │ │ │ ├── .gitignore │ │ │ │ ├── build.gradle │ │ │ │ ├── proguard-rules.pro │ │ │ │ └── src │ │ │ │ │ └── main │ │ │ │ │ ├── AndroidManifest.xml │ │ │ │ │ ├── aidl │ │ │ │ │ └── com │ │ │ │ │ │ └── tencent │ │ │ │ │ │ └── shadow │ │ │ │ │ │ └── sample │ │ │ │ │ │ └── plugin │ │ │ │ │ │ └── IMyAidlInterface.aidl │ │ │ │ │ ├── java │ │ │ │ │ └── com │ │ │ │ │ │ └── tencent │ │ │ │ │ │ └── shadow │ │ │ │ │ │ ├── dynamic │ │ │ │ │ │ └── impl │ │ │ │ │ │ │ ├── ManagerFactoryImpl.java │ │ │ │ │ │ │ └── WhiteList.java │ │ │ │ │ │ └── sample │ │ │ │ │ │ └── manager │ │ │ │ │ │ ├── Constant.java │ │ │ │ │ │ ├── FastPluginManager.java │ │ │ │ │ │ └── SamplePluginManager.java │ │ │ │ │ └── res │ │ │ │ │ └── layout │ │ │ │ │ └── activity_load_plugin.xml │ │ │ └── settings.gradle │ │ └── plugin-project │ │ │ ├── .gitignore │ │ │ ├── build.gradle │ │ │ ├── gradle.properties │ │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ └── gradle-wrapper.properties │ │ │ ├── gradlew │ │ │ ├── gradlew.bat │ │ │ ├── plugin-app │ │ │ ├── .gitignore │ │ │ ├── build.gradle │ │ │ ├── proguard-rules.pro │ │ │ └── src │ │ │ │ └── main │ │ │ │ ├── AndroidManifest.xml │ │ │ │ ├── aidl │ │ │ │ └── com │ │ │ │ │ └── tencent │ │ │ │ │ └── shadow │ │ │ │ │ └── sample │ │ │ │ │ └── plugin │ │ │ │ │ └── IMyAidlInterface.aidl │ │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── tencent │ │ │ │ │ └── shadow │ │ │ │ │ └── sample │ │ │ │ │ └── plugin │ │ │ │ │ ├── MainActivity.java │ │ │ │ │ └── MyService.java │ │ │ │ └── res │ │ │ │ ├── layout │ │ │ │ └── activity_main.xml │ │ │ │ └── values │ │ │ │ ├── colors.xml │ │ │ │ ├── strings.xml │ │ │ │ └── styles.xml │ │ │ ├── sample-loader │ │ │ ├── .gitignore │ │ │ ├── build.gradle │ │ │ ├── proguard-rules.pro │ │ │ └── src │ │ │ │ └── main │ │ │ │ ├── AndroidManifest.xml │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── tencent │ │ │ │ └── shadow │ │ │ │ ├── dynamic │ │ │ │ └── loader │ │ │ │ │ └── impl │ │ │ │ │ └── CoreLoaderFactoryImpl.java │ │ │ │ └── sample │ │ │ │ └── loader │ │ │ │ ├── SampleComponentManager.java │ │ │ │ └── SamplePluginLoader.java │ │ │ ├── sample-runtime │ │ │ ├── .gitignore │ │ │ ├── build.gradle │ │ │ ├── proguard-rules.pro │ │ │ └── src │ │ │ │ └── main │ │ │ │ ├── AndroidManifest.xml │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── tencent │ │ │ │ └── shadow │ │ │ │ └── sample │ │ │ │ └── runtime │ │ │ │ ├── PluginDefaultProxyActivity.java │ │ │ │ ├── PluginSingleInstance1ProxyActivity.java │ │ │ │ └── PluginSingleTask1ProxyActivity.java │ │ │ └── settings.gradle │ └── source │ │ ├── sample-constant │ │ ├── .gitignore │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ └── java │ │ │ └── com │ │ │ └── tencent │ │ │ └── shadow │ │ │ └── sample │ │ │ └── constant │ │ │ └── Constant.java │ │ ├── sample-host-lib │ │ ├── .gitignore │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ ├── sample-host-lib.pro │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── tencent │ │ │ │ └── shadow │ │ │ │ └── sample │ │ │ │ └── host │ │ │ │ └── lib │ │ │ │ ├── HostAddPluginViewContainer.java │ │ │ │ ├── HostAddPluginViewContainerHolder.java │ │ │ │ ├── HostUiLayerProvider.java │ │ │ │ └── LoadPluginCallback.java │ │ │ └── res │ │ │ └── layout │ │ │ └── host_ui_layer_layout.xml │ │ ├── sample-host │ │ ├── .gitignore │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── tencent │ │ │ │ └── shadow │ │ │ │ └── sample │ │ │ │ └── host │ │ │ │ ├── AndroidLogLoggerFactory.java │ │ │ │ ├── HostApplication.java │ │ │ │ ├── MainActivity.java │ │ │ │ ├── Plugin2ProcessPPS.java │ │ │ │ ├── PluginHelper.java │ │ │ │ ├── PluginLoadActivity.java │ │ │ │ ├── PluginProcessPPS.java │ │ │ │ ├── manager │ │ │ │ ├── FixedPathPmUpdater.java │ │ │ │ └── Shadow.java │ │ │ │ └── plugin_view │ │ │ │ ├── HostAddPluginViewActivity.java │ │ │ │ └── MainProcessManagerReceiver.java │ │ │ └── res │ │ │ ├── layout │ │ │ ├── activity_jump_to_plugin.xml │ │ │ ├── activity_load.xml │ │ │ └── part_key_adapter.xml │ │ │ └── values │ │ │ ├── strings.xml │ │ │ └── themes.xml │ │ ├── sample-manager │ │ ├── .gitignore │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── tencent │ │ │ │ └── shadow │ │ │ │ ├── dynamic │ │ │ │ └── impl │ │ │ │ │ ├── ManagerFactoryImpl.java │ │ │ │ │ └── WhiteList.java │ │ │ │ └── sample │ │ │ │ └── manager │ │ │ │ ├── FastPluginManager.java │ │ │ │ └── SamplePluginManager.java │ │ │ └── res │ │ │ └── layout │ │ │ └── activity_load_plugin.xml │ │ └── sample-plugin │ │ ├── sample-app │ │ ├── .gitignore │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── assets │ │ │ └── web │ │ │ │ └── test.html │ │ │ ├── java │ │ │ └── com │ │ │ │ └── tencent │ │ │ │ └── shadow │ │ │ │ └── sample │ │ │ │ └── plugin │ │ │ │ └── app │ │ │ │ └── lib │ │ │ │ ├── UseCaseApplication.java │ │ │ │ └── usecases │ │ │ │ ├── activity │ │ │ │ ├── TestActivityOnCreate.java │ │ │ │ ├── TestActivityOptionMenu.java │ │ │ │ ├── TestActivityOrientation.java │ │ │ │ ├── TestActivityReCreate.java │ │ │ │ ├── TestActivityReCreateBySystem.java │ │ │ │ ├── TestActivitySetTheme.java │ │ │ │ └── TestActivityWindowSoftMode.java │ │ │ │ ├── application │ │ │ │ └── TestApplicationActivity.java │ │ │ │ ├── context │ │ │ │ ├── ActivityContextSubDirTestActivity.java │ │ │ │ ├── ApplicationContextSubDirTestActivity.java │ │ │ │ └── SubDirContextThemeWrapperTestActivity.java │ │ │ │ ├── dialog │ │ │ │ ├── TestDialog.java │ │ │ │ └── TestDialogActivity.java │ │ │ │ ├── fragment │ │ │ │ ├── TestDialogFragment.java │ │ │ │ ├── TestDialogFragmentActivity.java │ │ │ │ ├── TestDynamicFragmentActivity.java │ │ │ │ ├── TestFragment.java │ │ │ │ └── TestXmlFragmentActivity.java │ │ │ │ ├── host_communication │ │ │ │ └── PluginUseHostClassActivity.java │ │ │ │ ├── packagemanager │ │ │ │ └── TestPackageManagerActivity.java │ │ │ │ ├── provider │ │ │ │ ├── TestDBContentProviderActivity.java │ │ │ │ ├── TestDBHelper.java │ │ │ │ ├── TestFileProviderActivity.java │ │ │ │ ├── TestProvider.java │ │ │ │ └── TestProviderInfo.java │ │ │ │ ├── receiver │ │ │ │ ├── MyReceiver.java │ │ │ │ ├── TestDynamicReceiverActivity.java │ │ │ │ └── TestReceiverActivity.java │ │ │ │ ├── service │ │ │ │ └── HostAddPluginViewService.java │ │ │ │ └── webview │ │ │ │ └── WebViewActivity.java │ │ │ └── res │ │ │ ├── anim │ │ │ └── dialog_exit_fade_out.xml │ │ │ ├── drawable │ │ │ ├── collapse.png │ │ │ ├── expanded.png │ │ │ ├── selector_group.xml │ │ │ └── selector_item.xml │ │ │ ├── layout │ │ │ ├── activity_test_file_provider.xml │ │ │ ├── activity_test_re_create_by_system.xml │ │ │ ├── layout_activity_lifecycle.xml │ │ │ ├── layout_activity_settheme.xml │ │ │ ├── layout_common.xml │ │ │ ├── layout_dialog.xml │ │ │ ├── layout_dialog_activity.xml │ │ │ ├── layout_fragment_activity.xml │ │ │ ├── layout_fragment_test.xml │ │ │ ├── layout_fragment_xml_activity.xml │ │ │ ├── layout_host_add_plugin_view.xml │ │ │ ├── layout_orientation.xml │ │ │ ├── layout_packagemanager.xml │ │ │ ├── layout_provider_db.xml │ │ │ ├── layout_receiver.xml │ │ │ ├── layout_recreate.xml │ │ │ ├── layout_result.xml │ │ │ ├── layout_service.xml │ │ │ ├── layout_softmode.xml │ │ │ └── layout_test_view_cons_cache.xml │ │ │ ├── menu │ │ │ └── case_test_activity_option_menu.xml │ │ │ ├── values-v21 │ │ │ └── themes.xml │ │ │ └── values │ │ │ ├── strings.xml │ │ │ ├── styles.xml │ │ │ └── themes.xml │ │ ├── sample-base-lib │ │ ├── .gitignore │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── tencent │ │ │ │ └── shadow │ │ │ │ └── sample │ │ │ │ └── plugin │ │ │ │ └── app │ │ │ │ └── lib │ │ │ │ └── gallery │ │ │ │ ├── BaseActivity.java │ │ │ │ ├── MainActivity.java │ │ │ │ ├── TestApplication.java │ │ │ │ ├── cases │ │ │ │ ├── UseCaseManager.java │ │ │ │ ├── UseCaseSummaryFragment.java │ │ │ │ └── entity │ │ │ │ │ ├── UseCase.java │ │ │ │ │ └── UseCaseCategory.java │ │ │ │ ├── splash │ │ │ │ ├── ISplashAnimation.java │ │ │ │ ├── SplashActivity.java │ │ │ │ └── SplashAnimation.java │ │ │ │ └── util │ │ │ │ ├── PluginChecker.java │ │ │ │ ├── ToastUtil.java │ │ │ │ └── UiUtil.java │ │ │ └── res │ │ │ ├── drawable │ │ │ └── child_bg.xml │ │ │ ├── layout │ │ │ ├── layout_case_category_item.xml │ │ │ ├── layout_case_item.xml │ │ │ ├── layout_fragment_case_summary.xml │ │ │ ├── layout_main.xml │ │ │ ├── layout_main_above.xml │ │ │ ├── layout_main_behind.xml │ │ │ └── layout_splash.xml │ │ │ ├── values │ │ │ ├── dimens.xml │ │ │ ├── strings.xml │ │ │ └── themes.xml │ │ │ └── xml │ │ │ └── filepaths.xml │ │ ├── sample-base │ │ ├── .gitignore │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ │ └── main │ │ │ └── AndroidManifest.xml │ │ ├── sample-loader │ │ ├── .gitignore │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ └── java │ │ │ └── com │ │ │ └── tencent │ │ │ └── shadow │ │ │ ├── dynamic │ │ │ ├── impl │ │ │ │ └── WhiteList.java │ │ │ └── loader │ │ │ │ └── impl │ │ │ │ └── CoreLoaderFactoryImpl.java │ │ │ └── sample │ │ │ └── plugin │ │ │ └── loader │ │ │ ├── SampleComponentManager.java │ │ │ └── SamplePluginLoader.java │ │ ├── sample-runtime │ │ ├── .gitignore │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ └── java │ │ │ └── com │ │ │ └── tencent │ │ │ └── shadow │ │ │ └── sample │ │ │ └── plugin │ │ │ └── runtime │ │ │ ├── PluginDefaultProxyActivity.java │ │ │ ├── PluginSingleInstance1ProxyActivity.java │ │ │ └── PluginSingleTask1ProxyActivity.java │ │ └── third-party │ │ ├── pinnedheaderexpandablelistview │ │ ├── .gitignore │ │ ├── LICENSE │ │ ├── README.md │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ └── java │ │ │ └── com │ │ │ └── ryg │ │ │ └── expandable │ │ │ └── ui │ │ │ ├── PinnedHeaderExpandableListView.java │ │ │ └── StickyLayout.java │ │ └── slidingmenu │ │ ├── .gitignore │ │ ├── LICENSE.txt │ │ ├── README.md │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ └── com │ │ │ └── jeremyfeinstein │ │ │ └── slidingmenu │ │ │ └── lib │ │ │ ├── CanvasTransformerBuilder.java │ │ │ ├── CustomViewAbove.java │ │ │ ├── CustomViewBehind.java │ │ │ └── SlidingMenu.java │ │ └── res │ │ └── values │ │ ├── attrs.xml │ │ └── ids.xml ├── sdk │ ├── coding │ │ ├── .gitignore │ │ ├── aar-to-jar-plugin │ │ │ ├── .gitignore │ │ │ ├── build.gradle │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── kotlin │ │ │ │ └── com │ │ │ │ └── tencent │ │ │ │ └── shadow │ │ │ │ └── coding │ │ │ │ └── aar_to_jar_plugin │ │ │ │ └── AarToJarPlugin.kt │ │ ├── android-jar │ │ │ ├── .gitignore │ │ │ └── build.gradle │ │ ├── build.gradle │ │ ├── code-generator │ │ │ ├── .gitignore │ │ │ ├── build.gradle │ │ │ └── src │ │ │ │ ├── main │ │ │ │ └── kotlin │ │ │ │ │ └── com │ │ │ │ │ └── tencent │ │ │ │ │ └── shadow │ │ │ │ │ ├── coding │ │ │ │ │ └── code_generator │ │ │ │ │ │ └── ActivityCodeGenerator.kt │ │ │ │ │ └── core │ │ │ │ │ └── runtime │ │ │ │ │ └── NeighborClass.kt │ │ │ │ └── test │ │ │ │ └── kotlin │ │ │ │ └── com │ │ │ │ └── tencent │ │ │ │ └── shadow │ │ │ │ └── coding │ │ │ │ └── code_generator │ │ │ │ └── ActivityCodeGeneratorTest.kt │ │ ├── common-jar-settings │ │ │ ├── .gitignore │ │ │ ├── build.gradle │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── kotlin │ │ │ │ └── com │ │ │ │ └── tencent │ │ │ │ └── shadow │ │ │ │ └── coding │ │ │ │ └── common_jar_settings │ │ │ │ └── CommonJarSettingsPlugin.kt │ │ ├── get-android-jar │ │ │ ├── .gitignore │ │ │ ├── build.gradle │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── AndroidManifest.xml │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ └── gradle-wrapper.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ ├── java-build-config │ │ │ ├── .gitignore │ │ │ └── build.gradle │ │ └── settings.gradle │ ├── core │ │ ├── .gitignore │ │ ├── activity-container │ │ │ ├── .gitignore │ │ │ ├── build.gradle │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── tencent │ │ │ │ └── shadow │ │ │ │ └── core │ │ │ │ └── runtime │ │ │ │ └── container │ │ │ │ ├── DelegateProvider.java │ │ │ │ ├── DelegateProviderHolder.java │ │ │ │ ├── HostActivity.java │ │ │ │ ├── HostActivityDelegate.java │ │ │ │ ├── HostActivityDelegator.java │ │ │ │ ├── HostNativeActivityDelegate.java │ │ │ │ ├── HostNativeActivityDelegator.java │ │ │ │ ├── NativePluginContainerActivity.java │ │ │ │ └── PluginContainerActivity.java │ │ ├── build.gradle │ │ ├── common │ │ │ ├── .gitignore │ │ │ ├── build.gradle │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── tencent │ │ │ │ └── shadow │ │ │ │ └── core │ │ │ │ ├── common │ │ │ │ ├── ILoggerFactory.java │ │ │ │ ├── InstalledApk.java │ │ │ │ ├── Logger.java │ │ │ │ └── LoggerFactory.java │ │ │ │ └── runtime │ │ │ │ └── container │ │ │ │ ├── ContentProviderDelegateProvider.java │ │ │ │ ├── ContentProviderDelegateProviderHolder.java │ │ │ │ ├── HostContentProviderDelegate.java │ │ │ │ └── PluginContainerContentProvider.java │ │ ├── gradle-plugin │ │ │ ├── .gitignore │ │ │ ├── build.gradle │ │ │ └── src │ │ │ │ ├── main │ │ │ │ └── kotlin │ │ │ │ │ └── com │ │ │ │ │ └── tencent │ │ │ │ │ └── shadow │ │ │ │ │ └── core │ │ │ │ │ └── gradle │ │ │ │ │ ├── AGPCompat.kt │ │ │ │ │ ├── AGPCompatImpl.kt │ │ │ │ │ ├── CreatePackagePluginTask.kt │ │ │ │ │ ├── ShadowPlugin.kt │ │ │ │ │ ├── ShadowPluginHelper.kt │ │ │ │ │ └── extensions │ │ │ │ │ ├── PackagePluginExtension.kt │ │ │ │ │ ├── PluginApkConfig.kt │ │ │ │ │ └── PluginBuildType.kt │ │ │ │ └── test │ │ │ │ ├── kotlin │ │ │ │ └── com │ │ │ │ │ └── tencent │ │ │ │ │ └── shadow │ │ │ │ │ └── core │ │ │ │ │ └── gradle │ │ │ │ │ ├── PackageMultiPluginTest.kt │ │ │ │ │ ├── PackageOnlyPluginTest.kt │ │ │ │ │ └── PackagePluginTaskTest.kt │ │ │ │ └── testProjects │ │ │ │ └── case1 │ │ │ │ ├── .gitignore │ │ │ │ ├── build.gradle │ │ │ │ ├── loader │ │ │ │ ├── build.gradle │ │ │ │ └── src │ │ │ │ │ └── main │ │ │ │ │ └── AndroidManifest.xml │ │ │ │ ├── plugin1 │ │ │ │ ├── .gitignore │ │ │ │ ├── build.gradle │ │ │ │ └── src │ │ │ │ │ └── main │ │ │ │ │ └── AndroidManifest.xml │ │ │ │ ├── plugin2 │ │ │ │ ├── .gitignore │ │ │ │ ├── build.gradle │ │ │ │ └── src │ │ │ │ │ └── main │ │ │ │ │ └── AndroidManifest.xml │ │ │ │ ├── runtime │ │ │ │ ├── build.gradle │ │ │ │ └── src │ │ │ │ │ └── main │ │ │ │ │ └── AndroidManifest.xml │ │ │ │ ├── settings.gradle │ │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── AndroidManifest.xml │ │ ├── gradle.properties │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ └── gradle-wrapper.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ ├── load-parameters │ │ │ ├── .gitignore │ │ │ ├── build.gradle │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── tencent │ │ │ │ └── shadow │ │ │ │ └── core │ │ │ │ └── load_parameters │ │ │ │ └── LoadParameters.java │ │ ├── loader │ │ │ ├── .gitignore │ │ │ ├── build.gradle │ │ │ └── src │ │ │ │ ├── main │ │ │ │ └── kotlin │ │ │ │ │ └── com │ │ │ │ │ └── tencent │ │ │ │ │ └── shadow │ │ │ │ │ └── core │ │ │ │ │ └── loader │ │ │ │ │ ├── ShadowPluginLoader.kt │ │ │ │ │ ├── blocs │ │ │ │ │ ├── CheckPackageNameBloc.kt │ │ │ │ │ ├── CreateApplicationBloc.kt │ │ │ │ │ ├── CreatePluginApplicationInfoBloc.kt │ │ │ │ │ ├── CreateResourceBloc.kt │ │ │ │ │ ├── LoadApkBloc.kt │ │ │ │ │ └── LoadPluginBloc.kt │ │ │ │ │ ├── classloaders │ │ │ │ │ ├── CombineClassLoader.kt │ │ │ │ │ └── PluginClassLoader.kt │ │ │ │ │ ├── delegates │ │ │ │ │ ├── DI.kt │ │ │ │ │ ├── PackageManagerWrapper.java │ │ │ │ │ ├── ShadowActivityDelegate.kt │ │ │ │ │ ├── ShadowContentProviderDelegate.kt │ │ │ │ │ ├── ShadowDelegate.kt │ │ │ │ │ └── ShadowNativeActivityDelegate.kt │ │ │ │ │ ├── exceptions │ │ │ │ │ ├── CreateApplicationException.kt │ │ │ │ │ ├── LoadApkException.kt │ │ │ │ │ ├── LoadPluginException.kt │ │ │ │ │ └── ParsePluginApkException.kt │ │ │ │ │ ├── infos │ │ │ │ │ ├── ContainerProviderInfo.kt │ │ │ │ │ └── PluginParts.kt │ │ │ │ │ └── managers │ │ │ │ │ ├── ComponentManager.kt │ │ │ │ │ ├── PluginContentProviderManager.kt │ │ │ │ │ ├── PluginPackageManagerImpl.kt │ │ │ │ │ └── PluginServiceManager.kt │ │ │ │ └── test │ │ │ │ └── kotlin │ │ │ │ └── com │ │ │ │ └── tencent │ │ │ │ └── shadow │ │ │ │ └── core │ │ │ │ └── loader │ │ │ │ └── classloaders │ │ │ │ └── PluginClassLoaderTest.kt │ │ ├── manager-db-test │ │ │ ├── .gitignore │ │ │ ├── build.gradle │ │ │ └── src │ │ │ │ ├── androidTest │ │ │ │ ├── java │ │ │ │ │ ├── com │ │ │ │ │ │ └── tencent │ │ │ │ │ │ │ └── shadow │ │ │ │ │ │ │ └── core │ │ │ │ │ │ │ ├── manager │ │ │ │ │ │ │ └── installplugin │ │ │ │ │ │ │ │ └── DbCompatibilityTest.java │ │ │ │ │ │ │ └── pluginmanager │ │ │ │ │ │ │ └── CustomAndroidJUnitRunner.java │ │ │ │ │ └── common │ │ │ │ │ │ └── AndroidLogLoggerFactory.java │ │ │ │ └── res │ │ │ │ │ └── raw │ │ │ │ │ ├── expect_sql_version1.sql │ │ │ │ │ ├── expect_sql_version2.sql │ │ │ │ │ ├── expect_sql_version3.sql │ │ │ │ │ ├── expect_sql_version4.sql │ │ │ │ │ ├── init_sql_version1.sql │ │ │ │ │ ├── init_sql_version2.sql │ │ │ │ │ ├── init_sql_version3.sql │ │ │ │ │ ├── init_sql_version4.sql │ │ │ │ │ └── plugin1.json │ │ │ │ └── main │ │ │ │ └── AndroidManifest.xml │ │ ├── manager │ │ │ ├── .gitignore │ │ │ ├── build.gradle │ │ │ └── src │ │ │ │ ├── main │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── tencent │ │ │ │ │ └── shadow │ │ │ │ │ └── core │ │ │ │ │ └── manager │ │ │ │ │ ├── BasePluginManager.java │ │ │ │ │ └── installplugin │ │ │ │ │ ├── AppCacheFolderManager.java │ │ │ │ │ ├── CopySoBloc.java │ │ │ │ │ ├── InstallPluginException.java │ │ │ │ │ ├── InstalledDao.java │ │ │ │ │ ├── InstalledPlugin.java │ │ │ │ │ ├── InstalledPluginDBHelper.java │ │ │ │ │ ├── InstalledRow.java │ │ │ │ │ ├── InstalledType.java │ │ │ │ │ ├── MinFileUtils.java │ │ │ │ │ ├── ODexBloc.java │ │ │ │ │ ├── PluginConfig.java │ │ │ │ │ ├── SafeZipFile.java │ │ │ │ │ └── UnpackManager.java │ │ │ │ └── test │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── tencent │ │ │ │ └── shadow │ │ │ │ └── core │ │ │ │ └── manager │ │ │ │ └── installplugin │ │ │ │ └── SafeZipFileTest.java │ │ ├── manifest-parser │ │ │ ├── .gitignore │ │ │ ├── build.gradle │ │ │ └── src │ │ │ │ ├── main │ │ │ │ └── kotlin │ │ │ │ │ └── com │ │ │ │ │ └── tencent │ │ │ │ │ └── shadow │ │ │ │ │ └── core │ │ │ │ │ └── manifest_parser │ │ │ │ │ ├── AndroidManifestKeys.kt │ │ │ │ │ ├── AndroidManifestReader.kt │ │ │ │ │ ├── ManifestParser.kt │ │ │ │ │ └── PluginManifestGenerator.kt │ │ │ │ └── test │ │ │ │ ├── kotlin │ │ │ │ └── com │ │ │ │ │ └── tencent │ │ │ │ │ └── shadow │ │ │ │ │ └── core │ │ │ │ │ └── manifest_parser │ │ │ │ │ ├── AndroidManifestReaderTest.kt │ │ │ │ │ └── PluginManifestGeneratorTest.kt │ │ │ │ └── resources │ │ │ │ ├── case_as_little_as_possible.xml │ │ │ │ ├── noAppComponentFactory.xml │ │ │ │ └── sample-app.xml │ │ ├── runtime │ │ │ ├── .gitignore │ │ │ ├── build.gradle │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── tencent │ │ │ │ └── shadow │ │ │ │ └── core │ │ │ │ └── runtime │ │ │ │ ├── ActivityOptionsSupport.java │ │ │ │ ├── FixedContextLayoutInflater.java │ │ │ │ ├── PackageManagerInvokeRedirect.java │ │ │ │ ├── PluginActivity.java │ │ │ │ ├── PluginManifest.java │ │ │ │ ├── PluginPackageManager.java │ │ │ │ ├── PluginPartInfo.java │ │ │ │ ├── PluginPartInfoManager.java │ │ │ │ ├── ResolverHook.java │ │ │ │ ├── ShadowActivity.java │ │ │ │ ├── ShadowActivityLifecycleCallbacks.java │ │ │ │ ├── ShadowAppComponentFactory.java │ │ │ │ ├── ShadowApplication.java │ │ │ │ ├── ShadowContext.java │ │ │ │ ├── ShadowDialogSupport.java │ │ │ │ ├── ShadowFactory2.java │ │ │ │ ├── ShadowFragmentSupport.java │ │ │ │ ├── ShadowInstrumentation.java │ │ │ │ ├── ShadowIntentService.java │ │ │ │ ├── ShadowLayoutInflater.java │ │ │ │ ├── ShadowNativeActivity.java │ │ │ │ ├── ShadowPackageItemInfo.java │ │ │ │ ├── ShadowPendingIntent.java │ │ │ │ ├── ShadowService.java │ │ │ │ ├── ShadowWebView.java │ │ │ │ ├── ShadowWebViewLayoutInflater.java │ │ │ │ ├── SubDirContextThemeWrapper.java │ │ │ │ ├── UriConverter.java │ │ │ │ ├── XmlPullParserUtil.java │ │ │ │ └── package-info.java │ │ ├── settings.gradle │ │ ├── transform-kit │ │ │ ├── .gitignore │ │ │ ├── build.gradle │ │ │ └── src │ │ │ │ ├── main │ │ │ │ ├── java │ │ │ │ │ └── javassist │ │ │ │ │ │ ├── EnhancedCodeConverter.java │ │ │ │ │ │ └── convert │ │ │ │ │ │ ├── TransformCallExceptSuperCallToStatic.java │ │ │ │ │ │ └── TransformNewClassFix.java │ │ │ │ └── kotlin │ │ │ │ │ └── com │ │ │ │ │ └── tencent │ │ │ │ │ └── shadow │ │ │ │ │ └── core │ │ │ │ │ └── transform_kit │ │ │ │ │ ├── AbstractTransform.kt │ │ │ │ │ ├── AbstractTransformManager.kt │ │ │ │ │ ├── AndroidClassPoolBuilder.kt │ │ │ │ │ ├── AutoMakeMissingClassPool.kt │ │ │ │ │ ├── ClassTransform.kt │ │ │ │ │ ├── JavassistTransform.kt │ │ │ │ │ ├── OverrideCheck.kt │ │ │ │ │ ├── ReplaceClassName.kt │ │ │ │ │ ├── SpecificTransform.kt │ │ │ │ │ └── TransformStep.kt │ │ │ │ └── test │ │ │ │ ├── java │ │ │ │ └── test │ │ │ │ │ ├── MethodRedirectToStatic.java │ │ │ │ │ └── override │ │ │ │ │ └── Foo.java │ │ │ │ └── kotlin │ │ │ │ └── com │ │ │ │ └── tencent │ │ │ │ └── shadow │ │ │ │ └── core │ │ │ │ └── transform_kit │ │ │ │ ├── AbstractTransformTest.kt │ │ │ │ ├── FilterRefClassesTest.kt │ │ │ │ ├── OverrideCheckTest.kt │ │ │ │ └── RedirectMethodCallToStaticTest.kt │ │ ├── transform │ │ │ ├── .gitignore │ │ │ ├── build.gradle │ │ │ └── src │ │ │ │ ├── main │ │ │ │ └── kotlin │ │ │ │ │ └── com │ │ │ │ │ └── tencent │ │ │ │ │ └── shadow │ │ │ │ │ └── core │ │ │ │ │ └── transform │ │ │ │ │ ├── DeprecatedTransformWrapper.kt │ │ │ │ │ ├── GradleTransformWrapper.kt │ │ │ │ │ ├── ShadowTransform.kt │ │ │ │ │ ├── TransformManager.kt │ │ │ │ │ └── specific │ │ │ │ │ ├── ActivityOptionsSupportTransform.kt │ │ │ │ │ ├── ActivityTransform.kt │ │ │ │ │ ├── AppComponentFactoryTransform.kt │ │ │ │ │ ├── ApplicationTransform.kt │ │ │ │ │ ├── ContentProviderTransform.kt │ │ │ │ │ ├── DialogSupportTransform.kt │ │ │ │ │ ├── FragmentSupportTransform.kt │ │ │ │ │ ├── InstrumentationTransform.kt │ │ │ │ │ ├── IntentServiceTransform.kt │ │ │ │ │ ├── KeepHostContextTransform.kt │ │ │ │ │ ├── LayoutInflaterTransform.kt │ │ │ │ │ ├── PackageItemInfoTransform.kt │ │ │ │ │ ├── PackageManagerTransform.kt │ │ │ │ │ ├── PendingIntentTransform.kt │ │ │ │ │ ├── ReceiverSupportTransform.kt │ │ │ │ │ ├── ServiceTransform.kt │ │ │ │ │ ├── SimpleRenameTransform.kt │ │ │ │ │ └── WebViewTransform.kt │ │ │ │ └── test │ │ │ │ ├── java │ │ │ │ ├── android │ │ │ │ │ ├── app │ │ │ │ │ │ ├── Activity.java │ │ │ │ │ │ ├── Application.java │ │ │ │ │ │ ├── Fragment.java │ │ │ │ │ │ ├── Instrumentation.java │ │ │ │ │ │ └── Service.java │ │ │ │ │ ├── content │ │ │ │ │ │ ├── BroadcastReceiver.java │ │ │ │ │ │ ├── ComponentName.java │ │ │ │ │ │ ├── Context.java │ │ │ │ │ │ ├── Intent.java │ │ │ │ │ │ ├── pm │ │ │ │ │ │ │ ├── ActivityInfo.java │ │ │ │ │ │ │ ├── ApplicationInfo.java │ │ │ │ │ │ │ ├── PackageInfo.java │ │ │ │ │ │ │ ├── PackageItemInfo.java │ │ │ │ │ │ │ ├── PackageManager.java │ │ │ │ │ │ │ ├── ProviderInfo.java │ │ │ │ │ │ │ └── ServiceInfo.java │ │ │ │ │ │ └── res │ │ │ │ │ │ │ └── XmlResourceParser.java │ │ │ │ │ ├── os │ │ │ │ │ │ ├── Bundle.java │ │ │ │ │ │ └── IBinder.java │ │ │ │ │ ├── util │ │ │ │ │ │ └── AttributeSet.java │ │ │ │ │ └── webkit │ │ │ │ │ │ └── WebView.java │ │ │ │ ├── com │ │ │ │ │ └── tencent │ │ │ │ │ │ └── shadow │ │ │ │ │ │ └── core │ │ │ │ │ │ └── runtime │ │ │ │ │ │ ├── PackageManagerInvokeRedirect.java │ │ │ │ │ │ ├── PluginPartInfo.java │ │ │ │ │ │ ├── PluginPartInfoManager.java │ │ │ │ │ │ ├── ShadowActivity.java │ │ │ │ │ │ ├── ShadowApplication.java │ │ │ │ │ │ ├── ShadowContext.java │ │ │ │ │ │ ├── ShadowFragmentSupport.java │ │ │ │ │ │ ├── ShadowInstrumentation.java │ │ │ │ │ │ └── ShadowWebView.java │ │ │ │ └── test │ │ │ │ │ ├── EggReceiver.java │ │ │ │ │ ├── TestActivity.java │ │ │ │ │ ├── TestActivityLifecycleCallbacks.java │ │ │ │ │ ├── TestApplication.java │ │ │ │ │ ├── TestInstrumentation.java │ │ │ │ │ ├── TestPackageManager.java │ │ │ │ │ ├── TestReceiver.java │ │ │ │ │ ├── TestService.java │ │ │ │ │ ├── TestWebView.java │ │ │ │ │ └── fragment │ │ │ │ │ ├── TestFragment.java │ │ │ │ │ ├── UseGetActivityFragment.java │ │ │ │ │ ├── UseStartActivityForResultFragment.java │ │ │ │ │ └── UseStartActivityFragment.java │ │ │ │ └── kotlin │ │ │ │ └── com │ │ │ │ └── tencent │ │ │ │ └── shadow │ │ │ │ └── core │ │ │ │ └── transform │ │ │ │ └── specific │ │ │ │ ├── ActivityLifecycleCallbacksTransformTest.kt │ │ │ │ ├── ActivityTransformTest.kt │ │ │ │ ├── ApplicationTransformTest.kt │ │ │ │ ├── FragmentSupportTransformTest.kt │ │ │ │ ├── InstrumentationTransformTest.kt │ │ │ │ ├── PackageManagerTransformTest.kt │ │ │ │ ├── ReceiverSupportTransformTest.kt │ │ │ │ ├── ServiceTransformTest.kt │ │ │ │ ├── SimpleRenameTransformTest.kt │ │ │ │ └── WebViewTransformTest.kt │ │ └── utils │ │ │ ├── .gitignore │ │ │ ├── build.gradle │ │ │ └── src │ │ │ ├── main │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── tencent │ │ │ │ └── shadow │ │ │ │ └── core │ │ │ │ └── utils │ │ │ │ └── Md5.java │ │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── tencent │ │ │ └── shadow │ │ │ └── core │ │ │ └── utils │ │ │ └── Md5Test.java │ └── dynamic │ │ ├── .gitignore │ │ ├── build.gradle │ │ ├── dynamic-apk │ │ ├── .gitignore │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── tencent │ │ │ └── shadow │ │ │ └── dynamic │ │ │ └── apk │ │ │ ├── ApkClassLoader.java │ │ │ ├── ChangeApkContextWrapper.java │ │ │ └── ImplLoader.java │ │ ├── dynamic-host-multi-loader-ext │ │ ├── .gitignore │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── tencent │ │ │ └── shadow │ │ │ └── dynamic │ │ │ └── host │ │ │ ├── MultiDynamicContainer.java │ │ │ ├── MultiLoaderPluginProcessService.java │ │ │ ├── MultiLoaderPpsBinder.java │ │ │ └── MultiLoaderPpsController.java │ │ ├── dynamic-host │ │ ├── .gitignore │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── tencent │ │ │ └── shadow │ │ │ └── dynamic │ │ │ └── host │ │ │ ├── BasePluginProcessService.java │ │ │ ├── BinderUuidManager.java │ │ │ ├── DynamicPluginManager.java │ │ │ ├── DynamicRuntime.java │ │ │ ├── EnterCallback.java │ │ │ ├── FailedException.java │ │ │ ├── LoaderFactory.java │ │ │ ├── LoaderImplLoader.java │ │ │ ├── ManagerFactory.java │ │ │ ├── ManagerImplLoader.java │ │ │ ├── NotFoundException.java │ │ │ ├── PluginLoaderImpl.java │ │ │ ├── PluginManager.java │ │ │ ├── PluginManagerImpl.java │ │ │ ├── PluginManagerUpdater.java │ │ │ ├── PluginProcessService.java │ │ │ ├── PpsBinder.java │ │ │ ├── PpsController.java │ │ │ ├── PpsStatus.java │ │ │ └── UuidManager.java │ │ ├── dynamic-loader-impl │ │ ├── .gitignore │ │ ├── build.gradle │ │ └── src │ │ │ └── main │ │ │ └── kotlin │ │ │ └── com │ │ │ └── tencent │ │ │ └── shadow │ │ │ └── dynamic │ │ │ ├── impl │ │ │ └── LoaderFactoryImpl.kt │ │ │ └── loader │ │ │ └── impl │ │ │ ├── BinderPluginServiceConnection.kt │ │ │ ├── CoreLoaderFactory.kt │ │ │ ├── DynamicPluginLoader.kt │ │ │ ├── LoaderFactoryImpl.kt │ │ │ └── PluginLoaderBinder.kt │ │ ├── dynamic-loader │ │ ├── .gitignore │ │ ├── build.gradle │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── tencent │ │ │ └── shadow │ │ │ └── dynamic │ │ │ └── loader │ │ │ ├── PluginLoader.java │ │ │ └── PluginServiceConnection.java │ │ ├── dynamic-manager-multi-loader-ext │ │ ├── .gitignore │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── tencent │ │ │ └── shadow │ │ │ └── dynamic │ │ │ └── manager │ │ │ └── PluginManagerThatSupportMultiLoader.java │ │ ├── dynamic-manager │ │ ├── .gitignore │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── tencent │ │ │ └── shadow │ │ │ └── dynamic │ │ │ └── manager │ │ │ ├── BaseDynamicPluginManager.java │ │ │ ├── BinderPluginLoader.java │ │ │ ├── PluginManagerThatUseDynamicLoader.java │ │ │ ├── PluginServiceConnectionBinder.java │ │ │ ├── UuidManagerBinder.java │ │ │ └── UuidManagerImpl.java │ │ ├── gradle.properties │ │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ └── settings.gradle └── test │ ├── common-jar-settings-test │ ├── .gitignore │ ├── build.gradle │ └── src │ │ └── main │ │ └── java │ │ └── Test.java │ ├── dynamic │ ├── host │ │ └── test-dynamic-host │ │ │ ├── .gitignore │ │ │ ├── build.gradle │ │ │ ├── proguard-rules.pro │ │ │ └── src │ │ │ ├── androidTest │ │ │ ├── AndroidManifest.xml │ │ │ └── java │ │ │ │ └── com │ │ │ │ ├── google │ │ │ │ └── devtools │ │ │ │ │ └── build │ │ │ │ │ └── android │ │ │ │ │ └── desugar │ │ │ │ │ └── runtime │ │ │ │ │ └── ThrowableExtension.java │ │ │ │ └── tencent │ │ │ │ └── shadow │ │ │ │ └── test │ │ │ │ ├── CreateResourceTest.java │ │ │ │ ├── CustomAndroidJUnitRunner.java │ │ │ │ ├── PluginTest.java │ │ │ │ ├── cases │ │ │ │ ├── plugin_androidx │ │ │ │ │ ├── AppCompatActivityTest.java │ │ │ │ │ ├── ComponentFactoryTest.java │ │ │ │ │ ├── LiveDataWithActivityTest.java │ │ │ │ │ └── PluginAndroidxAppTest.java │ │ │ │ ├── plugin_main │ │ │ │ │ ├── ActivityContextSubDirTest.java │ │ │ │ │ ├── ActivityLifecycleCallbacksTest.java │ │ │ │ │ ├── ActivityReCreateTest.java │ │ │ │ │ ├── ActivityWindowSoftModeTest.java │ │ │ │ │ ├── ApplicationContextInActivityTest.java │ │ │ │ │ ├── ApplicationContextSubDirTest.java │ │ │ │ │ ├── ApplicationTest.java │ │ │ │ │ ├── BasicTest.java │ │ │ │ │ ├── BootClassloaderTest.java │ │ │ │ │ ├── ContextGetPackageCodePathTest.java │ │ │ │ │ ├── GetCallingActivityTest.java │ │ │ │ │ ├── HostInterfaceTest.java │ │ │ │ │ ├── InstrumentationTest.java │ │ │ │ │ ├── LayoutInflaterTest.java │ │ │ │ │ ├── NullRefInXmlTest.java │ │ │ │ │ ├── PackageManagerTest.java │ │ │ │ │ ├── PluginBroadcastReceiverTest.java │ │ │ │ │ ├── PluginMainAppTest.java │ │ │ │ │ ├── PluginServiceTest.java │ │ │ │ │ ├── RegisterNullReceiverTest.java │ │ │ │ │ ├── ReinstallPluginTest.java │ │ │ │ │ ├── ServiceContextSubDirTest.java │ │ │ │ │ ├── SubDirContextThemeWrapperTest.java │ │ │ │ │ ├── TargetFragmentTest.java │ │ │ │ │ ├── ThemeTest.java │ │ │ │ │ ├── ViewIdTest.java │ │ │ │ │ ├── application_info │ │ │ │ │ │ ├── ApplicationInfoTest.java │ │ │ │ │ │ ├── CommonApplicationInfoTest.java │ │ │ │ │ │ ├── ContextGetApplicationInfoTest.java │ │ │ │ │ │ ├── PackageManagerGetOtherInstalledApplicationInfoTest.java │ │ │ │ │ │ └── PackageManagerGetSelfApplicationInfoTest.java │ │ │ │ │ ├── dialog_support │ │ │ │ │ │ ├── AlertDialogOwnerActivityTest.java │ │ │ │ │ │ └── DialogOwnerActivityTest.java │ │ │ │ │ └── fragment_support │ │ │ │ │ │ ├── CommonFragmentSupportTest.java │ │ │ │ │ │ ├── FragmentSupportTest.java │ │ │ │ │ │ ├── ProgrammaticallyAddBaseFragmentTest.java │ │ │ │ │ │ ├── ProgrammaticallyAddDialogFragmentTest.java │ │ │ │ │ │ ├── ProgrammaticallyAddFragmentTest.java │ │ │ │ │ │ ├── ProgrammaticallyAddNormalFragmentTest.java │ │ │ │ │ │ ├── ProgrammaticallyAddOnlyOverrideOnAttachActivityFragmentTest.java │ │ │ │ │ │ ├── ProgrammaticallyAddOnlyOverrideOnAttachContextFragmentTest.java │ │ │ │ │ │ ├── ProgrammaticallyAddSubFragmentTest.java │ │ │ │ │ │ ├── XmlAddBaseFragmentTest.java │ │ │ │ │ │ ├── XmlAddFragmentTest.java │ │ │ │ │ │ ├── XmlAddNormalFragmentTest.java │ │ │ │ │ │ └── XmlAddSubFragmentTest.java │ │ │ │ └── plugin_service │ │ │ │ │ ├── PluginIntentServiceConnectionTest.java │ │ │ │ │ ├── PluginServiceAppTest.java │ │ │ │ │ └── PluginServiceConnectionTest.java │ │ │ │ └── repeat │ │ │ │ ├── Repeat.java │ │ │ │ └── RepeatRule.java │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── tencent │ │ │ │ └── shadow │ │ │ │ └── test │ │ │ │ └── dynamic │ │ │ │ └── host │ │ │ │ ├── AndroidLogLoggerFactory.java │ │ │ │ ├── BindPluginServiceActivity.java │ │ │ │ ├── HostApplication.java │ │ │ │ ├── JumpToPluginActivity.java │ │ │ │ ├── MainActivity.java │ │ │ │ ├── PluginHelper.java │ │ │ │ ├── PluginLoadActivity.java │ │ │ │ ├── PluginProcessPPS.java │ │ │ │ ├── PluginServiceProcessPPS.java │ │ │ │ ├── SimpleIdlingResourceImpl.java │ │ │ │ └── manager │ │ │ │ ├── FixedPathPmUpdater.java │ │ │ │ └── Shadow.java │ │ │ └── res │ │ │ ├── drawable │ │ │ └── ic_launcher.png │ │ │ ├── layout │ │ │ ├── activity_jump_to_plugin.xml │ │ │ ├── activity_load.xml │ │ │ └── part_key_adapter.xml │ │ │ └── values │ │ │ ├── strings.xml │ │ │ └── themes.xml │ ├── manager │ │ └── test-dynamic-manager │ │ │ ├── .gitignore │ │ │ ├── build.gradle │ │ │ ├── proguard-rules.pro │ │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── tencent │ │ │ │ └── shadow │ │ │ │ ├── dynamic │ │ │ │ └── impl │ │ │ │ │ ├── ManagerFactoryImpl.java │ │ │ │ │ └── WhiteList.java │ │ │ │ └── test │ │ │ │ ├── UiUtil.java │ │ │ │ ├── cases │ │ │ │ ├── PluginIntentServiceConnectionTestCase.java │ │ │ │ └── PluginServiceConnectionTestCase.java │ │ │ │ └── dynamic │ │ │ │ └── manager │ │ │ │ ├── ActivityTestDynamicPluginManager.java │ │ │ │ ├── FastPluginManager.java │ │ │ │ ├── ReinstallPluginTestDynamicPluginManager.java │ │ │ │ ├── ServiceTestDynamicPluginManager.java │ │ │ │ └── TestDynamicPluginManager.java │ │ │ └── res │ │ │ └── layout │ │ │ └── activity_load_plugin.xml │ └── plugin │ │ ├── test-dynamic-loader │ │ ├── .gitignore │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ └── java │ │ │ └── com │ │ │ └── tencent │ │ │ └── shadow │ │ │ ├── dynamic │ │ │ └── loader │ │ │ │ └── impl │ │ │ │ └── CoreLoaderFactoryImpl.java │ │ │ └── test │ │ │ └── dynamic │ │ │ └── loader │ │ │ ├── TestComponentManager.java │ │ │ └── TestPluginLoader.java │ │ └── test-dynamic-runtime │ │ ├── .gitignore │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ └── java │ │ └── com │ │ └── tencent │ │ └── shadow │ │ └── test │ │ └── dynamic │ │ └── runtime │ │ └── container │ │ ├── PluginDefaultProxyActivity.java │ │ ├── PluginSingleInstance1ProxyActivity.java │ │ └── PluginSingleTask1ProxyActivity.java │ ├── gradle-plugin-agp-compat-test │ ├── .gitignore │ ├── README.md │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ ├── stub-project │ │ ├── .gitignore │ │ ├── build.gradle │ │ ├── settings.gradle │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── PluginManifestIncludeTest.java │ │ │ └── res │ │ │ └── values │ │ │ └── themes.xml │ ├── test_JDK11.sh │ ├── test_JDK17.sh │ ├── test_clean.sh │ └── test_prepare.sh │ ├── lib │ ├── constant │ │ ├── .gitignore │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ └── java │ │ │ └── com │ │ │ └── tencent │ │ │ └── shadow │ │ │ └── test │ │ │ └── lib │ │ │ └── constant │ │ │ └── Constant.java │ ├── custom-view │ │ ├── .gitignore │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ └── java │ │ │ └── com │ │ │ └── tencent │ │ │ └── shadow │ │ │ └── test │ │ │ └── lib │ │ │ └── custom_view │ │ │ └── TestViewConstructorCacheView.java │ ├── plugin-use-host-code-lib │ │ ├── .gitignore │ │ ├── build.gradle │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── tencent │ │ │ └── shadow │ │ │ └── test │ │ │ └── lib │ │ │ └── plugin_use_host_code_lib │ │ │ ├── interfaces │ │ │ ├── HostTestInterface.java │ │ │ └── subpackage │ │ │ │ └── Foo.java │ │ │ └── other │ │ │ └── HostOtherInterface.java │ └── test-manager │ │ ├── .gitignore │ │ ├── build.gradle │ │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── tencent │ │ └── shadow │ │ └── test │ │ └── lib │ │ └── test_manager │ │ ├── SimpleIdlingResource.java │ │ └── TestManager.java │ ├── none-dynamic │ └── host │ │ └── test-none-dynamic-host │ │ ├── .gitignore │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ └── com │ │ │ └── tencent │ │ │ └── shadow │ │ │ └── test │ │ │ └── none_dynamic │ │ │ └── host │ │ │ ├── DefaultContainerActivity.java │ │ │ ├── HostApplication.java │ │ │ ├── MainActivity.java │ │ │ ├── PreparePluginApkBloc.java │ │ │ ├── SLoggerFactory.java │ │ │ ├── SingleTaskContainerActivity.java │ │ │ ├── TestComponentManager.java │ │ │ ├── TestLoadingActivity.java │ │ │ └── TestPluginLoader.java │ │ └── res │ │ ├── layout │ │ ├── activity_main.xml │ │ └── qq_nearby_now_loading.xml │ │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxxhdpi │ │ └── ic_launcher.png │ │ └── values │ │ ├── strings.xml │ │ └── themes.xml │ └── plugin │ ├── androidx-cases │ └── test-plugin-androidx-cases │ │ ├── .gitignore │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ └── java │ │ └── com │ │ └── tencent │ │ └── shadow │ │ └── test │ │ └── plugin │ │ └── androidx_cases │ │ └── lib │ │ ├── AppCompatTestActivity.java │ │ ├── AppComponentFactoryTestActivity.java │ │ ├── LiveDataWithActivityTestActivity.java │ │ ├── TestComponentFactory.java │ │ └── UiUtil.java │ ├── general-cases │ └── test-plugin-general-cases │ │ ├── .gitignore │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ ├── androidTest │ │ └── java │ │ │ └── com │ │ │ └── tencent │ │ │ └── shadow │ │ │ └── test │ │ │ └── plugin │ │ │ └── general_cases │ │ │ └── app │ │ │ ├── ActivityLifecycleCallbacksTest.java │ │ │ ├── CustomAndroidJUnitRunner.java │ │ │ ├── NormalAppTest.java │ │ │ └── PackageManagerTest.java │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ ├── com │ │ │ └── tencent │ │ │ │ └── shadow │ │ │ │ └── test │ │ │ │ └── plugin │ │ │ │ └── general_cases │ │ │ │ └── lib │ │ │ │ ├── gallery │ │ │ │ ├── TestApplication.java │ │ │ │ └── util │ │ │ │ │ ├── ToastUtil.java │ │ │ │ │ └── UiUtil.java │ │ │ │ └── usecases │ │ │ │ ├── SimpleIdlingResource.java │ │ │ │ ├── WithIdlingResourceActivity.java │ │ │ │ ├── activity │ │ │ │ ├── ApplicationContextActivity.java │ │ │ │ ├── PrintActivityResultActivity.java │ │ │ │ ├── TestActivityOnCreate.java │ │ │ │ ├── TestActivityOrientation.java │ │ │ │ ├── TestActivityReCreate.java │ │ │ │ ├── TestActivityReCreateBySystem.java │ │ │ │ ├── TestActivityWindowSoftMode.java │ │ │ │ ├── TestCallingActivity.java │ │ │ │ ├── TestListActivity.java │ │ │ │ └── WindowSoftModeJumpActivity.java │ │ │ │ ├── application │ │ │ │ ├── ActivityLifecycleCallbacksTestActivity.java │ │ │ │ ├── TestApplicationActivity.java │ │ │ │ └── TestGetApplicationInfoActivity.java │ │ │ │ ├── classloader │ │ │ │ └── TestBootClassloaderActivity.java │ │ │ │ ├── context │ │ │ │ ├── ActivityContextSubDirTestActivity.java │ │ │ │ ├── ApplicationContextSubDirTestActivity.java │ │ │ │ ├── ContextGetPackageCodePathTestActivity.java │ │ │ │ ├── RegisterNullReceiverActivity.java │ │ │ │ ├── ServiceContextSubDirTestActivity.java │ │ │ │ ├── SubDirContextThemeWrapperTestActivity.java │ │ │ │ ├── TestLayoutInflaterActivity.java │ │ │ │ └── TestThemeActivity.java │ │ │ │ ├── dialog │ │ │ │ ├── TestAlertDialogActivity.java │ │ │ │ ├── TestDialog.java │ │ │ │ └── TestDialogActivity.java │ │ │ │ ├── fragment │ │ │ │ ├── BaseFragment.java │ │ │ │ ├── FragmentStartedActivity.java │ │ │ │ ├── OnlyOverrideActivityMethodBaseFragment.java │ │ │ │ ├── OnlyOverrideContextMethodBaseFragment.java │ │ │ │ ├── ProgrammaticallyAddFragmentActivity.java │ │ │ │ ├── SubTestBaseFragment.java │ │ │ │ ├── TargetFragmentTestActivity.java │ │ │ │ ├── TestBaseFragment.java │ │ │ │ ├── TestDialogFragment.java │ │ │ │ ├── TestFragment.java │ │ │ │ ├── TestFragmentCommonLogic.java │ │ │ │ ├── TestNormalFragment.java │ │ │ │ ├── TestSubFragment.java │ │ │ │ ├── TestSubOnlyOverrideOnAttachActivityFragment.java │ │ │ │ ├── TestSubOnlyOverrideOnAttachContextFragment.java │ │ │ │ └── XmlAddFragmentActivity.java │ │ │ │ ├── instrumentation │ │ │ │ ├── MyInstrumentation.java │ │ │ │ └── TestInstrumentationActivity.java │ │ │ │ ├── interfaces │ │ │ │ └── TestHostInterfaceActivity.java │ │ │ │ ├── packagemanager │ │ │ │ └── TestPackageManagerActivity.java │ │ │ │ ├── provider │ │ │ │ ├── TestDBContentProviderActivity.java │ │ │ │ ├── TestDBHelper.java │ │ │ │ ├── TestFileProviderActivity.java │ │ │ │ ├── TestProvider.java │ │ │ │ └── TestProviderInfo.java │ │ │ │ ├── receiver │ │ │ │ ├── BroadCastHelper.java │ │ │ │ ├── MyReceiver.java │ │ │ │ ├── ReceiverWithoutAction.java │ │ │ │ └── TestReceiverActivity.java │ │ │ │ ├── service │ │ │ │ ├── TestService.java │ │ │ │ └── TestStartServiceActivity.java │ │ │ │ └── view │ │ │ │ ├── TestNullRefInXmlActivity.java │ │ │ │ ├── TestViewConstructorCache.java │ │ │ │ └── TestViewIdActivity.java │ │ └── org │ │ │ └── xmlpull │ │ │ └── v1 │ │ │ └── XmlPullParser.java │ │ └── res │ │ ├── layout │ │ ├── activity_list.xml │ │ ├── activity_test_file_provider.xml │ │ ├── activity_test_re_create_by_system.xml │ │ ├── layout_activity_lifecycle.xml │ │ ├── layout_common.xml │ │ ├── layout_fragment_activity.xml │ │ ├── layout_fragment_test.xml │ │ ├── layout_list_item.xml │ │ ├── layout_orientation.xml │ │ ├── layout_packagemanager.xml │ │ ├── layout_provider_db.xml │ │ ├── layout_receiver.xml │ │ ├── layout_recreate.xml │ │ ├── layout_result.xml │ │ ├── layout_service.xml │ │ ├── layout_softmode.xml │ │ ├── layout_test_null_ref.xml │ │ ├── layout_test_view_cons_cache.xml │ │ ├── layout_test_view_id.xml │ │ ├── layout_xml_add_base_fragment_activity.xml │ │ ├── layout_xml_add_normal_fragment_activity.xml │ │ └── layout_xml_add_sub_fragment_activity.xml │ │ ├── values │ │ ├── strings.xml │ │ └── themes.xml │ │ └── xml │ │ └── filepaths.xml │ └── particular-cases │ └── plugin-service-for-host │ ├── .gitignore │ ├── build.gradle │ └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── com │ └── tencent │ └── shadow │ └── test │ └── plugin │ └── particular_cases │ └── plugin_service_for_host │ ├── SystemExitIntentService.java │ └── SystemExitService.java └── settings.gradle /.commitlintrc.yml: -------------------------------------------------------------------------------- 1 | extends: 2 | - '@commitlint/config-conventional' 3 | defaultIgnores: false 4 | rules: 5 | #允许中文 6 | subject-case: [ 0 ] 7 | footer-max-line-length: [ 0 ] 8 | body-max-line-length: [ 0 ] 9 | helpUrl: https://www.conventionalcommits.org/zh-hans/v1.0.0/ 10 | -------------------------------------------------------------------------------- /.github/actions/post-build/action.yml: -------------------------------------------------------------------------------- 1 | name: post-build 2 | description: '清理构建环境' 3 | runs: 4 | using: "composite" 5 | steps: 6 | - name: stop gradle deamon for actions/cache 7 | shell: bash 8 | run: ./gradlew --stop 9 | -------------------------------------------------------------------------------- /.github/actions/pre-build/action.yml: -------------------------------------------------------------------------------- 1 | name: pre-build 2 | description: '准备构建环境' 3 | runs: 4 | using: "composite" 5 | steps: 6 | - name: revert gradle distributionUrl in every gradle-wrapper.properties 7 | shell: bash 8 | run: git grep -l 'mirrors.tencent.com/gradle' -- gradle-wrapper.properties '**/gradle-wrapper.properties' | xargs sed -i 's/mirrors.tencent.com\/gradle/services.gradle.org\/distributions/g' 9 | - name: Inject slug/short variables 10 | uses: rlespinasse/github-slug-action@v3.x 11 | - name: revert gradle wrapper mirror setting 12 | shell: bash 13 | run: echo "DISABLE_TENCENT_MAVEN_MIRROR=true" >> $GITHUB_ENV 14 | - uses: actions/setup-java@v4 15 | with: 16 | distribution: 'temurin' 17 | java-version: '17' 18 | cache: 'gradle' 19 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Publish release 2 | 3 | on: 4 | release: 5 | types: 6 | - published #https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release 7 | 8 | jobs: 9 | publish: 10 | needs: check-build-test 11 | runs-on: ubuntu-22.04 12 | env: 13 | DISABLE_TENCENT_MAVEN_MIRROR: true 14 | PUBLISH_RELEASE: true 15 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 16 | steps: 17 | - name: checkout 18 | uses: actions/checkout@v4 19 | - name: pre-build 20 | uses: ./.github/actions/pre-build 21 | - name: publish 22 | run: ./gradlew publish 23 | - name: post-build 24 | uses: ./.github/actions/post-build 25 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | !.idea 5 | .idea/* 6 | !.idea/codeStyles 7 | .DS_Store 8 | /build 9 | /captures 10 | .externalNativeBuild 11 | .gradletasknamecache 12 | -------------------------------------------------------------------------------- /.idea/codeStyles/codeStyleConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /PRIVACY.md: -------------------------------------------------------------------------------- 1 | # Tencent Shadow SDK个人信息保护规则 2 | _生效日期:2022年4月6日_ 3 | 4 | ## 引言 5 | 6 | Tencent Shadow SDK (以下简称“SDK产品”)由深圳市腾讯计算机系统有限公司(以下简称“我们”)开发, 公司注册地为深圳市南山区粤海街道麻岭社区科技中一路腾讯大厦35层。 7 | 8 | **我们在此特别声明:** 9 | 10 | **1. 本SDK产品功能的实现将不需要收集、获取、传输、分享或者使用终端用户的任何个人信息。** 11 | 12 | **2. 我们不会因为开发者适配、集成和装载本SDK产品而向其提供、传输或共享任何的个人信息。** 13 | 14 | **3. 如果开发者因提供其产品或服务而需要处理终端用户的个人信息, 由开发者独自承担相应的法律责任。** 15 | 16 | **4. 请终端用户注意, 在开发者将本SDK产品适配、集成或装载到开发者产品或服务前, 我们已经要求相关开发者仔细阅读我们在官网公示的相关服务协议、本规则及开发者合规指南(或具有同样性质的相关法律文件), 并已经要求开发者依据开发者的产品收集使用个人信息的情况进行合规自查。** 17 | 18 | **5. 如果我们更新、改进或修改了本SDK产品, 并因此导致我们需要处理终端用户的个人信息的, 我们将会依据适用法律的要求对本规则进行修订, 并将修订后的内容及时告知开发者和终端用户, 我们将要求开发者适时更新其隐私政策,并以弹框形式通知终端用户并且获得其同意。** 19 | 20 | **6. 对于本规则的任何内容存在疑问的, 可以通过如下的方式与我们取得联系:** 21 | 22 | (1) 通过 https://kf.qq.com/ 与我们联系进行在线咨询; 23 | (2) 发送邮件至 Dataprivacy@tencent.com ; 24 | (3) 邮寄信件至:中国广东省深圳市南山区海天二路33号腾讯滨海大厦 数据隐私保护部(收)邮编:518054。 25 | -------------------------------------------------------------------------------- /buildScripts/gradle/versions.properties: -------------------------------------------------------------------------------- 1 | COMPILE_SDK_VERSION=33 2 | MIN_SDK_VERSION=14 3 | TARGET_SDK_VERSION=28 4 | VERSION_CODE=1 5 | VERSION_NAME=local 6 | android_build_tools_version=30.0.3 7 | android_support_annotations_version=28.0.0 8 | android_support_version=27.1.1 9 | androidx_activity_version=1.4.0 10 | androidx_appcompat_version=1.4.1 11 | androidx_test_junit_version=1.1.2 12 | androidx_test_version=1.3.0 13 | build_gradle_version=7.4.2 14 | commons_io_android_version=2.5 15 | commons_io_jvm_version=2.9.0 16 | espresso_version=3.3.0 17 | javapoet_version=1.11.1 18 | javassist_version=3.28.0-GA 19 | json_simple_version=1.1 20 | junit_version=4.12 21 | kotlin_version=1.5.31 22 | slf4j_version=1.7.25 23 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx4096m 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | android.useAndroidX=true 15 | org.gradle.caching=true 16 | 17 | android.nonTransitiveRClass=true 18 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/Shadow/f9dc3944944593c8d398f6ce5cb460f076d18d75/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | #distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip 4 | distributionUrl=https\://mirrors.tencent.com/gradle/gradle-7.5-bin.zip 5 | zipStoreBase=GRADLE_USER_HOME 6 | zipStorePath=wrapper/dists 7 | -------------------------------------------------------------------------------- /pics/run-sample-host-in-ide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/Shadow/f9dc3944944593c8d398f6ce5cb460f076d18d75/pics/run-sample-host-in-ide.png -------------------------------------------------------------------------------- /projects/sample/dynamic-apk/sample-hello-api-holder/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /projects/sample/dynamic-apk/sample-hello-api-holder/README.md: -------------------------------------------------------------------------------- 1 | 演示如何将自定义接口动态化,使得宿主能够使用apk中的实现 2 | 3 | sample-hello-api:定义宿主api接口 4 | sample-hello-api-holder:将 api 动态化,宿主通过这个包提供的方法来获取apk中的实现 5 | 6 | 宿主引入 apk 包,implementation project(':sample-hello-api-holder') 7 | -------------------------------------------------------------------------------- /projects/sample/dynamic-apk/sample-hello-api-holder/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion project.COMPILE_SDK_VERSION 5 | 6 | defaultConfig { 7 | minSdkVersion project.MIN_SDK_VERSION 8 | targetSdkVersion project.TARGET_SDK_VERSION 9 | versionCode project.VERSION_CODE 10 | versionName project.VERSION_NAME 11 | 12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 13 | 14 | } 15 | 16 | buildTypes { 17 | release { 18 | minifyEnabled false 19 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 20 | } 21 | } 22 | } 23 | 24 | dependencies { 25 | // 使用 api 而不是 compileOnly:发布 aar 时会传递依赖,而不是打包进 aar 26 | api 'com.tencent.shadow.core:utils' 27 | api 'com.tencent.shadow.core:common' 28 | api 'com.tencent.shadow.dynamic:dynamic-apk' 29 | 30 | api project(':sample-hello-api') 31 | } -------------------------------------------------------------------------------- /projects/sample/dynamic-apk/sample-hello-api-holder/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /projects/sample/dynamic-apk/sample-hello-api-holder/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /projects/sample/dynamic-apk/sample-hello-api/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /projects/sample/dynamic-apk/sample-hello-api/README.md: -------------------------------------------------------------------------------- 1 | 演示如何将自定义接口动态化,使得宿主能够使用apk中的实现 2 | 3 | sample-hello-api:定义宿主api接口 4 | sample-hello-api-holder:将 api 动态化,宿主通过这个包提供的方法来获取apk中的实现 5 | 6 | -------------------------------------------------------------------------------- /projects/sample/dynamic-apk/sample-hello-api/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion project.COMPILE_SDK_VERSION 5 | 6 | defaultConfig { 7 | minSdkVersion project.MIN_SDK_VERSION 8 | targetSdkVersion project.TARGET_SDK_VERSION 9 | versionCode project.VERSION_CODE 10 | versionName project.VERSION_NAME 11 | 12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 13 | 14 | } 15 | 16 | buildTypes { 17 | release { 18 | minifyEnabled false 19 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /projects/sample/dynamic-apk/sample-hello-api/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /projects/sample/dynamic-apk/sample-hello-api/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /projects/sample/dynamic-apk/sample-hello-api/src/main/java/com/tencent/shadow/sample/api/hello/IHelloWorld.java: -------------------------------------------------------------------------------- 1 | package com.tencent.shadow.sample.api.hello; 2 | 3 | import android.content.Context; 4 | import android.widget.TextView; 5 | 6 | /** 7 | * @author 林学渊 8 | * @email linxy59@mail2.sysu.edu.cn 9 | * @date 2021/9/6 10 | * @description 定义在宿主里的接口,使用插件apk中的实现 11 | * @usage 插件打印 hello world 12 | */ 13 | public interface IHelloWorld { 14 | void sayHelloWorld(Context context, TextView textView); 15 | } 16 | -------------------------------------------------------------------------------- /projects/sample/dynamic-apk/sample-hello-apk/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /projects/sample/dynamic-apk/sample-hello-apk/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | 23 | -keep class org.slf4j.**{*;} 24 | -keep class com.tencent.shadow.dynamic.impl.**{*;} 25 | 26 | -keep class com.tencent.shadow.dynamic.loader.**{*;} 27 | -------------------------------------------------------------------------------- /projects/sample/dynamic-apk/sample-hello-apk/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /projects/sample/dynamic-apk/sample-hello-apk/src/main/java/com/tencent/shadow/dynamic/impl/HelloFactoryImpl.java: -------------------------------------------------------------------------------- 1 | package com.tencent.shadow.dynamic.impl; 2 | 3 | import android.content.Context; 4 | 5 | import com.tencent.shadow.sample.api.hello.HelloFactory; 6 | import com.tencent.shadow.sample.api.hello.IHelloWorldImpl; 7 | import com.tencent.shadow.sample.api.hello.SampleHelloWorld; 8 | 9 | /** 10 | * @author 林学渊 11 | * @email linxy59@mail2.sysu.edu.cn 12 | * @date 2021/9/6 13 | * @description 此类包名及类名固定 14 | * @usage null 15 | */ 16 | public final class HelloFactoryImpl implements HelloFactory { 17 | @Override 18 | public IHelloWorldImpl build(Context context) { 19 | return new SampleHelloWorld(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /projects/sample/dynamic-apk/sample-hello-apk/src/main/java/com/tencent/shadow/sample/api/hello/SampleHelloWorld.java: -------------------------------------------------------------------------------- 1 | package com.tencent.shadow.sample.api.hello; 2 | 3 | import android.content.Context; 4 | import android.os.Bundle; 5 | import android.widget.TextView; 6 | 7 | /** 8 | * @author 林学渊 9 | * @email linxy59@mail2.sysu.edu.cn 10 | * @date 2021/9/6 11 | * @description 实现宿主自定义接口 12 | * @usage null 13 | */ 14 | public class SampleHelloWorld implements IHelloWorldImpl { 15 | @Override 16 | public void sayHelloWorld(Context context, TextView textView) { 17 | String text = "这是apk中的实现:" + SampleHelloWorld.class.toString(); 18 | if (textView == null) { 19 | return; 20 | } 21 | textView.setText(text); 22 | } 23 | 24 | @Override 25 | public void onCreate(Bundle bundle) { 26 | 27 | } 28 | 29 | @Override 30 | public void onSaveInstanceState(Bundle outState) { 31 | 32 | } 33 | 34 | @Override 35 | public void onDestroy() { 36 | 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /projects/sample/dynamic-apk/sample-hello-host/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /projects/sample/dynamic-apk/sample-hello-host/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | 23 | -keep class org.slf4j.**{*;} 24 | -dontwarn org.slf4j.impl.** 25 | 26 | -keep class com.tencent.shadow.dynamic.host.**{*;} 27 | -keep class com.tencent.shadow.core.common.**{*;} 28 | -keep class com.tencent.shadow.core.runtime.container.**{*;} 29 | -------------------------------------------------------------------------------- /projects/sample/dynamic-apk/sample-hello-host/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /projects/sample/maven/host-project/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | .idea 5 | .DS_Store 6 | /build 7 | /captures 8 | .externalNativeBuild 9 | -------------------------------------------------------------------------------- /projects/sample/maven/host-project/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx4096m 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | # Kotlin code style for this project: "official" or "obsolete": 15 | kotlin.code.style=official 16 | -------------------------------------------------------------------------------- /projects/sample/maven/host-project/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/Shadow/f9dc3944944593c8d398f6ce5cb460f076d18d75/projects/sample/maven/host-project/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /projects/sample/maven/host-project/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | #distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip 4 | distributionUrl=https\://mirrors.tencent.com/gradle/gradle-6.6.1-bin.zip 5 | zipStoreBase=GRADLE_USER_HOME 6 | zipStorePath=wrapper/dists 7 | -------------------------------------------------------------------------------- /projects/sample/maven/host-project/introduce-shadow-lib/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /projects/sample/maven/host-project/introduce-shadow-lib/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion 29 5 | 6 | 7 | defaultConfig { 8 | minSdkVersion 16 9 | targetSdkVersion 28 10 | versionCode 1 11 | versionName "1.0" 12 | } 13 | 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | 21 | } 22 | 23 | dependencies { 24 | implementation "com.tencent.shadow.dynamic:host:$shadow_version" 25 | } 26 | -------------------------------------------------------------------------------- /projects/sample/maven/host-project/introduce-shadow-lib/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /projects/sample/maven/host-project/introduce-shadow-lib/src/main/java/com/tencent/shadow/sample/introduce_shadow_lib/FixedPathPmUpdater.java: -------------------------------------------------------------------------------- 1 | package com.tencent.shadow.sample.introduce_shadow_lib; 2 | 3 | import com.tencent.shadow.dynamic.host.PluginManagerUpdater; 4 | 5 | import java.io.File; 6 | import java.util.concurrent.Future; 7 | 8 | /** 9 | * 这个Updater没有任何升级能力。直接将指定路径作为其升级结果。 10 | */ 11 | public class FixedPathPmUpdater implements PluginManagerUpdater { 12 | 13 | final private File apk; 14 | 15 | FixedPathPmUpdater(File apk) { 16 | this.apk = apk; 17 | } 18 | 19 | 20 | @Override 21 | public boolean wasUpdating() { 22 | return false; 23 | } 24 | 25 | @Override 26 | public Future update() { 27 | return null; 28 | } 29 | 30 | @Override 31 | public File getLatest() { 32 | return apk; 33 | } 34 | 35 | @Override 36 | public Future isAvailable(final File file) { 37 | return null; 38 | } 39 | } -------------------------------------------------------------------------------- /projects/sample/maven/host-project/introduce-shadow-lib/src/main/java/com/tencent/shadow/sample/introduce_shadow_lib/MainPluginProcessService.java: -------------------------------------------------------------------------------- 1 | package com.tencent.shadow.sample.introduce_shadow_lib; 2 | 3 | import com.tencent.shadow.dynamic.host.PluginProcessService; 4 | 5 | /** 6 | * 一个PluginProcessService(简称PPS)代表一个插件进程。插件进程由PPS启动触发启动。 7 | * 新建PPS子类允许一个宿主中有多个互不影响的插件进程。 8 | */ 9 | public class MainPluginProcessService extends PluginProcessService { 10 | } 11 | -------------------------------------------------------------------------------- /projects/sample/maven/host-project/introduce-shadow-lib/src/main/res/values/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | -------------------------------------------------------------------------------- /projects/sample/maven/host-project/sample-host/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /projects/sample/maven/host-project/sample-host/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 29 5 | defaultConfig { 6 | applicationId "com.tencent.shadow.sample.host" 7 | minSdkVersion 16 8 | targetSdkVersion 28 9 | versionCode 1 10 | versionName "1.0" 11 | } 12 | buildTypes { 13 | release { 14 | minifyEnabled true 15 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 16 | 17 | signingConfig signingConfigs.create("release") 18 | signingConfig.initWith(buildTypes.debug.signingConfig) 19 | } 20 | } 21 | } 22 | 23 | dependencies { 24 | implementation project(':introduce-shadow-lib') 25 | 26 | //如果introduce-shadow-lib发布到Maven,在pom中写明此依赖,宿主就不用写这个依赖了。 27 | implementation "com.tencent.shadow.dynamic:host:$shadow_version" 28 | } 29 | -------------------------------------------------------------------------------- /projects/sample/maven/host-project/sample-host/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -keep class com.tencent.shadow.core.common.**{*;} 23 | -keep class com.tencent.shadow.core.runtime.**{*;} 24 | -keep class com.tencent.shadow.dynamic.host.**{*;} -------------------------------------------------------------------------------- /projects/sample/maven/host-project/sample-host/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /projects/sample/maven/host-project/sample-host/src/main/java/com/tencent/shadow/sample/host/MyApplication.java: -------------------------------------------------------------------------------- 1 | package com.tencent.shadow.sample.host; 2 | 3 | import android.app.Application; 4 | 5 | import com.tencent.shadow.sample.introduce_shadow_lib.InitApplication; 6 | 7 | public class MyApplication extends Application { 8 | @Override 9 | public void onCreate() { 10 | super.onCreate(); 11 | 12 | InitApplication.onApplicationCreate(this); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /projects/sample/maven/host-project/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':sample-host', ':introduce-shadow-lib' 2 | -------------------------------------------------------------------------------- /projects/sample/maven/manager-project/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | .idea 5 | .DS_Store 6 | /build 7 | /captures 8 | .externalNativeBuild 9 | -------------------------------------------------------------------------------- /projects/sample/maven/manager-project/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx4096m 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | # Kotlin code style for this project: "official" or "obsolete": 15 | kotlin.code.style=official 16 | -------------------------------------------------------------------------------- /projects/sample/maven/manager-project/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/Shadow/f9dc3944944593c8d398f6ce5cb460f076d18d75/projects/sample/maven/manager-project/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /projects/sample/maven/manager-project/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed May 08 11:09:16 CST 2019 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | #distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip 7 | distributionUrl=https\://mirrors.tencent.com/gradle/gradle-6.6.1-bin.zip 8 | -------------------------------------------------------------------------------- /projects/sample/maven/manager-project/sample-manager/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /projects/sample/maven/manager-project/sample-manager/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | -keep class com.tencent.shadow.dynamic.impl.**{*;} 2 | 3 | -keep class com.tencent.shadow.dynamic.loader.**{*;} 4 | -------------------------------------------------------------------------------- /projects/sample/maven/manager-project/sample-manager/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /projects/sample/maven/manager-project/sample-manager/src/main/aidl/com/tencent/shadow/sample/plugin/IMyAidlInterface.aidl: -------------------------------------------------------------------------------- 1 | // IMyAidlInterface.aidl 2 | package com.tencent.shadow.sample.plugin; 3 | 4 | // Declare any non-default types here with import statements 5 | 6 | interface IMyAidlInterface { 7 | /** 8 | * Demonstrates some basic types that you can use as parameters 9 | * and return values in AIDL. 10 | */ 11 | String basicTypes(int anInt, long aLong, boolean aBoolean, float aFloat, 12 | double aDouble, String aString); 13 | } 14 | -------------------------------------------------------------------------------- /projects/sample/maven/manager-project/sample-manager/src/main/java/com/tencent/shadow/dynamic/impl/ManagerFactoryImpl.java: -------------------------------------------------------------------------------- 1 | package com.tencent.shadow.dynamic.impl; 2 | 3 | import android.content.Context; 4 | 5 | import com.tencent.shadow.dynamic.host.ManagerFactory; 6 | import com.tencent.shadow.dynamic.host.PluginManagerImpl; 7 | import com.tencent.shadow.sample.manager.SamplePluginManager; 8 | 9 | /** 10 | * 此类包名及类名固定 11 | */ 12 | public final class ManagerFactoryImpl implements ManagerFactory { 13 | @Override 14 | public PluginManagerImpl buildManager(Context context) { 15 | return new SamplePluginManager(context); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /projects/sample/maven/manager-project/sample-manager/src/main/java/com/tencent/shadow/dynamic/impl/WhiteList.java: -------------------------------------------------------------------------------- 1 | package com.tencent.shadow.dynamic.impl; 2 | 3 | /** 4 | * 此类包名及类名固定 5 | * classLoader的白名单 6 | * PluginManager可以加载宿主中位于白名单内的类 7 | */ 8 | public interface WhiteList { 9 | String[] sWhiteList = new String[] 10 | { 11 | }; 12 | } 13 | -------------------------------------------------------------------------------- /projects/sample/maven/manager-project/sample-manager/src/main/java/com/tencent/shadow/sample/manager/Constant.java: -------------------------------------------------------------------------------- 1 | package com.tencent.shadow.sample.manager; 2 | 3 | final public class Constant { 4 | public static final String KEY_PLUGIN_ZIP_PATH = "pluginZipPath"; 5 | public static final String KEY_ACTIVITY_CLASSNAME = "KEY_ACTIVITY_CLASSNAME"; 6 | public static final String KEY_EXTRAS = "KEY_EXTRAS"; 7 | public static final String KEY_PLUGIN_PART_KEY = "KEY_PLUGIN_PART_KEY"; 8 | public static final int FROM_ID_START_ACTIVITY = 1001; 9 | public static final int FROM_ID_CALL_SERVICE = 1002; 10 | } 11 | -------------------------------------------------------------------------------- /projects/sample/maven/manager-project/sample-manager/src/main/res/layout/activity_load_plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 16 | 17 | 22 | -------------------------------------------------------------------------------- /projects/sample/maven/manager-project/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':sample-manager' 2 | -------------------------------------------------------------------------------- /projects/sample/maven/plugin-project/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | .idea 5 | .DS_Store 6 | /build 7 | /captures 8 | .externalNativeBuild 9 | -------------------------------------------------------------------------------- /projects/sample/maven/plugin-project/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx4096m 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | # Kotlin code style for this project: "official" or "obsolete": 15 | kotlin.code.style=official 16 | -------------------------------------------------------------------------------- /projects/sample/maven/plugin-project/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/Shadow/f9dc3944944593c8d398f6ce5cb460f076d18d75/projects/sample/maven/plugin-project/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /projects/sample/maven/plugin-project/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed May 08 11:09:16 CST 2019 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | #distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip 7 | distributionUrl=https\://mirrors.tencent.com/gradle/gradle-6.6.1-bin.zip 8 | -------------------------------------------------------------------------------- /projects/sample/maven/plugin-project/plugin-app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /projects/sample/maven/plugin-project/plugin-app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /projects/sample/maven/plugin-project/plugin-app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /projects/sample/maven/plugin-project/plugin-app/src/main/aidl/com/tencent/shadow/sample/plugin/IMyAidlInterface.aidl: -------------------------------------------------------------------------------- 1 | // IMyAidlInterface.aidl 2 | package com.tencent.shadow.sample.plugin; 3 | 4 | // Declare any non-default types here with import statements 5 | 6 | interface IMyAidlInterface { 7 | /** 8 | * Demonstrates some basic types that you can use as parameters 9 | * and return values in AIDL. 10 | */ 11 | String basicTypes(int anInt, long aLong, boolean aBoolean, float aFloat, 12 | double aDouble, String aString); 13 | } 14 | -------------------------------------------------------------------------------- /projects/sample/maven/plugin-project/plugin-app/src/main/java/com/tencent/shadow/sample/plugin/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.tencent.shadow.sample.plugin; 2 | 3 | import android.app.Activity; 4 | import android.os.Bundle; 5 | 6 | public class MainActivity extends Activity { 7 | @Override 8 | protected void onCreate(Bundle savedInstanceState) { 9 | super.onCreate(savedInstanceState); 10 | setContentView(R.layout.activity_main); 11 | } 12 | } -------------------------------------------------------------------------------- /projects/sample/maven/plugin-project/plugin-app/src/main/java/com/tencent/shadow/sample/plugin/MyService.java: -------------------------------------------------------------------------------- 1 | package com.tencent.shadow.sample.plugin; 2 | 3 | import android.app.Service; 4 | import android.content.Intent; 5 | import android.os.IBinder; 6 | import android.os.RemoteException; 7 | 8 | public class MyService extends Service { 9 | public MyService() { 10 | } 11 | 12 | @Override 13 | public IBinder onBind(Intent intent) { 14 | return new IMyAidlInterface.Stub() { 15 | @Override 16 | public String basicTypes(int anInt, long aLong, boolean aBoolean, float aFloat, double aDouble, String aString) throws RemoteException { 17 | return Integer.toString(anInt) + aLong + aBoolean + aFloat + aDouble + aString; 18 | } 19 | }; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /projects/sample/maven/plugin-project/plugin-app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | 13 | -------------------------------------------------------------------------------- /projects/sample/maven/plugin-project/plugin-app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #008577 4 | #00574B 5 | #D81B60 6 | 7 | -------------------------------------------------------------------------------- /projects/sample/maven/plugin-project/plugin-app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Shadow Sample Plugin 3 | 4 | -------------------------------------------------------------------------------- /projects/sample/maven/plugin-project/plugin-app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /projects/sample/maven/plugin-project/sample-loader/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /projects/sample/maven/plugin-project/sample-loader/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /projects/sample/maven/plugin-project/sample-loader/src/main/java/com/tencent/shadow/dynamic/loader/impl/CoreLoaderFactoryImpl.java: -------------------------------------------------------------------------------- 1 | package com.tencent.shadow.dynamic.loader.impl; 2 | 3 | import android.content.Context; 4 | 5 | import com.tencent.shadow.core.loader.ShadowPluginLoader; 6 | import com.tencent.shadow.sample.loader.SamplePluginLoader; 7 | 8 | import org.jetbrains.annotations.NotNull; 9 | 10 | /** 11 | * 这个类的包名类名是固定的。 12 | *

13 | * 见com.tencent.shadow.dynamic.loader.impl.DynamicPluginLoader#CORE_LOADER_FACTORY_IMPL_NAME 14 | */ 15 | public class CoreLoaderFactoryImpl implements CoreLoaderFactory { 16 | 17 | @NotNull 18 | @Override 19 | public ShadowPluginLoader build(@NotNull Context context) { 20 | return new SamplePluginLoader(context); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /projects/sample/maven/plugin-project/sample-loader/src/main/java/com/tencent/shadow/sample/loader/SamplePluginLoader.java: -------------------------------------------------------------------------------- 1 | package com.tencent.shadow.sample.loader; 2 | 3 | import android.content.Context; 4 | 5 | import com.tencent.shadow.core.loader.ShadowPluginLoader; 6 | import com.tencent.shadow.core.loader.managers.ComponentManager; 7 | import com.tencent.shadow.sample.loader.SampleComponentManager; 8 | 9 | /** 10 | * 这里的类名和包名需要固定 11 | * com.tencent.shadow.sdk.pluginloader.PluginLoaderImpl 12 | */ 13 | public class SamplePluginLoader extends ShadowPluginLoader { 14 | 15 | private final static String TAG = "shadow"; 16 | 17 | private ComponentManager componentManager; 18 | 19 | public SamplePluginLoader(Context hostAppContext) { 20 | super(hostAppContext); 21 | componentManager = new SampleComponentManager(hostAppContext); 22 | } 23 | 24 | @Override 25 | public ComponentManager getComponentManager() { 26 | return componentManager; 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /projects/sample/maven/plugin-project/sample-runtime/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /projects/sample/maven/plugin-project/sample-runtime/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 29 5 | defaultConfig { 6 | applicationId "com.tencent.shadow.sample.runtime"//applicationId不重要 7 | minSdkVersion 16 8 | targetSdkVersion 28 9 | versionCode 1 10 | versionName "1.0" 11 | } 12 | buildTypes { 13 | debug { 14 | minifyEnabled false 15 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 16 | } 17 | 18 | release { 19 | minifyEnabled true 20 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 21 | 22 | signingConfig signingConfigs.create("release") 23 | signingConfig.initWith(buildTypes.debug.signingConfig) 24 | } 25 | } 26 | } 27 | 28 | dependencies { 29 | implementation "com.tencent.shadow.core:activity-container:$shadow_version" 30 | } 31 | 32 | -------------------------------------------------------------------------------- /projects/sample/maven/plugin-project/sample-runtime/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /projects/sample/maven/plugin-project/sample-runtime/src/main/java/com/tencent/shadow/sample/runtime/PluginDefaultProxyActivity.java: -------------------------------------------------------------------------------- 1 | package com.tencent.shadow.sample.runtime; 2 | 3 | 4 | import com.tencent.shadow.core.runtime.container.PluginContainerActivity; 5 | 6 | public class PluginDefaultProxyActivity extends PluginContainerActivity { 7 | } 8 | -------------------------------------------------------------------------------- /projects/sample/maven/plugin-project/sample-runtime/src/main/java/com/tencent/shadow/sample/runtime/PluginSingleInstance1ProxyActivity.java: -------------------------------------------------------------------------------- 1 | package com.tencent.shadow.sample.runtime; 2 | 3 | 4 | import com.tencent.shadow.core.runtime.container.PluginContainerActivity; 5 | 6 | public class PluginSingleInstance1ProxyActivity extends PluginContainerActivity { 7 | } 8 | -------------------------------------------------------------------------------- /projects/sample/maven/plugin-project/sample-runtime/src/main/java/com/tencent/shadow/sample/runtime/PluginSingleTask1ProxyActivity.java: -------------------------------------------------------------------------------- 1 | package com.tencent.shadow.sample.runtime; 2 | 3 | 4 | import com.tencent.shadow.core.runtime.container.PluginContainerActivity; 5 | 6 | public class PluginSingleTask1ProxyActivity extends PluginContainerActivity { 7 | } 8 | -------------------------------------------------------------------------------- /projects/sample/maven/plugin-project/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':plugin-app' 2 | include ':sample-runtime' 3 | include ':sample-loader' 4 | -------------------------------------------------------------------------------- /projects/sample/source/sample-constant/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /projects/sample/source/sample-constant/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion project.COMPILE_SDK_VERSION 5 | 6 | 7 | defaultConfig { 8 | minSdkVersion project.MIN_SDK_VERSION 9 | targetSdkVersion project.TARGET_SDK_VERSION 10 | versionCode project.VERSION_CODE 11 | versionName project.VERSION_NAME 12 | 13 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 14 | 15 | } 16 | 17 | buildTypes { 18 | release { 19 | minifyEnabled false 20 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 21 | } 22 | } 23 | 24 | } 25 | 26 | -------------------------------------------------------------------------------- /projects/sample/source/sample-constant/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /projects/sample/source/sample-constant/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /projects/sample/source/sample-host-lib/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /projects/sample/source/sample-host-lib/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | apply plugin: 'com.tencent.shadow.internal.aar-to-jar' 3 | 4 | android { 5 | compileSdkVersion project.COMPILE_SDK_VERSION 6 | 7 | 8 | defaultConfig { 9 | minSdkVersion project.MIN_SDK_VERSION 10 | targetSdkVersion project.TARGET_SDK_VERSION 11 | versionCode project.VERSION_CODE 12 | versionName project.VERSION_NAME 13 | 14 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 15 | 16 | } 17 | 18 | buildTypes { 19 | release { 20 | minifyEnabled false 21 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 22 | consumerProguardFiles 'sample-host-lib.pro' 23 | } 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /projects/sample/source/sample-host-lib/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /projects/sample/source/sample-host-lib/sample-host-lib.pro: -------------------------------------------------------------------------------- 1 | #让宿主在打包时能够keep住插件要使用到的类名和方法 2 | -keep class com.tencent.shadow.sample.host.lib.*{ 3 | public *; 4 | } 5 | -------------------------------------------------------------------------------- /projects/sample/source/sample-host-lib/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /projects/sample/source/sample-host-lib/src/main/java/com/tencent/shadow/sample/host/lib/HostAddPluginViewContainer.java: -------------------------------------------------------------------------------- 1 | package com.tencent.shadow.sample.host.lib; 2 | 3 | import android.view.View; 4 | 5 | public interface HostAddPluginViewContainer { 6 | void addView(View view); 7 | } 8 | -------------------------------------------------------------------------------- /projects/sample/source/sample-host-lib/src/main/java/com/tencent/shadow/sample/host/lib/HostAddPluginViewContainerHolder.java: -------------------------------------------------------------------------------- 1 | package com.tencent.shadow.sample.host.lib; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | public class HostAddPluginViewContainerHolder { 7 | public final static Map instances = new HashMap<>(); 8 | } 9 | -------------------------------------------------------------------------------- /projects/sample/source/sample-host-lib/src/main/java/com/tencent/shadow/sample/host/lib/LoadPluginCallback.java: -------------------------------------------------------------------------------- 1 | package com.tencent.shadow.sample.host.lib; 2 | 3 | import android.content.pm.ApplicationInfo; 4 | import android.content.res.Resources; 5 | 6 | public class LoadPluginCallback { 7 | 8 | private static Callback sCallback; 9 | 10 | public static void setCallback(Callback callback) { 11 | sCallback = callback; 12 | } 13 | 14 | public static Callback getCallback() { 15 | return sCallback; 16 | } 17 | 18 | public interface Callback { 19 | void beforeLoadPlugin(String partKey); 20 | 21 | void afterLoadPlugin(String partKey, ApplicationInfo applicationInfo, ClassLoader pluginClassLoader, Resources pluginResources); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /projects/sample/source/sample-host-lib/src/main/res/layout/host_ui_layer_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 13 | 14 | -------------------------------------------------------------------------------- /projects/sample/source/sample-host/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /projects/sample/source/sample-host/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | 23 | -keep class org.slf4j.**{*;} 24 | -dontwarn org.slf4j.impl.** 25 | 26 | -keep class com.tencent.shadow.dynamic.host.**{*;} 27 | -keep class com.tencent.shadow.core.common.**{*;} 28 | -keep class com.tencent.shadow.core.runtime.container.**{*;} 29 | -------------------------------------------------------------------------------- /projects/sample/source/sample-host/src/main/java/com/tencent/shadow/sample/host/plugin_view/MainProcessManagerReceiver.java: -------------------------------------------------------------------------------- 1 | package com.tencent.shadow.sample.host.plugin_view; 2 | 3 | import android.content.BroadcastReceiver; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | 7 | import com.tencent.shadow.sample.constant.Constant; 8 | import com.tencent.shadow.sample.host.HostApplication; 9 | 10 | public class MainProcessManagerReceiver extends BroadcastReceiver { 11 | @Override 12 | public void onReceive(Context context, Intent intent) { 13 | HostApplication.getApp().getPluginManager() 14 | .enter(context, Constant.FROM_ID_LOAD_VIEW_TO_HOST, intent.getExtras(), null); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /projects/sample/source/sample-host/src/main/res/values/themes.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | 20 | 21 | 11 | 12 | #9c27b0 13 | #7b1fa2 14 | #e040fb 15 | -------------------------------------------------------------------------------- /projects/sample/source/sample-plugin/sample-app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | 20 | 21 | Shadow主测试用例集合 22 | 这是插件中的string资源 23 | 24 | 25 | -------------------------------------------------------------------------------- /projects/sample/source/sample-plugin/sample-app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 11 | -------------------------------------------------------------------------------- /projects/sample/source/sample-plugin/sample-base-lib/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /projects/sample/source/sample-plugin/sample-base-lib/src/main/res/layout/layout_main_behind.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | -------------------------------------------------------------------------------- /projects/sample/source/sample-plugin/sample-base-lib/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | 20 | 40dp> 21 | 22 | -------------------------------------------------------------------------------- /projects/sample/source/sample-plugin/sample-base-lib/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | 20 | 21 | sample-base-lib 22 | 23 | 24 | -------------------------------------------------------------------------------- /projects/sample/source/sample-plugin/sample-base-lib/src/main/res/values/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /projects/sample/source/sample-plugin/sample-base/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /projects/sample/source/sample-plugin/sample-base/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 /Users/cubershi/Library/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 | #这是Shadow在编译期将AndroidManifest.xml中所需信息生成的Java类,没有被代码自然引用,所以需要手工keep住。 20 | -keep class com.tencent.shadow.core.manifest_parser.PluginManifest{*;} 21 | -------------------------------------------------------------------------------- /projects/sample/source/sample-plugin/sample-base/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /projects/sample/source/sample-plugin/sample-loader/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /projects/sample/source/sample-plugin/sample-loader/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /projects/sample/source/sample-plugin/sample-runtime/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /projects/sample/source/sample-plugin/sample-runtime/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion project.COMPILE_SDK_VERSION 5 | defaultConfig { 6 | applicationId project.SAMPLE_HOST_APP_APPLICATION_ID 7 | minSdkVersion project.MIN_SDK_VERSION 8 | targetSdkVersion project.TARGET_SDK_VERSION 9 | versionCode project.VERSION_CODE 10 | versionName project.VERSION_NAME 11 | } 12 | buildTypes { 13 | debug { 14 | minifyEnabled false 15 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 16 | } 17 | 18 | release { 19 | minifyEnabled true 20 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 21 | 22 | signingConfig signingConfigs.create("release") 23 | signingConfig.initWith(buildTypes.debug.signingConfig) 24 | } 25 | } 26 | } 27 | 28 | dependencies { 29 | implementation 'com.tencent.shadow.core:activity-container' 30 | } 31 | 32 | -------------------------------------------------------------------------------- /projects/sample/source/sample-plugin/sample-runtime/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | 23 | -keep class org.slf4j.**{*;} 24 | -dontwarn org.slf4j.impl.** 25 | 26 | -keep class com.tencent.shadow.core.runtime.**{*;} 27 | 28 | -keep class * extends com.tencent.shadow.core.runtime.container.PluginContainerActivity -------------------------------------------------------------------------------- /projects/sample/source/sample-plugin/sample-runtime/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /projects/sample/source/sample-plugin/third-party/pinnedheaderexpandablelistview/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /projects/sample/source/sample-plugin/third-party/pinnedheaderexpandablelistview/README.md: -------------------------------------------------------------------------------- 1 | https://github.com/singwhatiwanna/PinnedHeaderExpandableListView 2 | -------------------------------------------------------------------------------- /projects/sample/source/sample-plugin/third-party/pinnedheaderexpandablelistview/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion project.COMPILE_SDK_VERSION 5 | 6 | 7 | defaultConfig { 8 | minSdkVersion project.MIN_SDK_VERSION 9 | targetSdkVersion project.TARGET_SDK_VERSION 10 | versionCode project.VERSION_CODE 11 | versionName project.VERSION_NAME 12 | 13 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 14 | 15 | } 16 | 17 | buildTypes { 18 | release { 19 | minifyEnabled false 20 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 21 | } 22 | } 23 | 24 | lintOptions { 25 | abortOnError false 26 | } 27 | } 28 | 29 | dependencies { 30 | } 31 | -------------------------------------------------------------------------------- /projects/sample/source/sample-plugin/third-party/pinnedheaderexpandablelistview/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /projects/sample/source/sample-plugin/third-party/pinnedheaderexpandablelistview/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /projects/sample/source/sample-plugin/third-party/slidingmenu/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /projects/sample/source/sample-plugin/third-party/slidingmenu/README.md: -------------------------------------------------------------------------------- 1 | https://github.com/jfeinstein10/SlidingMenu 2 | -------------------------------------------------------------------------------- /projects/sample/source/sample-plugin/third-party/slidingmenu/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion project.COMPILE_SDK_VERSION 5 | 6 | 7 | defaultConfig { 8 | minSdkVersion project.MIN_SDK_VERSION 9 | targetSdkVersion project.TARGET_SDK_VERSION 10 | versionCode project.VERSION_CODE 11 | versionName project.VERSION_NAME 12 | 13 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 14 | 15 | } 16 | 17 | buildTypes { 18 | release { 19 | minifyEnabled false 20 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 21 | } 22 | } 23 | 24 | } 25 | 26 | dependencies{ 27 | implementation 'com.android.support:support-fragment:27.0.2' 28 | } -------------------------------------------------------------------------------- /projects/sample/source/sample-plugin/third-party/slidingmenu/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /projects/sample/source/sample-plugin/third-party/slidingmenu/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /projects/sample/source/sample-plugin/third-party/slidingmenu/src/main/res/values/ids.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /projects/sdk/coding/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | .idea 5 | .DS_Store 6 | /build 7 | /captures 8 | .externalNativeBuild 9 | .gradletasknamecache -------------------------------------------------------------------------------- /projects/sdk/coding/aar-to-jar-plugin/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /projects/sdk/coding/aar-to-jar-plugin/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java-gradle-plugin' 2 | 3 | apply plugin: 'kotlin' 4 | 5 | gradlePlugin { 6 | plugins { 7 | shadow { 8 | id = "com.tencent.shadow.internal.aar-to-jar" 9 | implementationClass = "com.tencent.shadow.coding.aar_to_jar_plugin.AarToJarPlugin" 10 | } 11 | } 12 | } 13 | 14 | dependencies { 15 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 16 | implementation "com.android.tools.build:gradle:$build_gradle_version" 17 | testImplementation "junit:junit:$junit_version" 18 | testImplementation gradleTestKit() 19 | 20 | } 21 | -------------------------------------------------------------------------------- /projects/sdk/coding/android-jar/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /projects/sdk/coding/android-jar/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java-library' 2 | 3 | java { 4 | sourceCompatibility = JavaVersion.VERSION_1_7 5 | targetCompatibility = JavaVersion.VERSION_1_7 6 | } 7 | 8 | evaluationDependsOn(':get-android-jar') 9 | dependencies { 10 | def androidJarPath = project(':get-android-jar').androidJarPath 11 | api files(androidJarPath) 12 | } 13 | -------------------------------------------------------------------------------- /projects/sdk/coding/code-generator/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /projects/sdk/coding/code-generator/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'kotlin' 2 | 3 | dependencies { 4 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 5 | implementation "com.squareup:javapoet:$javapoet_version" 6 | implementation "org.javassist:javassist:$javassist_version" 7 | implementation "junit:junit:$junit_version" 8 | 9 | compileOnly project(':android-jar') 10 | testImplementation project(':android-jar') 11 | } 12 | 13 | compileKotlin { 14 | kotlinOptions { 15 | jvmTarget = "1.6" 16 | } 17 | } 18 | 19 | compileTestKotlin { 20 | kotlinOptions { 21 | jvmTarget = "1.6" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /projects/sdk/coding/code-generator/src/main/kotlin/com/tencent/shadow/core/runtime/NeighborClass.kt: -------------------------------------------------------------------------------- 1 | package com.tencent.shadow.core.runtime 2 | 3 | /** 4 | * 为了兼容JDK 17和javassist 5 | * https://github.com/jboss-javassist/javassist/issues/369 6 | */ 7 | class NeighborClass -------------------------------------------------------------------------------- /projects/sdk/coding/code-generator/src/test/kotlin/com/tencent/shadow/coding/code_generator/ActivityCodeGeneratorTest.kt: -------------------------------------------------------------------------------- 1 | package com.tencent.shadow.coding.code_generator 2 | 3 | import org.junit.Test 4 | 5 | 6 | internal class ActivityCodeGeneratorTest { 7 | @Test 8 | fun testLoadAndroidClass() { 9 | ActivityCodeGenerator.classPool.get("android.app.Activity") 10 | } 11 | } -------------------------------------------------------------------------------- /projects/sdk/coding/common-jar-settings/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /projects/sdk/coding/get-android-jar/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /projects/sdk/coding/get-android-jar/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion project.COMPILE_SDK_VERSION 5 | } 6 | 7 | def sdkPath = android.sdkDirectory 8 | def androidJarPath = new File(sdkPath, "platforms/${android.compileSdkVersion}/android.jar") 9 | 10 | if (!androidJarPath.exists()) { 11 | println("File $androidJarPath not exists!") 12 | throw new RuntimeException("Android SDK ${android.compileSdkVersion} 没有安装") 13 | } 14 | 15 | ext.set('androidJarPath', androidJarPath) 16 | -------------------------------------------------------------------------------- /projects/sdk/coding/get-android-jar/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /projects/sdk/coding/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/Shadow/f9dc3944944593c8d398f6ce5cb460f076d18d75/projects/sdk/coding/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /projects/sdk/coding/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | #distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip 4 | distributionUrl=https\://mirrors.tencent.com/gradle/gradle-7.5-bin.zip 5 | zipStoreBase=GRADLE_USER_HOME 6 | zipStorePath=wrapper/dists 7 | -------------------------------------------------------------------------------- /projects/sdk/coding/java-build-config/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /projects/sdk/coding/settings.gradle: -------------------------------------------------------------------------------- 1 | include 'code-generator' 2 | include 'aar-to-jar-plugin' 3 | include 'common-jar-settings' 4 | include 'get-android-jar' 5 | include 'android-jar' 6 | include 'java-build-config' 7 | -------------------------------------------------------------------------------- /projects/sdk/core/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | .idea 5 | .DS_Store 6 | /build 7 | /captures 8 | .externalNativeBuild 9 | .gradletasknamecache 10 | 11 | -------------------------------------------------------------------------------- /projects/sdk/core/activity-container/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /projects/sdk/core/activity-container/build.gradle: -------------------------------------------------------------------------------- 1 | import com.tencent.shadow.coding.code_generator.ActivityCodeGenerator 2 | 3 | buildscript { 4 | dependencies { 5 | classpath 'com.tencent.shadow.coding:android-jar' 6 | classpath 'com.tencent.shadow.coding:code-generator' 7 | } 8 | } 9 | 10 | apply plugin: 'com.tencent.shadow.internal.common-jar-settings' 11 | 12 | java { 13 | sourceSets { 14 | main.java.srcDirs += 'build/generated/sources/code-generator' 15 | } 16 | } 17 | 18 | def generateCode = tasks.register('generateCode') { 19 | def outputDir = layout.buildDirectory.dir('generated/sources/code-generator') 20 | outputs.dir(outputDir) 21 | .withPropertyName('outputDir') 22 | doLast { 23 | ActivityCodeGenerator codeGenerator = new ActivityCodeGenerator() 24 | codeGenerator.generate(outputDir.get().getAsFile(), "activity_container") 25 | } 26 | } 27 | 28 | compileJava.dependsOn(generateCode) 29 | 30 | dependencies { 31 | implementation 'com.tencent.shadow.coding:java-build-config' 32 | } 33 | -------------------------------------------------------------------------------- /projects/sdk/core/common/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /projects/sdk/core/common/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.tencent.shadow.internal.common-jar-settings' 2 | -------------------------------------------------------------------------------- /projects/sdk/core/common/src/main/java/com/tencent/shadow/core/common/ILoggerFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Tencent Shadow available. 3 | * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. 4 | * 5 | * Licensed under the BSD 3-Clause License (the "License"); you may not use 6 | * this file except in compliance with the License. You may obtain a copy of 7 | * the License at 8 | * 9 | * https://opensource.org/licenses/BSD-3-Clause 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | package com.tencent.shadow.core.common; 20 | 21 | public interface ILoggerFactory { 22 | 23 | Logger getLogger(String name); 24 | } 25 | 26 | -------------------------------------------------------------------------------- /projects/sdk/core/gradle-plugin/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /projects/sdk/core/gradle-plugin/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java-gradle-plugin' 2 | 3 | apply plugin: 'kotlin' 4 | 5 | gradlePlugin { 6 | plugins { 7 | shadow { 8 | id = "com.tencent.shadow.plugin" 9 | implementationClass = "com.tencent.shadow.core.gradle.ShadowPlugin" 10 | } 11 | } 12 | } 13 | 14 | dependencies { 15 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 16 | implementation "com.android.tools.build:gradle:$build_gradle_version" 17 | implementation "com.googlecode.json-simple:json-simple:$json_simple_version" 18 | implementation project(':transform') 19 | implementation project(':manifest-parser') 20 | testImplementation "junit:junit:$junit_version" 21 | testImplementation gradleTestKit() 22 | 23 | } 24 | 25 | compileKotlin { 26 | kotlinOptions { 27 | jvmTarget = "1.6" 28 | } 29 | } 30 | 31 | compileTestKotlin { 32 | kotlinOptions { 33 | jvmTarget = "1.6" 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /projects/sdk/core/gradle-plugin/src/test/testProjects/case1/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | .idea 5 | .DS_Store 6 | build 7 | /captures 8 | .externalNativeBuild 9 | .gradletasknamecache -------------------------------------------------------------------------------- /projects/sdk/core/gradle-plugin/src/test/testProjects/case1/loader/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'com.android.application' 3 | } 4 | 5 | android { 6 | compileSdkVersion COMPILE_SDK_VERSION 7 | 8 | defaultConfig { 9 | applicationId "com.tencent.shadow.test.gradle.case1" 10 | minSdkVersion MIN_SDK_VERSION 11 | targetSdkVersion TARGET_SDK_VERSION 12 | versionCode VERSION_CODE 13 | versionName VERSION_NAME 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /projects/sdk/core/gradle-plugin/src/test/testProjects/case1/loader/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /projects/sdk/core/gradle-plugin/src/test/testProjects/case1/plugin1/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | .idea 5 | .DS_Store 6 | build 7 | /captures 8 | .externalNativeBuild 9 | .gradletasknamecache -------------------------------------------------------------------------------- /projects/sdk/core/gradle-plugin/src/test/testProjects/case1/plugin1/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /projects/sdk/core/gradle-plugin/src/test/testProjects/case1/plugin2/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | .idea 5 | .DS_Store 6 | build 7 | /captures 8 | .externalNativeBuild 9 | .gradletasknamecache -------------------------------------------------------------------------------- /projects/sdk/core/gradle-plugin/src/test/testProjects/case1/plugin2/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /projects/sdk/core/gradle-plugin/src/test/testProjects/case1/runtime/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'com.android.application' 3 | } 4 | 5 | android { 6 | compileSdkVersion COMPILE_SDK_VERSION 7 | 8 | defaultConfig { 9 | applicationId "com.tencent.shadow.test.gradle.case1" 10 | minSdkVersion MIN_SDK_VERSION 11 | targetSdkVersion TARGET_SDK_VERSION 12 | versionCode VERSION_CODE 13 | versionName VERSION_NAME 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /projects/sdk/core/gradle-plugin/src/test/testProjects/case1/runtime/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /projects/sdk/core/gradle-plugin/src/test/testProjects/case1/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'case1' 2 | include 'loader', 'runtime', 'plugin1', 'plugin2' -------------------------------------------------------------------------------- /projects/sdk/core/gradle-plugin/src/test/testProjects/case1/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /projects/sdk/core/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx4096m 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | android.useAndroidX=true 15 | -------------------------------------------------------------------------------- /projects/sdk/core/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/Shadow/f9dc3944944593c8d398f6ce5cb460f076d18d75/projects/sdk/core/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /projects/sdk/core/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | #distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip 4 | distributionUrl=https\://mirrors.tencent.com/gradle/gradle-7.5-bin.zip 5 | zipStoreBase=GRADLE_USER_HOME 6 | zipStorePath=wrapper/dists 7 | -------------------------------------------------------------------------------- /projects/sdk/core/load-parameters/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | *.iml 3 | -------------------------------------------------------------------------------- /projects/sdk/core/load-parameters/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.tencent.shadow.internal.common-jar-settings' 2 | -------------------------------------------------------------------------------- /projects/sdk/core/loader/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /projects/sdk/core/loader/src/main/kotlin/com/tencent/shadow/core/loader/delegates/DI.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Tencent Shadow available. 3 | * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. 4 | * 5 | * Licensed under the BSD 3-Clause License (the "License"); you may not use 6 | * this file except in compliance with the License. You may obtain a copy of 7 | * the License at 8 | * 9 | * https://opensource.org/licenses/BSD-3-Clause 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | package com.tencent.shadow.core.loader.delegates 20 | 21 | interface DI { 22 | fun inject(delegate: ShadowDelegate, partKey: String) 23 | } -------------------------------------------------------------------------------- /projects/sdk/core/loader/src/main/kotlin/com/tencent/shadow/core/loader/exceptions/CreateApplicationException.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Tencent Shadow available. 3 | * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. 4 | * 5 | * Licensed under the BSD 3-Clause License (the "License"); you may not use 6 | * this file except in compliance with the License. You may obtain a copy of 7 | * the License at 8 | * 9 | * https://opensource.org/licenses/BSD-3-Clause 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | package com.tencent.shadow.core.loader.exceptions 20 | 21 | class CreateApplicationException(cause: Throwable) : Exception(cause) 22 | -------------------------------------------------------------------------------- /projects/sdk/core/loader/src/main/kotlin/com/tencent/shadow/core/loader/exceptions/LoadApkException.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Tencent Shadow available. 3 | * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. 4 | * 5 | * Licensed under the BSD 3-Clause License (the "License"); you may not use 6 | * this file except in compliance with the License. You may obtain a copy of 7 | * the License at 8 | * 9 | * https://opensource.org/licenses/BSD-3-Clause 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | package com.tencent.shadow.core.loader.exceptions 20 | 21 | 22 | class LoadApkException(message: String) : Exception(message) 23 | -------------------------------------------------------------------------------- /projects/sdk/core/loader/src/main/kotlin/com/tencent/shadow/core/loader/exceptions/ParsePluginApkException.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Tencent Shadow available. 3 | * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. 4 | * 5 | * Licensed under the BSD 3-Clause License (the "License"); you may not use 6 | * this file except in compliance with the License. You may obtain a copy of 7 | * the License at 8 | * 9 | * https://opensource.org/licenses/BSD-3-Clause 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | package com.tencent.shadow.core.loader.exceptions 20 | 21 | /** 22 | * 解析插件apk异常 23 | * 24 | * @author cubershi 25 | */ 26 | class ParsePluginApkException(message: String) : Exception(message) 27 | -------------------------------------------------------------------------------- /projects/sdk/core/loader/src/main/kotlin/com/tencent/shadow/core/loader/infos/ContainerProviderInfo.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Tencent Shadow available. 3 | * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. 4 | * 5 | * Licensed under the BSD 3-Clause License (the "License"); you may not use 6 | * this file except in compliance with the License. You may obtain a copy of 7 | * the License at 8 | * 9 | * https://opensource.org/licenses/BSD-3-Clause 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | package com.tencent.shadow.core.loader.infos 20 | 21 | open class ContainerProviderInfo(var className: String, var authority: String) 22 | -------------------------------------------------------------------------------- /projects/sdk/core/manager-db-test/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | *.iml 3 | -------------------------------------------------------------------------------- /projects/sdk/core/manager-db-test/src/androidTest/res/raw/plugin1.json: -------------------------------------------------------------------------------- 1 | { 2 | "compact_version": [ 3 | 1 4 | ], 5 | "pluginLoader": { 6 | "apkName": "loader-apk-debug.apk", 7 | "hash": "B0358A1919582A0FD467A42EEC40A5B7" 8 | }, 9 | "plugins": [ 10 | { 11 | "partKey": "test_main", 12 | "apkName": "test-plugin-debug.apk", 13 | "hash": "DAC0234D1BE7F363A66263A01595DA64" 14 | } 15 | ], 16 | "runtime": { 17 | "apkName": "runtime-apk-debug.apk", 18 | "hash": "51FDE1246F62D17D881493B037795D63" 19 | }, 20 | "UUID": "0087DACB-3373-4E11-B50B-1B3076BD4F16", 21 | "version": 1, 22 | "UUID_NickName": "plugin_config_version1.json" 23 | } 24 | -------------------------------------------------------------------------------- /projects/sdk/core/manager-db-test/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /projects/sdk/core/manager/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | *.iml 3 | -------------------------------------------------------------------------------- /projects/sdk/core/manager/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.tencent.shadow.internal.common-jar-settings' 2 | 3 | dependencies { 4 | implementation project(':utils') 5 | compileOnly project(':common') 6 | api project(':load-parameters') 7 | 8 | testImplementation "junit:junit:$junit_version" 9 | } 10 | -------------------------------------------------------------------------------- /projects/sdk/core/manifest-parser/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /projects/sdk/core/manifest-parser/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'kotlin' 2 | 3 | dependencies { 4 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 5 | implementation "com.squareup:javapoet:$javapoet_version" 6 | implementation project(':runtime') 7 | testImplementation "junit:junit:$junit_version" 8 | testImplementation "commons-io:commons-io:$commons_io_jvm_version" 9 | testImplementation 'com.tencent.shadow.coding:java-build-config' 10 | } 11 | 12 | compileKotlin { 13 | kotlinOptions { 14 | jvmTarget = "1.6" 15 | apiVersion = "1.3"// 兼容低版本Gradle和https://youtrack.jetbrains.com/issue/KT-39389 16 | } 17 | } 18 | 19 | compileTestKotlin { 20 | kotlinOptions { 21 | jvmTarget = "1.6" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /projects/sdk/core/manifest-parser/src/main/kotlin/com/tencent/shadow/core/manifest_parser/ManifestParser.kt: -------------------------------------------------------------------------------- 1 | package com.tencent.shadow.core.manifest_parser 2 | 3 | import java.io.File 4 | 5 | /** 6 | * manifest-parser的入口方法 7 | * 8 | * @param xmlFile com.android.build.gradle.tasks.ManifestProcessorTask任务的输出文件, 9 | * 一般位于apk工程的build/intermediates/merged_manifest目录中。 10 | * @param outputDir 生成文件的输出目录 11 | * @param packageName 生成类的包名 12 | */ 13 | fun generatePluginManifest( 14 | xmlFile: File, 15 | outputDir: File, 16 | packageName: String 17 | ) { 18 | val androidManifest = AndroidManifestReader().read(xmlFile) 19 | val generator = PluginManifestGenerator() 20 | generator.generate(androidManifest, outputDir, packageName) 21 | } -------------------------------------------------------------------------------- /projects/sdk/core/manifest-parser/src/test/resources/case_as_little_as_possible.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /projects/sdk/core/manifest-parser/src/test/resources/noAppComponentFactory.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /projects/sdk/core/runtime/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /projects/sdk/core/runtime/src/main/java/com/tencent/shadow/core/runtime/ShadowDialogSupport.java: -------------------------------------------------------------------------------- 1 | package com.tencent.shadow.core.runtime; 2 | 3 | import android.app.Activity; 4 | import android.app.Dialog; 5 | 6 | import com.tencent.shadow.core.runtime.container.PluginContainerActivity; 7 | 8 | public class ShadowDialogSupport { 9 | 10 | public static void dialogSetOwnerActivity(Dialog dialog, ShadowActivity activity) { 11 | Activity hostActivity = (Activity) activity.hostActivityDelegator.getHostActivity(); 12 | dialog.setOwnerActivity(hostActivity); 13 | } 14 | 15 | public static ShadowActivity dialogGetOwnerActivity(Dialog dialog) { 16 | PluginContainerActivity ownerActivity = (PluginContainerActivity) dialog.getOwnerActivity(); 17 | if (ownerActivity != null) { 18 | return (ShadowActivity) PluginActivity.get(ownerActivity); 19 | } else { 20 | return null; 21 | } 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /projects/sdk/core/runtime/src/main/java/com/tencent/shadow/core/runtime/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Tencent Shadow available. 3 | * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. 4 | * 5 | * Licensed under the BSD 3-Clause License (the "License"); you may not use 6 | * this file except in compliance with the License. You may obtain a copy of 7 | * the License at 8 | * 9 | * https://opensource.org/licenses/BSD-3-Clause 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | // TODO #34 将runtime中的复杂逻辑移到loader中去 20 | package com.tencent.shadow.core.runtime; -------------------------------------------------------------------------------- /projects/sdk/core/settings.gradle: -------------------------------------------------------------------------------- 1 | includeBuild '../coding' 2 | include 'loader', 3 | 'runtime', 4 | 'activity-container', 5 | 'transform', 6 | 'gradle-plugin', 7 | 'common', 8 | 'manager', 9 | 'manager-db-test', 10 | 'manifest-parser', 11 | 'load-parameters', 12 | 'transform-kit', 13 | 'utils' -------------------------------------------------------------------------------- /projects/sdk/core/transform-kit/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /projects/sdk/core/transform-kit/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'kotlin' 2 | 3 | dependencies { 4 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 5 | api "com.android.tools.build:gradle:$build_gradle_version" 6 | api "com.android.tools:common:$android_build_tools_version" 7 | api "org.javassist:javassist:$javassist_version" 8 | api gradleApi() 9 | testImplementation "junit:junit:$junit_version" 10 | testImplementation "commons-io:commons-io:$commons_io_jvm_version" 11 | } 12 | 13 | compileKotlin { 14 | kotlinOptions { 15 | jvmTarget = "1.6" 16 | } 17 | } 18 | 19 | compileTestKotlin { 20 | kotlinOptions { 21 | jvmTarget = "1.6" 22 | } 23 | } 24 | 25 | java { 26 | sourceCompatibility JavaVersion.VERSION_11 27 | targetCompatibility JavaVersion.VERSION_11 28 | } 29 | 30 | task testJar(type: Jar, dependsOn: testClasses) { 31 | baseName = "test-${project.archivesBaseName}" 32 | from sourceSets.test.output 33 | } 34 | 35 | configurations { 36 | tests 37 | } 38 | 39 | artifacts { 40 | tests testJar 41 | } 42 | -------------------------------------------------------------------------------- /projects/sdk/core/transform-kit/src/main/java/javassist/EnhancedCodeConverter.java: -------------------------------------------------------------------------------- 1 | package javassist; 2 | 3 | import javassist.convert.TransformCallExceptSuperCallToStatic; 4 | import javassist.convert.TransformNewClassFix; 5 | 6 | public class EnhancedCodeConverter extends CodeConverter { 7 | 8 | public void redirectMethodCallExceptSuperCallToStatic(CtMethod origMethod, CtMethod substMethod) throws CannotCompileException { 9 | transformers = new TransformCallExceptSuperCallToStatic(transformers, origMethod, 10 | substMethod); 11 | } 12 | 13 | public void replaceNew(CtClass oldClass, CtClass newClass) { 14 | transformers = new TransformNewClassFix(transformers, oldClass.getName(), 15 | newClass.getName()); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /projects/sdk/core/transform-kit/src/main/kotlin/com/tencent/shadow/core/transform_kit/TransformStep.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Tencent Shadow available. 3 | * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. 4 | * 5 | * Licensed under the BSD 3-Clause License (the "License"); you may not use 6 | * this file except in compliance with the License. You may obtain a copy of 7 | * the License at 8 | * 9 | * https://opensource.org/licenses/BSD-3-Clause 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | package com.tencent.shadow.core.transform_kit 20 | 21 | import javassist.CtClass 22 | 23 | interface TransformStep { 24 | fun filter(allInputClass: Set): Set 25 | 26 | fun transform(ctClass: CtClass) 27 | } -------------------------------------------------------------------------------- /projects/sdk/core/transform-kit/src/test/kotlin/com/tencent/shadow/core/transform_kit/FilterRefClassesTest.kt: -------------------------------------------------------------------------------- 1 | package com.tencent.shadow.core.transform_kit 2 | 3 | import org.junit.Assert 4 | import org.junit.Test 5 | 6 | class FilterRefClassesTest : AbstractTransformTest() { 7 | 8 | 9 | /** 10 | * 测试Transform时如果想修改一个对象方法调用时, 11 | * 如果这个方法来自于其父类,是否可以通过过来父类来找出需要修改的类, 12 | * 以便优化Transform速度。 13 | * 结论是不行,直接调用父类方法时并不需要引用父类。 14 | */ 15 | @Test 16 | fun testCallSuperMethodWithoutSuperClass() { 17 | val targetClass = sLoader["test.override.UseFooAsSuperSuper"] 18 | 19 | val allAppClass = setOf(targetClass) 20 | val filterRefClasses = 21 | SpecificTransform.filterRefClasses(allAppClass, listOf("test.override.SuperSuper")) 22 | 23 | Assert.assertFalse( 24 | "直接调用父类方法时并不需要引用父类", 25 | filterRefClasses.contains(targetClass) 26 | ) 27 | } 28 | } -------------------------------------------------------------------------------- /projects/sdk/core/transform/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /projects/sdk/core/transform/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'kotlin' 2 | 3 | dependencies { 4 | api project(':transform-kit') 5 | testImplementation "junit:junit:$junit_version" 6 | testImplementation project(path: ':transform-kit', configuration: 'tests') 7 | } 8 | 9 | compileKotlin { 10 | kotlinOptions { 11 | jvmTarget = "1.6" 12 | apiVersion = "1.3"// 兼容低版本Gradle和https://youtrack.jetbrains.com/issue/KT-39389 13 | } 14 | } 15 | 16 | compileTestKotlin { 17 | kotlinOptions { 18 | jvmTarget = "1.6" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /projects/sdk/core/transform/src/main/kotlin/com/tencent/shadow/core/transform/specific/AppComponentFactoryTransform.kt: -------------------------------------------------------------------------------- 1 | package com.tencent.shadow.core.transform.specific 2 | 3 | class AppComponentFactoryTransform : SimpleRenameTransform( 4 | mapOf( 5 | "android.app.AppComponentFactory" 6 | to "com.tencent.shadow.core.runtime.ShadowAppComponentFactory" 7 | ) 8 | ) 9 | -------------------------------------------------------------------------------- /projects/sdk/core/transform/src/main/kotlin/com/tencent/shadow/core/transform/specific/IntentServiceTransform.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Tencent Shadow available. 3 | * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. 4 | * 5 | * Licensed under the BSD 3-Clause License (the "License"); you may not use 6 | * this file except in compliance with the License. You may obtain a copy of 7 | * the License at 8 | * 9 | * https://opensource.org/licenses/BSD-3-Clause 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | package com.tencent.shadow.core.transform.specific 20 | 21 | class IntentServiceTransform : SimpleRenameTransform( 22 | mapOf("android.app.IntentService" to "com.tencent.shadow.core.runtime.ShadowIntentService") 23 | ) 24 | -------------------------------------------------------------------------------- /projects/sdk/core/transform/src/test/java/android/app/Activity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Tencent Shadow available. 3 | * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. 4 | * 5 | * Licensed under the BSD 3-Clause License (the "License"); you may not use 6 | * this file except in compliance with the License. You may obtain a copy of 7 | * the License at 8 | * 9 | * https://opensource.org/licenses/BSD-3-Clause 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | package android.app; 20 | 21 | public class Activity { 22 | } 23 | -------------------------------------------------------------------------------- /projects/sdk/core/transform/src/test/java/android/app/Application.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Tencent Shadow available. 3 | * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. 4 | * 5 | * Licensed under the BSD 3-Clause License (the "License"); you may not use 6 | * this file except in compliance with the License. You may obtain a copy of 7 | * the License at 8 | * 9 | * https://opensource.org/licenses/BSD-3-Clause 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | package android.app; 20 | 21 | public class Application { 22 | 23 | public interface ActivityLifecycleCallbacks { 24 | } 25 | } -------------------------------------------------------------------------------- /projects/sdk/core/transform/src/test/java/android/app/Instrumentation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Tencent Shadow available. 3 | * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. 4 | * 5 | * Licensed under the BSD 3-Clause License (the "License"); you may not use 6 | * this file except in compliance with the License. You may obtain a copy of 7 | * the License at 8 | * 9 | * https://opensource.org/licenses/BSD-3-Clause 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | package android.app; 20 | 21 | import android.content.Intent; 22 | 23 | public class Instrumentation { 24 | 25 | public static class ActivityResult { 26 | public ActivityResult(int code, Intent intent) { 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /projects/sdk/core/transform/src/test/java/android/app/Service.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Tencent Shadow available. 3 | * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. 4 | * 5 | * Licensed under the BSD 3-Clause License (the "License"); you may not use 6 | * this file except in compliance with the License. You may obtain a copy of 7 | * the License at 8 | * 9 | * https://opensource.org/licenses/BSD-3-Clause 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | package android.app; 20 | 21 | public class Service { 22 | } 23 | -------------------------------------------------------------------------------- /projects/sdk/core/transform/src/test/java/android/content/BroadcastReceiver.java: -------------------------------------------------------------------------------- 1 | package android.content; 2 | 3 | public abstract class BroadcastReceiver { 4 | public abstract void onReceive(Context context, Intent intent); 5 | } 6 | -------------------------------------------------------------------------------- /projects/sdk/core/transform/src/test/java/android/content/ComponentName.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Tencent Shadow available. 3 | * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. 4 | * 5 | * Licensed under the BSD 3-Clause License (the "License"); you may not use 6 | * this file except in compliance with the License. You may obtain a copy of 7 | * the License at 8 | * 9 | * https://opensource.org/licenses/BSD-3-Clause 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | package android.content; 20 | 21 | public class ComponentName { 22 | } 23 | -------------------------------------------------------------------------------- /projects/sdk/core/transform/src/test/java/android/content/Context.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Tencent Shadow available. 3 | * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. 4 | * 5 | * Licensed under the BSD 3-Clause License (the "License"); you may not use 6 | * this file except in compliance with the License. You may obtain a copy of 7 | * the License at 8 | * 9 | * https://opensource.org/licenses/BSD-3-Clause 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | package android.content; 20 | 21 | public class Context { 22 | } 23 | -------------------------------------------------------------------------------- /projects/sdk/core/transform/src/test/java/android/content/Intent.java: -------------------------------------------------------------------------------- 1 | package android.content; 2 | 3 | public class Intent { 4 | public Intent() { 5 | } 6 | 7 | public Intent(Intent intent) { 8 | } 9 | 10 | public void setExtrasClassLoader(ClassLoader loader) { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /projects/sdk/core/transform/src/test/java/android/content/pm/ActivityInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Tencent Shadow available. 3 | * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. 4 | * 5 | * Licensed under the BSD 3-Clause License (the "License"); you may not use 6 | * this file except in compliance with the License. You may obtain a copy of 7 | * the License at 8 | * 9 | * https://opensource.org/licenses/BSD-3-Clause 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | package android.content.pm; 20 | 21 | public class ActivityInfo extends PackageItemInfo { 22 | } 23 | -------------------------------------------------------------------------------- /projects/sdk/core/transform/src/test/java/android/content/pm/ApplicationInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Tencent Shadow available. 3 | * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. 4 | * 5 | * Licensed under the BSD 3-Clause License (the "License"); you may not use 6 | * this file except in compliance with the License. You may obtain a copy of 7 | * the License at 8 | * 9 | * https://opensource.org/licenses/BSD-3-Clause 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | package android.content.pm; 20 | 21 | 22 | public class ApplicationInfo extends PackageItemInfo { 23 | 24 | 25 | } 26 | -------------------------------------------------------------------------------- /projects/sdk/core/transform/src/test/java/android/content/pm/PackageInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Tencent Shadow available. 3 | * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. 4 | * 5 | * Licensed under the BSD 3-Clause License (the "License"); you may not use 6 | * this file except in compliance with the License. You may obtain a copy of 7 | * the License at 8 | * 9 | * https://opensource.org/licenses/BSD-3-Clause 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | package android.content.pm; 20 | 21 | public class PackageInfo { 22 | } 23 | -------------------------------------------------------------------------------- /projects/sdk/core/transform/src/test/java/android/content/pm/ProviderInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Tencent Shadow available. 3 | * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. 4 | * 5 | * Licensed under the BSD 3-Clause License (the "License"); you may not use 6 | * this file except in compliance with the License. You may obtain a copy of 7 | * the License at 8 | * 9 | * https://opensource.org/licenses/BSD-3-Clause 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | package android.content.pm; 20 | 21 | public class ProviderInfo extends PackageItemInfo { 22 | } 23 | -------------------------------------------------------------------------------- /projects/sdk/core/transform/src/test/java/android/content/pm/ServiceInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Tencent Shadow available. 3 | * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. 4 | * 5 | * Licensed under the BSD 3-Clause License (the "License"); you may not use 6 | * this file except in compliance with the License. You may obtain a copy of 7 | * the License at 8 | * 9 | * https://opensource.org/licenses/BSD-3-Clause 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | package android.content.pm; 20 | 21 | public class ServiceInfo extends PackageItemInfo { 22 | } 23 | -------------------------------------------------------------------------------- /projects/sdk/core/transform/src/test/java/android/content/res/XmlResourceParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Tencent Shadow available. 3 | * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. 4 | * 5 | * Licensed under the BSD 3-Clause License (the "License"); you may not use 6 | * this file except in compliance with the License. You may obtain a copy of 7 | * the License at 8 | * 9 | * https://opensource.org/licenses/BSD-3-Clause 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | package android.content.res; 20 | 21 | public interface XmlResourceParser { 22 | } 23 | -------------------------------------------------------------------------------- /projects/sdk/core/transform/src/test/java/android/os/Bundle.java: -------------------------------------------------------------------------------- 1 | package android.os; 2 | 3 | public class Bundle { 4 | } 5 | -------------------------------------------------------------------------------- /projects/sdk/core/transform/src/test/java/android/os/IBinder.java: -------------------------------------------------------------------------------- 1 | package android.os; 2 | 3 | public interface IBinder { 4 | } 5 | -------------------------------------------------------------------------------- /projects/sdk/core/transform/src/test/java/android/util/AttributeSet.java: -------------------------------------------------------------------------------- 1 | package android.util; 2 | 3 | public class AttributeSet { 4 | } 5 | -------------------------------------------------------------------------------- /projects/sdk/core/transform/src/test/java/android/webkit/WebView.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Tencent Shadow available. 3 | * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. 4 | * 5 | * Licensed under the BSD 3-Clause License (the "License"); you may not use 6 | * this file except in compliance with the License. You may obtain a copy of 7 | * the License at 8 | * 9 | * https://opensource.org/licenses/BSD-3-Clause 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | package android.webkit; 20 | 21 | import android.content.Context; 22 | 23 | public class WebView { 24 | public WebView(Context context) { 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /projects/sdk/core/transform/src/test/java/com/tencent/shadow/core/runtime/PluginPartInfo.java: -------------------------------------------------------------------------------- 1 | package com.tencent.shadow.core.runtime; 2 | 3 | public class PluginPartInfo { 4 | public ShadowApplication application = new ShadowApplication(); 5 | } 6 | -------------------------------------------------------------------------------- /projects/sdk/core/transform/src/test/java/com/tencent/shadow/core/runtime/PluginPartInfoManager.java: -------------------------------------------------------------------------------- 1 | package com.tencent.shadow.core.runtime; 2 | 3 | public class PluginPartInfoManager { 4 | public static PluginPartInfo getPluginInfo(ClassLoader classLoader) { 5 | return new PluginPartInfo(); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /projects/sdk/core/transform/src/test/java/com/tencent/shadow/core/runtime/ShadowActivity.java: -------------------------------------------------------------------------------- 1 | package com.tencent.shadow.core.runtime; 2 | 3 | public class ShadowActivity { 4 | } 5 | -------------------------------------------------------------------------------- /projects/sdk/core/transform/src/test/java/com/tencent/shadow/core/runtime/ShadowApplication.java: -------------------------------------------------------------------------------- 1 | package com.tencent.shadow.core.runtime; 2 | 3 | public class ShadowApplication extends ShadowContext { 4 | 5 | public void onCreate() { 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /projects/sdk/core/transform/src/test/java/com/tencent/shadow/core/runtime/ShadowContext.java: -------------------------------------------------------------------------------- 1 | package com.tencent.shadow.core.runtime; 2 | 3 | import android.content.Context; 4 | 5 | public class ShadowContext extends Context { 6 | } 7 | -------------------------------------------------------------------------------- /projects/sdk/core/transform/src/test/java/test/EggReceiver.java: -------------------------------------------------------------------------------- 1 | package test; 2 | 3 | import android.content.BroadcastReceiver; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | 7 | import java.util.List; 8 | 9 | abstract class EggReceiver extends BroadcastReceiver { 10 | List log; 11 | 12 | EggReceiver(List log) { 13 | this.log = log; 14 | } 15 | 16 | @Override 17 | public void onReceive(Context context, Intent intent) { 18 | log.add("EggReceiver onReceive"); 19 | } 20 | 21 | public static class FoxReceiver extends EggReceiver { 22 | FoxReceiver(List log) { 23 | super(log); 24 | } 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /projects/sdk/core/transform/src/test/java/test/TestActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Tencent Shadow available. 3 | * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. 4 | * 5 | * Licensed under the BSD 3-Clause License (the "License"); you may not use 6 | * this file except in compliance with the License. You may obtain a copy of 7 | * the License at 8 | * 9 | * https://opensource.org/licenses/BSD-3-Clause 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | package test; 20 | 21 | import android.app.Activity; 22 | 23 | public class TestActivity extends Activity { 24 | 25 | Activity foo(Activity activity) { 26 | activity.toString(); 27 | return activity; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /projects/sdk/core/transform/src/test/java/test/TestApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Tencent Shadow available. 3 | * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. 4 | * 5 | * Licensed under the BSD 3-Clause License (the "License"); you may not use 6 | * this file except in compliance with the License. You may obtain a copy of 7 | * the License at 8 | * 9 | * https://opensource.org/licenses/BSD-3-Clause 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | package test; 20 | 21 | import android.app.Application; 22 | 23 | public class TestApplication extends Application { 24 | 25 | Application get() { 26 | System.out.println("get Application"); 27 | return this; 28 | } 29 | } -------------------------------------------------------------------------------- /projects/sdk/core/transform/src/test/java/test/TestInstrumentation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Tencent Shadow available. 3 | * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. 4 | * 5 | * Licensed under the BSD 3-Clause License (the "License"); you may not use 6 | * this file except in compliance with the License. You may obtain a copy of 7 | * the License at 8 | * 9 | * https://opensource.org/licenses/BSD-3-Clause 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | package test; 20 | 21 | import android.app.Instrumentation; 22 | 23 | public class TestInstrumentation extends Instrumentation { 24 | } 25 | -------------------------------------------------------------------------------- /projects/sdk/core/transform/src/test/java/test/TestService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Tencent Shadow available. 3 | * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. 4 | * 5 | * Licensed under the BSD 3-Clause License (the "License"); you may not use 6 | * this file except in compliance with the License. You may obtain a copy of 7 | * the License at 8 | * 9 | * https://opensource.org/licenses/BSD-3-Clause 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | package test; 20 | 21 | import android.app.Service; 22 | 23 | public class TestService extends Service { 24 | 25 | Service getService() { 26 | System.out.println("getService"); 27 | return this; 28 | } 29 | } -------------------------------------------------------------------------------- /projects/sdk/core/transform/src/test/java/test/fragment/TestFragment.java: -------------------------------------------------------------------------------- 1 | package test.fragment; 2 | 3 | import android.app.Fragment; 4 | import android.content.Context; 5 | 6 | public class TestFragment extends Fragment { 7 | 8 | @Override 9 | public void onAttach(Context context) { 10 | System.out.println("before super.onAttach" + context); 11 | super.onAttach(context); 12 | System.out.println("after super.onAttach" + context); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /projects/sdk/core/transform/src/test/java/test/fragment/UseGetActivityFragment.java: -------------------------------------------------------------------------------- 1 | package test.fragment; 2 | 3 | import android.content.Intent; 4 | import android.os.Bundle; 5 | 6 | import com.tencent.shadow.core.runtime.ShadowActivity; 7 | 8 | public class UseGetActivityFragment { 9 | 10 | ShadowActivity test(TestFragment fragment) { 11 | fragment.startActivity(new Intent()); 12 | fragment.startActivity(new Intent(), new Bundle()); 13 | return fragment.getActivity(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /projects/sdk/core/transform/src/test/java/test/fragment/UseStartActivityForResultFragment.java: -------------------------------------------------------------------------------- 1 | package test.fragment; 2 | 3 | import android.content.Intent; 4 | import android.os.Bundle; 5 | 6 | import com.tencent.shadow.core.runtime.ShadowActivity; 7 | 8 | public class UseStartActivityForResultFragment { 9 | 10 | ShadowActivity test(TestFragment fragment) { 11 | fragment.startActivityForResult(new Intent(), 1); 12 | fragment.startActivityForResult(new Intent(), 1, new Bundle()); 13 | return fragment.getActivity(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /projects/sdk/core/transform/src/test/java/test/fragment/UseStartActivityFragment.java: -------------------------------------------------------------------------------- 1 | package test.fragment; 2 | 3 | import android.content.Intent; 4 | import android.os.Bundle; 5 | 6 | import com.tencent.shadow.core.runtime.ShadowActivity; 7 | 8 | public class UseStartActivityFragment { 9 | 10 | ShadowActivity test(TestFragment fragment) { 11 | fragment.startActivity(new Intent()); 12 | fragment.startActivity(new Intent(), new Bundle()); 13 | return fragment.getActivity(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /projects/sdk/core/utils/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /projects/sdk/core/utils/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.tencent.shadow.internal.common-jar-settings' 2 | 3 | dependencies { 4 | testImplementation "junit:junit:$junit_version" 5 | 6 | // https://mvnrepository.com/artifact/commons-io/commons-io (requires Java 8) 7 | testImplementation "commons-io:commons-io:$commons_io_jvm_version" 8 | } 9 | -------------------------------------------------------------------------------- /projects/sdk/dynamic/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | .idea 5 | .DS_Store 6 | /build 7 | /captures 8 | .externalNativeBuild 9 | .gradletasknamecache 10 | 11 | -------------------------------------------------------------------------------- /projects/sdk/dynamic/dynamic-apk/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | *.iml -------------------------------------------------------------------------------- /projects/sdk/dynamic/dynamic-apk/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.tencent.shadow.internal.common-jar-settings' 2 | 3 | dependencies { 4 | implementation 'com.tencent.shadow.core:utils' 5 | compileOnly 'com.tencent.shadow.core:common' 6 | } 7 | -------------------------------------------------------------------------------- /projects/sdk/dynamic/dynamic-apk/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 /Users/cubershi/Library/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 | -------------------------------------------------------------------------------- /projects/sdk/dynamic/dynamic-host-multi-loader-ext/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /projects/sdk/dynamic/dynamic-host-multi-loader-ext/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.tencent.shadow.internal.common-jar-settings' 2 | 3 | dependencies { 4 | compileOnly 'com.tencent.shadow.core:common' 5 | api project(':dynamic-host') 6 | } 7 | -------------------------------------------------------------------------------- /projects/sdk/dynamic/dynamic-host-multi-loader-ext/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /projects/sdk/dynamic/dynamic-host/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | *.iml -------------------------------------------------------------------------------- /projects/sdk/dynamic/dynamic-host/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.tencent.shadow.internal.common-jar-settings' 2 | 3 | dependencies { 4 | implementation 'com.tencent.shadow.core:utils' 5 | compileOnly 'com.tencent.shadow.core:common' 6 | api project(':dynamic-apk') 7 | } 8 | -------------------------------------------------------------------------------- /projects/sdk/dynamic/dynamic-host/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 /Users/cubershi/Library/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 | -------------------------------------------------------------------------------- /projects/sdk/dynamic/dynamic-host/src/main/java/com/tencent/shadow/dynamic/host/LoaderFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Tencent Shadow available. 3 | * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. 4 | * 5 | * Licensed under the BSD 3-Clause License (the "License"); you may not use 6 | * this file except in compliance with the License. You may obtain a copy of 7 | * the License at 8 | * 9 | * https://opensource.org/licenses/BSD-3-Clause 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | package com.tencent.shadow.dynamic.host; 20 | 21 | import android.content.Context; 22 | 23 | public interface LoaderFactory { 24 | PluginLoaderImpl buildLoader(String uuid, Context context); 25 | } 26 | -------------------------------------------------------------------------------- /projects/sdk/dynamic/dynamic-host/src/main/java/com/tencent/shadow/dynamic/host/ManagerFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Tencent Shadow available. 3 | * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. 4 | * 5 | * Licensed under the BSD 3-Clause License (the "License"); you may not use 6 | * this file except in compliance with the License. You may obtain a copy of 7 | * the License at 8 | * 9 | * https://opensource.org/licenses/BSD-3-Clause 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | package com.tencent.shadow.dynamic.host; 20 | 21 | import android.content.Context; 22 | 23 | public interface ManagerFactory { 24 | PluginManagerImpl buildManager(Context context); 25 | } 26 | -------------------------------------------------------------------------------- /projects/sdk/dynamic/dynamic-host/src/main/java/com/tencent/shadow/dynamic/host/PluginLoaderImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Tencent Shadow available. 3 | * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. 4 | * 5 | * Licensed under the BSD 3-Clause License (the "License"); you may not use 6 | * this file except in compliance with the License. You may obtain a copy of 7 | * the License at 8 | * 9 | * https://opensource.org/licenses/BSD-3-Clause 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | package com.tencent.shadow.dynamic.host; 20 | 21 | import android.os.IBinder; 22 | 23 | public interface PluginLoaderImpl extends IBinder { 24 | void setUuidManager(UuidManager uuidManager); 25 | } 26 | -------------------------------------------------------------------------------- /projects/sdk/dynamic/dynamic-loader-impl/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /projects/sdk/dynamic/dynamic-loader-impl/build.gradle: -------------------------------------------------------------------------------- 1 | import com.tencent.shadow.coding.common_jar_settings.AndroidJar 2 | 3 | apply plugin: 'com.tencent.shadow.internal.common-jar-settings' 4 | 5 | apply plugin: 'kotlin' 6 | 7 | compileKotlin { 8 | sourceCompatibility = JavaVersion.VERSION_1_7 9 | targetCompatibility = JavaVersion.VERSION_1_7 10 | 11 | kotlinOptions { 12 | jvmTarget = "1.6" 13 | noJdk = true 14 | noStdlib = true 15 | } 16 | } 17 | 18 | dependencies { 19 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 20 | implementation 'com.tencent.shadow.core:loader' 21 | compileOnly 'com.tencent.shadow.core:activity-container' 22 | compileOnly 'com.tencent.shadow.core:common' 23 | compileOnly project(':dynamic-host') 24 | compileOnly project(':dynamic-loader') 25 | compileOnly files(AndroidJar.ANDROID_JAR_PATH) 26 | } 27 | -------------------------------------------------------------------------------- /projects/sdk/dynamic/dynamic-loader-impl/src/main/kotlin/com/tencent/shadow/dynamic/impl/LoaderFactoryImpl.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Tencent Shadow available. 3 | * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. 4 | * 5 | * Licensed under the BSD 3-Clause License (the "License"); you may not use 6 | * this file except in compliance with the License. You may obtain a copy of 7 | * the License at 8 | * 9 | * https://opensource.org/licenses/BSD-3-Clause 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | package com.tencent.shadow.dynamic.impl 20 | 21 | @Deprecated("兼容旧版本dynamic-host访问这个类名", level = DeprecationLevel.HIDDEN) 22 | class LoaderFactoryImpl : com.tencent.shadow.dynamic.loader.impl.LoaderFactoryImpl() { 23 | } -------------------------------------------------------------------------------- /projects/sdk/dynamic/dynamic-loader/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /projects/sdk/dynamic/dynamic-loader/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.tencent.shadow.internal.common-jar-settings' 2 | -------------------------------------------------------------------------------- /projects/sdk/dynamic/dynamic-manager-multi-loader-ext/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /projects/sdk/dynamic/dynamic-manager-multi-loader-ext/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.tencent.shadow.internal.common-jar-settings' 2 | 3 | dependencies { 4 | implementation 'com.tencent.shadow.core:manager' 5 | implementation project(':dynamic-manager') 6 | implementation project(':dynamic-loader') 7 | compileOnly 'com.tencent.shadow.core:common' 8 | compileOnly project(':dynamic-host-multi-loader-ext') 9 | } 10 | -------------------------------------------------------------------------------- /projects/sdk/dynamic/dynamic-manager-multi-loader-ext/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /projects/sdk/dynamic/dynamic-manager/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | *.iml -------------------------------------------------------------------------------- /projects/sdk/dynamic/dynamic-manager/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.tencent.shadow.internal.common-jar-settings' 2 | 3 | dependencies { 4 | compileOnly 'com.tencent.shadow.core:common' 5 | implementation 'com.tencent.shadow.core:manager' 6 | implementation project(':dynamic-loader') 7 | compileOnly project(':dynamic-host') 8 | } 9 | -------------------------------------------------------------------------------- /projects/sdk/dynamic/dynamic-manager/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 /Users/cubershi/Library/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 | -------------------------------------------------------------------------------- /projects/sdk/dynamic/dynamic-manager/src/main/java/com/tencent/shadow/dynamic/manager/UuidManagerImpl.java: -------------------------------------------------------------------------------- 1 | package com.tencent.shadow.dynamic.manager; 2 | 3 | import com.tencent.shadow.core.common.InstalledApk; 4 | import com.tencent.shadow.dynamic.host.FailedException; 5 | import com.tencent.shadow.dynamic.host.NotFoundException; 6 | 7 | public interface UuidManagerImpl { 8 | InstalledApk getPlugin(String uuid, String partKey) throws NotFoundException, FailedException; 9 | 10 | InstalledApk getPluginLoader(String uuid) throws NotFoundException, FailedException; 11 | 12 | InstalledApk getRuntime(String uuid) throws NotFoundException, FailedException; 13 | } 14 | -------------------------------------------------------------------------------- /projects/sdk/dynamic/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx4096m 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | android.useAndroidX=true 15 | -------------------------------------------------------------------------------- /projects/sdk/dynamic/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/Shadow/f9dc3944944593c8d398f6ce5cb460f076d18d75/projects/sdk/dynamic/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /projects/sdk/dynamic/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | #distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip 4 | distributionUrl=https\://mirrors.tencent.com/gradle/gradle-7.5-bin.zip 5 | zipStoreBase=GRADLE_USER_HOME 6 | zipStorePath=wrapper/dists 7 | -------------------------------------------------------------------------------- /projects/sdk/dynamic/settings.gradle: -------------------------------------------------------------------------------- 1 | includeBuild '../coding' 2 | includeBuild '../core' 3 | include 'dynamic-manager', 4 | 'dynamic-apk', 5 | 'dynamic-host', 6 | 'dynamic-loader', 7 | 'dynamic-loader-impl', 8 | 'dynamic-host-multi-loader-ext', 9 | 'dynamic-manager-multi-loader-ext' -------------------------------------------------------------------------------- /projects/test/common-jar-settings-test/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /projects/test/common-jar-settings-test/src/main/java/Test.java: -------------------------------------------------------------------------------- 1 | import java.nio.ByteBuffer; 2 | 3 | class Test { 4 | public static void test(ByteBuffer byteBuffer) { 5 | byteBuffer.position(0); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /projects/test/dynamic/host/test-dynamic-host/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /projects/test/dynamic/host/test-dynamic-host/src/androidTest/java/com/tencent/shadow/test/CreateResourceTest.java: -------------------------------------------------------------------------------- 1 | package com.tencent.shadow.test; 2 | 3 | import com.tencent.shadow.test.cases.plugin_androidx.AppCompatActivityTest; 4 | import com.tencent.shadow.test.cases.plugin_main.ThemeTest; 5 | import com.tencent.shadow.test.cases.plugin_main.ViewIdTest; 6 | 7 | import org.junit.Ignore; 8 | import org.junit.runner.RunWith; 9 | import org.junit.runners.Suite; 10 | 11 | /** 12 | * com.tencent.shadow.core.loader.blocs.CreateResourceBloc 13 | * 改动相关测试 14 | */ 15 | @RunWith(Suite.class) 16 | @Ignore("避免自动化全量测试时重复这些测试") 17 | @Suite.SuiteClasses({ 18 | ViewIdTest.class, 19 | ThemeTest.class, 20 | AppCompatActivityTest.class, 21 | }) 22 | public class CreateResourceTest { 23 | } 24 | -------------------------------------------------------------------------------- /projects/test/dynamic/host/test-dynamic-host/src/androidTest/java/com/tencent/shadow/test/cases/plugin_androidx/PluginAndroidxAppTest.java: -------------------------------------------------------------------------------- 1 | package com.tencent.shadow.test.cases.plugin_androidx; 2 | 3 | import com.tencent.shadow.test.PluginTest; 4 | import com.tencent.shadow.test.lib.constant.Constant; 5 | 6 | public abstract class PluginAndroidxAppTest extends PluginTest { 7 | 8 | @Override 9 | protected String getPartKey() { 10 | return Constant.PART_KEY_PLUGIN_ANDROIDX; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /projects/test/dynamic/host/test-dynamic-host/src/androidTest/java/com/tencent/shadow/test/cases/plugin_main/application_info/ApplicationInfoTest.java: -------------------------------------------------------------------------------- 1 | package com.tencent.shadow.test.cases.plugin_main.application_info; 2 | 3 | import org.junit.Ignore; 4 | import org.junit.runner.RunWith; 5 | import org.junit.runners.Suite; 6 | 7 | @RunWith(Suite.class) 8 | @Ignore("避免自动化全量测试时重复这些测试") 9 | @Suite.SuiteClasses({ContextGetApplicationInfoTest.class, 10 | PackageManagerGetSelfApplicationInfoTest.class, 11 | PackageManagerGetOtherInstalledApplicationInfoTest.class}) 12 | public class ApplicationInfoTest { 13 | } 14 | -------------------------------------------------------------------------------- /projects/test/dynamic/host/test-dynamic-host/src/androidTest/java/com/tencent/shadow/test/cases/plugin_main/application_info/ContextGetApplicationInfoTest.java: -------------------------------------------------------------------------------- 1 | package com.tencent.shadow.test.cases.plugin_main.application_info; 2 | 3 | /** 4 | * 在插件中通过Context.getApplicationInfo()获得到的ApplicationInfo测试。 5 | * 6 | * @author shifujun 7 | */ 8 | public class ContextGetApplicationInfoTest extends CommonApplicationInfoTest { 9 | 10 | @Override 11 | protected String getTag() { 12 | return "Context"; 13 | } 14 | 15 | @Override 16 | public void testMetaData() { 17 | matchTextWithViewTag("TAG_metaData_" + getTag(), ""); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /projects/test/dynamic/host/test-dynamic-host/src/androidTest/java/com/tencent/shadow/test/cases/plugin_main/application_info/PackageManagerGetSelfApplicationInfoTest.java: -------------------------------------------------------------------------------- 1 | package com.tencent.shadow.test.cases.plugin_main.application_info; 2 | 3 | /** 4 | * 在插件中通过PackageManager.getApplicationInfo()获取插件自己的ApplicationInfo测试。 5 | * 6 | * @author shifujun 7 | */ 8 | public class PackageManagerGetSelfApplicationInfoTest extends CommonApplicationInfoTest { 9 | 10 | @Override 11 | protected String getTag() { 12 | return "PackageManagerGetSelf"; 13 | } 14 | 15 | @Override 16 | public void testMetaData() { 17 | matchSubstringWithViewTag("TAG_metaData_" + getTag(), "test_value"); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /projects/test/dynamic/host/test-dynamic-host/src/androidTest/java/com/tencent/shadow/test/cases/plugin_main/fragment_support/FragmentSupportTest.java: -------------------------------------------------------------------------------- 1 | package com.tencent.shadow.test.cases.plugin_main.fragment_support; 2 | 3 | import org.junit.Ignore; 4 | import org.junit.runner.RunWith; 5 | import org.junit.runners.Suite; 6 | 7 | @RunWith(Suite.class) 8 | @Ignore("避免自动化全量测试时重复这些测试") 9 | @Suite.SuiteClasses({ 10 | ProgrammaticallyAddNormalFragmentTest.class, 11 | ProgrammaticallyAddSubFragmentTest.class, 12 | ProgrammaticallyAddBaseFragmentTest.class, 13 | ProgrammaticallyAddDialogFragmentTest.class, 14 | ProgrammaticallyAddOnlyOverrideOnAttachActivityFragmentTest.class, 15 | ProgrammaticallyAddOnlyOverrideOnAttachContextFragmentTest.class, 16 | XmlAddNormalFragmentTest.class, 17 | XmlAddSubFragmentTest.class, 18 | XmlAddBaseFragmentTest.class 19 | }) 20 | public class FragmentSupportTest { 21 | } 22 | -------------------------------------------------------------------------------- /projects/test/dynamic/host/test-dynamic-host/src/androidTest/java/com/tencent/shadow/test/cases/plugin_main/fragment_support/ProgrammaticallyAddBaseFragmentTest.java: -------------------------------------------------------------------------------- 1 | package com.tencent.shadow.test.cases.plugin_main.fragment_support; 2 | 3 | public class ProgrammaticallyAddBaseFragmentTest extends ProgrammaticallyAddFragmentTest { 4 | @Override 5 | protected String fragmentType() { 6 | return "TestBaseFragment"; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /projects/test/dynamic/host/test-dynamic-host/src/androidTest/java/com/tencent/shadow/test/cases/plugin_main/fragment_support/ProgrammaticallyAddDialogFragmentTest.java: -------------------------------------------------------------------------------- 1 | package com.tencent.shadow.test.cases.plugin_main.fragment_support; 2 | 3 | public class ProgrammaticallyAddDialogFragmentTest extends ProgrammaticallyAddFragmentTest { 4 | @Override 5 | protected String fragmentType() { 6 | return "TestDialogFragment"; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /projects/test/dynamic/host/test-dynamic-host/src/androidTest/java/com/tencent/shadow/test/cases/plugin_main/fragment_support/ProgrammaticallyAddFragmentTest.java: -------------------------------------------------------------------------------- 1 | package com.tencent.shadow.test.cases.plugin_main.fragment_support; 2 | 3 | abstract class ProgrammaticallyAddFragmentTest extends CommonFragmentSupportTest { 4 | @Override 5 | protected String getActivityName() { 6 | return "ProgrammaticallyAddFragmentActivity"; 7 | } 8 | 9 | @Override 10 | protected String expectMsg() { 11 | return "addFragmentProgrammatically"; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /projects/test/dynamic/host/test-dynamic-host/src/androidTest/java/com/tencent/shadow/test/cases/plugin_main/fragment_support/ProgrammaticallyAddNormalFragmentTest.java: -------------------------------------------------------------------------------- 1 | package com.tencent.shadow.test.cases.plugin_main.fragment_support; 2 | 3 | public class ProgrammaticallyAddNormalFragmentTest extends ProgrammaticallyAddFragmentTest { 4 | @Override 5 | protected String fragmentType() { 6 | return "TestNormalFragment"; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /projects/test/dynamic/host/test-dynamic-host/src/androidTest/java/com/tencent/shadow/test/cases/plugin_main/fragment_support/ProgrammaticallyAddOnlyOverrideOnAttachActivityFragmentTest.java: -------------------------------------------------------------------------------- 1 | package com.tencent.shadow.test.cases.plugin_main.fragment_support; 2 | 3 | public class ProgrammaticallyAddOnlyOverrideOnAttachActivityFragmentTest extends ProgrammaticallyAddFragmentTest { 4 | @Override 5 | protected String fragmentType() { 6 | return "OnlyOverrideActivityMethodBaseFragment"; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /projects/test/dynamic/host/test-dynamic-host/src/androidTest/java/com/tencent/shadow/test/cases/plugin_main/fragment_support/ProgrammaticallyAddOnlyOverrideOnAttachContextFragmentTest.java: -------------------------------------------------------------------------------- 1 | package com.tencent.shadow.test.cases.plugin_main.fragment_support; 2 | 3 | public class ProgrammaticallyAddOnlyOverrideOnAttachContextFragmentTest extends ProgrammaticallyAddFragmentTest { 4 | @Override 5 | protected String fragmentType() { 6 | return "OnlyOverrideContextMethodBaseFragment"; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /projects/test/dynamic/host/test-dynamic-host/src/androidTest/java/com/tencent/shadow/test/cases/plugin_main/fragment_support/ProgrammaticallyAddSubFragmentTest.java: -------------------------------------------------------------------------------- 1 | package com.tencent.shadow.test.cases.plugin_main.fragment_support; 2 | 3 | public class ProgrammaticallyAddSubFragmentTest extends ProgrammaticallyAddFragmentTest { 4 | @Override 5 | protected String fragmentType() { 6 | return "TestSubFragment"; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /projects/test/dynamic/host/test-dynamic-host/src/androidTest/java/com/tencent/shadow/test/cases/plugin_main/fragment_support/XmlAddBaseFragmentTest.java: -------------------------------------------------------------------------------- 1 | package com.tencent.shadow.test.cases.plugin_main.fragment_support; 2 | 3 | public class XmlAddBaseFragmentTest extends XmlAddFragmentTest { 4 | @Override 5 | protected String fragmentType() { 6 | return "TestBaseFragment"; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /projects/test/dynamic/host/test-dynamic-host/src/androidTest/java/com/tencent/shadow/test/cases/plugin_main/fragment_support/XmlAddNormalFragmentTest.java: -------------------------------------------------------------------------------- 1 | package com.tencent.shadow.test.cases.plugin_main.fragment_support; 2 | 3 | public class XmlAddNormalFragmentTest extends XmlAddFragmentTest { 4 | @Override 5 | protected String fragmentType() { 6 | return "TestNormalFragment"; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /projects/test/dynamic/host/test-dynamic-host/src/androidTest/java/com/tencent/shadow/test/cases/plugin_main/fragment_support/XmlAddSubFragmentTest.java: -------------------------------------------------------------------------------- 1 | package com.tencent.shadow.test.cases.plugin_main.fragment_support; 2 | 3 | public class XmlAddSubFragmentTest extends XmlAddFragmentTest { 4 | @Override 5 | protected String fragmentType() { 6 | return "TestSubFragment"; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /projects/test/dynamic/host/test-dynamic-host/src/main/java/com/tencent/shadow/test/dynamic/host/PluginProcessPPS.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Tencent Shadow available. 3 | * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. 4 | * 5 | * Licensed under the BSD 3-Clause License (the "License"); you may not use 6 | * this file except in compliance with the License. You may obtain a copy of 7 | * the License at 8 | * 9 | * https://opensource.org/licenses/BSD-3-Clause 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | package com.tencent.shadow.test.dynamic.host; 20 | 21 | import com.tencent.shadow.dynamic.host.PluginProcessService; 22 | 23 | public class PluginProcessPPS extends PluginProcessService { 24 | } 25 | -------------------------------------------------------------------------------- /projects/test/dynamic/host/test-dynamic-host/src/main/java/com/tencent/shadow/test/dynamic/host/PluginServiceProcessPPS.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tencent is pleased to support the open source community by making Tencent Shadow available. 3 | * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. 4 | * 5 | * Licensed under the BSD 3-Clause License (the "License"); you may not use 6 | * this file except in compliance with the License. You may obtain a copy of 7 | * the License at 8 | * 9 | * https://opensource.org/licenses/BSD-3-Clause 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | package com.tencent.shadow.test.dynamic.host; 20 | 21 | import com.tencent.shadow.dynamic.host.PluginProcessService; 22 | 23 | public class PluginServiceProcessPPS extends PluginProcessService { 24 | } 25 | -------------------------------------------------------------------------------- /projects/test/dynamic/host/test-dynamic-host/src/main/res/drawable/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/Shadow/f9dc3944944593c8d398f6ce5cb460f076d18d75/projects/test/dynamic/host/test-dynamic-host/src/main/res/drawable/ic_launcher.png -------------------------------------------------------------------------------- /projects/test/dynamic/host/test-dynamic-host/src/main/res/values/themes.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | 20 | 21 |