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

fix_ContentProvider:Fix the issue of replacing the context in the ContentProvider during the startup of ProxyApplication. #44

Conversation

blackandwhiteforzj
Copy link

@blackandwhiteforzj blackandwhiteforzj commented May 30, 2024

fix_ContentProvider:Fix the issue of replacing the context in the ContentProvider during the startup of ProxyApplication.

@blackandwhiteforzj blackandwhiteforzj changed the title fix_ContentProvider:修复ContentProvider里面context的替换问题 fix_ContentProvider:Fix the issue of replacing the context in the ContentProvider during the startup of ProxyApplication. May 30, 2024
JniBridge.craa(getApplicationContext(), realApplicationName);
JniBridge.craoc(realApplicationName);
Global.sNeedCalledApplication = false;
// String realApplicationName = FileUtils.readAppName(getApplicationContext());
Copy link
Owner

Choose a reason for hiding this comment

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

无用代码,麻烦移除

}
}

@Override
public String getPackageName() {
if(TextUtils.isEmpty(realApplicationName)){
Copy link
Owner

Choose a reason for hiding this comment

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

写法可以简化

public Context createPackageContext(String packageName, int flags) throws PackageManager.NameNotFoundException {
Log.d(TAG, "createPackageContext: " + realApplicationName);
if(TextUtils.isEmpty(realApplicationName)){
// 如果 AndroidManifest.xml 中配置的 Application 全类名为空
Copy link
Owner

Choose a reason for hiding this comment

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

注释麻烦改成英文,如果不想改则删除注释

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