Skip to content
This repository was archived by the owner on Jun 3, 2021. It is now read-only.

[android] android targetSdkVersion 29 ashmem issue - #3246

Open
neuyu wants to merge 2 commits into
apache:masterfrom
neuyu:master
Open

[android] android targetSdkVersion 29 ashmem issue#3246
neuyu wants to merge 2 commits into
apache:masterfrom
neuyu:master

Conversation

@neuyu

@neuyu neuyu commented Jul 27, 2020

Copy link
Copy Markdown

As Google Play warn all apps need update targetSdkVersion to 29 before 2020.10, We must handle this issue, #2706

@neuyu
neuyu requested a review from YorkShen as a code owner July 27, 2020 03:33
@weex-bot

weex-bot commented Jul 27, 2020

Copy link
Copy Markdown
Warnings
⚠️ No Changelog changes! - Can you add a Changelog? To do so,append your changes to the changelog.md
⚠️ Current pr not bind the milestone
⚠️ If your PR is about fixing a bug excluding crash the code,you should add the demo link in the PR description. Demo link: http://dotwe.org/vue

Generated by 🚫 dangerJS against 8c5d848

@neuyu
neuyu requested a review from gubaojian as a code owner July 27, 2020 06:30
@neuyu neuyu changed the title [android] android targetSdkVersion 29 ashmem issue #2706 [android] android targetSdkVersion 29 ashmem issue Jul 27, 2020
@neuyu

neuyu commented Jul 27, 2020

Copy link
Copy Markdown
Author

Successful self-test

@weex-bot

Copy link
Copy Markdown
Fails
🚫 AndroidLint Result
🚫

Missing Permissions

../../src/main/java/org/apache/weex/WXEnvironment.java:410: Missing permissions required by TelephonyManager.getDeviceId: android.permission.READ_PRIVILEGED_PHONE_STATE
 407     String ret = "";
 408     if(sApplication != null){
 409       try{
 410         ret = ((TelephonyManager) sApplication                                                      
 411             .getSystemService(Context.TELEPHONY_SERVICE)).getDeviceId();
 412       }catch (SecurityException | NullPointerException e){
 413         WXLogUtils.e(WXLogUtils.getStackTrace(e));

../../src/main/java/org/apache/weex/WXEnvironment.java:410: Missing permissions required by TelephonyManager.getDeviceId: android.permission.READ_PRIVILEGED_PHONE_STATE


407 String ret = "";
408 if(sApplication != null){
409 try{
410 ret = ((TelephonyManager) sApplication                                                      
411 .getSystemService(Context.TELEPHONY_SERVICE)).getDeviceId();
412 }catch (SecurityException | NullPointerException e){
413 WXLogUtils.e(WXLogUtils.getStackTrace(e));

This check scans through your code and libraries and looks at the APIs being used, and checks this against the set of permissions required to access those APIs. If the code using those APIs is called at runtime, then the program will crash.

Furthermore, for permissions that are revocable (with targetSdkVersion 23), client code must also be prepared to handle the calls throwing an exception if the user rejects the request for permission at runtime.
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
To suppress this error, use the issue id "MissingPermission" as explained in the Suppressing Warnings and Errors section.

MissingPermission Correctness Error Priority 9/10
Explain Dismiss
🚫 AndroidLint Result
🚫

Missing Permissions

../../src/main/java/org/apache/weex/WXEnvironment.java:410: Missing permissions required by TelephonyManager.getDeviceId: android.permission.READ_PRIVILEGED_PHONE_STATE
 407     String ret = "";
 408     if(sApplication != null){
 409       try{
 410         ret = ((TelephonyManager) sApplication                                                      
 411             .getSystemService(Context.TELEPHONY_SERVICE)).getDeviceId();
 412       }catch (SecurityException | NullPointerException e){
 413         WXLogUtils.e(WXLogUtils.getStackTrace(e));

../../src/main/java/org/apache/weex/WXEnvironment.java:410: Missing permissions required by TelephonyManager.getDeviceId: android.permission.READ_PRIVILEGED_PHONE_STATE


407 String ret = "";
408 if(sApplication != null){
409 try{
410 ret = ((TelephonyManager) sApplication                                                      
411 .getSystemService(Context.TELEPHONY_SERVICE)).getDeviceId();
412 }catch (SecurityException | NullPointerException e){
413 WXLogUtils.e(WXLogUtils.getStackTrace(e));

This check scans through your code and libraries and looks at the APIs being used, and checks this against the set of permissions required to access those APIs. If the code using those APIs is called at runtime, then the program will crash.

Furthermore, for permissions that are revocable (with targetSdkVersion 23), client code must also be prepared to handle the calls throwing an exception if the user rejects the request for permission at runtime.
Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.
To suppress this error, use the issue id "MissingPermission" as explained in the Suppressing Warnings and Errors section.

MissingPermission Correctness Error Priority 9/10
Explain Dismiss

Generated by 🚫 dangerJS against 8c5d848

@ikantech

ikantech commented Aug 5, 2020

Copy link
Copy Markdown

Just judging the api level is a problem with Android R.Should judge target sdk version and api level together.
if (g_targetSDKInt >= 29 && device_api_level() >= 29)

@lzq879069670

Copy link
Copy Markdown

As Google Play warn all apps need update targetSdkVersion to 29 before 2020.10, We must handle this issue, #2706

Successful self-test

大佬,修改了c文件后要如何打包呢?

@lovemyapple

Copy link
Copy Markdown

targetSdkVersion29的问题解决了吗?我用后面c文件修改后的重新打包aar还是不行

@leif0419

Copy link
Copy Markdown

Now that google play has started to execute, can we accelerate the completion of this matter?

@hualiang0537

Copy link
Copy Markdown

targetSdkVersion29的问题解决了吗?我们着急提交包啊,不支持29不让提包

@leif0419

leif0419 commented Sep 11, 2020

Copy link
Copy Markdown

成功的自检

现在项目着急上线,我怎么操作来实现,或者给我联系方式来提问,感谢

@roger2380

Copy link
Copy Markdown

我用后面c文件修改后的重新打包aar还是不行

@roger2380

Copy link
Copy Markdown

targetSdkVersion29的问题解决了吗?我用后面c文件修改后的重新打包aar还是不行

同样不行

@hxs2mr

hxs2mr commented Oct 15, 2020

Copy link
Copy Markdown

成功的自测

确定成功了吗?大佬

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants