I am having some trouble figuring out how to split a string in a text file and separate the strings into separate files
Within the text file I have the following:
package:/system/app/CustomLocale/CustomLocale.apk=com.android.customlocale2
package:/system/app/Gallery2/Gallery2.apk=com.android.gallery3d
package:/system/app/Calendar/Calendar.apk=com.android.calendar
And I have the following code:
import os
os.system("adb shell pm list packages -f > apps.txt")
f = open('apps.txt',"r")
lines = f.readlines()
for line in lines:
for word in line.split():
#print(word)
if word.startswith('.apk'):
print(word)
Now I understand how to split each line up indivdually and pipe them into a file however i would like to implement a way to split the first part of the string which is "package:/system/app/CustomLocale/CustomLocale" from the second part which is ".apk=com.android.calendar". How would I start to implement this. Any help would be greatly appreciated.