{"id":13429339,"url":"https://github.com/didi/VirtualAPK","last_synced_at":"2025-03-16T03:31:18.781Z","repository":{"id":22261703,"uuid":"95750391","full_name":"didi/VirtualAPK","owner":"didi","description":"A powerful and lightweight plugin framework for Android","archived":false,"fork":false,"pushed_at":"2023-07-13T22:06:36.000Z","size":1010,"stargazers_count":8988,"open_issues_count":119,"forks_count":1521,"subscribers_count":343,"default_branch":"master","last_synced_at":"2024-10-29T15:34:14.496Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/didi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-06-29T07:25:05.000Z","updated_at":"2024-10-29T06:28:30.000Z","dependencies_parsed_at":"2024-01-29T10:10:04.073Z","dependency_job_id":"615a7984-3b7d-410a-b367-dc07978bdc16","html_url":"https://github.com/didi/VirtualAPK","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/didi%2FVirtualAPK","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/didi%2FVirtualAPK/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/didi%2FVirtualAPK/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/didi%2FVirtualAPK/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/didi","download_url":"https://codeload.github.com/didi/VirtualAPK/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243822312,"owners_count":20353496,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T02:00:35.421Z","updated_at":"2025-03-16T03:31:18.443Z","avatar_url":"https://github.com/didi.png","language":"Java","funding_links":[],"categories":["Plugin","Java","Index","Android Hacking"],"sub_categories":["Android Plugin"],"readme":"# Android 9.0 supported! Please use [the lastest release](https://github.com/didi/VirtualAPK/releases).\n\n# \u003cimg src=\"imgs/va-logo.png\" width=\"200px\" align=\"center\" alt=\"VirtualAPK\"/\u003e\n[![license](http://img.shields.io/badge/license-Apache2.0-brightgreen.svg?style=flat)](https://github.com/didi/VirtualAPK/blob/master/LICENSE)\n[![Release Version](https://img.shields.io/badge/release-0.9.8-red.svg)](https://github.com/didi/VirtualAPK/releases)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/didi/VirtualAPK/pulls)\n\nVirtualAPK 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.\n\n![VirtualAPK](imgs/va.png)\n\n# Supported Features\n\n| Feature | Detail |\n|:-------------|:-------------:|\n| Supported components | Activity, Service, Receiver and Provider |\n| Manually register components in AndroidManifest.xml | No need |\n| Access host app classes and resources | Supported |\n| PendingIntent | Supported |\n| Supported Android features | Almost all features |\n| Compatibility | Almost all devices |\n| Building system | Gradle plugin |\n| Supported Android versions | API Level 15+ |\n\n# Getting started\n\n## Host Project\n\nAdd a dependency in `build.gradle` in root of host project as following.\n\n``` java\ndependencies {\n    classpath 'com.didi.virtualapk:gradle:0.9.8.6'\n}\n```\n\nApply plugin in application module of `build.gradle`.\n\n```\napply plugin: 'com.didi.virtualapk.host'\n```\n\nCompile VirtualAPK in application module of `build.gradle`.\n\n``` java\ncompile 'com.didi.virtualapk:core:0.9.8'\n```\n\nInitialize `PluginManager` in `YourApplication::attachBaseContext()`.\n\n``` java\n@Override\nprotected void attachBaseContext(Context base) {\n    super.attachBaseContext(base);\n    PluginManager.getInstance(base).init();\n}\n```\n\nModify proguard rules to keep VirtualAPK related files.\n\n```\n-keep class com.didi.virtualapk.internal.VAInstrumentation { *; }\n-keep class com.didi.virtualapk.internal.PluginContentResolver { *; }\n\n-dontwarn com.didi.virtualapk.**\n-dontwarn android.**\n-keep class android.** { *; }\n```\n\nFinally, load an APK and have fun!\n\n``` java\nString pluginPath = Environment.getExternalStorageDirectory().getAbsolutePath().concat(\"/Test.apk\");\nFile plugin = new File(pluginPath);\nPluginManager.getInstance(base).loadPlugin(plugin);\n\n// Given \"com.didi.virtualapk.demo\" is the package name of plugin APK, \n// and there is an activity called `MainActivity`.\nIntent intent = new Intent();\nintent.setClassName(\"com.didi.virtualapk.demo\", \"com.didi.virtualapk.demo.MainActivity\");\nstartActivity(intent);\n```\n\n## Plugin Project\n\nAdd a dependency in `build.gradle` in root of plugin project as following.\n\n``` java\ndependencies {\n    classpath 'com.didi.virtualapk:gradle:0.9.8.6'\n}\n```\n\nApply plugin in application module of `build.gradle`.\n\n```\napply plugin: 'com.didi.virtualapk.plugin'\n```\n\nConfig VirtualAPK. Remember to put following lines at the end of `build.gradle`.\n\n```\nvirtualApk {\n    packageId = 0x6f             // The package id of Resources.\n    targetHost='source/host/app' // The path of application module in host project.\n    applyHostMapping = true      // [Optional] Default value is true. \n}\n```\n\n# Developer guide\n\n* API document [wiki](https://github.com/didi/VirtualAPK/wiki)\n* Sample project [PluginDemo](https://github.com/didi/VirtualAPK/tree/master/PluginDemo)\n* Read [core library source code](https://github.com/didi/VirtualAPK/tree/master/CoreLibrary)\n* Read [Release notes](RELEASE-NOTES.md)\n\n# Known issues\n\n* Notifications with custom layout are not supported in plugin.\n* Transition animations with animation resources are not supported in plugin.\n\n# Contributing\n\nWelcome to contribute by creating issues or sending pull requests. See [Contributing Guide](CONTRIBUTING.md) for guidelines.\n\n# Who is using VirtualAPK?\n\n\u003cimg src=\"imgs/didi.png\" width=\"78px\" align=\"center\" alt=\"滴滴出行\"/\u003e \u003cimg src=\"imgs/uber-china.png\" width=\"78px\" align=\"center\" alt=\"Uber中国\"/\u003e\n\n# License\n\nVirtualAPK is licensed under the Apache License 2.0. See the [LICENSE](LICENSE) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdidi%2FVirtualAPK","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdidi%2FVirtualAPK","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdidi%2FVirtualAPK/lists"}