Skip to content

Commit

Permalink
jhgfjhfgjhkufrioesyfdsaoggihghfgghjf
Browse files Browse the repository at this point in the history
  • Loading branch information
MrCheatEugene authored Oct 24, 2022
1 parent 23d16de commit 07c775e
Show file tree
Hide file tree
Showing 100 changed files with 32,583 additions and 0 deletions.
5,132 changes: 5,132 additions & 0 deletions axios.bundle.js

Large diffs are not rendered by default.

2,921 changes: 2,921 additions & 0 deletions axios.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions axios.min.js

Large diffs are not rendered by default.

109 changes: 109 additions & 0 deletions compileApp.php
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));
?>
6 changes: 6 additions & 0 deletions config.php
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 = "\\";
?>
24 changes: 24 additions & 0 deletions dlFile.php
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));
Loading

0 comments on commit 07c775e

Please sign in to comment.