mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-14 11:10:30 +03:00
Merge branch 'master' into dev
This commit is contained in:
commit
0b93372716
20 changed files with 875 additions and 58 deletions
|
|
@ -102,7 +102,10 @@ class FDroid
|
|||
|
||||
|
||||
function get_app($query_vars) {
|
||||
$permissions_object = new AndroidPermissions($this->site_path.'/repo/AndroidManifest.xml', $this->site_path.'/repo/strings.xml', $this->site_path.'/repo/android-permissions.cache');
|
||||
global $permissions_data;
|
||||
$permissions_object = new AndroidPermissions($this->site_path.'/wp-content/plugins/wp-fdroid/AndroidManifest.xml',
|
||||
$this->site_path.'/wp-content/plugins/wp-fdroid/strings.xml',
|
||||
sys_get_temp_dir().'/android-permissions.cache');
|
||||
$permissions_data = $permissions_object->get_permissions_array();
|
||||
|
||||
// Get app data
|
||||
|
|
@ -242,29 +245,7 @@ class FDroid
|
|||
$out.='<br /><a href="javascript:void(0);" onClick="showHidePermissions(\''.$divId.'\');">view permissions</a><br/>';
|
||||
$out.='<div style="display:'.$divStyleDisplay.';" id="'.$divId.'">';
|
||||
$permissions = explode(',',$apk['permissions']);
|
||||
usort($permissions,
|
||||
function ($a, $b) use (&$permissions_data) {
|
||||
|
||||
$aProtectionLevel = $permissions_data['permission'][$a]['protectionLevel'];
|
||||
$bProtectionLevel = $permissions_data['permission'][$b]['protectionLevel'];
|
||||
|
||||
if($aProtectionLevel != $bProtectionLevel) {
|
||||
if(strlen($aProtectionLevel)==0) return 1;
|
||||
if(strlen($bProtectionLevel)==0) return -1;
|
||||
|
||||
return strcmp($aProtectionLevel, $bProtectionLevel);
|
||||
}
|
||||
|
||||
$aGroup = $permissions_data['permission'][$a]['permissionGroup'];
|
||||
$bGroup = $permissions_data['permission'][$b]['permissionGroup'];
|
||||
|
||||
if($aGroup != $bGroup) {
|
||||
return strcmp($aGroup, $bGroup);
|
||||
}
|
||||
|
||||
return strcmp($a, $b);
|
||||
}
|
||||
);
|
||||
usort($permissions, "permissions_cmp");
|
||||
|
||||
$permission_group_last = '';
|
||||
foreach($permissions as $permission) {
|
||||
|
|
@ -552,6 +533,29 @@ class FDOutGrid
|
|||
}
|
||||
}
|
||||
|
||||
function permissions_cmp($a, $b) {
|
||||
global $permissions_data;
|
||||
|
||||
$aProtectionLevel = $permissions_data['permission'][$a]['protectionLevel'];
|
||||
$bProtectionLevel = $permissions_data['permission'][$b]['protectionLevel'];
|
||||
|
||||
if($aProtectionLevel != $bProtectionLevel) {
|
||||
if(strlen($aProtectionLevel)==0) return 1;
|
||||
if(strlen($bProtectionLevel)==0) return -1;
|
||||
|
||||
return strcmp($aProtectionLevel, $bProtectionLevel);
|
||||
}
|
||||
|
||||
$aGroup = $permissions_data['permission'][$a]['permissionGroup'];
|
||||
$bGroup = $permissions_data['permission'][$b]['permissionGroup'];
|
||||
|
||||
if($aGroup != $bGroup) {
|
||||
return strcmp($aGroup, $bGroup);
|
||||
}
|
||||
|
||||
return strcmp($a, $b);
|
||||
}
|
||||
|
||||
// Make a link to this page, with the current query vars attached and desired params added/modified
|
||||
function makelink($query_vars, $params=array()) {
|
||||
$link=get_permalink();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue