Published January 9, 2011 | https://doi.org/10.59348/wzhqv-xpg98

Android Rom Update Utility extractor for Linux

  • 1. ROR icon University of Sussex

As my hobby-geek phase draws to a close and I return well and truly to my PhD, I thought it worth sharing this python script I wrote a while back which will extract the update.zip file from an Android RUU.exe file on Linux. There are other items out there that do the same thing, but this is my effort.

Usage: modify the options, start the script and then run the RUU under Wine.

{% highlight python %} #!/usr/bin/python ''' ROM Extractor Copyright (c) 2010 Martin Paul Eve This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . ''' import os import pyinotify import io # USERNAME = REQUIRED username = "martin" # Modify these if using a different format; HTC seem to go by this standard filename = "rom.zip" monitor_path = "~/.wine/drive_c/users/%s/Temp/" % username wm = pyinotify.WatchManager() mask = pyinotify.IN_CREATE | pyinotify.IN_MODIFY | pyinotify.IN_DELETE | pyinotify.IN_MOVED_TO bd = None class RExtract(pyinotify.ProcessEvent): def process_IN_MOVED_TO(self, event): if event.name.endswith(filename): print "Found ROM. Awaiting completion of modification." self.f = open(os.path.join(event.path, event.name), "r") self.bd = self.f.read() def process_IN_CREATE(self, event): if event.name.endswith(filename): print "Found ROM. Awaiting completion of modification." self.f = open(os.path.join(event.path, event.name), "r") def process_IN_MODIFY(self, event): if event.name.endswith(filename): if hasattr(self, "bd"): self.bd = self.bd + self.f.read() else: self.bd = self.f.read() def process_IN_DELETE(self, event): if event.name.endswith(filename): self.f.close() self.f = open(os.path.join("/home/%s/" % username, "rom.zip"), "w") self.f.write(self.bd) self.f.close() print "ROM Copied" raise KeyboardInterrupt notifier = pyinotify.Notifier(wm, RExtract()) print "ROM Extractor Copyright (c) 2010 Martin Paul Eve" print "This program comes with ABSOLUTELY NO WARRANTY." print "This is free software, and you are welcome to redistribute it under certain conditions; see the included licence statement" print "" print "Monitoring: %(path)s for %(filename)s" % {"path": os.path.expanduser(monitor_path), "filename": filename} print "Press CTRL+C to exit" wdd = wm.add_watch(os.path.expanduser(monitor_path), mask, rec=True, auto_add=True) while True: try: notifier.process_events() if notifier.check_events(): notifier.read_events() except KeyboardInterrupt: notifier.stop() break {% endhighlight %}

Android Rom Update Utility extractor for Linux was originally published by Martin Paul Eve at Martin Paul Eve on January 09, 2011.

Additional details

Description

As my hobby-geek phase draws to a close and I return well and truly to my PhD, I thought it worth sharing this python script I wrote a while back which will extract the update.zip file from an Android RUU.exe file on Linux. There are other items out there that do the same thing, but this is my effort. Usage: modify the options, start the script and then run the RUU under Wine.

Identifiers

UUID
5972a4f6-d43f-41f2-b387-2529ffc29941
GUID
https://doi.org/10.59348/wzhqv-xpg98
URL
https://eve.gd/2011/01/09/android-rom-update-utility-extractor-for-linux

Dates

Issued
2011-01-09T15:55:58
Updated
2011-01-09T15:55:58