GitHub Hot Board

GitHub Hot Board · 저장소 아카이브

didi/VirtualAPK

A powerful and lightweight plugin framework for Android (소개는 저장소 자체 문서에서 왔습니다.)

데이터 기준 October 25didi

최고 순위

#294

종합 · Java 언어별

9K

누적 스타

1.5K

포크 수

0

최근 30일 기록 일수

프로젝트 상태라이선스: Apache-2.0최근 push: July 13열린 이슈(PR 포함): 123

2026-10-25부터 수집. 미확인 = 아직 미수집

README에 뱃지를 붙여보세요 · didi/VirtualAPK[![README에 뱃지를 붙여보세요](https://git.vaiox.xyz/api/badge/didi/VirtualAPK.svg)](https://git.vaiox.xyz/ko/repo/didi/VirtualAPK)
<a href="https://git.vaiox.xyz/ko/repo/didi/VirtualAPK"><img src="https://git.vaiox.xyz/api/badge/didi/VirtualAPK.svg" alt="README에 뱃지를 붙여보세요" height="20"></a>

프로젝트 문서

Android 9.0 supported! Please use the lastest release.

VirtualAPK

license Release Version PRs Welcome

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.

VirtualAPK

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.

dependencies {
    classpath 'com.didi.virtualapk:gradle:0.9.8.6'
}

Apply plugin in application module of build.gradle.

apply plugin: 'com.didi.virtualapk.host'

Compile VirtualAPK in application module of build.gradle.

compile 'com.didi.virtualapk:core:0.9.8'

Initialize PluginManager in YourApplication::attachBaseContext().

@Override
protected void attachBaseContext(Context base) {
    super.attachBaseContext(base);
    PluginManager.getInstance(base).init();
}

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.

dependencies {
    classpath 'com.didi.virtualapk:gradle:0.9.8.6'
}

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

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?

滴滴出行 Uber中国

License

VirtualAPK is licensed under the Apache License 2.0. See the LICENSE file.

현재 순위

  • 294

    종합 랭킹 · 역대 최강 · Java

    9K 스타 · 1.5K fork · 총 스타 수

    종합 · Java →

최근 30일 추이

최근 30일간 기록이 없습니다.

← 랭킹으로