-
-
Notifications
You must be signed in to change notification settings - Fork 168
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
grant and revoke app permission for Android 23 and above #186
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few small things. Overall looks amazing. Thanks @sravanmedarapu!
|
||
async function cleanUpReqPermissions (reqPermissions) { | ||
let permissions = []; | ||
Array.from(reqPermissions).forEach(function (permission) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rewrite this function's body as:
return reqPermissions
.filter(p => p.trim().startsWith('android.permission'))
.map(p => p.trim().replace(': granted=true', ''));
let args = ['dump', 'badging', localApk]; | ||
let {stdout} = await exec(this.binaries.aapt, args); | ||
let targetSdkVersion = new RegExp(/targetSdkVersion:'([^']+)'/g).exec(stdout); | ||
return parseInt(targetSdkVersion[1]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
parseInt(targetSdkVersion[1], 10);
did you run lint on this? this should have been caught
await adb.install(apiDemos); | ||
(await adb.isAppInstalled('io.appium.android.apis')).should.be.true; | ||
let requestedPermissions = await adb.getReqPermissions('io.appium.android.apis'); | ||
expect(await adb.getReqPermissions('io.appium.android.apis')).to.have.members(requestedPermissions); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if this is testing anything. What it seems to be doing is ensuring that calling getReqPermissions
twice returns the same thing. Is that what you want to be testing?
7ef7f21
to
f2876e6
Compare
Published as 2.8.0 |
had a problem publishing from the plane, it's actually 2.9.0 |
Fix for #appium/appium#5561
cc: @jlipps, @imurchie