<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Blog on Jhuan Reategui Solis</title><link>https://chijure.github.io/en/blog/</link><description>Recent content in Blog on Jhuan Reategui Solis</description><generator>Hugo</generator><language>en</language><atom:link href="https://chijure.github.io/en/blog/index.xml" rel="self" type="application/rss+xml"/><item><title>xray v1: an X-ray of an Android phone before porting</title><link>https://chijure.github.io/en/blog/xray-v1/</link><pubDate>Thu, 05 Nov 2026 00:00:00 -0500</pubDate><guid>https://chijure.github.io/en/blog/xray-v1/</guid><description>&lt;p&gt;I buy old phones to port CyanogenMod to them, and each one starts the same way: find out the SoC, the RAM, the kernel, how the partitions are laid out, what the &lt;code&gt;fstab&lt;/code&gt; mounts, and whether the flash is eMMC or NAND. I used to do it by hand with &lt;code&gt;adb shell&lt;/code&gt;, and every device answered differently. &lt;strong&gt;xray&lt;/strong&gt; does that first pass with one command. It is a Go tool, a single binary for Linux, Windows and macOS, under the MIT license. I tried it on 13 devices running Android 2.2 to 4.2.2.&lt;/p&gt;</description></item><item><title>Persistent TWRP on the LG Optimus F3 P659H: a new Loki target</title><link>https://chijure.github.io/en/blog/loki-lg-f3-p659h/</link><pubDate>Wed, 04 Nov 2026 00:00:00 -0500</pubDate><guid>https://chijure.github.io/en/blog/loki-lg-f3-p659h/</guid><description>&lt;p&gt;The &lt;strong&gt;LG Optimus F3 P659H&lt;/strong&gt; (&lt;code&gt;fx3sca&lt;/code&gt;, firmware &lt;code&gt;P659h10a&lt;/code&gt;) could boot a custom recovery temporarily, but would not accept one in its recovery partition. After writing TWRP directly and running &lt;code&gt;adb reboot recovery&lt;/code&gt;, the result was always &lt;strong&gt;“boot certification verify”&lt;/strong&gt;. LG&amp;rsquo;s &lt;a class="gloss" href="https://chijure.github.io/en/glossary/#bootloader" title="The first program that runs when the phone is switched on: it sets up the basics, loads the kernel and hands over to it."&gt;bootloader&lt;/a&gt; rejected the installed image before executing its &lt;a class="gloss" href="https://chijure.github.io/en/glossary/#kernel" title="The core of the operating system (Linux on Android): it manages hardware, memory and processes."&gt;kernel&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Kernel 3.4 for the LG L3 (E400): from a phone that rebooted itself to CM10.1 with GPS, sensors and camera</title><link>https://chijure.github.io/en/blog/kernel-34-lg-l3/</link><pubDate>Tue, 03 Nov 2026 00:00:00 -0500</pubDate><guid>https://chijure.github.io/en/blog/kernel-34-lg-l3/</guid><description>&lt;p&gt;The &lt;strong&gt;LG Optimus L3 (E400)&lt;/strong&gt; is a 2012 phone: a Qualcomm &lt;strong&gt;MSM7225A&lt;/strong&gt;, a 320x240 screen, 384 MB of RAM (about 299 MB for Android) and a 2.6.38 kernel from the factory. It already ran &lt;a class="gloss" href="https://chijure.github.io/en/glossary/#cm" title="Community ROM built from Android&amp;rsquo;s open source code, now discontinued (LineageOS continues it). CM7 is Android 2.3 and CM10 is Android 4.1/4.2."&gt;CyanogenMod&lt;/a&gt; 7 and 9. I wanted to move it to &lt;strong&gt;CM10.1 (Android 4.2.2)&lt;/strong&gt; on a &lt;strong&gt;3.4&lt;/strong&gt; &lt;a class="gloss" href="https://chijure.github.io/en/glossary/#kernel" title="The core of the operating system (Linux on Android): it manages hardware, memory and processes."&gt;kernel&lt;/a&gt;, like its siblings the L5 and L7. This post tells the path and the failures I had to take apart. It continues the &lt;a href="https://chijure.github.io/en/blog/reboot-at-612-seconds/"&gt;612-second reboot&lt;/a&gt;, which now has a different ending.&lt;/p&gt;</description></item><item><title>The LG G2 Mini doesn't use LK: unlocking a Tegra 4i with nvflash</title><link>https://chijure.github.io/en/blog/nvflash-lg-d625/</link><pubDate>Tue, 03 Nov 2026 00:00:00 -0500</pubDate><guid>https://chijure.github.io/en/blog/nvflash-lg-d625/</guid><description>&lt;p&gt;The &lt;a href="https://chijure.github.io/en/blog/mediatek-lk-patch/"&gt;L5 II, L4 II and L50&lt;/a&gt; share MediaTek&amp;rsquo;s &lt;a class="gloss" href="https://chijure.github.io/en/glossary/#lk" title="Bootloader used by MediaTek and Qualcomm on Android. It runs after the first-stage loader (on MediaTek, the preloader), brings up the display, draws the logo and loads the kernel."&gt;LK&lt;/a&gt; bootloader, so one piece of analysis worked, with adjustments, for all three. The &lt;strong&gt;LG G2 Mini (D625)&lt;/strong&gt; is a different family inside: an &lt;strong&gt;NVIDIA Tegra 4i&lt;/strong&gt;, with its own low-level recovery mode and its own flashing tool. Nothing learned from the LK carried over as-is.&lt;/p&gt;</description></item><item><title>adb over Wi-Fi, and why it drops right when you need it most</title><link>https://chijure.github.io/en/blog/adb-over-wifi/</link><pubDate>Mon, 02 Nov 2026 00:00:00 -0500</pubDate><guid>https://chijure.github.io/en/blog/adb-over-wifi/</guid><description>&lt;p&gt;When I test &lt;a class="gloss" href="https://chijure.github.io/en/glossary/#otg" title="On-The-Go: lets a phone act as a USB host to connect flash drives, mice and keyboards, using a special adapter."&gt;USB OTG&lt;/a&gt; in &lt;a class="gloss" href="https://chijure.github.io/en/glossary/#host-mode" title="The phone acts as the &amp;ldquo;PC&amp;rdquo;: it drives and powers whatever is connected (flash drive, mouse). The opposite is peripheral mode, the usual one when plugged into a PC."&gt;USB host mode&lt;/a&gt;, the phone&amp;rsquo;s USB port stops being useful for &lt;a class="gloss" href="https://chijure.github.io/en/glossary/#adb" title="Android Debug Bridge: a command-line tool to talk to a phone over USB or the network. It copies files, opens a shell and installs apps."&gt;ADB&lt;/a&gt;: it&amp;rsquo;s busy talking to the flash drive or mouse plugged into it. The fix is &lt;code&gt;adb&lt;/code&gt; over Wi-Fi:&lt;/p&gt;</description></item><item><title>QApp: testing a ROM without guessing</title><link>https://chijure.github.io/en/blog/qapp-testing-without-guessing/</link><pubDate>Mon, 02 Nov 2026 00:00:00 -0500</pubDate><guid>https://chijure.github.io/en/blog/qapp-testing-without-guessing/</guid><description>&lt;p&gt;Porting a ROM to an old phone comes with a problem that isn&amp;rsquo;t about software: when something fails, it isn&amp;rsquo;t always clear whether the ROM is at fault or the hardware itself, worn down by years of use. &lt;strong&gt;QApp&lt;/strong&gt; was born to take that doubt out of the equation.&lt;/p&gt;&#10;&lt;h2 id="the-origin-a-battery-that-couldnt-keep-up"&gt;The origin: a battery that couldn&amp;rsquo;t keep up&lt;/h2&gt;&#10;&lt;p&gt;The first version was written for the LG D625, while investigating a reboot that looked like a ROM bug. The battery test measures the idle voltage, puts the CPU and GPU under load for thirty seconds, and measures how far it drops. A healthy battery drops little and recovers fast; a worn one drops a lot and takes a while to come back. That measurement let me rule out the kernel as the cause and confirm the battery was the culprit, without opening the phone or buying a replacement to test.&lt;/p&gt;</description></item><item><title>Screenshotting Android 2.3 without screencap</title><link>https://chijure.github.io/en/blog/gingerbread-screen-capture/</link><pubDate>Mon, 02 Nov 2026 00:00:00 -0500</pubDate><guid>https://chijure.github.io/en/blog/gingerbread-screen-capture/</guid><description>&lt;p&gt;&lt;code&gt;adb shell screencap&lt;/code&gt; arrived in Android 4.0. On &lt;a class="gloss" href="https://chijure.github.io/en/glossary/#gingerbread" title="Android version 2.3, from 2010–2011. Its kernels and tools are old, which is why many modern solutions do not apply."&gt;Gingerbread (Android 2.3)&lt;/a&gt; (2.3) it doesn&amp;rsquo;t exist, so taking a screenshot of an old phone means reading the &lt;a class="gloss" href="https://chijure.github.io/en/glossary/#framebuffer" title="Region of video memory whose contents are shown on screen. The kernel exposes it as /dev/graphics/fb0."&gt;Framebuffer&lt;/a&gt; directly: &lt;code&gt;/dev/graphics/fb0&lt;/code&gt;.&lt;/p&gt;&#10;&lt;p&gt;The part that almost always trips you up isn&amp;rsquo;t the permission or the format, it&amp;rsquo;s the &lt;strong&gt;&lt;a class="gloss" href="https://chijure.github.io/en/glossary/#bpp" title="Colour depth of an image. 16 bpp uses 2 bytes per pixel (RGB565); 32 bpp uses 4 (8 bits per channel plus alpha)."&gt;bpp (bits per pixel)&lt;/a&gt; (stride)&lt;/strong&gt;: the real width, in pixels, of each row in memory, which almost never equals the screen&amp;rsquo;s visible width. On the LG C660, the screen is 240×320, but the real stride is &lt;strong&gt;256 pixels&lt;/strong&gt;, not 240. If you read the image assuming 240, every row comes out shifted, and the result looks like diagonal tearing, as if the video were out of sync.&lt;/p&gt;</description></item><item><title>The C660's battery: what you can measure without a fuel gauge</title><link>https://chijure.github.io/en/blog/battery-without-fuel-gauge/</link><pubDate>Mon, 02 Nov 2026 00:00:00 -0500</pubDate><guid>https://chijure.github.io/en/blog/battery-without-fuel-gauge/</guid><description>&lt;p&gt;When you suspect a worn battery, the right tool is a multimeter. What I had on hand was the LG C660 and &lt;a href="https://chijure.github.io/en/blog/qapp-testing-without-guessing/"&gt;QApp&lt;/a&gt;, so this is how far software alone can take you, and where it has to stop.&lt;/p&gt;&#10;&lt;h2 id="the-phone-has-no-hahahugoshortcode15s1hbhb-with-a-cell-meter"&gt;The phone has no &lt;a class="gloss" href="https://chijure.github.io/en/glossary/#pmic" title="Power management chip: regulators, battery charging, the power button."&gt;PMIC&lt;/a&gt; with a cell meter&lt;/h2&gt;&#10;&lt;p&gt;The C660 ships with no dedicated battery-metering chip (neither &lt;code&gt;bq27x00&lt;/code&gt; nor &lt;code&gt;max17040&lt;/code&gt;; both are off in the kernel). Everything Android sees — voltage, capacity, temperature — arrives through a remote call to the modem (&lt;code&gt;msm_battery&lt;/code&gt; over RPC), which itself filters the ADC signal. The practical consequence: voltage moves in &lt;strong&gt;steps of about 17 mV&lt;/strong&gt;, not a continuous curve, and that has to be accounted for when reading any number.&lt;/p&gt;</description></item><item><title>USB OTG on the LG C660: what I measured and why it does not work</title><link>https://chijure.github.io/en/blog/usb-otg-c660/</link><pubDate>Mon, 02 Nov 2026 00:00:00 -0500</pubDate><guid>https://chijure.github.io/en/blog/usb-otg-c660/</guid><description>&lt;p&gt;On the LG L3 (E400), &lt;a class="gloss" href="https://chijure.github.io/en/glossary/#host-mode" title="The phone acts as the &amp;ldquo;PC&amp;rdquo;: it drives and powers whatever is connected (flash drive, mouse). The opposite is peripheral mode, the usual one when plugged into a PC."&gt;USB host&lt;/a&gt; mode worked with a powered &lt;a class="gloss" href="https://chijure.github.io/en/glossary/#otg" title="On-The-Go: lets a phone act as a USB host to connect flash drives, mice and keyboards, using a special adapter."&gt;OTG&lt;/a&gt; adapter, so I tried the same on the &lt;strong&gt;LG Optimus Pro C660&lt;/strong&gt;. It does not work, and this is what I measured to be sure.&lt;/p&gt;</description></item><item><title>What doesn't exist in the Android 2.3 shell (and what does, against what I believed)</title><link>https://chijure.github.io/en/blog/what-gingerbread-lacks/</link><pubDate>Mon, 02 Nov 2026 00:00:00 -0500</pubDate><guid>https://chijure.github.io/en/blog/what-gingerbread-lacks/</guid><description>&lt;p&gt;Debugging a &lt;a class="gloss" href="https://chijure.github.io/en/glossary/#gingerbread" title="Android version 2.3, from 2010–2011. Its kernels and tools are old, which is why many modern solutions do not apply."&gt;Gingerbread (Android 2.3)&lt;/a&gt; (Android 2.3) phone over &lt;code&gt;adb shell&lt;/code&gt; has traps that don&amp;rsquo;t exist on newer versions, and it&amp;rsquo;s worth knowing them before writing a script that hangs halfway through a test.&lt;/p&gt;&#10;&lt;h2 id="what-really-doesnt-exist"&gt;What really doesn&amp;rsquo;t exist&lt;/h2&gt;&#10;&lt;p&gt;Confirmed on an LG C660 running CM7:&lt;/p&gt;&#10;&lt;pre tabindex="0"&gt;&lt;code&gt;$ input tap 10 10&#10;Error: Unknown command: tap&#10;&#10;$ input swipe 10 10 20 20&#10;Error: Unknown command: swipe&#10;&#10;$ am force-stop com.example&#10;Error: Unknown command: force-stop&#10;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;code&gt;input&lt;/code&gt; on this version only accepts &lt;code&gt;text&lt;/code&gt; and &lt;code&gt;keyevent&lt;/code&gt;; to simulate a touch you have to use &lt;code&gt;sendevent&lt;/code&gt; directly on the input device, or a &lt;code&gt;keyevent&lt;/code&gt; if the element already has focus. To force-close an app without &lt;code&gt;force-stop&lt;/code&gt;, the alternative is killing the process by &lt;code&gt;pid&lt;/code&gt; (&lt;code&gt;ps&lt;/code&gt; + &lt;code&gt;kill&lt;/code&gt;), or &lt;code&gt;am kill&lt;/code&gt;, which is gentler and doesn&amp;rsquo;t always free the memory.&lt;/p&gt;</description></item><item><title>USB OTG on the LG L3 (E400): host mode with a software switch</title><link>https://chijure.github.io/en/blog/usb-otg-e400/</link><pubDate>Sun, 01 Nov 2026 00:00:00 -0500</pubDate><guid>https://chijure.github.io/en/blog/usb-otg-e400/</guid><description>&lt;p&gt;On the &lt;strong&gt;LG Optimus L3 (E400)&lt;/strong&gt; running &lt;a class="gloss" href="https://chijure.github.io/en/glossary/#cm" title="Community ROM built from Android&amp;rsquo;s open source code, now discontinued (LineageOS continues it). CM7 is Android 2.3 and CM10 is Android 4.1/4.2."&gt;CyanogenMod&lt;/a&gt; 7, a flash drive plugged in through &lt;a class="gloss" href="https://chijure.github.io/en/glossary/#otg" title="On-The-Go: lets a phone act as a USB host to connect flash drives, mice and keyboards, using a special adapter."&gt;USB OTG&lt;/a&gt; works: it mounts by itself and can be read from the phone. This is what it took, compared with the &lt;a href="https://chijure.github.io/en/blog/usb-otg-c660/"&gt;C660&lt;/a&gt;, where there was no way.&lt;/p&gt;</description></item><item><title>A reboot at exactly 612 seconds</title><link>https://chijure.github.io/en/blog/reboot-at-612-seconds/</link><pubDate>Sat, 31 Oct 2026 00:00:00 -0500</pubDate><guid>https://chijure.github.io/en/blog/reboot-at-612-seconds/</guid><description>&lt;blockquote&gt;&#10;&lt;p&gt;&lt;strong&gt;Update, 3 November 2026:&lt;/strong&gt; this reboot stopped happening after restoring the phone&amp;rsquo;s full factory firmware (modem and NV included), with the same 3.4 kernel. So the conclusion below, &amp;ldquo;it is not the modem&amp;rdquo;, was too strong. I tell the story in &lt;a href="https://chijure.github.io/en/blog/kernel-34-lg-l3/"&gt;Kernel 3.4 for the LG L3&lt;/a&gt;.&lt;/p&gt;&#10;&lt;/blockquote&gt;&#10;&lt;p&gt;Porting &lt;a class="gloss" href="https://chijure.github.io/en/glossary/#cm" title="Community ROM built from Android&amp;rsquo;s open source code, now discontinued (LineageOS continues it). CM7 is Android 2.3 and CM10 is Android 4.1/4.2."&gt;CyanogenMod (CM)&lt;/a&gt; 10.1 to the &lt;strong&gt;LG Optimus L3 (E400)&lt;/strong&gt; with a 3.4 &lt;a class="gloss" href="https://chijure.github.io/en/glossary/#kernel" title="The core of the operating system (Linux on Android): it manages hardware, memory and processes."&gt;Kernel&lt;/a&gt; (instead of the 2.6.38 that already worked) brought a failure I had not seen before: the phone reboots on its own, with no &lt;a class="gloss" href="https://chijure.github.io/en/glossary/#panic" title="Unrecoverable kernel error: the kernel stops and the device reboots. Its message is kept in last_kmsg."&gt;Kernel panic&lt;/a&gt; and no oops in the log, almost always between &lt;strong&gt;609 and 616 seconds&lt;/strong&gt; of uptime. It happens even at full idle, with the screen off. After the reboot, the bootloader comes up in charging mode.&lt;/p&gt;</description></item><item><title>A 3.4.5 kernel for the Huawei Y220-U05: 26 commits from a donor tree to a stable Gingerbread</title><link>https://chijure.github.io/en/blog/y220-kernel/</link><pubDate>Fri, 23 Oct 2026 00:00:00 -0500</pubDate><guid>https://chijure.github.io/en/blog/y220-kernel/</guid><description>&lt;p&gt;This is the second of two articles about the &lt;a class="gloss" href="https://chijure.github.io/en/glossary/#kernel" title="The core of the operating system (Linux on Android): it manages hardware, memory and processes."&gt;kernel&lt;/a&gt; of the &lt;strong&gt;Huawei Ascend Y220-U05&lt;/strong&gt; (MediaTek &lt;strong&gt;&lt;a class="gloss" href="https://chijure.github.io/en/glossary/#mt6572" title="Dual-core Cortex-A7 MediaTek processor used in low-end phones such as the Huawei Y220."&gt;MT6572&lt;/a&gt;&lt;/strong&gt;, Android 2.3.6 &lt;a class="gloss" href="https://chijure.github.io/en/glossary/#stock" title="The factory firmware: the one the phone ships with. It is the reference for comparing the behaviour of your own ROM."&gt;stock&lt;/a&gt;). In the &lt;a href="https://chijure.github.io/en/blog/y220-twrp-first/"&gt;first&lt;/a&gt; I tell how I tested it in &lt;a class="gloss" href="https://chijure.github.io/en/glossary/#twrp" title="Team Win Recovery Project: a touch-driven recovery that installs zips, makes backups and restores partitions."&gt;TWRP&lt;/a&gt; so as not to risk the system. Here are the fixes.&lt;/p&gt;</description></item><item><title>Platform patches or device tree: why I choose HALs and shims</title><link>https://chijure.github.io/en/blog/hals-and-shims/</link><pubDate>Thu, 22 Oct 2026 00:00:00 -0500</pubDate><guid>https://chijure.github.io/en/blog/hals-and-shims/</guid><description>&lt;p&gt;If you look at the device trees I have published, you will find the same sentence repeated: &lt;em&gt;&amp;ldquo;all through a &lt;a class="gloss" href="https://chijure.github.io/en/glossary/#device-tree" title="In the ROM world, the folder holding one model&amp;rsquo;s configuration: partitions, init.rc, boot files. It is not the kernel&amp;rsquo;s binary device tree (DTB)."&gt;Device tree&lt;/a&gt; HAL, like on the Y220&amp;rdquo;&lt;/em&gt;. It is not an abstract rule, it is a decision I make on every port, and one I have paid to undo when I did not follow it. This is what it means and why I prefer it.&lt;/p&gt;</description></item><item><title>One patch, three phones: MediaTek's LK bootloader</title><link>https://chijure.github.io/en/blog/mediatek-lk-patch/</link><pubDate>Sat, 17 Oct 2026 00:00:00 -0500</pubDate><guid>https://chijure.github.io/en/blog/mediatek-lk-patch/</guid><description>&lt;p&gt;The &lt;a href="https://github.com/chijure-android-system-development/lg-d625-tegra-bootloader-patch"&gt;LG D625&lt;/a&gt; (Tegra 4i) needed its own unlock path, with &lt;code&gt;nvflash&lt;/code&gt;. A different group of older LG phones — the &lt;strong&gt;L5 II (E450g)&lt;/strong&gt;, the &lt;strong&gt;L4 II (E440g)&lt;/strong&gt; and the &lt;strong&gt;L50 (D213)&lt;/strong&gt; — share something that sets them apart: the same MediaTek &lt;strong&gt;LK&lt;/strong&gt; bootloader, on the same chip family (MT6575 and MT6572). That coincidence is what let one piece of analysis work, with adjustments, for all three.&lt;/p&gt;&#10;&lt;h2 id="the-problem-it-solves"&gt;The problem it solves&lt;/h2&gt;&#10;&lt;p&gt;A custom recovery like TWRP or CWM isn&amp;rsquo;t signed by LG. The LK, before booting any image from the &lt;code&gt;boot&lt;/code&gt; or &lt;code&gt;recovery&lt;/code&gt; partition, checks that signature, and if it doesn&amp;rsquo;t match, it halts with a &amp;ldquo;Security Error&amp;rdquo; and boots nothing. Without disabling that check, there&amp;rsquo;s no way to install your own recovery, short of paying for an unlock tool every time it&amp;rsquo;s needed.&lt;/p&gt;</description></item><item><title>Testing the Huawei Y220-U05 kernel without risking the ROM: TWRP first</title><link>https://chijure.github.io/en/blog/y220-twrp-first/</link><pubDate>Mon, 12 Oct 2026 00:00:00 -0500</pubDate><guid>https://chijure.github.io/en/blog/y220-twrp-first/</guid><description>&lt;p&gt;The &lt;strong&gt;Huawei Ascend Y220-U05&lt;/strong&gt; uses a MediaTek &lt;strong&gt;&lt;a class="gloss" href="https://chijure.github.io/en/glossary/#mt6572" title="Dual-core Cortex-A7 MediaTek processor used in low-end phones such as the Huawei Y220."&gt;MT6572&lt;/a&gt;&lt;/strong&gt; and ships with Android 2.3.6 (build &lt;code&gt;C482B206SP05&lt;/code&gt;). For the &lt;a class="gloss" href="https://chijure.github.io/en/glossary/#cm" title="Community ROM built from Android&amp;rsquo;s open source code, now discontinued (LineageOS continues it). CM7 is Android 2.3 and CM10 is Android 4.1/4.2."&gt;CyanogenMod&lt;/a&gt; port I needed my own &lt;a class="gloss" href="https://chijure.github.io/en/glossary/#kernel" title="The core of the operating system (Linux on Android): it manages hardware, memory and processes."&gt;kernel&lt;/a&gt;, and the starting point was a &lt;strong&gt;donor&lt;/strong&gt; tree from Longcheer for Jelly Bean (&lt;code&gt;lcsh72_we_jb3&lt;/code&gt;): a Linux 3.4.5 with MediaTek support (its history shows it imported from a Lenovo project in 2014).&lt;/p&gt;</description></item></channel></rss>