Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- import time
- import glob
- import platform
- files_to_change = '*.apk'
- lame_space = ' ';
- cool_space = '.';
- #Rename Apk: space to .
- def rename_apk():
- for f in glob.glob(files_to_change):
- f2 = f
- f2 = f2.replace(lame_space, cool_space)
- print 'renaming: ', f, ' -> ', f2
- os.rename(f, f2)
- clear_screen()
- print "Done Renaming."
- time.sleep(2)
- #Clear the screen output.
- def clear_screen():
- if platform.system() == "Windows":
- os.system('cls')
- else:
- os.system('clear')
- #Install Apk
- def install_apk():
- for files in os.listdir('.'):
- if files.endswith(".apk"):
- string=files
- cmd="adb install "+string
- os.system(cmd)
- time.sleep(2)
- clear_screen()
- print "Apps Installed Rebooting."
- os.system("adb shell reboot")
- #re-install apk
- def re_install_apk():
- for files in os.listdir('.'):
- if files.endswith(".apk"):
- string=files
- cmd="adb install -r "+string
- os.system(cmd)
- time.sleep(2)
- clear_screen()
- print "Apps Installed Rebooting."
- os.system("adb shell reboot")
- warn = "\n You must from the menu 1, 2, 3, 4, 5.\n"+\
- " Enter your choice : "
- quest = ("""
- 1 - Install All Apps.
- 2 - Reinstall All Apps.
- 3 - Install apps (with spaces)
- 4 - Reinstall apps (with spaces)
- 5 - Only Rename Apps from this to.this
- """"Choose :")
- qts1 = raw_input(quest)
- while qts1 not in ('1','2','3','4','5'):
- qts1 = raw_input(warn)
- if "1" in qts1:
- install_apk()
- elif "2" in qts1:
- re_install_apk()
- elif "3" in qts1:
- rename_apk()
- install_apk()
- elif "4" in qts1:
- rename_apk()
- re_install_apk()
- elif "5" in qts1:
- rename_apk()
- print
- print
- raw_input("Press ENTER to exit")
Advertisement
Add Comment
Please, Sign In to add comment