|
@@ -537,16 +537,23 @@ def change_huawei_file(path_dest, huawei_file, package_id):
|
|
|
f.write(replaced)
|
|
|
|
|
|
def change_fms_file(path_dest, fms_enable):
|
|
|
- if fms_enable == 0:
|
|
|
- build_gradle = os.path.join(path_dest, 'app/build.gradle')
|
|
|
- with open(build_gradle, "r") as f:
|
|
|
- lines = f.readlines()
|
|
|
- with open(build_gradle, "w") as f:
|
|
|
+ build_gradle = os.path.join(path_dest, 'app/build.gradle')
|
|
|
+ with open(build_gradle, "r") as f:
|
|
|
+ lines = f.readlines()
|
|
|
+ with open(build_gradle, "w") as f:
|
|
|
+ if fms_enable == 0:
|
|
|
for line in lines:
|
|
|
if "withfcm" in line:
|
|
|
continue
|
|
|
else:
|
|
|
f.write(line)
|
|
|
+ else:
|
|
|
+ for line in lines:
|
|
|
+ if "-nofcm" in line:
|
|
|
+ continue
|
|
|
+ else:
|
|
|
+ f.write(line)
|
|
|
+
|
|
|
|
|
|
|
|
|
def run_build(path_dest):
|