Okay, I know this sounds odd but here is what I am trying to do.
- Find the boot class file of a phone via shell command. The boot class file is a list of APKs the phone needs to perform certainn operations
- Saving that list as text file on my PC. This text file will now contain .jar names such as core.jar, services.jar, sc.jar, etc.
- Loop through this text file and read the names one at a time.
- For each file name encountered on the text file, it will then go to the framework directory of the phone and copy the actual file the text references. For example....
If the first name on the text was "services.jar", it would then look into the correct directory of the phone and locate the actual file "services.jar" and copy it to a directory on the PC.
So far I have 1 and 2 worked out. I also know how to pull the file from the correct directory on the phone, I just dont know how to break the loop on each iteration to perform the search and copy function.
So right now here is how the BAT works....
adb shell echo $BOOTCLASSPATH > tmp.txt
Now I want to loop through that tmp.txt to see what names are on it and pull a file from another location based on the names it finds. If core.jar is on the text it pulls the actual core.jarfile from the phone.
If i use...
SETLOCAL ENABLEDELAYEDEXPANSION for /f "usebackqdelims=" %%a in ("temp.txt") do ( SET file!index!=%%a "what file did i find on this iteration? "look in directory "X" on phone and copy that file to PC ....continue loop ECHO !index! - %%a | more SET /A index=!index!+1 )
to loop through the txt file, how can i stop at each iteration to pull the file associated with that name from different directory? So first loop through it finds core.jar, i then grab the actual core.jar from the phone. Second loop through it finds services.jar on the list, i then grab the actual services.jar from another location....etc.
Keep in mind the entire time this BAT is running my phone is connected to my PC via USB, otherwise it obviously would not work correctly.
I hope I have explained this clearly...its tough to describe.