Showing posts with label Guide. Show all posts
Showing posts with label Guide. Show all posts

Monday, October 12, 2015

How To: recalibrate battery life on HTC devices

This method is an official one, recommended by the HTC Technical Support Team. Finally we have some alternative to the old myth related with re-calibrating the battery by removing the batterystats.bin file from /data/system location, as it has no impact on the battery life.

So if you're having some problems with battery life, for example it rapidly or erratically discharges (the battery indicator says 18% left but then suddenly, 5 seconds later your device is OFF) this procedure should help, as it clears all battery stats, coordinates and normalizes charging. At least HTC Technical Support says that :)

The procedure is simple:
  1. Make sure that Fastboot option is disabled in Power settings.
  2. Turn off your phone.
  3. Plug phone into HTC charger and charge for two minutes or more.
  4. While charging, hold down volume-up + volume-down + power button and continue holding. Phone will turn on and off repeatedly every 15 seconds or so while continuing to hold all three buttons.
  5. Keep this going for 2 minutes, then release all buttons when phone is ON.
  6. Now, let phone charge fully normally (with phone either on or off) and battery level reporting, charging and battery life should be normalized.
So... have you tried it? Did it help? Let me know!

Do you have any questions or comments? Feel free to share! Also, if you like this article, please use media sharing buttons (Twitter, G+, Facebook) below this post!


For latest news follow Android Revolution HD on popular social platforms:

Sunday, February 1, 2015

How To: Find a proper firmware variant for the HTC device


This guide is related to the previously published article - How To: Flash firmware package on the HTC device. The goal of this guide is to expose the problem of a matching firmware version for the particular HTC device. Please read it carefully and in case of any questions leave a proper comment in the comments section at the end of this article.

Every firmware.zip has 2 main attributes: modelid (MID) and cidnum (CID).

  • MID contains a codename of your device. For example the "0P6B1000" is the international version of the HTC One M8, while the "0P6B13000" is the T-Mobile U.S. version of the HTC One M8.
  • CID is the carrier software codename. For example the "HTC__J15" code represents the unbranded international version of the HTC One M8, while the "T-MOB010" code represents the T-Mobile U.S. software. Different CID numbers are usually used for mobile operators to include different regional settings, languages or to include some extra software (Wi-Fi Calling, Visual Voice Mail etc.).

Both MID and CID can be found in the android-info.txt inside each firmware.zip. This is how android-info.txt looks like (as an example I used firmware.zip from the international version of the HTC One M8):


Once you know the version of the firmware you have, you need to check if your device can be safely flashed with that particular firmware.zip. To check that:
  1. Download this mini-sdk package and extract it to c:\mini-sdk
  2. Connect your device to the PC
  3. Boot your device in fastboot mode (vol down + power ===> fastboot)
  4. Open a command prompt on the PC (cmd.exe), type and confirm each command with ENTER:
  5. cd /d c:\mini-sdk
  6. fastboot getvar all

This is an example output from the international version of the HTC One M8:


What you are looking for is the "modelid" and "cidnum".
  • If your device is S-ON then both modelid and cidnum must match.
  • If your device is S-OFF then modelid is critical to match, but cidnum can be changed either by changing CID of your device or by editing android-info.txt.
  • Edited firmware.zip can't be flashed on the S-ON device.
  • If your device is S-ON then you can't downgrade your current firmware version.
If both CID and MID numbers match you can safely flash the firmware.zip package - How To: Flash firmware package on the HTC device.

Do you have any questions or comments? Feel free to share! Also, if you like this article, please use media sharing buttons (Twitter, G+, Facebook) below this post!


For latest news follow Android Revolution HD on popular social platforms:

How To: Flash firmware package on the HTC device


Flashing so called "firmware" is as popular these days as flashing "custom ROM". For HTC old-boys it's nothing complicated, but some fresh Android users might find it difficult to understand the differences between "firmware" and a "custom ROM". As a result they might be afraid to upgrade OS on their device or even accidentally hard/soft brick it. Before continuing please read this article: How To: Find the proper firmware variant on the HTC device.


First of all let’s make some definitions clear. Both "Firmware" and "ROM" has their own dictionary definitions, but in this guide we need to use the same context of these words as you can find on popular articles and forums.

Your device is equipped with eMMC memory (embedded MultiMediaCard) - a place where every kind of data is stored. This eMMC memory in Android OS is called mmcblk0. But for a various reasons this memory space has to be divided into several smaller parts (f.g. not every kind of data can be stored on the same type of a filesystem). As a result, the eMMC memory is separated into different partitions (RAW, EXT3, EXT4) - smaller or bigger. To indicate the correct partition, each of them has it's own number - p1, p2, p3, p(...) etc. The whole partition name indicates also the eMMC number it's located in - mmcblk0p1, mmcblk0p2, mmcblk0p3, mmcblk0p(...) etc.

To see a lit of all the partitions on your device just type cat /proc/emmc in the adb.exe command shell.

Doing that you can also see the original name of each partition. The list you can see above is what we call "firmware", and what "custom ROM" is made of is usually just "boot" and "system" partitions. In other words - custom ROM represents "system", "boot" (sometimes "userdata" too) and everything else you can see on the list is a "firmware".


Important: Every signed and official firmware.zip can be flashed on a particular device only. Information about the device and its variant can be found inside android-info.txt in the firmware.zip package.

Question: Where firmware comes from? There are 2 ways: official and non-official. Usually firmware package comes together with the OTA (.zip) update. Inside the OTA package you can find firmware.zip archive (always signed). The non-official way is based on decrypting and extracting content of the RUU (.exe)

Question: Is everything from the list above always included in the official firmware.zip? No. HTC updates only these components (partitions) where there were changes in the code, usually related to the Android OS update or security changes in the bootloader (hboot). That means firmware.zip might have "adsp", "boot", "radio" inside and weigh 10 MB or it might contain a lot more and weight even 50 MB.


Signed (official) firmware packages can be flashed on both S-ON and S-OFF device. Once modified (unsigned) firmware.zip can't be flashed on the S-ON device. If your device is S-ON then you have to re-lock the bootloader. As long as your device is S-ON you also can't downgrade the firmware version.


Important: Make sure you have a correct MID (Model ID) and CID (Carrier ID). To check that use fastboot getvar all command. Everything you do, including following this guide, you do at your own risk!



Flashing Process
  1. Download this mini-sdk package and extract it to c:\mini-sdk
  2. Copy firmware (.zip) package to c:\mini-sdk and rename it to "firmware.zip"
  3. Connect your device to the PC
  4. Boot your device in fastboot mode (vol down + power ===> fastboot)
  5. Open a command prompt on the PC (cmd.exe), type and confirm each command with ENTER:
  6. cd /d c:\mini-sdk
  7. fastboot getvar all (open android-info.txt inside firmware.zip and check if MID and CID matches)
  8. <optionally> fastboot oem lock (if your device is not yet re-locked)
  9. fastboot oem rebootRUU
  10. fastboot flash zip firmware.zip and wait for the process to be completed. Sometimes flashing firmware once doesn't work, so flash firmware.zip again using the same command.
  11. fastboot reboot

In case of further questions I prepared a little Q&A part:
  • What is firmware.zip?
Firmware.zip is a part of Over The Air (OTA) update from the HTC. It contains important parts of the firmware like radio, bootloader, recovery, kernel etc.
  • Why it's important to flash firmware.zip and when should I flash it?
It is recommended to have the latest firmware on your device for the best modem performance and overall system stability. Sometimes it's necessary to have the latest bootloader too, because otherwise your device might not work well with the new system update.
  • Why it's important to flash it before flashing custom ROM?
Because firmware.zip contains boot.img (ramdisk and kernel) that will replace custom boot.img from any custom ROM you already have. That's why you have to flash firmware.zip first, because otherwise boot.img will be overwritten with the stock one. If you already flashed firmware.zip after flashing custom ROM, just flash this particular custom ROM again.
  • Does firmware.zip contain recovery?
Yes, it does contain recovery image, that's why after flashing firmware.zip you will have to flash custom recovery again to be able to flash custom ROM afterwards.
  • Can I flash any firmware.zip on my device?
Not if your device is S-ON. To be able to flash firmware.zip on the S-ON device, your MID number (example: PN0710000) and CID number (example: HTC__001) must match the firmware.zip version you are about to flash.
  • If my MID or CID doesn't match, can I brick my device if I try to flash firmware.zip anyway?
As long as your device is S-ON flashing firmware.zip with non matching MID or CID will result in error and nothing will be flashed, so there is no risk of brick.
  • Do I need to have locked, unlocked or relocked bootloader to be able to flash firmware.zip?
Your bootloader needs to be relocked.
  • If I can't flash newest firmware.zip because of wrong modeid (MID) or cidnum (CID) does it mean I can't use custom ROM based on the latest HTC update?
In most cases you should be able to use any custom ROM as long as hboot update is not mandatory.
  • What if there is no firmware.zip for my MID/CID?
Try to find latest OTA update for your original stock ROM and extract it. Firmware.zip should be inside.

Do you have any questions or comments? Feel free to share! Also, if you like this article, please use media sharing buttons (Twitter, G+, Facebook) below this post!


For latest news follow Android Revolution HD on popular social platforms:

Monday, January 26, 2015

How to: Unlock external SD Card writing for all apps in Android 4.4 and 5.0

In Android 4.4 "Kitkat" (API 19) Google has changed the default permissions for the external SD Card (usually microSD). Since that Android OS version third-party apps have no more access to write on the SD Card. It's a bit problematic, because now you might not be able to use your favourite Files Manager to move or copy files on the external storage.

Some time ago I wrote a comprehensive guide about the differences between external storage (microSD Card), internal storage (virtual SD Card) as a part of the userdata partition and internal storage (virtual SD Card) as a separate eMMC partition - Virtual SD card on Android.

Now let's get back to our R/W (Read/Write) permission "problem" on the external storage. There are 3 things you need to know before going any further:
  1. This change was made by Google for a security reason. Keep that in mind!
  2. Root access is required to make proper changes on your device.
  3. This method might break OTA updates on your device if you're running stock operating system. I wrote "might" because this trick is based on modifying the /system/etc/permissions/platform.xml file, which isn't frequently updated by phone manufacturers, but most likely it will be updated when next major system update arrives (f.g. KitKat ---> Lollipop).

Procedure
Note: root required!
  1. Start up your device normally and wait for the system to be fully loaded.
  2. Open any files manager of your choice (Root Explorer, ES File Explorer, Total Commander) and make sure it runs with superuser permissions.
  3. Mount your system partition as R/W (Read/Write) to perform any changes.
  4. Navigate to the /system/etc/permissions/ folder and look for the platform.xml.
  5. Copy the platform.xml file into the same location as platform.xml.bak file.
  6. Open the platform.xml file with any text editor on your device and search for the following line:
  7. <permission name="android.permission.WRITE_EXTERNAL_STORAGE">

    It should look like on the picture below:

  8. Now you need to add a 3rd GID (Group ID): <group gid="media_rw" /> and you need to make it looks exactly like on the picture below:
  9. Using Root Explorer or any other Files Manager of your choice make sure that the platform.xml file has proper permissions: Owner R-W | Group R | Others R (0644 rw-r--r--). You can also use adb shell to set permissions with a chmod 0644 /system/etc/permissions/platform.xml command.
  10. Reboot your device and enjoy!
  11. In case of problems with OTA update just remove modified platform.xml and rename platform.xml.bak to its original name.
Do you have any questions or comments? Feel free to share! Also, if you like this article, please use media sharing buttons (Twitter, G+, Facebook) below this post!


For latest news follow Android Revolution HD on popular social platforms:

Sunday, January 25, 2015

How to: Fix no access to the virtual SD card after Android Lollipop update


This solution is based on the experience with some HTC and Nexus devices, however it will work on any device running Android Lollipop or newer/older Android OS with SELinux (Security-Enhanced Linux) kernel security module.

What's the problem? Sometimes you might not be able to access the content of the internal userdata memory, also known as "virtual SD card" - located as /data/media/0 on the userdata partition. The "bad" workaround is to boot the device in a recovery mode and gain the access to all files from there, but this doesn't solve the problem at all.

Repair Process
Note: root required!
  1. Download this mini-sdk package and extract it to c:\mini-sdk
  2. Connect your device to the PC
  3. Start up the device normally, wait until system is fully loaded
  4. Open a command prompt on the PC (cmd.exe), type and confirm each command with ENTER:
  5. cd /d c:\mini-sdk
  6. adb shell
  7. su
  8. restorecon -FR /data/media/0
  9. exit
What's going to happen? Restorecon is a program used to restore file(s) default SELinux security contexts. It can be run at any time to correct errors or to add support for new policy. With a corrected SELinux security context for the /data/media/0 you will be able to access the content of the virtual SD card again.

Do you have any questions or comments? Feel free to share! Also, if you like this article, please use media sharing buttons (Twitter, G+, Facebook) below this post!


For latest news follow Android Revolution HD on popular social platforms:

Tuesday, September 30, 2014

How to: Fix a random reboots on the HTC One M8


Some time ago I described a method to format the /data partition on the HTC One (M7) - How to: Fix a corrupted DATA partition on the HTC One. This method is suitable for more HTC devices (all with EXT4 support) and with the mkfs.ext4 tool you can format system and cache partitions as well. All you need to know is the proper /dev/block/mmcblk0pXY number of the partition you want to format.

However, formatting the partition always means that your data will be gone. On the HTC One M8 I noticed a problem, most likely caused by the wp_mod.ko module (module to disable system R/W protection). When the module is loaded too late and anything ever gets changed before the module is loaded the file-structure of the /data partition might (and probably will) get corrupted. As a result your device will reboot each time you'll try to make and change on the /system partition (even if mounted as RW). So removing, copying, moving, re-naming or editing any file on a system partition will result with the following message in the kernel log (last_kmsg.txt):


Formatting the /data partition is not the best idea for some and it's not needed in most cases.

Repair Process
  1. Download this mini-sdk package and extract it to c:\mini-sdk
  2. Download this fsck.ext4 binary and put it into c:\mini-sdk
  3. Connect your device to the PC
  4. Boot your device in recovery mode
  5. Open a command prompt on the PC (cmd.exe), type and confirm each command with ENTER:
  6. cd /d c:\mini-sdk
  7. adb push fsck.ext4 /tmp
  8. adb shell
  9. chmod 777 /tmp/fsck.ext4
  10. /tmp/fsck.ext4 -fn /dev/block/mmcblk0p47

This will fix your /data partition and you should see the following output (numbers in the last line will be different in each case):

e2fsck 1.42.9 (28-Dec-2013)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/block/mmcblk0p47: 19050/712704 files (2.7% non-contiguous), 2320338/2850816 blocks


Your /data partition is now fixed and you should no longer experience random reboots problem on your device (assuming that the corrupted /data partition was the source of the problem). Keep in mind that the fsck.ext4 -fn command can be used to check other EXT4 partitions on any device that has EXT4 file-system structure. All you need to know is the partition name or block number.


Do you have any questions or comments? Feel free to share! Also, if you like this article, please use media sharing buttons (Twitter, G+, Facebook) below this post!


For latest news follow Android Revolution HD on popular social platforms:

Friday, May 2, 2014

How to: Enable Harman & Kardon sound effect of the HTC One M8

Just few days ago HTC announced the new HTC One (M8) Harman & Kardon Edition. The HTC One (M8) Harman & Kardon edition has been designed for consumers who appreciate high-quality audio and want the best smartphone on the market without compromise. It’s a special edition of the critically acclaimed HTC One (M8) that builds upon the iconic all-metal design in a new brushed black finish with champagne accents, and is another example of HTC’s commitment to offer the best audio experience on a smartphone.

Today we present you how to enjoy this revolutionary audio experience on your “regular” HTC One (M8).

First of all it seems that the changes between the regular M8 and the M8 H&K Edition are only or mainly software related. We believe that the sound processor is the same in both units, however the firmware of that sound processor is probably different. To such conclusion led us the particular part of the M8 Sprint firmware.zip package called adsp.img (Advanced Digital Sound Processor) which is usually the same between each device variants and stays the same since the first device software release date, but in this case it was different. We found out that the adsp.img from the Sprint HTC One M8 was different to the others One M8 variants so it's probably needed for a proper H&K sound mod function.

The rest of the changes are located on /system partition:
  • system/customize/ACC/default.xml
<item type="boolean" name="support_harman">false</item> has to be changed to
<item type="boolean" name="support_harman">true</item> to make the OS "think" that you're actually using the H&K M8 Edition. This boolean item wasn't present in the early HTC One M8 1.24.401.4 software version.
  • system/etc/tfa/playbackHM.* / playbackHM_l.* files which are mostly related to the equalizer settings
  • system/etc/audio_policy.conf tuned for higher sampling_rate values (up to 192000)
  • system/lib and system/lib/hw libraries, mostly related to the part of the SoC responsible for the audio
This all might sound a little bit complicated, but in fact it was just an explanation about the changes that are required software-wise to enable the H&K support on the regular HTC One M8.

The tricky part is that to flash adsp.img on international version of the HTC One M8 you'll need to have Security OFF (S-OFF) device. Without S-OFF you can only update files located on the system partition on your device. Below you can find proper ZIP packages that are suppose to be flashed using custom recovery. First one (for S-OFF devices) together with system partition will also update the adsp.img. The other one (for S-ON devices) will update only system files, however you might not notice any sound improvements without the adsp.img.

Download links:

Harman & Kardon sound mod for the HTC One M8 S-OFF
Harman & Kardon sound mod for the HTC One M8 S-ON

Thanks to baadnewz for brining the initial version of the modification.

Do you have any questions or comments? Feel free to share! Also, if you like this article, please use media sharing buttons (Twitter, G+, Facebook) below this post!


For latest news follow Android Revolution HD on popular social platforms:

Saturday, February 22, 2014

How To: Fix Wi-Fi connecting issues on the HTC One running Android 4.4.2

It turned out that HTC One users have lately some problems with connecting their devices to the Wi-Fi routers after the Android 4.4.2 update. Here we present the iconography solution of this problem.

  1. Open Settings panel and click on the "Wi-Fi" tile
  2. Tap on the "3 dots" menu in the upper right corner
  3. From the list select "Wi-Fi Direct"


  4. You will now see that your device is called "Android_ed2c". Tap on the "3 dots" menu in the upper right corner
  5. From the list select "Rename device"
  6. Replace the "Android_ed2c" with  the "HTC One" text and hit "OK" button


  7. Done!
Have any questions or comments? Feel free to share! Also, if you like this article, please use media sharing buttons (Twitter, G+, Facebook) below this post!

Sunday, February 16, 2014

How to: Generate a kernel log after random reboot

Once in a while, a software bug in the kernel will cause a random reboot, so in order to help kernel developers to fix and troubleshoot the reboots, a kernel log need to be submitted to the developer for further analysis and hopefully lead to a bug fix.

Most Android kernels have "RAM Consoles" to save the necessary kernel logs immediately after reboot in the RAM.  The users can then retrieve this RAM log on a subsequent reboot to submit to kernel developers. Here is a quick tour on how to do that.


[ Using ADB ]
  1. adb shell
  2. su
  3. cat /proc/last_kmsg > /sdcard/last_kmsg.txt
  4. exit
  5. exit
  6. adb pull /sdcard/last_kmsg.txt
File last_kmsg.txt will be located in the same location as adb.exe executable.


[ Using android terminal app ]
  1. su
  2. cat /proc/last_kmsg > /sdcard/last_kmsg.txt
  3. exit
  4. exit
  5. adb pull /sdcard/last_kmsg.txt
File last_kmsg.txt will be located on your SD-card.


[ Using Root Explorer / ES Explorer with Root ]
  1. go to /proc folder
  2. copy last_kmsg to /sdcard/
  3. rename last_kmsg to last_kmsg.txt
File last_kmsg.txt will be located on your SD-card.

The best method to share the last_kmsg.txt content is to upload it to pastebin.com and send a link to the developer.

Source: faux123 (Google +)

Have any questions or comments? Feel free to share! Also, if you like this article, please use media sharing buttons (Twitter, G+, Facebook) below this post!

Wednesday, December 18, 2013

How to: Use "adb sideload" on your Android device


Probably every Android power-user at least once in his life used ADB - Android Debug Bridge. It is a versatile command line tool that lets you communicate with an emulator instance or connected Android-powered device. Using ADB shell commands gives you additional control over your device and sometimes it can save your device from being bricked (example: How to: copy ROM zip file to the freshly wiped device). You can find some more basic information about ADB here.

Since Android Jelly Bean there has been a new ADB mode available in the AOSP recovery, incorporated by the Android developer community into custom recoveries too. It is called "ADB sideload" and most of you probably have heard about it already. This is an alternate method to the one I wrote about here - How to: copy ROM zip file to the freshly wiped device. The main difference is that ADB sideload works only with recoveries based on Jelly Bean source or newer. I believe that ADB sideload was created to simplify the process of flashing/restoring Android update.zip packages.

Keep in mind that while using ADB sideload, the regular ADB shell won't work. To be able to use SIDELOAD mode make sure you're running latest ADB drivers from the Android SDK (Platform-tools). Here are the simple steps you need to follow to flash update.zip package using adb sideload mode (based on stock Android recovery):
  1. Place the ZIP package you want to install in the same location where you keep ADB drivers - adb.exe, AdbWinApi.dll and AdbWinUsbApi.dll (usually it's SDK\platform-tools)
  2. Make sure you have USB debugging enabled in Settings > Development on your device
  3. Make sure your phone drivers are installed on the PC you're going to use
  4. Boot your device in recovery mode (Android logo with a exclamation mark) and connect your device to PC
  5. Hold down "power" button first, followed quickly by "volume up" button. You should now see the recovery menu
  6. Use the volume up/down keys to select "apply update from ADB," then press power to select it
  7. Open a command prompt on the PC (cmd.exe), type and confirm with ENTER:
  8. cd /d <adb.exe location> (for example: cd /d c:\SDK\platform-tools) or you can open your SDK/platform-tools folder, then press SHIFT button and the right-click mouse button and choose “Open command prompt here
  9. adb sideload <filename>.zip (for example: adb sideload update.zip)
  10. The zip package will begin installing. When it's done, select "reboot system now."
How is that different from the alternative method? You don't have to manually create the proper folders structure, push the file and later install if from inside the recovery menu. The result is basically the same, because ADB sideload is also transferring the zip file into the device internal memory and later it automatically begins the installation procedure. However, it works only with recoveries based on Android Jelly Bean source.

Have any questions or comments? Feel free to share! Also, if you like this article, please use media sharing buttons (Twitter, G+, Facebook) below this post!

Monday, December 9, 2013

How to: Manually install an OTA update on your HTC device

Sometimes it turns out that your device for some reason can't find the most recent OTA (Over The Air) update. However, there is a solution to apply OTA update manually, without being forced to wait for the update being downloaded and installed by your device.

Facts you need to know before continuing:
  1. This method has nothing to do with the "adb sideload" feature available on Android devices since Jelly Bean. It should work on every Android HTC device.
  2. Read about different software versions for the HTC devices here. Keep in mind that the OTA update must match the software version on your device. Each original OTA update.zip package has 2 different software versions in its name - the version of the software that must be currently installed on your device and the version of the software that your device will run after the update. For example:
OTA_M7_UL_JB43_SENSE55_MR_HTC_Europe_3.62.401.1-2.24.401.8_release_338160gxmo5sd9337kadux.zip

As you can see, 2.24.401.8 is the software version you must currently have installed to be able to run the OTA and 3.62.401.1 is the version of the software expected after the update. You can't flash an OTA update on a different software version to that expected by the OTA update for two main reasons:
  1. Formal reason - the OTA update.zip package checks if your system is running the expected software version before it starts to install the update:
    assert(file_getprop("/system/build.prop", "ro.build.fingerprint") == "htc/htc_europe/m7:4.2.2/JDQ39/235216.8:user/release-keys");
    This must match the following build fingerprint from the build.prop. If the versions don't match, the installation of the OTA package will be cancelled.
    ro.build.fingerprint=htc/htc_europe/m7:4.2.2/JDQ39/235216.8:user/release-keys
  2. Technical reason - OTA update.zip packages usually contain patches for the target files. This way OTA update doesn't have to be 1GB size, even if it is supposed to update the whole OS to the newer version. Patch files have an *.apk.p extension (f.g. Camera.apk.p) and each patch file must match the target file (f.g. Camera.apk). To make it possible, OTA update.zip package checks the MD5 checksum of each file on the system partition on your device:
    assert(apply_patch_check("/system/app/Camera.apk",
    "b3b79e40bad0b1bec5fb949ac5f8662f91bee714",
    "5a5bf63e3d7c9de52a7d8d7a292e158263783844"));
    And finally, if the MD5 is correct it applies the patch. All these commands are stored in META-INF\com\google\android\updater-script of each OTA update.zip package. If the MD5 is incorrect, or at least one file is missing, the installation of the OTA package will be cancelled.
    assert(apply_patch("/system/app/Camera.apk", "-",
    b3b79e40bad0b1bec5fb949ac5f8662f91bee714, 4229394, 
    5a5bf63e3d7c9de52a7d8d7a292e158263783844,
    package_extract_file("patch/system/app/Camera.apk.p")));

Now you are ready to manually apply the OTA update on your device. The methods you'll use is based on Android stock recovery.

Method 1 (for users with root access)
  1. Make sure you have the stock (original) recovery on your device
  2. Make sure you're running a completely unmodified operating system. Additional files like Superuser.apk or su binary are allowed, you just can't have any system files changed or removed (due to the MD5 check)
  3. Make sure you have a reasonable amount of battery charge remaining
  4. Make sure the OTA update you're about to install matches the software version on your device
  5. Copy the OTA update.zip package to the internal storage /data/media/0/update.zip
  6. Open adb shell or use Android Terminal Emulator and type: echo "--update_package=/data/media/0/update.zip" > /cache/recovery/command
  7. Turn OFF the device (make sure fastboot mode is disabled in settings)
  8. Hold your volume down and power keys until the bootloader starts up
  9. Using the volume keys, navigate down to RECOVERY and press power
  10. The OTA update installation process should now start automatically
  11. Once system is booted you should see a confirmation about the successfully flashed update.
Method 2 (for users without root access) | This method won't work on the S-ON HTC One M8
  1. Make sure you have the stock (original) recovery on your device
  2. Make sure you're running a completely unmodified operating system. Additional files like Superuser.apk or su binary are allowed, you just can't have any system files changed or removed (due to the MD5 check)
  3. Make sure you have a reasonable amount of battery charge remaining
  4. Make sure the OTA update you're about to install matches the software version on your device
  5. Copy the OTA update.zip package to your device (internal storage preferred)
  6. Turn OFF the device (make sure fastboot mode is disabled in settings)
  7. Hold your volume down and power keys until the bootloader starts up
  8. Using the volume keys, navigate down to RECOVERY and press power
  9. You are now in stock recovery mode. You should see nothing more than a (sometimes spinning) Android with the red exclamation mark above it (an empty black screen is also possible). Wait for a few seconds
  10. First hold volume up, then (with volume up held down) press power button to enter the main recovery menu. This keys combination may vary from device to device. Try different keys combination if the above one doesn't work (might be all three keys all together too)
  11. Navigate down to "apply from phone storage" text and press power to confirm
  12. Navigate to the location where you copied the OTA update.zip package and press power to confirm
  13. Wait (sometimes you might need to follow further instructions on the screen) until the update process is finished
  14. Once system is booted you should see a confirmation about the successfully flashed update.
Have any questions or comments? Feel free to share! Also, if you like this article, please use media sharing buttons (Twitter, G+, Facebook) below this post!


For latest news follow Android Revolution HD on popular social platforms: