Top Related Projects
A powerful Android Dynamic Component Framework.
A powerful and lightweight plugin framework for Android
Android Signature V2 Scheme签名下的新一代渠道包打包神器
A small framework to split app into small parts
Virtual Engine for Android(Support 14.0 in business version)
🔥🔥Qigsaw ['tʃɪɡsɔ] is a dynamic modularization library which is based on Android App Bundles(Do not need Google Play Service). It supports dynamic delivery for split APKs without reinstalling the base one.
Quick Overview
Shadow is an Android plugin framework developed by Tencent. It allows developers to dynamically load and run Android components as plugins, enabling hot-fixing, dynamic feature delivery, and modular app development without requiring app restarts or updates through app stores.
Pros
- Enables dynamic loading of Android components, allowing for hot-fixing and feature updates without app restarts
- Supports modular app development, improving code organization and maintenance
- Provides a flexible plugin system that can be customized to fit specific project needs
- Developed and maintained by Tencent, a major tech company with extensive experience in mobile app development
Cons
- Steep learning curve for developers new to plugin architectures
- May introduce additional complexity to the app's architecture
- Potential performance overhead due to dynamic loading of components
- Limited documentation and resources in English, as the project is primarily maintained in Chinese
Code Examples
- Loading a plugin:
val pluginManager = PluginManager.getInstance(context)
pluginManager.loadPlugin(pluginZipPath)
- Starting a plugin activity:
val intent = Intent()
intent.setClassName("com.example.plugin", "com.example.plugin.MainActivity")
pluginManager.startPluginActivity(context, intent)
- Accessing plugin resources:
val pluginResources = pluginManager.getPluginResources(pluginPackageName)
val drawableId = pluginResources.getIdentifier("icon", "drawable", pluginPackageName)
val drawable = pluginResources.getDrawable(drawableId)
Getting Started
To integrate Shadow into your Android project:
- Add the Shadow dependency to your
build.gradle
file:
dependencies {
implementation 'com.tencent.shadow:shadow-core:2.1.1'
}
- Initialize the Shadow plugin manager in your application class:
class MyApplication : Application() {
override fun onCreate() {
super.onCreate()
PluginManager.init(this)
}
}
- Load and use plugins in your app:
val pluginManager = PluginManager.getInstance(context)
pluginManager.loadPlugin("path/to/plugin.zip")
val intent = Intent()
intent.setClassName("com.example.plugin", "com.example.plugin.MainActivity")
pluginManager.startPluginActivity(context, intent)
For more detailed instructions and advanced usage, refer to the project's documentation on GitHub.
Competitor Comparisons
A powerful Android Dynamic Component Framework.
Pros of Atlas
- More mature project with longer development history
- Broader scope, supporting both dynamic component management and hotfix patching
- Larger community and more extensive documentation
Cons of Atlas
- Heavier framework with more complex implementation
- Steeper learning curve for developers new to the system
- Less frequent updates and maintenance compared to Shadow
Code Comparison
Atlas:
Atlas.getInstance().installBundleTransitively(bundleFile, false);
BundleImpl bundle = (BundleImpl) Atlas.getInstance().getBundle(bundleName);
bundle.start();
Shadow:
val pluginManager = Shadow.getPluginManager()
val installedPlugin = pluginManager.installPlugin(pluginZipFile)
pluginManager.loadPlugin(installedPlugin)
Both frameworks provide methods for installing and loading plugins, but Atlas offers a more granular approach with separate installation and start steps, while Shadow combines these operations in a more streamlined manner.
A powerful and lightweight plugin framework for Android
Pros of VirtualAPK
- Simpler implementation and easier to integrate into existing projects
- Supports a wider range of Android versions (4.0+)
- More flexible plugin management with dynamic loading and unloading
Cons of VirtualAPK
- Less active development and community support
- Limited documentation and examples compared to Shadow
- May have compatibility issues with newer Android versions
Code Comparison
VirtualAPK:
PluginManager pluginManager = PluginManager.getInstance(context);
pluginManager.loadPlugin(pluginPath);
Intent intent = new Intent();
intent.setClassName("com.example.plugin", "com.example.plugin.MainActivity");
startActivity(intent);
Shadow:
val pluginManager = PluginManager.getInstance(context)
pluginManager.loadPlugin(pluginPath)
val intent = Intent()
intent.setClassName("com.example.plugin", "com.example.plugin.MainActivity")
startActivity(intent)
Both frameworks use similar approaches for loading and launching plugin activities, but Shadow uses Kotlin while VirtualAPK uses Java. Shadow generally offers more advanced features and better performance optimization, while VirtualAPK provides a simpler implementation that may be easier for beginners to understand and integrate into existing projects.
Android Signature V2 Scheme签名下的新一代渠道包打包神器
Pros of Walle
- Simpler setup and configuration process
- Supports multiple channels for app distribution
- Provides a user-friendly web interface for managing app releases
Cons of Walle
- Limited plugin ecosystem compared to Shadow
- Less flexibility for complex app architectures
- Fewer advanced features for dynamic loading and resource management
Code Comparison
Shadow:
@ContainerFragment
class PluginContainerFragment : Fragment() {
override fun onAttach(context: Context) {
super.onAttach(context)
// Plugin-specific initialization
}
}
Walle:
public class WalleChannelWriter {
public static void putChannel(File apkFile, String channel) throws Exception {
// Write channel information to APK
}
}
Shadow focuses on creating a flexible plugin system for dynamic loading of app components, while Walle primarily deals with app packaging and distribution across multiple channels. Shadow's code example demonstrates its plugin architecture, whereas Walle's code shows its channel writing functionality for APK files.
Both projects serve different purposes in the Android development ecosystem, with Shadow offering more advanced features for app modularization and dynamic loading, while Walle provides a streamlined solution for app distribution and channel management.
A small framework to split app into small parts
Pros of Small
- Lighter weight and simpler implementation
- Easier to integrate into existing projects
- Supports hot-fixing without app updates
Cons of Small
- Less comprehensive documentation
- Smaller community and fewer updates
- Limited support for complex plugin scenarios
Code Comparison
Small:
Small.setBaseUri("https://example.com/updates/");
Small.setUp(this);
Shadow:
PluginManager pluginManager = Shadow.getPluginManager();
pluginManager.loadPlugin("plugin.apk");
pluginManager.startPlugin("com.example.plugin");
Both Shadow and Small are Android plugin frameworks designed to enable dynamic loading and updating of app components. Shadow, developed by Tencent, offers a more robust and feature-rich solution with better documentation and ongoing support. It's particularly well-suited for large-scale applications with complex plugin requirements.
Small, on the other hand, provides a more lightweight approach that may be easier to implement in smaller projects. It offers hot-fixing capabilities, allowing for quick updates without requiring a full app update. However, its documentation is less comprehensive, and it may not be as suitable for more complex plugin scenarios.
In terms of code, Small's setup is generally simpler, while Shadow provides more granular control over plugin loading and management. The choice between the two depends on the specific needs of your project, considering factors such as complexity, scale, and required features.
Virtual Engine for Android(Support 14.0 in business version)
Pros of VirtualApp
- More comprehensive virtualization, supporting full app-level virtualization
- Broader compatibility with various Android versions and devices
- More active community and frequent updates
Cons of VirtualApp
- Potentially higher resource consumption due to full app virtualization
- More complex implementation and integration process
- May face legal challenges due to its nature of app cloning
Code Comparison
VirtualApp:
@Override
public void onCreate() {
super.onCreate();
VirtualCore.get().setHostPackageName("com.example.host");
VirtualCore.get().initialize(this);
}
Shadow:
override fun onCreate() {
super.onCreate()
PluginManager.init(this)
PluginManager.loadPlugin("com.example.plugin")
}
VirtualApp provides a more comprehensive virtualization approach, allowing full app cloning and running multiple instances of the same app. Shadow, on the other hand, focuses on plugin-based architecture, which can be lighter and more suitable for specific use cases.
VirtualApp's code shows initialization of the virtual core, while Shadow's code demonstrates plugin loading. This reflects their different approaches to app virtualization and plugin management.
🔥🔥Qigsaw ['tʃɪɡsɔ] is a dynamic modularization library which is based on Android App Bundles(Do not need Google Play Service). It supports dynamic delivery for split APKs without reinstalling the base one.
Pros of Qigsaw
- Supports incremental updates, reducing download size for app updates
- Provides a more flexible plugin management system
- Offers better support for custom plugin loading strategies
Cons of Qigsaw
- Less mature and less widely adopted compared to Shadow
- Documentation is primarily in Chinese, which may be a barrier for non-Chinese speakers
- Potentially more complex setup process for developers
Code Comparison
Shadow:
@PluginApplication(application = "com.example.MyApplication")
class PluginApplication : Application() {
override fun onCreate() {
super.onCreate()
// Plugin initialization code
}
}
Qigsaw:
public class PluginApplication extends QigsawApplication {
@Override
public void onCreate() {
super.onCreate();
// Plugin initialization code
}
}
Both frameworks use similar approaches for initializing plugin applications, but Qigsaw uses Java while Shadow uses Kotlin. Shadow's annotation-based approach may be more concise, while Qigsaw's inheritance-based method might offer more flexibility for customization.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Shadow
ä»ç»
Shadowæ¯ä¸ä¸ªè ¾è®¯èªä¸»ç åçAndroidæ件æ¡æ¶ï¼ç»è¿çº¿ä¸äº¿çº§ç¨æ·éæ£éªã Shadowä¸ä» å¼æºå享äºæ件ææ¯çå ³é®ä»£ç ï¼è¿å®æ´çå享äºä¸çº¿é¨ç½²æéè¦çææ设计ã
ä¸å¸é¢ä¸å ¶ä»æ件æ¡æ¶ç¸æ¯ï¼Shadow主è¦å ·æ以ä¸ç¹ç¹ï¼
- å¤ç¨ç¬ç«å®è£ Appçæºç ï¼æ件Appçæºç åæ¬å°±æ¯å¯ä»¥æ£å¸¸å®è£ è¿è¡çã
- **é¶åå°æ Hackå®ç°æ件ææ¯**ï¼ä»ç论ä¸å°±å·²ç»ç¡®å®æ é对任ä½ç³»ç»åå ¼å®¹å¼åï¼æ´æ ä»»ä½éèAPIè°ç¨ï¼åGoogleéå¶éå ¬å¼SDKæ¥å£è®¿é®ççç¥å®å ¨ä¸å²çªã
- **å ¨å¨ææ件æ¡æ¶**ï¼ä¸æ¬¡æ§å®ç°å®ç¾çæ件æ¡æ¶å¾é¾ï¼ä½Shadowå°è¿äºå®ç°å ¨é¨å¨æåèµ·æ¥ï¼ä½¿æ件æ¡æ¶ç代ç æ为äºæ件çä¸é¨åãæ件çè¿ä»£ä¸åå宿主æå äºæ§çæ¬æ件æ¡æ¶æéå¶ã
- 宿主å¢éæå°ï¼å¾çäºå ¨å¨æå®ç°ï¼çæ£åå ¥å®¿ä¸»ç¨åºç代ç éæå°ï¼15KBï¼160æ¹æ³æ°å·¦å³ï¼ã
- **Kotlinå®ç°**ï¼core.loaderï¼core.transformæ ¸å¿ä»£ç å®å ¨ç¨Kotlinå®ç°ï¼ä»£ç ç®æ´æç»´æ¤ã
æ¯æç¹æ§
- å大ç»ä»¶
- Fragmentï¼ä»£ç æ·»å åXmlæ·»å ï¼
- DataBindingï¼æ éç¹å«æ¯æï¼ä½å·²éªè¯å¯æ£å¸¸å·¥ä½ï¼
- è·¨è¿ç¨ä½¿ç¨æ件Service
- èªå®ä¹Theme
- æ件访é®å®¿ä¸»ç±»
- Soå è½½
- å段å è½½æ件ï¼å¤Apkåå«å è½½æå¤Apk以æ¤ä¾èµå è½½ï¼
- ä¸ä¸ªActivityä¸å è½½å¤ä¸ªApkä¸çView
- ççâ¦â¦
ç¼è¯ä¸å¼åç¯å¢
ç¯å¢åå¤
建议ç´æ¥ç¨ææ°ç稳å®çæ¬Android Studioæå¼å·¥ç¨ãç®å项ç®å·²éé
Android Studio Arctic Fox | 2020.3.1
ï¼
ä½çæ¬çAndroid Studioå¯è½å 为Gradleçæ¬è¿é«èæ æ³æ£å¸¸æå¼é¡¹ç®ã
ç¶åå¨IDEä¸éæ©sample-app
æsample-host
模åç´æ¥è¿è¡ï¼åå«ä½éªåä¸ä»½ä»£ç å¨æ£å¸¸å®è£
æ
åµä¸åæ件æ
åµä¸çè¿è¡æ
åµã
Shadowçææ代ç é½ä½äºprojects
ç®å½ä¸ç3个ç®å½ï¼åå«æ¯ï¼
sdk
å å«SDKçææ代ç test
å å«SDKçèªå¨åæµè¯ä»£ç sample
å å«æ¼ç¤ºä»£ç
å
¶ä¸sample
åºè¯¥æ¯å¤§å®¶ä½éªShadowçæä½³ç¯å¢ã
详è§sample
ç®å½ä¸çREADMEä»ç»ã
å ¼å®¹æ§
Shadow项ç®æè¾ä¸ºå®åçèªå¨åæµè¯ï¼å æ¤ææ°ä»£ç 对å¤é¨ç¯å¢ççæ¬å ¼å®¹æ§å¯ä»¥åèèªå¨åæµè¯çé ç½®ã
- pr-check.yml èææºèªå¨åæµè¯ï¼å å«Androidæµè¯æºçæ¬åç¼è¯ç¯å¢JDKççæ¬ã
- pr-check-gradle-plugin.yml AGPå ¼å®¹æ§æµè¯ã å ¶ä¸æåçtest_JDK17.shå test_JDK11.shä¸å®ä¹äºè¢«æµè¯çAGPçæ¬ã
èªå·±åçæµè¯ä»£ç åºéï¼
以æ们å¤å¹´çæ件ç¯å¢ä¸ä¸å¡å¼åç»éªï¼æ件æ¡æ¶æ¯ä¸å¯è½ä¸æ¥å°ä½å®ç°å®ç¾çã å æ¤ï¼æ们ç¸ä¿¡å¤§é¨åä¸å¡å¨æ¥å ¥æ¶é½æ¯éè¦ä¸å®çäºæ¬¡å¼åå·¥ä½ã Shadowç°æç代ç 满足çæ¯æ们èªå·±çä¸å¡ç°å¨çéæ±ãå¾çäºå ¨å¨æçè®¾è®¡ï¼ æ件æ¡æ¶åæ件æ¬èº«é½æ¯å¨æåå¸çï¼æ件å éæ¢ææ件代ç ä¹ææ件æ¡æ¶ä»£ç ï¼ æ以å¯ä»¥æ ¹æ®æ°çæ¬æ件çéè¦åæ¶å¼åæ件æ¡æ¶ã
ä¾å¦ï¼ShadowActivity没æå®ç°å ¨ææActivityæ¹æ³ï¼ä½ åçæµè¯ä»£ç å¯è½ç¨å°äºï¼ å°±ä¼åºç°Method Not Foundé误ï¼åªéè¦å¨ShadowActivityä¸å®ç°å¯¹åºæ¹æ³å°±å¯ä»¥äºã 大é¨åæ¹æ³çå®ç°é½åªæ¯éè¦ç®åç转è°å°±è½å·¥ä½æ£å¸¸ã
å¦æéå°ä¸ä¼å®ç°çåè½ï¼å¯ä»¥æIssueãæ好éä¸æµè¯ä»£ç ã
åç»å¼å
- åçä¸è®¾è®¡è¯´æææ¡£
- å¤æ件æ¯æçæ¼ç¤ºå·¥ç¨
- èªå¨åæµè¯ç¨ä¾è¡¥å
- å¼æºå å«ä¸è½½è½åçmanagerå®ç°
è´¡ç®ä»£ç
详è§CONTRIBUTING.md
许å¯åè®®
Tencent Shadowéç¨BSD 3-Clause License
ï¼è¯¦è§LICENSEã
个人信æ¯ä¿æ¤è§å声æ
详è§PRIVACY.md
Top Related Projects
A powerful Android Dynamic Component Framework.
A powerful and lightweight plugin framework for Android
Android Signature V2 Scheme签名下的新一代渠道包打包神器
A small framework to split app into small parts
Virtual Engine for Android(Support 14.0 in business version)
🔥🔥Qigsaw ['tʃɪɡsɔ] is a dynamic modularization library which is based on Android App Bundles(Do not need Google Play Service). It supports dynamic delivery for split APKs without reinstalling the base one.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot