"Commit thy works unto the LORD, and thy thoughts shall be established." Proverbs 16:3
How to extract an OTA package
One of the many tools in the toolbox of the Android phone developer is that of downloading OTAs. An OTA is an Over The Air zip file that contains an update for your Android phone. This zip file will have a lot of very useful information and files in it, which you can use to develop custom roms for the phone. If you can get ahold of one, it can also serve as a great backup to your system, provided that you have the stock boot image/recovery image, so you can flash back to this OTA you downloaded.
NOTE: Not all OTA’s are created equal. Sometimes they are small and only include a few files, not the whole system, and don’t make a very useful download because you cannot use them as a backup or pull enough information to create a custom rom. However, if you plan to use it for that purpose, try to grab one that updates the Android version of your phone.
The downside to grabbing these OTA updates is that your phone may not have any, or after accepting one, it may be a long, long time before another OTA update. Either way, here is how I grabbed one for the CAT S42G.
It was brand new in the box, and I already knew that it would come with Android 10 preinstalled. I also knew that there would be an OTA update waiting for it, which was a system update to Android 12. I knew this because I owned one before opening this one. Another way you might know this is by looking up the phone online, such as GSM arena. If it says that it came with Android 10, but is upgrade-able to Android 12, you can be pretty sure that what you open in the box is the original software, and that it will eventually take an OTA to update to Android 12. I say eventually because sometimes they take them in series, as incremental ones, and sometimes they just go to the latest one. It depends on the company and carrier mods, etc.
Turning on the phone, go through the setup, without a sim card, and don’t connect to the WiFi, so that the phone has no internet connection.
Then, go to settings, and enable developer mode by clicking rapidly on the build number until it says you have enabled developer mode.
Go to the developer mode, and turn on ADB (Android debugging), and connect the phone to your computer.
On the computer, open a terminal (I use Linux), and start a logcat like so:
$ adb logcat |tee ota.txt
You may need to accept on the phone touch screen, depending on your brand and settings. This starts pulling a log of everything the phone is doing and displaying it to you in the terminal, as well as writing it down in a file called ota.txt.
On the phone, enable the WiFi, connect to a network, and go to the settings and check for an update. Since there was an update in my case, it says the update information and started downloading it.
At this point, I turned off the WiFi to prevent the full download of the OTA update. On the computer terminal, I pressed control-c, to stop the logcat from logging.
Now I reviewed the large text file by grepping the information I was looking for:
$ cat ota.txt |grep zip
This showed me every line in the file with the word zip in it. There were roughly 50 lines that met this criteria, some of which were useless, like this one:
11-14 12:20:42.538 10007 10037 I FirebaseCrashApiImpl: FirebaseCrashApiImpl created by ClassLoader dalvik.system.DelegateLastClassLoader[DexPathList[[zip file “/data/user_de/0/com.google.android.gms/app_chimera/m/00000004/DynamiteModulesC.apk”],nativeLibraryDirectories=[/data/user_de/0/com.google.android.gms/app_chimera/m/00000004/DynamiteModulesC.apk!/lib/armeabi-v7a, /data/user_de/0/com.google.android.gms/app_chimera/m/00000004/DynamiteModulesC.apk!/lib/armeabi, /system/lib, /product/lib]]]
But, as I scroll through there, I found this one:
11-14 12:20:40.767 2559 2961 I SystemUpdate: [Control,InstallationControl] Update URL changed from “” to “https://ota.googlezip.net/packages/ota-api/package/cf1f7c3fa1596c87f045cee1508823c98667fa06.zip”.
Sometimes, you can type your command like this:
$ cat ota.txt |grep zip |grep http
To only get lines with both the word zip and http in them, which makes an even shorter list, usually only 4 or 5, typically. Looking at the line with the OTA update in it, I could use the computer to download just the OTA itself:
Now you have an OTA zip file that you can work with! You may wonder what to do with it, well, you could try using adb sideload to fix another phone that you dorked up while messing around, or you can use tools like dumpyara. Other options are unzipping it and breaking down the payload.bin file to get what you need.