Skip to content

Commit

Permalink
feat(permissions): add default country and update URL
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristianoying authored Oct 16, 2024
1 parent c0bdcec commit a4fb60c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,7 @@ Returns the list of permissions an app has access to.

* `appId`: the Google Play id of the application to get permissions for.
* `lang` (optional, defaults to `'en'`): the two letter language code in which to fetch the permissions.
* `country` (optional, defaults to `'us'`): the two letter country code in which to fetch the permissions.
* `short` (optional, defaults to `false`): if `true`, the permission names will be returned instead of
permission/description objects.

Expand Down
3 changes: 2 additions & 1 deletion lib/permissions.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ function permissions (opts) {
}

opts.lang = opts.lang || 'en';
opts.country = opts.country || 'us';

processPermissions(opts)
.then(resolve)
Expand All @@ -22,7 +23,7 @@ function permissions (opts) {

function processPermissions (opts) {
const body = `f.req=%5B%5B%5B%22xdSrCf%22%2C%22%5B%5Bnull%2C%5B%5C%22${opts.appId}%5C%22%2C7%5D%2C%5B%5D%5D%5D%22%2Cnull%2C%221%22%5D%5D%5D`;
const url = `${BASE_URL}/_/PlayStoreUi/data/batchexecute?rpcids=qnKhOb&f.sid=-697906427155521722&bl=boq_playuiserver_20190903.08_p0&hl=${opts.lang}&authuser&soc-app=121&soc-platform=1&soc-device=1&_reqid=1065213`;
const url = `${BASE_URL}/_/PlayStoreUi/data/batchexecute?rpcids=qnKhOb&f.sid=-697906427155521722&bl=boq_playuiserver_20190903.08_p0&hl=${opts.lang}&gl=${opts.country}&authuser&soc-app=121&soc-platform=1&soc-device=1&_reqid=1065213`;

debug('batchexecute URL: %s', url);
debug('with body: %s', body);
Expand Down

0 comments on commit a4fb60c

Please sign in to comment.