<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Android on Such geek. Wow.</title><link>https://www.ericlight.com/tags/android.html</link><description>Recent content in Android on Such geek. Wow.</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Sun, 12 Apr 2020 00:00:00 +1200</lastBuildDate><atom:link href="https://www.ericlight.com/tags/android/index.xml" rel="self" type="application/rss+xml"/><item><title>Flashing a Samsung S5 G900I back to stock</title><link>https://www.ericlight.com/post/new_heimdall.html</link><pubDate>Tue, 19 Dec 2017 00:00:00 +1300</pubDate><guid>https://www.ericlight.com/post/new_heimdall.html</guid><description>&lt;p&gt;I got a second-hand Samsung Galaxy S5 for my mum yesterday (a G900I model, from Telstra), and I spent some time getting it ready.&lt;/p&gt;
&lt;p&gt;Firstly, I &lt;a class="link" href="https://www.sammobile.com/firmwares/galaxy-s5/SM-G900I/" target="_blank" rel="noopener"
 &gt;downloaded&lt;/a&gt; the most-recent Telstra firmware image. At time of writing, that&amp;rsquo;s G900IDVU1CQJ2. Telstra appears to be the only carrier still releasing stock firmware for this phone, so I downloaded the Telstra version even though we&amp;rsquo;re connecting to Spark New Zealand. This means the phone will at least be running the most up-to-date baseband and modem firmware.&lt;/p&gt;
&lt;p&gt;Note - if you try this, and find that the recent (international) version doesn&amp;rsquo;t work properly with your local carriers, download the older (local) package, and flash the modem.bin and the NON-HLOS.bin packages from the local one instead.&lt;/p&gt;
&lt;p&gt;Flashing the new firmware required a little thinking. I&amp;rsquo;m 99% sure that I did this the hard way, but basically:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Download the newest version of &lt;a class="link" href="https://github.com/Benjamin-Dobell/Heimdall" target="_blank" rel="noopener"
 &gt;Heimdall from Github&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Back last year I had &lt;a class="link" href="https://www.ericlight.com/post/heimdall-nongui.html" &gt;a post&lt;/a&gt; that mentioned editing CMakeLists.txt - ignore that now.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Build the software (assuming you extracted the zip instead of using &lt;code&gt;git clone&lt;/code&gt;), with:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; cd Heimdall-master
 mkdir build
 cd build
 cmake -DDISABLE_FRONTEND=ON -DCMAKE_BUILD_TYPE=Release .. 
 make
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Once I&amp;rsquo;d built Heimdall, I unzipped the firmware into a convenient place, and I examined the PIT file from the phone:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;./heimdall print-pit
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This descripts the partition table on the phone. In particular, it tells you which files in your firmware package should be uploaded to which partitions. I ended up with the following Heimdall flash line:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;./heimdall flash --APNHLOS NON-HLOS.bin --MODEM modem.bin --SBL1 sbl1.mbn --DBI sdi.mbn --ABOOT aboot.mbn --RPM rpm.mbn --TZ tz.mbn --BOOT boot.img --RECOVERY recovery.img --SYSTEM system.img.ext4 --CACHE cache.img.ext4 --HIDDEN hidden.img.ext4
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I know I could have only flashed the modem.bin and NON-HLOS.bin files, but I&amp;rsquo;m not sure what I would have missed by skipping all the other partitions.&lt;/p&gt;
&lt;p&gt;After the phone was flashed up to the current Stock firmware, I made sure it booted correctly, and then went ahead and converted the phone to my beloved &lt;a class="link" href="https://www.lineageos.org" target="_blank" rel="noopener"
 &gt;LineageOS&lt;/a&gt;, happy in the knowledge that all the &amp;ldquo;other bits&amp;rdquo; of the firmware were all updated.&lt;/p&gt;</description></item><item><title>Compiling Heimdall without installing Qt</title><link>https://www.ericlight.com/post/heimdall-nongui.html</link><pubDate>Wed, 13 Sep 2017 00:00:00 +1200</pubDate><guid>https://www.ericlight.com/post/heimdall-nongui.html</guid><description>&lt;img src="https://www.ericlight.com/post/heimdall-nongui/yuck.png" alt="Featured image of post Compiling Heimdall without installing Qt" /&gt;&lt;p&gt;During my recent &lt;a class="link" href="https://www.ericlight.com/post/broken_phone.html" &gt;Wrecked-phone Saga&lt;/a&gt;, I had some trouble flashing my firmware. My phone was broken at the time, so I couldn&amp;rsquo;t enable ADB Debugging - therefore adb wasn&amp;rsquo;t an option. OEM Bootlock was on, so fastboot wasn&amp;rsquo;t an option. My Recovery bootloader was also broken. I thought my phone was bricked.&lt;/p&gt;
&lt;p&gt;That&amp;rsquo;s until I remembered Heimdall.&lt;/p&gt;
&lt;p&gt;&lt;a class="link" href="http://glassechidna.com.au/heimdall/" target="_blank" rel="noopener"
 &gt;Heimdall&lt;/a&gt; is specifically a tool for working with the partitions on Samsung phones - other visitors need not apply. It works a treat for my Samsung Galaxy S5 (kltedv) though.&lt;/p&gt;
&lt;p&gt;Heimdall, however, is &lt;strong&gt;old&lt;/strong&gt;. The version in the Debian Sid repository is 1.4.1, which &lt;a class="link" href="http://metadata.ftp-master.debian.org/changelogs/main/h/heimdall-flash/heimdall-flash_1.4.1-2_changelog" target="_blank" rel="noopener"
 &gt;dates back to 2015&lt;/a&gt;. And when we have old versions, we also have incompatibilites! Such as Heimdall 1.4.1&amp;rsquo;s &lt;a class="link" href="https://github.com/Benjamin-Dobell/Heimdall/issues/209" target="_blank" rel="noopener"
 &gt;incompatibility with newer versions of Samsung devices&lt;/a&gt; &amp;hellip; such as my precious SGS5.&lt;/p&gt;
&lt;p&gt;Happily, Heimdall is open source, so I was able to download and compile a new version that overcomes the problem. And that&amp;rsquo;s how I found myself staring at the screen and looking at this:&lt;/p&gt;
&lt;p&gt;&lt;img alt="Do I really need to install 55 packages to build this?" class="gallery-image" data-flex-basis="568px" data-flex-grow="236" height="595" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://www.ericlight.com/post/heimdall-nongui/yuck.png" srcset="https://www.ericlight.com/post/heimdall-nongui/yuck_hu_5d669859ae154774.png 800w, https://www.ericlight.com/post/heimdall-nongui/yuck.png 1409w" width="1409"&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;That is Yuck.bat&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I really didn&amp;rsquo;t want to install 55 packages just to build this. The majority of missing packages were required to build the GUI section of the tool, which I didn&amp;rsquo;t want to use anyway. What if I could &amp;hellip; &lt;em&gt;build Heimdall without building the GUI??&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;And of course, that&amp;rsquo;s the title of this article, so here&amp;rsquo;s how to do it!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;EDIT 2017-12-19: The stuff below is no longer necessary. For better instructions, have a look at my article about &lt;a class="link" href="https://www.ericlight.com/post/new_heimdall.html" &gt;flashing a Samsung G900I back to stock&lt;/a&gt;.&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Clone the git repository, with &lt;code&gt;git clone https://github.com/Benjamin-Dobell/Heimdall.git&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Edit the CMakeLists.txt file: &lt;code&gt;nano Heimdall/CMakeLists.txt&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Delete the last four lines of CMakeLists.txt:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; cmake_minimum_required(VERSION 2.8.4)

 set(CMAKE_MODULE_PATH
 ${CMAKE_SOURCE_DIR}/cmake
 ${CMAKE_MODULE_PATH})

 project(Heimdall)

 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

 option(DISABLE_FRONTEND &amp;quot;Disable GUI frontend&amp;quot; OFF)

 add_subdirectory(libpit)
 add_subdirectory(heimdall)
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You&amp;rsquo;re done! Go ahead and build according to the instructions.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;</description></item><item><title>When Encryption Attacks!</title><link>https://www.ericlight.com/post/broken_phone.html</link><pubDate>Tue, 12 Sep 2017 00:00:00 +1200</pubDate><guid>https://www.ericlight.com/post/broken_phone.html</guid><description>&lt;p&gt;So&amp;hellip; I wrecked my phone last night. :-(&lt;/p&gt;
&lt;p&gt;Android&amp;rsquo;s phone encryption feature has been around for aaaages, so I was confident when I started the encryption process last night. Unfortunately, something went wrong, and last night I discovered that everything was toast.&lt;/p&gt;
&lt;p&gt;After a bit of digging, I found someone else with &lt;a class="link" href="https://forum.xda-developers.com/galaxy-s4-sprint/help/phone-encrypted-access-twrp-t3587534" target="_blank" rel="noopener"
 &gt;&lt;strong&gt;exactly&lt;/strong&gt; the same problem&lt;/a&gt;!&lt;/p&gt;

 &lt;blockquote&gt;
 &lt;p&gt;&amp;ldquo;unable to boot into my phone as it sits at the boot screen. When I try to boot into TWRP, it asks for my password. [&amp;hellip;] it appears to decrypt the partition and mount, but then while loading, TWRP shows a continuous stream of:&lt;/p&gt;
&lt;p&gt;&lt;span style="color:red"&gt;E:Error parsing XML file&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;errors until it just restarts.&amp;rdquo;&lt;/p&gt;

 &lt;/blockquote&gt;
&lt;p&gt;Unfortunately, nobody responded to my own personal &lt;a class="link" href="https://xkcd.com/979/" target="_blank" rel="noopener"
 &gt;denvercoder9&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Long story short, I lost everything. But for a while, I thought my &lt;em&gt;entire phone&lt;/em&gt; was bricked. The phone wasn&amp;rsquo;t accessible in either Recovery mode (due to the XML parsing catastrophe) &lt;strong&gt;or&lt;/strong&gt; Download mode - it wasn&amp;rsquo;t accessible either via adb or via fastboot.&lt;/p&gt;
&lt;p&gt;Eventually my mate &lt;a class="link" href="https://keybase.io/rendition" target="_blank" rel="noopener"
 &gt;@rendition&lt;/a&gt; pointed out that I could just boot into Recovery, then cancel the decryption step and wipe my phone from there. That allowed me to start again from a clean slate.&lt;/p&gt;
&lt;p&gt;And I encrypted my phone right away, with no trouble at all!&lt;/p&gt;</description></item><item><title>Updating the modem and radio firmware on a Samsung Galaxy 5 (G900I)</title><link>https://www.ericlight.com/post/g900i-update.html</link><pubDate>Thu, 27 Oct 2016 00:00:00 +1300</pubDate><guid>https://www.ericlight.com/post/g900i-update.html</guid><description>&lt;p&gt;A couple months ago, &lt;a class="link" href="http://www.checkpoint.com" target="_blank" rel="noopener"
 &gt;Check Point&lt;/a&gt; revealed their discovery of the &lt;a class="link" href="http://blog.checkpoint.com/2016/08/07/quadrooter/" target="_blank" rel="noopener"
 &gt;Quadrooter vulnerability&lt;/a&gt; affecting the Qualcomm chipsets in oodles of Android phones.&lt;/p&gt;
&lt;p&gt;I use &amp;ndash;CyanogenMod&amp;ndash; &lt;a class="link" href="http://www.lineageos.org" target="_blank" rel="noopener"
 &gt;LineageOS&lt;/a&gt; on a Samsung Galaxy S5, so thankfully I &lt;a class="link" href="https://web.archive.org/web/20161223020015/http://www.cyanogenmod.org/blog/cm-13-0-release-znh5y" target="_blank" rel="noopener"
 &gt;received patches&lt;/a&gt; for three of the four vulnerabilities in only a few days.&lt;/p&gt;
&lt;p&gt;However, that last vulnerability was part of a proprietary binary blob for controlling the Qualcomm LTE chipset, only patchable by Samsung themselves. It took a while for the Samsung updates to roll out, and then I got distracted for a while, but I finally downloaded my firmware. The package I&amp;rsquo;ve used is &amp;ldquo;G900IDVU1CPH3&amp;rdquo;, which seems to be compatible at least with the three NZ-based carriers, as well as all the Australian carriers.&lt;/p&gt;
&lt;p&gt;There are a couple little issues with the firmware upgrade, easily fixed if you know how. I&amp;rsquo;m going to assume you know exactly how to do everything without help. I&amp;rsquo;m sure you&amp;rsquo;re pleased.&lt;/p&gt;
&lt;p&gt;In particular, the version of Heimdall in the Debian Sid repositories (1.4.1-2) doesn&amp;rsquo;t quite work with the SGS5. It appears &lt;a class="link" href="https://www.google.com/search?q=ERROR%3A&amp;#43;Failed&amp;#43;to&amp;#43;send&amp;#43;request&amp;#43;to&amp;#43;end&amp;#43;PIT&amp;#43;file&amp;#43;transfer%21&amp;#43;samsung" target="_blank" rel="noopener"
 &gt;other people&lt;/a&gt; have had similar problems.&lt;/p&gt;
&lt;p&gt;The beginning of fix for me came from &lt;a class="link" href="https://github.com/turboyz" target="_blank" rel="noopener"
 &gt;turboyz&lt;/a&gt; on Github, at the bottom of this post: (Edit 2020-04-12: GitHub Issue 348 from &lt;a class="link" href="https://github.com/Benjamin-Dobell/Heimdall/" target="_blank" rel="noopener"
 &gt;https://github.com/Benjamin-Dobell/Heimdall/&lt;/a&gt; has been deleted); however, he&amp;rsquo;s manually made a couple changes to BridgeManager.cpp, which appear to be no longer necessary. We can simply build it from source:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sudo apt-get install build-essential cmake zlib1g-dev libusb-1.0-0-dev git
git clone https://github.com/Benjamin-Dobell/Heimdall.git
cd Heimdall

# OPTIONAL: Remove the `if(NOT DISABLE_FRONTEND)` codeblock at the end of Heimdall/CMakeLists.txt
# I believe this just saves time compiling the GUI

mkdir build &amp;amp;&amp;amp; cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make
cd bin 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now you&amp;rsquo;ve got a nice new Heimdall installation, with the approproate updates to allow it to talk nicely to the new Samsung bootloader.&lt;/p&gt;
&lt;p&gt;I copied my new baseband files into the Heimdall/build/bin folder, just to get them all together. The last step is to flash your NON-HLOS.bin and modem.bin files:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;./heimdall flash --APNHLOS NON-HLOS.bin --MODEM modem.bin
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I happen to have an issue on my phone currently where, even though the modem and LTE drivers have both been successfully installed, and even thought the Quadrooter tester is no longer showing any vulnerabilities, my Baseband version on my phone is still shown as the old one. I haven&amp;rsquo;t been able to figure out why yet, but I don&amp;rsquo;t think I&amp;rsquo;ll worry about it for now. There have been reports that you should first do this with &amp;ndash;no-reboot, wait for the update to complete, then pull your battery, then when you power back on, immediately go &lt;em&gt;back&lt;/em&gt; into download mode and re-flash. Apparently this helps update the recognised Baseband version, but to be honest it didn&amp;rsquo;t help me.&lt;/p&gt;
&lt;p&gt;If you&amp;rsquo;re completely 100% lucky and absolutely nothing goes wrong, you win! You should now have the most recent Samsung modem and LTE chipset drivers available for your phone&amp;hellip; without having to roll back to the stock Samsung firmware.&lt;/p&gt;
&lt;p&gt;Incidentally, if you want to save gigabytes and time downloading said firmware, and if your phone is precisely a Samsung Galaxy S5 (G900I), and if you definitely want firmware G900IDVU1CPH3, I&amp;rsquo;ve extracted the important files (modem.bin and NON-HLOS.bin) and stored them here:&lt;/p&gt;
&lt;p&gt;&lt;a class="link" href="https://www.ericlight.com/files/G900IDVU1CPH3_modem_LTE.zip" target="_blank" rel="noopener"
 &gt;https://www.ericlight.com/files/G900IDVU1CPH3_modem_LTE.zip&lt;/a&gt;&lt;br&gt;
SHA256 hash = a2ab13063583f6e83a3c2d8b79521a59ba103dda30a24bddf9248dd5a25bff3c&lt;/p&gt;
&lt;p&gt;I promise I haven&amp;rsquo;t intentionally backdoored them, but I make no warranties of any sort. They might just be pictures of my foot.&lt;/p&gt;
&lt;p&gt;Good luck!&lt;/p&gt;</description></item></channel></rss>