|
@@ -19,8 +19,9 @@ app.temp_folder = "/apps/3ps/build_apk/BuildApk"
|
|
app.apk_folder = "/var/www/html/palio.io/dashboardv2/uploads"
|
|
app.apk_folder = "/var/www/html/palio.io/dashboardv2/uploads"
|
|
# app.apk_folder = "/Users/easysoft/"
|
|
# app.apk_folder = "/Users/easysoft/"
|
|
app.verbose = True
|
|
app.verbose = True
|
|
-app.ssl =('/etc/ssl/star.newuniverse.io/star.newuniverse.io.crt', '/etc/ssl/star.newuniverse.io/STAR_newuniverse_io.key')
|
|
|
|
-#app.ssl =('/etc/ssl/STAR_palio_io/STAR_palio_io.crt', '/etc/ssl/STAR_palio_io/STAR_palio_io.pem')
|
|
|
|
|
|
+app.ssl = (
|
|
|
|
+'/etc/ssl/star.newuniverse.io/star.newuniverse.io.crt', '/etc/ssl/star.newuniverse.io/STAR_newuniverse_io.key')
|
|
|
|
+# app.ssl =('/etc/ssl/STAR_palio_io/STAR_palio_io.crt', '/etc/ssl/STAR_palio_io/STAR_palio_io.pem')
|
|
|
|
|
|
# app.ssl = None
|
|
# app.ssl = None
|
|
app.keytool = '/usr/bin/keytool'
|
|
app.keytool = '/usr/bin/keytool'
|
|
@@ -96,6 +97,7 @@ def change_name(path_dest, name, enable_sms):
|
|
with open(string_res, "w") as f:
|
|
with open(string_res, "w") as f:
|
|
f.write(replaced)
|
|
f.write(replaced)
|
|
|
|
|
|
|
|
+
|
|
def change_font(path_dest, font, package):
|
|
def change_font(path_dest, font, package):
|
|
if font == 1:
|
|
if font == 1:
|
|
path_package_id = package.replace(".", "/")
|
|
path_package_id = package.replace(".", "/")
|
|
@@ -108,7 +110,8 @@ def change_font(path_dest, font, package):
|
|
button_apps_code_path = os.path.join(path_dest, "palio-button-app/src/main/java")
|
|
button_apps_code_path = os.path.join(path_dest, "palio-button-app/src/main/java")
|
|
button_apps_res_path = os.path.join(path_dest, "palio-button-app/src/main/res-pba/")
|
|
button_apps_res_path = os.path.join(path_dest, "palio-button-app/src/main/res-pba/")
|
|
lib_javas = [os.path.join(dp, f) for dp, dn, filenames in os.walk(button_apps_code_path) for f in filenames]
|
|
lib_javas = [os.path.join(dp, f) for dp, dn, filenames in os.walk(button_apps_code_path) for f in filenames]
|
|
- lib_res = [os.path.join(dp, f) for dp, dn, filenames in os.walk(button_apps_res_path) for f in filenames if "xml" in f]
|
|
|
|
|
|
+ lib_res = [os.path.join(dp, f) for dp, dn, filenames in os.walk(button_apps_res_path) for f in filenames if
|
|
|
|
+ "xml" in f]
|
|
for j in javas:
|
|
for j in javas:
|
|
print(j)
|
|
print(j)
|
|
if "ForumFragment.java" in j:
|
|
if "ForumFragment.java" in j:
|
|
@@ -213,6 +216,7 @@ def change_package(path_dest, package):
|
|
new_img_powered = os.path.join(path_dest, new_img_powered)
|
|
new_img_powered = os.path.join(path_dest, new_img_powered)
|
|
shutil.move(img_powered, new_img_powered)
|
|
shutil.move(img_powered, new_img_powered)
|
|
|
|
|
|
|
|
+
|
|
def change_logo(path_dest, logo, logo_float=None):
|
|
def change_logo(path_dest, logo, logo_float=None):
|
|
img_path = "app/src/main/res/drawable/ic_launcher.png"
|
|
img_path = "app/src/main/res/drawable/ic_launcher.png"
|
|
img_path = os.path.join(path_dest, img_path)
|
|
img_path = os.path.join(path_dest, img_path)
|
|
@@ -247,12 +251,12 @@ def change_logo(path_dest, logo, logo_float=None):
|
|
|
|
|
|
|
|
|
|
def change_tab(path_dest, tabs, tab_icon, package, tab3_mode, tab_amount):
|
|
def change_tab(path_dest, tabs, tab_icon, package, tab3_mode, tab_amount):
|
|
- default_tab_icon = ["tab{}.png".format(x) for x in range(1, tab_amount+1)]
|
|
|
|
- for i in range(tab_amount):
|
|
|
|
|
|
+ default_tab_icon = ["tab{}.png".format(x) for x in tabs]
|
|
|
|
+ for icon, i in enumerate(default_tab_icon):
|
|
if not tab_icon[i]:
|
|
if not tab_icon[i]:
|
|
continue
|
|
continue
|
|
img_path = "app/src/main/res/drawable"
|
|
img_path = "app/src/main/res/drawable"
|
|
- img_path = os.path.join(path_dest, img_path, default_tab_icon[i])
|
|
|
|
|
|
+ img_path = os.path.join(path_dest, img_path, icon)
|
|
if isinstance(tab_icon[i], str):
|
|
if isinstance(tab_icon[i], str):
|
|
logo = requests.get('https://newuniverse.io/dashboardv2/uploads/tab_icon/{}'.format(tab_icon[i]))
|
|
logo = requests.get('https://newuniverse.io/dashboardv2/uploads/tab_icon/{}'.format(tab_icon[i]))
|
|
with open(img_path, "wb") as f:
|
|
with open(img_path, "wb") as f:
|
|
@@ -287,8 +291,10 @@ def change_tab(path_dest, tabs, tab_icon, package, tab3_mode, tab_amount):
|
|
with open(prefs_code_path, "w") as f:
|
|
with open(prefs_code_path, "w") as f:
|
|
f.write(replaced)
|
|
f.write(replaced)
|
|
|
|
|
|
|
|
+
|
|
def change_fb(path_dest, fb_icon):
|
|
def change_fb(path_dest, fb_icon):
|
|
- default_fb_icon = ["pb_button_chat.png", "pb_button_call.png", "pb_button_cc.png", "pb_button_stream.png", "nexilis_fb_04.png"]
|
|
|
|
|
|
+ default_fb_icon = ["pb_button_chat.png", "pb_button_call.png", "pb_button_cc.png", "pb_button_stream.png",
|
|
|
|
+ "nexilis_fb_04.png"]
|
|
for i in range(5):
|
|
for i in range(5):
|
|
if not fb_icon[i]:
|
|
if not fb_icon[i]:
|
|
continue
|
|
continue
|
|
@@ -358,7 +364,8 @@ def change_certificate(path_dest, key, keyfile, keytool):
|
|
key["state_name"], key["country"])
|
|
key["state_name"], key["country"])
|
|
cmd = [keytool, "-genkey", "-v", "-keystore", keyfile_path, "-alias", key["alias"], "-keyalg", "RSA",
|
|
cmd = [keytool, "-genkey", "-v", "-keystore", keyfile_path, "-alias", key["alias"], "-keyalg", "RSA",
|
|
"-keysize", "2048",
|
|
"-keysize", "2048",
|
|
- "-validity", "10000", "-dname", dname, "-storepass", key["store_password"], "-keypass", key["key_password"]]
|
|
|
|
|
|
+ "-validity", "10000", "-dname", dname, "-storepass", key["store_password"], "-keypass",
|
|
|
|
+ key["key_password"]]
|
|
vprint(cmd)
|
|
vprint(cmd)
|
|
subprocess.run(cmd)
|
|
subprocess.run(cmd)
|
|
vprint("keytool end")
|
|
vprint("keytool end")
|
|
@@ -436,14 +443,15 @@ def build_apk():
|
|
tabs = []
|
|
tabs = []
|
|
tab3_mode = "0"
|
|
tab3_mode = "0"
|
|
tab_amount = 6
|
|
tab_amount = 6
|
|
- tab_icon = [None, None, None, None, None, None]
|
|
|
|
|
|
+ tab_icon = [None, None, None, None]
|
|
fb_icon = [None, None, None, None, None]
|
|
fb_icon = [None, None, None, None, None]
|
|
background = None
|
|
background = None
|
|
version_code = "1"
|
|
version_code = "1"
|
|
version_name = "1.0.0"
|
|
version_name = "1.0.0"
|
|
font = 0
|
|
font = 0
|
|
enable_sms = 0
|
|
enable_sms = 0
|
|
- key = {"alias": "nexilislite", "store_password": "allyourbase", "key_password": "arebelongto", "common_name": "all", "organization_unit": "your",
|
|
|
|
|
|
+ key = {"alias": "nexilislite", "store_password": "allyourbase", "key_password": "arebelongto",
|
|
|
|
+ "common_name": "all", "organization_unit": "your",
|
|
"organization_name": "base", "locality_name": "are", "state_name": "belong", "country": "to"}
|
|
"organization_name": "base", "locality_name": "are", "state_name": "belong", "country": "to"}
|
|
if 'logo' in request.files:
|
|
if 'logo' in request.files:
|
|
logo = request.files['logo']
|
|
logo = request.files['logo']
|
|
@@ -594,7 +602,7 @@ def build_apk():
|
|
change_name(path_dest, app_name, enable_sms)
|
|
change_name(path_dest, app_name, enable_sms)
|
|
change_certificate(path_dest, key, keystore, app.keytool)
|
|
change_certificate(path_dest, key, keystore, app.keytool)
|
|
change_package(path_dest, package_id)
|
|
change_package(path_dest, package_id)
|
|
- change_version(path_dest, version_code,version_name)
|
|
|
|
|
|
+ change_version(path_dest, version_code, version_name)
|
|
change_font(path_dest, font, package_id)
|
|
change_font(path_dest, font, package_id)
|
|
if logo:
|
|
if logo:
|
|
change_logo(path_dest, logo, logo_float)
|
|
change_logo(path_dest, logo, logo_float)
|