|
@@ -334,26 +334,36 @@ def change_tab(path_dest, tabs, tab_icon, package, tab3_mode, tab_amount):
|
|
|
f.write(replaced)
|
|
|
|
|
|
|
|
|
-def change_fb(path_dest, fb_icon):
|
|
|
+def change_fb(path_dest, fb_order, package, fb_icon):
|
|
|
+ fb_order_list = fb_order.split(",")
|
|
|
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):
|
|
|
- if not fb_icon[i]:
|
|
|
+ for x,i in enumerate(fb_order_list):
|
|
|
+ if not fb_icon[x]:
|
|
|
continue
|
|
|
img_path = "app/src/main/res/drawable-nodpi"
|
|
|
- img_path = os.path.join(path_dest, img_path, default_fb_icon[i])
|
|
|
- if isinstance(fb_icon[i], str):
|
|
|
- logo = requests.get('https://newuniverse.io/dashboardv2/uploads/fb_icon/{}'.format(fb_icon[i]))
|
|
|
- with open(img_path, "wb") as f:
|
|
|
- f.write(logo.content)
|
|
|
- with open(img_path, "rb") as f:
|
|
|
- logo = Image.open(f)
|
|
|
+ if i-1 in range(-len(default_fb_icon), len(default_fb_icon)):
|
|
|
+ img_path = os.path.join(path_dest, img_path, default_fb_icon[i-1])
|
|
|
+ if isinstance(fb_icon[x], str):
|
|
|
+ logo = requests.get('https://newuniverse.io/dashboardv2/uploads/fb_icon/{}'.format(fb_icon[x]))
|
|
|
+ with open(img_path, "wb") as f:
|
|
|
+ f.write(logo.content)
|
|
|
+ with open(img_path, "rb") as f:
|
|
|
+ logo = Image.open(f)
|
|
|
+ logo = logo.resize((150, 150))
|
|
|
+ logo.save(img_path, "PNG")
|
|
|
+ else:
|
|
|
+ logo = Image.open(fb_icon[x])
|
|
|
logo = logo.resize((150, 150))
|
|
|
logo.save(img_path, "PNG")
|
|
|
- else:
|
|
|
- logo = Image.open(fb_icon[i])
|
|
|
- logo = logo.resize((150, 150))
|
|
|
- logo.save(img_path, "PNG")
|
|
|
+ path_package_id = package.replace(".", "/")
|
|
|
+ code_path = "app/src/main/java/"
|
|
|
+ main_code_path = os.path.join(path_dest, code_path, path_package_id, "MAB.java")
|
|
|
+ with open(main_code_path, "r") as f:
|
|
|
+ file_source = f.read()
|
|
|
+ replaced = file_source.replace('dockedPlacement = "1,2,3,4,5"', 'dockedPlacement = "{}"'.format(fb_order))
|
|
|
+ with open(main_code_path, "w") as f:
|
|
|
+ f.write(replaced)
|
|
|
|
|
|
|
|
|
def change_background(path_dest, background):
|
|
@@ -530,6 +540,7 @@ def build_apk():
|
|
|
huawei_file = None
|
|
|
key_exists = False
|
|
|
# tabs = ["1", "2", "3", "4"]
|
|
|
+ fb_order = "1,2,3,4,5"
|
|
|
tabs = []
|
|
|
tab3_mode = "0"
|
|
|
tab_amount = 6
|
|
@@ -667,6 +678,10 @@ def build_apk():
|
|
|
fb_icon[4] = request.files['fb5_icon']
|
|
|
elif 'fb5_icon' in request.form:
|
|
|
fb_icon[4] = request.form['fb5_icon']
|
|
|
+ if 'fb_icon' in request.form:
|
|
|
+ fb_icon = request.form['fb_icon'].split(",")
|
|
|
+ if 'fb_order' in request.form:
|
|
|
+ fb_order = request.form['fb_order']
|
|
|
vprint("fb_icon: {}".format(fb_icon))
|
|
|
access_model = int(request.form['access_model'])
|
|
|
if 'tab3_mode' in request.form:
|
|
@@ -707,7 +722,7 @@ def build_apk():
|
|
|
change_logo(path_dest, logo, logo_float)
|
|
|
if background:
|
|
|
change_background(path_dest, background)
|
|
|
- change_fb(path_dest, fb_icon)
|
|
|
+ change_fb(path_dest, fb_order, package_id, fb_icon)
|
|
|
change_access(path_dest, access_model, package_id)
|
|
|
change_tab(path_dest, tabs, tab_icon, package_id, tab3_mode, tab_amount)
|
|
|
change_huawei_file(path_dest, huawei_file, package_id)
|