#!/usr/bin/env python3
import json
import string
import random
import glob, os
import sys

path = "../../../app/src/main/AndroidManifest.xml"

with open(path, "r", encoding="utf-8") as f:
    lines = f.readlines()

with open(path, "w", encoding="utf-8") as f_w:
    isPermissionDoce = False
    isFinished = False;
    for line in lines:
        if "<uses-permission" in line:
            isPermissionDoce = True
        if "<application" in line:
            isFinished = True

        if isPermissionDoce and not isFinished and "<!--" not in line:
            line = "<!-- " + line.replace("\n"," -->\n")

        f_w.write(line)