Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pn插件升级为apk插件问题 #294

Merged
merged 3 commits into from
Aug 11, 2017
Merged

pn插件升级为apk插件问题 #294

merged 3 commits into from
Aug 11, 2017

Conversation

kevinfen9
Copy link
Contributor

1、修复entry中调用context导致插件安装失败的bug;
2、修复apk插件覆盖pn插件插件包名没有更新的bug;

Thank you for contributing! Let's make RePlugin better and better!

Now please tell us the following info for better understanding:

Summary

Description

The issue id of this Pull Request fixes and your general idea of implementation.

2、修复apk插件覆盖pn插件插件包名没有更新的bug;
@kevinfen9
Copy link
Contributor Author

pn插件在没有使用情况下使用apk插件升级,持久化文件中存储的包名还是pn插件的包名,常驻进程重启后Plugininfo.isDexExtracted状态判断出错。

@kevinfen9 kevinfen9 changed the title pn pn插件升级为apk插件问题 Aug 11, 2017
Copy link
Contributor

@jiongxuan jiongxuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

多谢冯达的给力PR!这里还有一些小的细节,辛苦再改下。

@@ -495,6 +495,15 @@ public void setType(int type) {
}

/**
* 设置插件的包名
*/
public void setPkgName(String pkgName){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • 建议将“访问权限”改为Private,防止被外界误以为是可以直接调用的,导致出现问题
  • 同时,建议将方法名改为“setPackageName”,和之前的getPackageName“遥相呼应”

@@ -709,6 +718,7 @@ public void update(PluginInfo info) {
setVersion(info.getVersion());
setPath(info.getPath());
setType(info.getType());
setPkgName(info.getPackageName());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • 可以同时再设置下setAlias,防止出现“变成APK方案后,因别名发生改变而导致”的问题
  • update方法上面的说明中,“插件名之类的不会被更新”字样可以被去掉

@@ -443,7 +443,12 @@ public Context getApplicationContext() {
// 直接获取插件的Application对象
// NOTE 切勿获取mLoader.mPkgContext,因为里面的一些方法会调用getApplicationContext(如registerComponentCallback)
// NOTE 这样会造成StackOverflow异常。所以只能获取Application对象(框架版本为3以上的会创建此对象)
return mLoader.mPluginObj.mApplicationClient.getObj();
//entry中调用context.getApplicationContext时mApplicationClient还没被赋值,会导致空指针造成插件安装失败
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

此处建议做下“代码格式化”

@jiongxuan
Copy link
Contributor

Good,辛苦!

@jiongxuan jiongxuan merged commit d574eab into Qihoo360:dev Aug 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants