• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

[App] OTA Verifier

scary alien

not really so scary
Mar 5, 2010
22,303
23,779
Indy
Whenever there's an over-the-air (OTA) update sent-out or made available (either leaked or official), there's always a large number of users that end-up reporting that their installations have failed with the infamous and dreaded "E:Error in /sdcard/xxx.zip (Status 7) installation aborted." error message. So, I decided to try to write an app that would help folks figure-out what the issues might be so that they can get their OTA update installed.

The OTA Verifier app can be used to evaluate an over-the-air (OTA) update.zip or other flashable .zip file before you attempt the install or afterwards to help you figure-out why the installation may have failed. OTA Verifier will point-out what files and conditions are being tested so that you can more easily attempt to correct these issues.


Play Market Link (free!): OTA Verifier (beta)


Do I have to be rooted to use this?

No, but rooted devices will have more conditions that the app will be able to test/evalute because it will have access to protected files that non-app devices don't.


Will the app actually do the installation or change anything on my device?

No. The app will only evaluate the expressions and conditions contained inside the updater-script file inside the .zip file that's trying to be installed. None of the functions or commands that try to modify your device (i.e., delete/patch/format/extract, etc.) will be evaluated or executed. The app basically operates in "read-only" mode with respect to the .zip file being evaluated.


Will this app work on older devices or flashable .zip files that use the amend update-script files?

No, this app evaluates and interprets the newer edify updater-script files (notice the "r" in "updater").


How do I use this app?

  1. Install and launch the app
  2. Click the "Select File" button and navigate to desired .zip file
  3. Long-press (press and hold) the file entry for the desired .zip file
  4. Click the "Verify OTA .zip" file pop-up
  5. Wait for the app to process the file (should take under a minute, depending on your device)
  6. View the displayed results (text will also be copied to the clipboard)

Miscellaneous info:

1. Savvy root users probably already know that after a failed .zip file installation, you should be able to view the /cache/recovery/log file to view the information about what might have failed. OTA Verifier will try to uncover all of the issues and not just the first one that causes the installation to fail.

2. While I wrote this app principally to evaluate OTA update.zip files, the edify updater-script files are used and written by ROM devs and others who created flashable .zip files. This app can be used to evaluate those file's updater-script files, too.


How does this all work?

Here's the basic outline/structure of what the app does:

1. the .zip file is selected by the user via the file selector

2. list of frozen system apps are identified for later reporting

3. the updater-script file is extracted from the META-INF/com/google/android folder in the .zip file

4. this updater-script file is parsed and converted into reverse polish notation (RPN) for execution

5. edify functions that might modify your device are NOT evaluated; these include apply_patch, delete, delete_recursive, format, mount, package_extract_dir/file, run_program, set_perm[_recursive], symlink, unmount, write_raw_image, etc.

6. note: the update-binary executable is not used by or involved in this app; the edify script interpreter that the app uses was written by me, in Java, specifically for this app

7. the remaining edify script functions that test conditions (such as apply_patch_check, apply_patch_space, assert, concat, file_exists, file_getprop, getprop, greater_than_int, if-then-else-endif, ifelse, is_substring, less_than_int, read_file, ui_print, and various operators (!, !=, &&, (, ), ;, ||, +, ==)) are evaluated using an operand/operator stack from the RPN expression parsed from the updater-script statements

8. expressions that fail (return a null-string) or are bypassed (usually because a resource (file/partition) is protected/secured against read-access) are reported for the user

9. after the entire script has been processed, the results are displayed in a pop-up window on the device and the text of those results are copied to the clipboard


Planned / future features:

- preferences / settings
- logging of the output to a file on the /sdcard
- test if .zip file is signed or not
- display more stats
- "explanation mode" to interpret, in English, what the edify commands are testing


Successfully tested on:

Samsung Galaxy Nexus (CDMA) 4.1.1
Samsung Galaxy Nexus (GSM) 4.1.2
Asus Nexus 7 tablet 4.1.2
Motorola Droid X 2.3.4


The following edify commands/functions/operators are supported:

Code:
apply_patch_check  // apply_patch_check ( <filepath>, <sha1-checksum> [ , <sha1-checksum> ... ] )

                    // apply_patch_check ( <compoundvalue> )


                      <compoundvalue> := [ EMMC : <filepath>  : <sha1-size> : <sha1-checksum> [ <sha1-size> : <sha1-checksum> ... ]

                                          [ MTD  : <dev-block> : <sha1-size> : <sha1-checksum> [ <sha1-size> : <sha1-checksum> ... ]

                                          [ vfat : <dev-block> : <sha1-size> : <sha1-checksum> [ <sha1-size> : <sha1-checksum> ... ]


                      <dev-block>    := filename in /dev/block


apply_patch_space  // apply_patch_space ( <bytes> )

assert              // assert ( <expression> )

concat              // contact ( <string> , <string> )

file_exists        // file_exists ( <filepath> )

file_getprop        // file_getprop ( <filepath>, <propertyname> )

getprop            // getprop ( <propertyname> )

greater_than_int    // greater_than_int ( <integer>, <integer> )

if then else endif  // if <condition> then <expression> [ else <expression> ] endif

ifelse              // ifelse ( <condition>, <then-expression> [ <else-expression> ] )

is_substring        // is_substring ( <string> , <string> )

less_than_int      // less_than_int ( <integer>, <integer> )

read_file          // read_file ( <filepath> )

ui_print            // ui_print ( <string> ) parsed & executed, but output not displayed

sha1_check     // sha1_check ( <string> )

!                  // logical NOT operator

!=                  // not equals operator

&&                  // logical AND operator

(                  // open paren: precedence / grouping   

)                  // close paren: precedence / grouping   

;                  // sequence/imperative (terminates & separates statements)

||                  // logical OR operator

+                  // string concatenation operator

==                  // equals operator

#                  // comment line


The following edify functions are NOT supported(the majority of them because they are intended to modify your device):


Code:
apply_patch              

delete                    

delete_recursive          

format                    

mount                  

package_extract_dir      

package_extract_file      

run_program              

set_perm                  

set_perm_recursive        

symlink                  

unmount                  

write_raw_image          

is_mounted            // innocuous, but still not supported          

stdout                // innocuous, but still not supported

show_progress          // innocuous, but still not supported              

set_progress          // innocuous, but still not supported
Keywords:

OTA, over-the-air, updater-script, edify, amend


Screenshots:
 

Attachments

  • 01-main-splash.jpg
    01-main-splash.jpg
    77.4 KB · Views: 106
  • 02-file-selector.jpg
    02-file-selector.jpg
    52.6 KB · Views: 117
  • 03-select-file.jpg
    03-select-file.jpg
    54.1 KB · Views: 120
  • 04-processing.jpg
    04-processing.jpg
    41.9 KB · Views: 89
  • 05-results-one.jpg
    05-results-one.jpg
    170.8 KB · Views: 88
  • 06-results-two.jpg
    06-results-two.jpg
    134.4 KB · Views: 77
  • 07-results-three.jpg
    07-results-three.jpg
    163.3 KB · Views: 132
Last edited:
Thank you, sir! I do hope it's helpful to folks.

It's still got a few rough edges that I'll be smoothing-out as time goes on, but I had it to the point where it was looking ready for other folks to try-out and test.

jmartino was a big help to me with this...I pinged him a while back when I saw him post something about an OTA he was trying to install. So I said, "hmm, can you try this out?" ;) :).

Big thanks and props to jmar to helping me test this over the last couple of weeks.

Let me know guys if you try it out on an HTC or LG device--I'm curious to know if they've got any curiosities in their updater-script files that I haven't encountered in the Samsung, Asus, and Moto devices I've tested.

Cheers!
 
Upvote 0
Updated app with root-enabled file browser for navigating to protected/secured directories like /cache to select OTA's update zip file.


Full change log to date:

[v1.3 - 04-Nov-2012]:

- for rooted devices, change file browser to allow navigating and selecting .zip files in protected directories (like /cache)

[v1.2 - 29-Oct-2012]:

- minor fix to handle two reports of null pointer exceptions

[v1.1 - 28-Oct-2012]:

- remove unused SD card write permission

[v1.0 - 28-Oct-2012]:

- initial Play Market release
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones