[Q] how to fix failing OTA 4.4.4 update

kwaamkit

Member
May 17, 2013
17
0
0
I have an unlocked HTC One M8 purchased in Asia. I currently cannot update to the recent OTA 4.4.4 release. The OTA file downloaded to my phone is:

OTA_M8_UL_K444_SENSE60_MR_hTC_Asia_WWE_3.32.707.9-2.22.707.4_release_398958qolv1sj4mfwgae00.zip

Phone info:
cid: HTC__044
version-main: 2.22.707.4
version-misc: PVT SHIP S-OFF
product: m8_ul

I have TWRP installed into the recovery partition. Additionally I used SDFix provided by NextApp (writers of the nice FX app) to make my external SD writable. From what I can tell SDFix app changed the /system/etc/permissions/platform.xml file by adding the following bolded lines:

Code:
<...snip...>
<permission name="android.permission.WRITE_EXTERNAL_STORAGE">
    <group gid="sdcard_r"/>
    <group gid="sdcard_rw"/>
    [B]<group gid="media_rw"/>[/B]
</permission>

[B]<permission name="android.permission.WRITE_MEDIA_STORAGE">
    <group gid="media_rw"/>
</permission>[/B]
<...snip...>
To install the OTA I first reflashed the stock recovery, rebooted the phone and then started the OTA update. About 25% of the way through the update it fails and I see the message:

Verifying current system...
"/system/etc/permissions/platform.xml" has unexpected contents.
Installation aborted.
I tried removing the <group gid="media_rw"/> group from WRITE_EXTERNAL_STORAGE and removed the WRITE_MEDIA_STORAGE permission completely and retried but things are still failing.

Anyone have any idea what I need to do to get the OTA to install successfully?

Thanks much in advance!
 

redpoint73

Recognized Contributor
Oct 24, 2007
15,259
6,946
113
Anyone have any idea what I need to do to get the OTA to install successfully?
System files need to be returned to their stock condition. Either do it manually, or find the stock nandroid (if one is posted for your CID) and restore it.

As it seems you have not returned the xml file to exactly the stock condition, this is causing the error. And it might be difficult to determine the exact stock xml condition. Restoring is a nandroid is probably easiest.
 
Last edited:

sterod

Senior Member
Aug 27, 2012
394
110
0
Toronto
I had the same problem, its because platform.xml is being reverted and discarding your edit after you reboot.
This is how to fix it.

Prerequisites:
A clean copy of platform.xml from a stock backup OR a copy that has the <group gid="media_rw" /> line removed from <permission name="android.permission.WRITE_EXTERNAL_STORAGE" >
Or, a link to one here. https://dl.dropboxusercontent.com/u/89102457/platform.xml
Factory recovery.img file
Newest TWRP img file
ADB to connect to phone from PC

Boot into TWRP
mount system
run adb shell on your PC
cd into /system/etc/permissions
rm platform.xml (have to remove / delete it, overwrite DOES NOT work as it gets restored on reboot)
push platform.xml /system/etc/permissions (the clean copy that has the extra line removed)
chmod 644 platform.xml

Boot into fastboot

Flash Stock Recovery
fastboot flash recovery stockrecovery.img

Reboot into OS

Run OTA

Boot into fastboot
Flash TWRP
fastboot flash recovery openrecovery_xxx.img

Re-add the lines to platform.xml or re run your SD fixer app.
<permission name="android.permission.WRITE_EXTERNAL_STORAGE" >
<group gid="sdcard_r" />
<group gid="sdcard_rw" />
<group gid="media_rw" />
</permission>

added <group gid="media_rw" />

You're done.

I have an unlocked HTC One M8 purchased in Asia. I currently cannot update to the recent OTA 4.4.4 release. The OTA file downloaded to my phone is:

OTA_M8_UL_K444_SENSE60_MR_hTC_Asia_WWE_3.32.707.9-2.22.707.4_release_398958qolv1sj4mfwgae00.zip

Phone info:
cid: HTC__044
version-main: 2.22.707.4
version-misc: PVT SHIP S-OFF
product: m8_ul

I have TWRP installed into the recovery partition. Additionally I used SDFix provided by NextApp (writers of the nice FX app) to make my external SD writable. From what I can tell SDFix app changed the /system/etc/permissions/platform.xml file by adding the following bolded lines:

Code:
<...snip...>
<permission name="android.permission.WRITE_EXTERNAL_STORAGE">
    <group gid="sdcard_r"/>
    <group gid="sdcard_rw"/>
    [B]<group gid="media_rw"/>[/B]
</permission>

[B]<permission name="android.permission.WRITE_MEDIA_STORAGE">
    <group gid="media_rw"/>
</permission>[/B]
<...snip...>
To install the OTA I first reflashed the stock recovery, rebooted the phone and then started the OTA update. About 25% of the way through the update it fails and I see the message:



I tried removing the <group gid="media_rw"/> group from WRITE_EXTERNAL_STORAGE and removed the WRITE_MEDIA_STORAGE permission completely and retried but things are still failing.

Anyone have any idea what I need to do to get the OTA to install successfully?

Thanks much in advance!
 
Last edited:
  • Like
Reactions: jahandy

kwaamkit

Member
May 17, 2013
17
0
0
System files need to be returned to their stock condition. Either do it manually, or find the stock nandroid (if one is posted for your CID) and restore it.

As it seems you have not returned the xml file to exactly the stock condition, this is causing the error. And it might be difficult to determine the exact stock xml condition. Restoring is a nandroid is probably easiest.
Thanks. This may sound silly. I'm still a bit of a newb at this. I never did an initial backup :( and don't think I've been able to find the nandroid version for my version, or possibly simpler just find the stock version of the /system/etc/permissions/platform.xml file?

I have a file called 2.22.707.4.zip which I thought was the nandroid zip, but unpacking just contains files like boot.emmc.win, data.ext4.win, system.ext4.win000, etc, but I don't really know how to extract the platform.xml file without completely reverting my phone back to stock.

Any pointers in the right direction would be much appreciated.
 

kwaamkit

Member
May 17, 2013
17
0
0
I had the same problem, its because platform.xml is being reverted and discarding your edit after you reboot.
This is how to fix it.

Prerequisites:
A clean copy of platform.xml from a stock backup OR a copy that has the <group gid="media_rw" /> line removed from <permission name="android.permission.WRITE_EXTERNAL_STORAGE" >
Or, a link to one here. https://dl.dropboxusercontent.com/u/89102457/platform.xml
Factory recovery.img file
Newest TWRP img file
ADB to connect to phone from PC

Boot into TWRP
mount system
run adb shell on your PC
cd into /system/etc/permissions
rm platform.xml (have to remove / delete it, overwrite DOES NOT work as it gets restored on reboot)
push platform.xml /system/etc/permissions (the clean copy that has the extra line removed)
chmod 644 platform.xml

Boot into fastboot

Flash Stock Recovery
fastboot flash recovery stockrecovery.img

Reboot into OS

Run OTA

Boot into fastboot
Flash TWRP
fastboot flash recovery openrecovery_xxx.img

Re-add the lines to platform.xml or re run your SD fixer app.
<permission name="android.permission.WRITE_EXTERNAL_STORAGE" >
<group gid="sdcard_r" />
<group gid="sdcard_rw" />
<group gid="media_rw" />
</permission>

added <group gid="media_rw" />

You're done.
Thanks for your response....I actually noticed my file edits to platform.xml were being blown away when rebooting the phone. I figured out though, in the FX file explorer app I could remount the /system dir as r/w and edit the file while the phone was booted up. I did it this way and when I rebooted the phone my changes stuck and did not get blown away.

Not sure what remaining differences still exist between the stock platform.xml file and my modified version. Any chance you have the stock version of the file somewhere?

Thanks much!
 

sterod

Senior Member
Aug 27, 2012
394
110
0
Toronto
Thanks for your response....I actually noticed my file edits to platform.xml were being blown away when rebooting the phone. I figured out though, in the FX file explorer app I could remount the /system dir as r/w and edit the file while the phone was booted up. I did it this way and when I rebooted the phone my changes stuck and did not get blown away.

Not sure what remaining differences still exist between the stock platform.xml file and my modified version. Any chance you have the stock version of the file somewhere?

Thanks much!
I added a link to a stock platform.xml in my post. Also, remember you have to have the factory recovery.img you can't do an OTA if you have TWRP installed.
 

redpoint73

Recognized Contributor
Oct 24, 2007
15,259
6,946
113
I have a file called 2.22.707.4.zip which I thought was the nandroid zip, but unpacking just contains files like boot.emmc.win, data.ext4.win, system.ext4.win000, etc, but I don't really know how to extract the platform.xml file without completely reverting my phone back to stock.
It looks like a nandroid from the collection of stock backups: http://forum.xda-developers.com/showthread.php?t=2701376

Just restore with the appropriate recovery (most backups for your CID are made with TWRP). You're making it more complicated than need be.