[G1 Android Development] Firerat:
Magpie 110128

I see a couple of you have found the latest Magpie :D

( link to the mediafire folder is in my sig or http://tinyurl.com/FR-Magpie )

FR-110128-Magpie_GingerB-DS_S.zip

this build does not include EzTerry's latest pushes

Essentially it is 110122 but with the 4.4.0 toolchain to resolve the 'gmail bug'

in addition I have made some changes to the backuptool

within the backuptool script I have noted that it is kanged from CM, cos well it is

like before it will backup your gapps, but when restoring it will put the apks in /system/vendor/app

I like the idea of having the 'extras' separate to the main system.

I have pencilled in a complete rewrite of the backuptool, so that it will cover anything in the vendor tree..

I'm not yet 100% on this but I think libs and permission xmls are covered in the framework, once I confirm I will do a gapps ( maybe a few flavours to account for different dietary requirements ) which will put things in vendor/

builders, if you want to include a backuptool in your build I have an ugly diff

diff is against build , I've not pushed it to github as tbh its a bit ugly

I kanged the function from cm and learnt how to put the script into the zip from ezterry's autoKernel

atm it works, so I might go all lazy and push it "as is", but I want to make it less 'hardcoded'

diff --git a/tools/releasetools/edify_generator.py b/tools/releasetools/edify_generator.py
index 42c29e6..27414d9 100644
--- a/tools/releasetools/edify_generator.py
+++ b/tools/releasetools/edify_generator.py
@@ -99,6 +99,11 @@ class EdifyGenerator(object):
");")
self.script.append(self._WordWrap(cmd))

+ def RunBackup(self, command):
+ self.script.append('package_extract_file("backuptool.sh", "/tmp/backuptool.sh");')
+ self.script.append('set_perm(0, 0, 0777, "/tmp/backuptool.sh");')
+ self.script.append(('run_program("/tmp/backuptool.sh", "%s");' % command))
+
def ShowProgress(self, frac, dur):
"""Update the progress bar, advancing it over 'frac' over the next
'dur' seconds. 'dur' may be zero to advance it via SetProgress
@@ -302,3 +307,11 @@ class EdifyGenerator(object):
data = open(os.path.join(input_path, "updater")).read()
common.ZipWriteStr(output_zip, "META-INF/com/google/android/update-binary",
data, perms=0755)
+
+ # TODO make this more generic
+ android_root=os.getenv("ANDROID_BUILD_TOP")
+ backuptool = open(os.path.join(android_root,
+ "device","htc","dream-sapphire","prebuilt","backuptool.sh"),
+ "rb")
+ common.ZipWriteStr(output_zip,"backuptool.sh",backuptool.read())
+ backuptool.close()
diff --git a/tools/releasetools/ota_from_target_files b/tools/releasetools/ota_from_target_files
index d42a83a..a04b61e 100755
--- a/tools/releasetools/ota_from_target_files
+++ b/tools/releasetools/ota_from_target_files
@@ -384,6 +384,8 @@ def WriteFullOTAPackage(input_zip, output_zip):
if OPTIONS.wipe_user_data:
script.FormatPartition("/data")

+ script.RunBackup("backup")
+
script.FormatPartition("/system")
script.Mount("/system")
script.UnpackPackageDir("recovery", "/system")
@@ -392,6 +394,8 @@ def WriteFullOTAPackage(input_zip, output_zip):
symlinks = CopySystemFiles(input_zip, output_zip)
script.MakeSymlinks(symlinks)

+ script.RunBackup("restore")
+
boot_img = common.File("boot.img", common.BuildBootableImage(
os.path.join(OPTIONS.input_tmp, "BOOT")))
try:

but, for fun and education try writing a script to shoehorn it into an existing update zip ;)

http://sed.sourceforge.net/sed1line.txt

http://www.catonmat.net/blog/wp-content/uploads/2008/09/awk1line.txt