website - load mobile .apk version, and embedded IITC version, dynamically - ensures the data remains up to date, even for the 'test builds' page
This commit is contained in:
32
website/page/code/mobile-version.php
Normal file
32
website/page/code/mobile-version.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
include_once ( "apk/ApkParser.php" );
|
||||
include_once ( "userscript.php" );
|
||||
|
||||
function getMobileVersion($apkfile)
|
||||
{
|
||||
$result = Array();
|
||||
|
||||
|
||||
$apkinfo = new ApkParser ( $apkfile );
|
||||
|
||||
$manifest = $apkinfo->getManifest();
|
||||
|
||||
$result['apk_version'] = $manifest->getVersionName();
|
||||
|
||||
|
||||
$archive = $apkinfo->getApkArchive();
|
||||
$iitc_file = "assets/total-conversion-build.user.js";
|
||||
if ( $archive->statName ( $iitc_file ) === FALSE );
|
||||
$iitc_file = "assets/iitc.js";
|
||||
|
||||
$stream = $archive->getStream ( $iitc_file );
|
||||
|
||||
$header = loadUserScriptHeader ( $stream );
|
||||
|
||||
$result['iitc_version'] = $header['@version'];
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
?>
|
Reference in New Issue
Block a user