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

grant and revoke app permission for Android 23 and above #186

Merged
merged 1 commit into from
Dec 1, 2016

Conversation

sravanmedarapu
Copy link
Member

@sravanmedarapu sravanmedarapu commented Nov 30, 2016

Copy link
Member

@jlipps jlipps left a 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) {
Copy link
Member

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]);
Copy link
Member

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);
Copy link
Member

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?

@jlipps jlipps merged commit 532e558 into appium:master Dec 1, 2016
@jlipps
Copy link
Member

jlipps commented Dec 1, 2016

Published as 2.8.0

@jlipps
Copy link
Member

jlipps commented Dec 2, 2016

had a problem publishing from the plane, it's actually 2.9.0

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