{"id":15036598,"url":"https://github.com/houkx/android-pluginmgr","last_synced_at":"2025-05-16T05:00:30.876Z","repository":{"id":23650653,"uuid":"27021152","full_name":"houkx/android-pluginmgr","owner":"houkx","description":"apk plug apkplug apk load","archived":false,"fork":false,"pushed_at":"2018-09-17T14:28:32.000Z","size":2282,"stargazers_count":1582,"open_issues_count":28,"forks_count":542,"subscribers_count":158,"default_branch":"master","last_synced_at":"2025-04-08T14:12:55.051Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/houkx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-11-23T03:46:47.000Z","updated_at":"2025-02-24T21:16:20.000Z","dependencies_parsed_at":"2022-08-22T02:30:49.571Z","dependency_job_id":null,"html_url":"https://github.com/houkx/android-pluginmgr","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/houkx%2Fandroid-pluginmgr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/houkx%2Fandroid-pluginmgr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/houkx%2Fandroid-pluginmgr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/houkx%2Fandroid-pluginmgr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/houkx","download_url":"https://codeload.github.com/houkx/android-pluginmgr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254471028,"owners_count":22076582,"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-09-24T20:31:39.541Z","updated_at":"2025-05-16T05:00:30.847Z","avatar_url":"https://github.com/houkx.png","language":"Java","readme":"## Android PluginManager ##\n**dynamic load uninstalled apk**\n## Introduction ##\n PluginManager is used to manage android applications like [eclipse](http://eclipse.org/) plugins.\nyou can start an activity from an uninstalled apk placed in sdcard,just like it has installed or registed in the application's `AndroidManifest.xml`.\n### Version\n[![Download](https://img.shields.io/badge/PluginManager-0.2.2-brightgreen.svg?style=plastic) ](https://github.com/houkx/android-pluginmgr/archive/master.zip)\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Android%20PluginManager-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/1457)\n### Support Features\n- a **normal** apk is regard as **plug-in**\n- start **activity** from plug-in\n- start other Activity from plug activity\n- plug activity with **theme**\n- plug with custom `Application`\n- plug with **.so**\n- support android2.x\n\n it's easy to use:\n### How to use:\n\n- declare permission in your `AndroidManifest.xml`: \n\n  `\u003cuses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\" /\u003e`\n\n  `\u003cuses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\" /\u003e`\n\n- regist an activity\n\n  `\u003cactivity android:name=\"androidx.pluginmgr.DynamicActivity\" /\u003e`\n\n- init PluginMgr in your application\n  ```java\n  @Override\n  public void onCreate(){\n     PluginManager.init(this);\n     //...\n  }\n  ```\n\n\n- load plugin from plug apk:\n  ```java\n  PluginManager mgr = PluginManager.getSingleton();\n  File myPlug = new File(\"/mnt/sdcard/Download/myplug.apk\");\n  PlugInfo plug = pluginMgr.loadPlugin(myPlug).iterator().next();\n  ```\n- start activity:\n  `\n  mgr.startMainActivity(context, plug);\n  `\n\n\n- Plugin verify feature\n  ```java\n    PluginManager.getSingleton().setPluginOverdueVerifier(new PluginOverdueVerifier() {\n            @Override\n            public boolean isOverdue(File originPluginFile, File targetExistFile) {\n                //check If the plugin has expired\n                return true;\n            }\n        });\n  ```\n\n- Use custom selector\n  ```java\n    PluginManager.getSingleton().setActivitySelector(new DynamicActivitySelector() {\n            @Override\n            public Class\u003c? extends Activity\u003e selectDynamicActivity(ActivityInfo pluginActivityInfo) {\n\n                return YourProxyActivity.class;\n            }\n        });\n  ```\n- 破壳系统 - 取得存在于宿主中的对象\n\n  ```java\n    Context hostContext = (Context) getSystemService(\"GetHostContext\");\n    String pluginPackageName = (String) getSystemService(\"GetPluginPkgName\");\n    PackageInfo pluginPackageInfo = (PackageInfo) getSystemService(\"GetPluginPkgInfo\");\n    //...\n    //破壳系统支持的操作详见 androidx/pluginmgr/Globals.java\n  ```\n\n## License\n```java\n/*\n * Copyright (C) 2015 HouKx \u003chkx.aidream@gmail.com\u003e\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n```\n## About\n[author's blog](http://blog.csdn.net/hkxxx/article/details/42194387)\n本博客中所写的原理已不适用于目前的主分支，但是dev分支保留原来的插件化方案。\n### QQGroup: 334394768\n","funding_links":[],"categories":["Index","etc"],"sub_categories":["Android Plugin"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoukx%2Fandroid-pluginmgr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhoukx%2Fandroid-pluginmgr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoukx%2Fandroid-pluginmgr/lists"}