-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
jhgfjhfgjhkufrioesyfdsaoggihghfgghjf
- Loading branch information
1 parent
23d16de
commit 07c775e
Showing
100 changed files
with
32,583 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
<?php | ||
//header("Content-Type: application/json"); | ||
if (isset($_GET['proj'])) { | ||
$project = $_GET['proj']; | ||
} | ||
if (isset($_GET['assets'])) { | ||
$assets = $_GET['assets']; | ||
} | ||
include 'config.php'; | ||
chdir($projects_path); | ||
chdir($project); | ||
function deleteDirectory($dir) { | ||
if (!file_exists($dir)) { | ||
return true; | ||
} | ||
|
||
if (!is_dir($dir)) { | ||
return unlink($dir); | ||
} | ||
|
||
foreach (scandir($dir) as $item) { | ||
if ($item == '.' || $item == '..') { | ||
continue; | ||
} | ||
|
||
if (!deleteDirectory($dir . DIRECTORY_SEPARATOR . $item)) { | ||
return false; | ||
} | ||
|
||
} | ||
|
||
return rmdir($dir); | ||
} | ||
deleteDirectory("www"); | ||
mkdir("www"); | ||
|
||
function recurseCopy( | ||
string $sourceDirectory, | ||
string $destinationDirectory, | ||
string $childFolder = '' | ||
): void { | ||
$directory = opendir($sourceDirectory); | ||
|
||
if (is_dir($destinationDirectory) === false) { | ||
mkdir($destinationDirectory); | ||
} | ||
|
||
if ($childFolder !== '') { | ||
if (is_dir("$destinationDirectory/$childFolder") === false) { | ||
mkdir("$destinationDirectory/$childFolder"); | ||
} | ||
|
||
while (($file = readdir($directory)) !== false) { | ||
if ($file === '.' || $file === '..') { | ||
continue; | ||
} | ||
|
||
if (is_dir("$sourceDirectory/$file") === true) { | ||
recurseCopy("$sourceDirectory/$file", "$destinationDirectory/$childFolder/$file"); | ||
} else { | ||
copy("$sourceDirectory/$file", "$destinationDirectory/$childFolder/$file"); | ||
} | ||
} | ||
|
||
closedir($directory); | ||
|
||
return; | ||
} | ||
|
||
while (($file = readdir($directory)) !== false) { | ||
if ($file === '.' || $file === '..') { | ||
continue; | ||
} | ||
|
||
if (is_dir("$sourceDirectory/$file") === true) { | ||
recurseCopy("$sourceDirectory/$file", "$destinationDirectory/$file"); | ||
} | ||
else { | ||
copy("$sourceDirectory/$file", "$destinationDirectory/$file"); | ||
} | ||
} | ||
|
||
closedir($directory); | ||
} | ||
chdir($projects_path."\\".$project); | ||
recurseCopy($assets,'./www'); | ||
$out = ""; | ||
$succ = false; | ||
$file = "unknown"; | ||
$waitForAPK = false; | ||
exec($cordova_path." build -- --jvmargs='-Xmx1G'",$out); | ||
foreach ($out as $key => $value) { | ||
if((strpos($value,"BUILD SUCCESSFUL")=== false)== false){ | ||
$succ = true; | ||
$waitForAPK = false; | ||
}else if((strpos($value,"Built the following apk(s):")=== false)==false){ | ||
$waitForAPK = true; | ||
}else if($waitForAPK){ | ||
$file = trim($value); | ||
$waitForAPK = false; | ||
} | ||
} | ||
//var_dump($out); | ||
//putenv("PATH"); | ||
if ($succ == false) { | ||
$file = false; | ||
} | ||
echo json_encode(array("file"=>$file,"success"=>$succ)); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?php | ||
$cordova_path = 'cmd /c cordova'; | ||
$projects_path = 'C:\Program Files\VertrigoServ\www\editor\cordova-projects'; | ||
$tmp_path = 'C:\Program Files\VertrigoServ\www\editor\tmp'; | ||
$slash = "\\"; | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
$fn = "unknown"; | ||
if (isset($_GET['path'])) { | ||
$fn = trim($_GET['path']); | ||
} | ||
if (file_exists($fn) == true && file_get_contents($fn) !== false && pathinfo($fn)['extension'] == 'apk') { | ||
$quoted = sprintf('"%s"', addcslashes(basename($fn), '"\\')); | ||
$size = filesize($fn); | ||
|
||
header('Content-Description: File Transfer'); | ||
header('Content-Type: application/octet-stream'); | ||
header('Content-Disposition: attachment; filename=' . $quoted); | ||
header('Content-Transfer-Encoding: binary'); | ||
header('Connection: Keep-Alive'); | ||
header('Expires: 0'); | ||
header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); | ||
header('Pragma: public'); | ||
header('Content-Length: ' . $size); | ||
readfile($fn); | ||
exit; | ||
} | ||
echo 'Unable to download file.'; | ||
var_dump($fn); | ||
var_dump(file_exists($fn)); |
Oops, something went wrong.