didi/VirtualAPK — dự án mã nguồn mở — đang có 9.1k sao GitHub. A powerful and lightweight plugin framework for Android
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
Android 9.0 supported! Please use the lastest release.
VirtualAPK is a powerful yet lightweight plugin framework for Android. It can dynamically load and run an APK file (we call it LoadedPlugin) seamlessly as an installed application. Developers can use any Class, Resources, Activity, Service, Receiver and Provider in LoadedPlugin as if they are registered in app's manifest file.
Supported Features
Feature
Detail
Supported components
Activity, Service, Receiver and Provider
Manually register components in AndroidManifest.xml
No need
Access host app classes and resources
Supported
PendingIntent
Supported
Supported Android features
Almost all features
Compatibility
Almost all devices
Building system
Gradle plugin
Supported Android versions
API Level 15+
Getting started
Host Project
Add a dependency in build.gradle in root of host project as following.
Modify proguard rules to keep VirtualAPK related files.
-keep class com.didi.virtualapk.internal.VAInstrumentation { *; }
-keep class com.didi.virtualapk.internal.PluginContentResolver { *; }
-dontwarn com.didi.virtualapk.**
-dontwarn android.**
-keep class android.** { *; }
Finally, load an APK and have fun!
String pluginPath = Environment.getExternalStorageDirectory().getAbsolutePath().concat("/Test.apk");
File plugin = new File(pluginPath);
PluginManager.getInstance(base).loadPlugin(plugin);
// Given "com.didi.virtualapk.demo" is the package name of plugin APK,
// and there is an activity called `MainActivity`.
Intent intent = new Intent();
intent.setClassName("com.didi.virtualapk.demo", "com.didi.virtualapk.demo.MainActivity");
startActivity(intent);
Plugin Project
Add a dependency in build.gradle in root of plugin project as following.
Apply plugin in application module of build.gradle.
apply plugin: 'com.didi.virtualapk.plugin'
Config VirtualAPK. Remember to put following lines at the end of build.gradle.
virtualApk {
packageId = 0x6f // The package id of Resources.
targetHost='source/host/app' // The path of application module in host project.
applyHostMapping = true // [Optional] Default value is true.
}
Developer guide
API document wiki
Sample project PluginDemo
Read core library source code
Read Release notes
Known issues
Notifications with custom layout are not supported in plugin.
Transition animations with animation resources are not supported in plugin.
Contributing
Welcome to contribute by creating issues or sending pull requests. See Contributing Guide for guidelines.
Who is using VirtualAPK?
License
VirtualAPK is licensed under the Apache License 2.0. See the LICENSE file.
Có — didi/VirtualAPK phát hành theo license Apache-2.0, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/didi/VirtualAPK.
didi/VirtualAPK là gì?
didi/VirtualAPK (didi/VirtualAPK) là dự án Java trên GitHub. Theo mô tả gốc: A powerful and lightweight plugin framework for Android
Đọc thêm về didi/VirtualAPK ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/didi/VirtualAPK là nguồn chính thức.
Đọc đầy đủ README ở tab phía trên.
VirtualAPK có đáng để bạn bỏ thời gian?
ChatGPT, Claude và Perplexity đều đọc được trang này. Hỏi thử xem họ nghĩ gì về VirtualAPK.