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 |
22 |
23 |
--------------------------------------------------------------------------------
/projects/sample/source/sample-manager/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/projects/sample/source/sample-manager/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/source/sample-manager/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/projects/sample/source/sample-plugin/sample-app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/projects/sample/source/sample-plugin/sample-app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /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-app/src/main/assets/web/test.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | location.search:
4 |
5 |
9 |
10 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/projects/sample/source/sample-plugin/sample-app/src/main/res/anim/dialog_exit_fade_out.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
--------------------------------------------------------------------------------
/projects/sample/source/sample-plugin/sample-app/src/main/res/drawable/collapse.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/Shadow/f9dc3944944593c8d398f6ce5cb460f076d18d75/projects/sample/source/sample-plugin/sample-app/src/main/res/drawable/collapse.png
--------------------------------------------------------------------------------
/projects/sample/source/sample-plugin/sample-app/src/main/res/drawable/expanded.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/Shadow/f9dc3944944593c8d398f6ce5cb460f076d18d75/projects/sample/source/sample-plugin/sample-app/src/main/res/drawable/expanded.png
--------------------------------------------------------------------------------
/projects/sample/source/sample-plugin/sample-app/src/main/res/layout/layout_host_add_plugin_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
10 |
11 |
15 |
--------------------------------------------------------------------------------
/projects/sample/source/sample-plugin/sample-app/src/main/res/menu/case_test_activity_option_menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/projects/sample/source/sample-plugin/sample-app/src/main/res/values-v21/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
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 |
22 |
23 |
--------------------------------------------------------------------------------
/projects/test/dynamic/manager/test-dynamic-manager/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/projects/test/dynamic/manager/test-dynamic-manager/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/test/dynamic/manager/test-dynamic-manager/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/projects/test/dynamic/plugin/test-dynamic-loader/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/projects/test/dynamic/plugin/test-dynamic-loader/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/projects/test/dynamic/plugin/test-dynamic-runtime/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/projects/test/dynamic/plugin/test-dynamic-runtime/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion project.COMPILE_SDK_VERSION
5 | defaultConfig {
6 | applicationId project.TEST_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/test/dynamic/plugin/test-dynamic-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.**{*;}
--------------------------------------------------------------------------------
/projects/test/dynamic/plugin/test-dynamic-runtime/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/projects/test/gradle-plugin-agp-compat-test/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | .idea
5 | .DS_Store
6 | /build
7 | /captures
8 | .externalNativeBuild
9 | .gradletasknamecache
10 |
11 |
--------------------------------------------------------------------------------
/projects/test/gradle-plugin-agp-compat-test/README.md:
--------------------------------------------------------------------------------
1 | ## core.gradle-plugin模块的AGP各版本黑盒测试
2 |
3 | 准备一个桩工程`stub-project`,通过命令行参数控制其AGP版本和Shadow版本。
4 |
5 | 自动化测试脚本: `test_JDK11.sh`和`test_JDK17.sh`。其中先编译Shadow,发布到本地Maven,然后用这个Shadow版本进行测试。
6 |
7 | 注意脚本会echo出执行的命令,如果遇到测试失败,可复制命令手工重新执行。
8 |
9 | `test_JDK11.sh`需要JDK 11环境,`test_JDK17.sh`需要JDK 17环境。
10 |
11 | `test_clean.sh`可以还原测试脚本对Gradle文件对改动。
12 |
13 | ### 确定实际使用的AGP版本:
14 |
15 | 查看`stub-project/build/intermediates/app_metadata/pluginDebug/app-metadata.properties`
16 |
--------------------------------------------------------------------------------
/projects/test/gradle-plugin-agp-compat-test/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
--------------------------------------------------------------------------------
/projects/test/gradle-plugin-agp-compat-test/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=false
16 |
17 |
--------------------------------------------------------------------------------
/projects/test/gradle-plugin-agp-compat-test/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/Shadow/f9dc3944944593c8d398f6ce5cb460f076d18d75/projects/test/gradle-plugin-agp-compat-test/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/projects/test/gradle-plugin-agp-compat-test/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/test/gradle-plugin-agp-compat-test/settings.gradle:
--------------------------------------------------------------------------------
1 | pluginManagement {
2 | repositories {
3 | if (!System.getenv().containsKey("DISABLE_TENCENT_MAVEN_MIRROR")) {
4 | maven { url 'https://mirrors.tencent.com/nexus/repository/maven-public/' }
5 | } else {
6 | google()
7 | mavenCentral()
8 | }
9 | mavenLocal()
10 | }
11 | }
12 | rootProject.name = 'gradle-plugin-agp-compat-test'
13 | if (SetGradleVersion != 'true') {
14 | include 'stub-project'
15 | }
16 |
--------------------------------------------------------------------------------
/projects/test/gradle-plugin-agp-compat-test/stub-project/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | .idea
5 | .DS_Store
6 | build
7 | /captures
8 | .externalNativeBuild
9 | .gradletasknamecache
--------------------------------------------------------------------------------
/projects/test/gradle-plugin-agp-compat-test/stub-project/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'caseAGPCompat'
--------------------------------------------------------------------------------
/projects/test/gradle-plugin-agp-compat-test/stub-project/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/projects/test/gradle-plugin-agp-compat-test/stub-project/src/main/java/PluginManifestIncludeTest.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 引用一下PluginManifest类型,测试自动生成的
3 | * PluginManifest.java 是否被添加到编译源码路径中了
4 | */
5 | public final class PluginManifestIncludeTest {
6 | public static final Class DEBUG = com.tencent.shadow.core.manifest_parser.PluginManifest.class;
7 | }
--------------------------------------------------------------------------------
/projects/test/gradle-plugin-agp-compat-test/stub-project/src/main/res/values/themes.xml:
--------------------------------------------------------------------------------
1 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/projects/test/gradle-plugin-agp-compat-test/test_JDK17.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | # 从Gradle 7.5和AGP 8.0开始支持和要求使用JDK 17,所以这个脚本中的待测版本需要在JDK 17环境下测试。
4 |
5 | JAVA_MAJOR_VERSION=$(javap -verbose java.lang.Object | grep "major version" | cut -d " " -f5)
6 | if [[ $JAVA_MAJOR_VERSION -ne 61 ]]; then
7 | echo "需要JDK 17!"
8 | exit 1
9 | fi
10 |
11 | source ./test_prepare.sh
12 |
13 | # 测试版本来源
14 | # AGP release页面:https://developer.android.com/studio/releases/gradle-plugin
15 | # AGP Maven仓库:https://mvnrepository.com/artifact/com.android.tools.build/gradle
16 | # Gradle下载:https://services.gradle.org/distributions/
17 | setGradleVersion 8.11.1
18 | testUnderAGPVersion 8.9.0
19 | setGradleVersion 8.6
20 | testUnderAGPVersion 8.4.0-rc02
21 | setGradleVersion 8.4
22 | testUnderAGPVersion 8.3.2
23 | setGradleVersion 8.2.1
24 | testUnderAGPVersion 8.2.0
25 | setGradleVersion 8.0.2
26 | testUnderAGPVersion 8.1.4
27 | testUnderAGPVersion 8.0.2
28 | setGradleVersion 7.5.1
29 | testUnderAGPVersion 7.4.1
30 |
--------------------------------------------------------------------------------
/projects/test/gradle-plugin-agp-compat-test/test_clean.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | set -eo pipefail
4 |
5 | git restore gradle/wrapper gradlew gradlew.bat
6 | git clean -fdx .
--------------------------------------------------------------------------------
/projects/test/lib/constant/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/projects/test/lib/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/test/lib/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/test/lib/constant/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/projects/test/lib/custom-view/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/projects/test/lib/custom-view/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/test/lib/custom-view/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/test/lib/custom-view/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/projects/test/lib/plugin-use-host-code-lib/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/projects/test/lib/plugin-use-host-code-lib/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'java-library'
2 |
3 | group 'com.tencent.shadow.test.lib.plugin-use-host-code-lib'
4 |
5 | dependencies {
6 | implementation fileTree(dir: 'libs', include: ['*.jar'])
7 | }
8 |
9 | sourceCompatibility = "7"
10 | targetCompatibility = "7"
11 |
--------------------------------------------------------------------------------
/projects/test/lib/plugin-use-host-code-lib/src/main/java/com/tencent/shadow/test/lib/plugin_use_host_code_lib/interfaces/subpackage/Foo.java:
--------------------------------------------------------------------------------
1 | package com.tencent.shadow.test.lib.plugin_use_host_code_lib.interfaces.subpackage;
2 |
3 | public final class Foo {
4 | }
5 |
--------------------------------------------------------------------------------
/projects/test/lib/test-manager/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/projects/test/lib/test-manager/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'java-library'
2 |
3 | group 'com.tencent.shadow.test.lib.test-manager'
4 |
5 | dependencies {
6 | compileOnly 'com.tencent.shadow.dynamic:dynamic-host'
7 | }
8 | sourceCompatibility = JavaVersion.VERSION_1_8
9 | targetCompatibility = JavaVersion.VERSION_1_8
10 |
--------------------------------------------------------------------------------
/projects/test/lib/test-manager/src/main/java/com/tencent/shadow/test/lib/test_manager/SimpleIdlingResource.java:
--------------------------------------------------------------------------------
1 | package com.tencent.shadow.test.lib.test_manager;
2 |
3 | public interface SimpleIdlingResource {
4 | void setIdleState(boolean isIdleNow);
5 | }
6 |
--------------------------------------------------------------------------------
/projects/test/lib/test-manager/src/main/java/com/tencent/shadow/test/lib/test_manager/TestManager.java:
--------------------------------------------------------------------------------
1 | package com.tencent.shadow.test.lib.test_manager;
2 |
3 | public class TestManager {
4 | public static String uuid;
5 |
6 | public static SimpleIdlingResource TheSimpleIdlingResource;
7 |
8 | public static Object sBindPluginServiceActivityContentView;
9 | }
10 |
--------------------------------------------------------------------------------
/projects/test/none-dynamic/host/test-none-dynamic-host/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/projects/test/none-dynamic/host/test-none-dynamic-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.**{*;}
--------------------------------------------------------------------------------
/projects/test/none-dynamic/host/test-none-dynamic-host/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/Shadow/f9dc3944944593c8d398f6ce5cb460f076d18d75/projects/test/none-dynamic/host/test-none-dynamic-host/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/projects/test/none-dynamic/host/test-none-dynamic-host/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/Shadow/f9dc3944944593c8d398f6ce5cb460f076d18d75/projects/test/none-dynamic/host/test-none-dynamic-host/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/projects/test/none-dynamic/host/test-none-dynamic-host/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/Shadow/f9dc3944944593c8d398f6ce5cb460f076d18d75/projects/test/none-dynamic/host/test-none-dynamic-host/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/projects/test/none-dynamic/host/test-none-dynamic-host/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/Shadow/f9dc3944944593c8d398f6ce5cb460f076d18d75/projects/test/none-dynamic/host/test-none-dynamic-host/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/projects/test/none-dynamic/host/test-none-dynamic-host/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tencent/Shadow/f9dc3944944593c8d398f6ce5cb460f076d18d75/projects/test/none-dynamic/host/test-none-dynamic-host/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/projects/test/none-dynamic/host/test-none-dynamic-host/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
18 |
19 |
20 | 启动插件
21 |
--------------------------------------------------------------------------------
/projects/test/none-dynamic/host/test-none-dynamic-host/src/main/res/values/themes.xml:
--------------------------------------------------------------------------------
1 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/projects/test/plugin/androidx-cases/test-plugin-androidx-cases/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/projects/test/plugin/androidx-cases/test-plugin-androidx-cases/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 |
--------------------------------------------------------------------------------
/projects/test/plugin/androidx-cases/test-plugin-androidx-cases/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
21 |
22 |
--------------------------------------------------------------------------------
/projects/test/plugin/androidx-cases/test-plugin-androidx-cases/src/main/java/com/tencent/shadow/test/plugin/androidx_cases/lib/AppComponentFactoryTestActivity.java:
--------------------------------------------------------------------------------
1 | package com.tencent.shadow.test.plugin.androidx_cases.lib;
2 |
3 | import android.app.Activity;
4 | import android.os.Bundle;
5 | import android.view.ViewGroup;
6 |
7 | import androidx.annotation.Nullable;
8 |
9 | public class AppComponentFactoryTestActivity extends Activity {
10 | boolean flag = false;
11 |
12 | @Override
13 | protected void onCreate(@Nullable Bundle savedInstanceState) {
14 | super.onCreate(savedInstanceState);
15 |
16 | ViewGroup viewGroup = UiUtil.setActivityContentView(this);
17 | ViewGroup item = UiUtil.makeItem(
18 | this,
19 | "flag",
20 | "flag",
21 | Boolean.toString(flag)
22 | );
23 |
24 | viewGroup.addView(item);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/projects/test/plugin/general-cases/test-plugin-general-cases/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/projects/test/plugin/general-cases/test-plugin-general-cases/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 |
--------------------------------------------------------------------------------
/projects/test/plugin/general-cases/test-plugin-general-cases/src/androidTest/java/com/tencent/shadow/test/plugin/general_cases/app/NormalAppTest.java:
--------------------------------------------------------------------------------
1 | package com.tencent.shadow.test.plugin.general_cases.app;
2 |
3 | import androidx.test.espresso.Espresso;
4 | import androidx.test.espresso.assertion.ViewAssertions;
5 | import androidx.test.espresso.matcher.ViewMatchers;
6 |
7 | import org.hamcrest.Matchers;
8 |
9 | /**
10 | * 正常安装app条件下测试general-cases-lib
11 | */
12 | public abstract class NormalAppTest {
13 | /**
14 | * 检测view
15 | *
16 | * @param tag view的tag
17 | * @param text view上的文字
18 | */
19 | public void matchTextWithViewTag(String tag, String text) {
20 | Espresso.onView(ViewMatchers.withTagValue(Matchers.