Droid Plugin
======
[中文文档](readme_cn.md "中文文档")
DroidPlugin is a new **Plugin Framework** developed and maintained by the Android app-store team at Qihoo 360 (NYSE:QIHU).
It enables the host app run any third-party apk without installation, modification and repackage, which benefit a lot for collaborative development on Android.
-------
##Problems to be solved:
1. Unable to send `Notification` with custom Resources,eg:
a. Notification with custom RemoteLayout, which means `Notification`'s `contentView`,`tickerView`,
`bigContentView` and `headsUpContentView` must be null.
b. Notification with icon customized by R.drawable.XXX. The framework will transform it to Bitmap instead.
2. Unable to define specified `Intent Filter` for the plugged app's `Service`、`Activity`、`BroadcastReceiver`
and `ContentProvider`. So the plugged app is invisible for the outside system and app.
3. Lack of `Hook` to the `Native` layer, thus apk (e.g. a majority of game apps) with `native` code cannot be loaded as plugin.
##Features:
1. Compatible to Android 2.3 and later versions
2. Given its .apk file, the plugged app could be run either independently or as plugin of the host, **NO** source code needed.
3. Unnecessary to register the plugged app's `Service`、`Activity`、`BroadcastReceiver`、`ContentProvider` in the host.
4. The plugged app are recognized as *Installed* by the host and other plugged apps
5. Very low level of code invasion, in deed just one line code to integrate DroidPlugin into the host app.
6. Complete code level separation between host and plugged apps, only system level message passing method provide by Android allowed.
7. All system API supported
8. Resources management are also completely separated between host and plugged apps.
9. Process management for plugged apps, idle processed of the plugged app will be timely recycled to guarantee minimum memory usage.
10. Static broadcast of plugged app will be treated as dynamic, thus the static broadcasting will never be trigger if
the plugged app are not activated.
##Usage:
####Integrate with the host apps
It is very simple integrate Droid Plugin to your proejct:
1. Import Droid Plugin project to your project as a lib.
2. Include following attributes in host's `AndroidManifest.xml`:
<application android:name="com.morgoo.droidplugin.PluginApplication"
android:label="@string/app_name"
android:icon="@drawable/ic_launcher" >
3. Or, if you use customized `Application`,add following code in the methods `onCreate` and `attachBaseContext`:
@Override
public void onCreate() {
super.onCreate();
PluginHelper.getInstance().applicationOnCreate(getBaseContext()); //must behind super.onCreate()
}
@Override
protected void attachBaseContext(Context base) {
PluginHelper.getInstance().applicationAttachBaseContext(base);
super.attachBaseContext(base);
}
4. **All** `provider`'s `authorities` value in DroidPlugin's `Libraries\DroidPlugin\AndroidManifest.xml`
default to be `com.morgoo.droidplugin_stub_P00`, e.g. :
<provider
android:name="com.morgoo.droidplugin.stub.ContentProviderStub$StubP00"
android:authorities="com.morgoo.droidplugin_stub_P00"
android:exported="false"
android:label="@string/stub_name_povider" />
You'd better change it to avoid conflict with other instances, e.g.:
<provider
android:name="com.morgoo.droidplugin.stub.ContentProviderStub$StubP00"
android:authorities="com.example.droidplugin_stub_P00"
android:exported="false"
android:label="@string/stub_name_povider" />
and change ```PluginManager.STUB_AUTHORITY_NAME``` to your value:
PluginManager.STUB_AUTHORITY_NAME="com.example.droidplugin_stub"
####Install、Uninstall or Upgrade the plugged app:
1. **Install/Upgrade**, use this method:
int PluginManager.getInstance().installPackage(String filepath, int flags);
For installation, `filepath` set to path of the .apk file, and `flags` set to 0.
For upgrade, `filepath` set to path of the .apk file, and `flags` set to `PackageManagerCompat.INSTALL_REPLACE_EXISTING`.
2. **Uninstall**, use this method:
int PluginManager.getInstance().deletePackage(String packageName,int flags);
`packageName` is package name of the plugged app,`flags = 0`。
3. **Activate**
Just use android's API, same for communication between components.
## Remark:
Please feel free to [report bugs](https://github.com/Qihoo360/DroidPlugin/issues) or ask for help via email.
##Who is using Droid Plugin?
[360 App Store](http://sj.360.cn "360 App Store")
### Thanks:
Translated by Ming Song(gnosoir@hotmail.com)
没有合适的资源?快使用搜索试试~ 我知道了~
360官方Android插件化开发框架
共209个文件
java:148个
xml:27个
png:9个
4星 · 超过85%的资源 需积分: 10 51 下载量 63 浏览量
2015-12-12
12:48:48
上传
评论
收藏 1.36MB ZIP 举报
温馨提示
360官方开源的Android插件化开发的例子,可以直接动态加载apk。带源码,带例子
资源推荐
资源详情
资源评论
收起资源包目录
360官方Android插件化开发框架 (209个子文件)
IPluginManager.aidl 5KB
IPackageDataObserver.aidl 1KB
IApplicationCallback.aidl 1KB
gradlew.bat 2KB
.gitignore 259B
build.gradle 2KB
build.gradle 827B
build.gradle 801B
build.gradle 363B
settings.gradle 111B
gradlew 5KB
android-support-v4.jar 972KB
dalviksystem.jar 2KB
layoutlib.jar 805B
IActivityManagerHookHandle.java 97KB
IPackageManagerHookHandle.java 73KB
IPluginManagerImpl.java 55KB
PluginManager.java 35KB
IntentMatcher.java 25KB
RunningProcesList.java 24KB
INotificationManagerHookHandle.java 24KB
MyActivityManagerService.java 22KB
ActivityStub.java 21KB
PluginPackageParser.java 21KB
PluginProcessManager.java 20KB
PluginCallback.java 20KB
SocketBinder.java 16KB
ServcesManager.java 14KB
MethodUtils.java 13KB
AbstractContentProviderStub.java 13KB
PackageParserApi21.java 13KB
StaticProcessList.java 11KB
FieldUtils.java 10KB
ApkFragment.java 10KB
MemberUtils.java 9KB
InstalledFragment.java 8KB
SocketServiceManager.java 8KB
Log.java 8KB
PluginInstrumentation.java 8KB
IWifiManagerHookHandle.java 8KB
MyCrashHandler.java 8KB
IContentProviderInvokeHandle.java 7KB
LibCoreHookHandle.java 7KB
RunningActivities.java 7KB
PluginHelper.java 7KB
ServiceManagerCacheBinderHook.java 6KB
LaunchModeTestActivity.java 6KB
HookFactory.java 6KB
PackageParser.java 6KB
BaseActivityManagerService.java 6KB
PackageParserApi16.java 6KB
AbstractServiceStub.java 5KB
ServiceTest1.java 5KB
Utils.java 5KB
PluginDirHelper.java 5KB
WebViewFactoryProviderHookHandle.java 5KB
IClipboardHookHandle.java 5KB
PackageParserApi15.java 5KB
IAudioServiceHookHandle.java 5KB
IActivityManagerHook.java 5KB
ServiceManagerBinderHook.java 4KB
IWindowSessionInvokeHandle.java 4KB
AttributeCache.java 4KB
ShortcutProxyActivity.java 4KB
MyActivity.java 4KB
SQLiteDatabaseHook.java 4KB
BinderHook.java 4KB
IMountServiceHookHandle.java 4KB
IContentServiceHandle.java 4KB
LibCoreHook.java 4KB
ServiceStubMap.java 4KB
ContentProviderTest.java 3KB
IWindowManagerBinderHook.java 3KB
IPackageManagerHook.java 3KB
PluginCallbackHook.java 3KB
InstrumentationHook.java 3KB
NotificationTest.java 3KB
ProxyHook.java 3KB
MyProxy.java 3KB
ActivityThreadCompat.java 3KB
PackageParserApi22.java 3KB
IWindowManagerHookHandle.java 3KB
Utils.java 3KB
ApkItem.java 3KB
PluginClassLoader.java 3KB
MyActivity.java 3KB
IWifiManagerBinderHook.java 3KB
HookedMethodHandler.java 3KB
IInputMethodManagerHookHandle.java 3KB
IMediaRouterServiceHookHandle.java 3KB
MyContentProvider1.java 3KB
MyContentProvider2.java 3KB
PackageParserApi22Preview1.java 2KB
ISearchManagerHookHandle.java 2KB
IInputMethodManagerBinderHook.java 2KB
WebViewFactoryProviderHook.java 2KB
BroadcastReceiverTest.java 2KB
BaseService.java 2KB
IGraphicsStatsHookHandle.java 2KB
PluginManagerService.java 2KB
共 209 条
- 1
- 2
- 3
资源评论
- win2domain2020-04-11测试没有问题, 还好
- qq4765264472015-12-22下载下来还没有使用过,希望能够给力
白小木
- 粉丝: 2
- 资源: 21
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功