|
@@ -144,7 +144,7 @@ def change_font(path_dest, font, package):
|
|
|
f.write(replaced)
|
|
|
|
|
|
|
|
|
-def change_package(path_dest, package):
|
|
|
+def change_package(path_dest, package, enable_location):
|
|
|
build_gradle = os.path.join(path_dest, 'app/build.gradle')
|
|
|
with open(build_gradle, "r") as f:
|
|
|
file_source = f.read()
|
|
@@ -185,6 +185,37 @@ def change_package(path_dest, package):
|
|
|
with open(j, "w") as f:
|
|
|
f.write(replaced)
|
|
|
|
|
|
+ queue_page = os.path.join(path_dest, code_path, "QueueBank.java")
|
|
|
+ with open(queue_page, "r") as f:
|
|
|
+ lines = f.readlines()
|
|
|
+ with open(queue_page, "w") as f:
|
|
|
+ counter = 0
|
|
|
+ for line in lines:
|
|
|
+ if counter == 0:
|
|
|
+ if enable_location == 0 and "LocationOn1" in line:
|
|
|
+ counter = 9
|
|
|
+ if enable_location == 0 and "LocationOn2" in line:
|
|
|
+ counter = 17
|
|
|
+ else:
|
|
|
+ f.write(line)
|
|
|
+ else:
|
|
|
+ counter = counter - 1
|
|
|
+
|
|
|
+ manifest = os.path.join(path_dest, "app/src/main/AndroidManifest.xml")
|
|
|
+ with open(manifest, "r") as f:
|
|
|
+ lines = f.readlines()
|
|
|
+ with open(manifest, "w") as f:
|
|
|
+ counter = 0
|
|
|
+ for line in lines:
|
|
|
+ if counter == 0:
|
|
|
+ if enable_location == 0 and "<!-- LocationOn/Off -->" in line:
|
|
|
+ counter = 3
|
|
|
+ else:
|
|
|
+ f.write(line)
|
|
|
+ else:
|
|
|
+ counter = counter - 1
|
|
|
+
|
|
|
+
|
|
|
if package.__contains__('digipos') or package.__contains__('digisales'):
|
|
|
settings_gradle = os.path.join(path_dest, "settings.gradle")
|
|
|
with open(settings_gradle, "r") as f:
|
|
@@ -565,6 +596,7 @@ def build_apk():
|
|
|
version_name = "1.0.0"
|
|
|
font = 0
|
|
|
enable_sms = 0
|
|
|
+ enable_location = 0
|
|
|
key = {"alias": "nexilislite", "store_password": "allyourbase", "key_password": "allyourbase",
|
|
|
"common_name": "all", "organization_unit": "your",
|
|
|
"organization_name": "base", "locality_name": "are", "state_name": "belong", "country": "to"}
|
|
@@ -719,6 +751,8 @@ def build_apk():
|
|
|
version_name = "1.0.{}".format(version_code)
|
|
|
if 'enable_sms' in request.form:
|
|
|
enable_sms = int(request.form['enable_sms'])
|
|
|
+ if 'enable_location' in request.form:
|
|
|
+ enable_sms = int(request.form['enable_location'])
|
|
|
except BaseException as e:
|
|
|
vprint(traceback.format_exc())
|
|
|
return {"status": "1", "message": "Parameter mismatch\n{}\n".format(str(e))}
|
|
@@ -730,9 +764,9 @@ def build_apk():
|
|
|
change_acc(c_code_path, acc, enable_sms)
|
|
|
if url:
|
|
|
change_url(c_code_path, url)
|
|
|
- change_name(path_dest, app_name, enable_sms)
|
|
|
+ change_name(path_dest, app_name, enable_sms, enable_location)
|
|
|
change_certificate(path_dest, key, keystore, app.keytool)
|
|
|
- change_package(path_dest, package_id)
|
|
|
+ change_package(path_dest, package_id, enable_location)
|
|
|
change_version(path_dest, version_code, version_name)
|
|
|
change_font(path_dest, font, package_id)
|
|
|
if logo:
|