You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to extract the APP_RESTRICTIONS from an APK
These are listed in the manifest as meta-data, pointing to an XML file (typically res/xml/app_restrictions.xml)
The following code is how I get the XML file using php-apk-parser (awesome tool btw)
However, the XML file still has the resource IDs instead of the corresponding strings for most fields (name, description, etc)
$metaconf = $manifest->getMetaData('android.content.APP_RESTRICTIONS');
if (($metaconf != null)&&(strlen($metaconf)>1)){
// metaconf is the resource id for the xml file
$managedconfig = 1;
if ($getresource){
$mcarr = $apk->getResources($metaconf);
//error_log("Supports managedconfig, values = " . count($mcarr));
$managedconfigxmlfile = $mcarr[0];
//$managedconfigxml = stream_get_contents($apk->getStream($managedconfigxmlfile));
// below works, but extracted xml has resource ids in it (not decoded)
$mcstr = new \ApkParser\Stream($apk->getStream($managedconfigxmlfile));
$mcxml = new \ApkParser\XmlParser($mcstr);
$managedconfigxml = $mcxml->getXmlString();
}
}
Is there a straightforward way to get the XML text with all resource strings decoded?
The text was updated successfully, but these errors were encountered:
The description field in the app_restrictions.xml will always contain the resource id, not the decoded version. Of course this is to allow for localization of the strings, but it would be handy to have an easy way to set your localization and get the corresponded decoded string directly.
I am trying to extract the APP_RESTRICTIONS from an APK
These are listed in the manifest as meta-data, pointing to an XML file (typically res/xml/app_restrictions.xml)
The following code is how I get the XML file using php-apk-parser (awesome tool btw)
However, the XML file still has the resource IDs instead of the corresponding strings for most fields (name, description, etc)
Is there a straightforward way to get the XML text with all resource strings decoded?
The text was updated successfully, but these errors were encountered: