<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ravindu Deshan on Medium]]></title>
        <description><![CDATA[Stories by Ravindu Deshan on Medium]]></description>
        <link>https://medium.com/@ravindu644?source=rss-ba8ee2c61c85------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*sO_LYoT0zst3Y3CJ1Om7Tg.jpeg</url>
            <title>Stories by Ravindu Deshan on Medium</title>
            <link>https://medium.com/@ravindu644?source=rss-ba8ee2c61c85------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 11:53:58 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ravindu644/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Trying to root an Android device without needing the stock firmware by dumping the boot.img]]></title>
            <link>https://ravindu644.medium.com/trying-to-root-an-android-device-without-needing-the-stock-firmware-by-dumping-the-boot-img-b5fde350059b?source=rss-ba8ee2c61c85------2</link>
            <guid isPermaLink="false">https://medium.com/p/b5fde350059b</guid>
            <category><![CDATA[magisk]]></category>
            <category><![CDATA[firmware]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[apatch]]></category>
            <category><![CDATA[roots]]></category>
            <dc:creator><![CDATA[Ravindu Deshan]]></dc:creator>
            <pubDate>Wed, 05 Mar 2025 17:00:15 GMT</pubDate>
            <atom:updated>2025-03-08T17:10:32.357Z</atom:updated>
            <content:encoded><![CDATA[<h3>Trying to root an Android device without needing the stock firmware by dumping the boot.img and injecting it via Magisk/APatch</h3><p><strong>In modern Android rooting, </strong>people like us usually use <a href="https://github.com/topjohnwu/Magisk">Magisk</a>, <a href="https://github.com/tiann/KernelSU">KernelSU</a>, or <a href="https://github.com/bmax121/APatch">APatch</a> to gain root access on our phones :)</p><blockquote><strong>But the problem is, we must </strong>have access to our device’s stock firmware(ROM) from the OEM to get those requirements which we need to root our phone with above mentioned rooting solutions.</blockquote><ul><li>But <strong>what if </strong>our manufacturer doesn’t provide a stock ROM?</li><li>What if the manufacturer doesn’t even exist?</li><li><strong>How do we root those sketchy unbranded phones we find on AliExpress?</strong></li></ul><p><strong>This article explains everything 🗿</strong></p><h4><strong>Phase 1: Explaining the requirements we need to root our phones with </strong><a href="https://github.com/topjohnwu/Magisk">Magisk</a>, <a href="https://github.com/tiann/KernelSU">KernelSU</a>, and <a href="https://github.com/bmax121/APatch">APatch</a></h4><ol><li><strong>Magisk: </strong>To root your device with Magisk, <strong>we basically need the boot.img from the stock firmware</strong> provided by your OEM (Samsung, Xiaomi, etc) -&gt; <strong>Magisk </strong>injects itself into the <strong>ramdisk </strong>located inside the boot image to gain root access while the device is booting.</li><li><strong>KernelSU:</strong> Here, we actually need more than the stock firmware. <strong>We need the Linux kernel source code of your device</strong> to integrate the KernelSU driver into it and compile it, which requires additional skills. <strong>Not all manufacturers provide their kernel source</strong> (Kernel source code is only needed for older devices that do not have GKI kernels). <strong>If your device’s kernel is GKI,</strong> we can either download a proper KernelSU release from their GitHub releases or patch the <strong>init_boot.img</strong> with the KernelSU manager and install the patched/relevant files.</li><li><strong>APatch:</strong> In APatch, like Magisk, <strong>we only need the boot.img from the stock firmware</strong> provided by your OEM -&gt; <strong>APatch </strong>injects itself into the <strong>kernel </strong>located inside the boot image to gain root access while the device is booting.</li></ol><h4>Phase 2: The Solution ?</h4><p><strong>This solution is based on a simple logic </strong>🧠</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/1*xLbV8AdesOx-En0yeDLfKw.gif" /></figure><ol><li>Accessing a temporary root shell <strong><em>somehow</em></strong>.</li><li>Dumping VBMETA &amp; BOOT images.</li><li>Patching BOOT image with Magisk/APatch &amp; disabling verification from the VBMETA image if needed.</li><li>Flashing the Patched image(s).</li><li>Done.</li></ol><p><strong>Quick edit (2025–03–08):</strong></p><pre>This guide mainly targets Qualcomm devices that do not have a stock ROM/firmware.  <br><br>If you have an MTK phone, it is also possible to use MTKClient to dump the stock ROM on most MediaTek devices (especially those AliExpress ones) and patch it with Magisk/APatch.  <br><br><strong>That&#39;s how my friend rooted his Chinese AliExpress tablet. </strong> <br><br>You can check out this very useful guide on XDA:  <br>[GUIDE][MTK] How to use MTKClient and set it up – XDA Forums  <br>https://xdaforums.com/t/guide-mtk-how-to-use-mtkclient-and-set-it-up.4509245/  <br><br>Shared by: @qrads (telegram)</pre><h4>Phase 3: The Method 😉</h4><ul><li><strong>Starting from phones shipped with Android 10,</strong> Android uses a partition structure called “<a href="https://source.android.com/docs/core/ota/dynamic_partitions"><strong>Dynamic Partitions</strong></a>”</li><li>With Dynamic Partitions, system updates became much easier.</li><li>Alongside Dynamic Partitions, there’s a feature built into the Android OS called “<strong>Dynamic System Updates</strong>” (DSU)</li><li><strong>With the help of DSU,</strong> we can boot a live system <strong>without even touching the phone’s internal partitions.</strong></li><li><strong>That means we can boot a live Android system with ADB root built-in, providing a root shell via ADB :)</strong></li><li>The live systems we are going to boot are called “GSIs” (Generic System Images).</li><li><strong>Theoretically,</strong> these images should boot on any Android device that meets the following requirements :)</li></ul><h4>Phase 4: Requirements for “The Method”</h4><ol><li><strong>Your phone must have shipped with Android 10 or later</strong> - Otherwise, this method won’t work for you due to the absence of Dynamic Partitions :(</li><li><strong>Your phone must have an unlockable bootloader</strong> - Without unlocking the bootloader, neither booting a DSU nor rooting will work :(</li><li><strong>A working GSI image compatible with your phone’s CPU architecture.</strong></li><li>A Wi-Fi connection for setting up <a href="https://github.com/RikkaApps/Shizuku"><strong>Shizuku</strong></a>.</li><li>A USB cable and knowledge of flashing images through fastbootd or ODIN mode (for Samsung).</li></ol><h4>Phase 5: Fulfilling the Requirements</h4><p><strong>01. First of all, we have to unlock the bootloader of our phone.</strong></p><ul><li>You can search the internet or get help from an AI like <strong><em>ChatGPT </em></strong>for the steps to unlock the bootloader.</li><li><strong>For non-Samsung devices,</strong> the <strong>generic </strong>steps are: <br>- Enable “OEM unlocking” in Developer Options. <br>- Boot into Fastboot mode. <br>- Execute <strong><em>fastboot oem unlock</em></strong> or <strong><em>fastboot flashing unlock</em></strong> to unlock the bootloader.</li><li><strong>For Samsung devices,</strong> <a href="https://github.com/ravindu644/Scamsung/wiki/How-to-root-your-Samsung-device-with-help-of-my-Script%3F-%5B-NO-TWRP-!-%5D#bootloader-unlocking-process---new-devices">you can refer this guide</a>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UhtqFh9hzwna0C0H4FmjoQ.jpeg" /><figcaption>Successfully Unlocked the Bootloader</figcaption></figure><p><strong>02. Secondly, we need to determine which live Android system, or in other words, which “GSI” variant, we must choose to boot on our device.</strong></p><ul><li>To do that, install the <strong>“Treble Info” </strong>app from <a href="https://f-droid.org/en/packages/tk.hack5.treblecheck/">here</a>.</li><li><strong>Once installed,</strong> open “Treble Info” to determine which type of GSI we are going to use for this experiment xD</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*azT8CETx71lrFunwIF4Spg.jpeg" /><figcaption>Required image</figcaption></figure><ul><li><strong>In my case,</strong> the target GSI name should be something like <em>“name-of-the-gsi-</em><strong><em>arm64-ab</em></strong><em>.img.xz”</em></li></ul><p><strong>❗️ Additional note for users with an ARM32 CPU architecture, but a 64-bit binder architecture mentioned on the “Details” page of the “Treble Info” app :</strong></p><ul><li><em>name-of-the-gsi-</em><strong><em>arm32_binder64</em></strong><em>-ab-vanilla.img.xz</em> and <em>name-of-the-gsi-</em><strong><em>a64</em></strong><em>_bvS.img.gz</em> are the same.</li><li>That means<strong> arm32_binder64 = a64</strong>, it’s just the same thing with different names 😌</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*h4Dj5RK1tQwNab-GoE3JyQ.png" /><figcaption>a phone with <strong>arm32_binder64/a64</strong></figcaption></figure><p><strong>03. Once you’ve figured out the correct name format for the GSI you’re going to use, we can finally download our live system/GSI, which will help us dump the partitions from our phone :)</strong></p><ul><li><strong>I recommend using </strong><a href="https://github.com/TrebleDroid/treble_experimentations"><strong>treble_experimentation’s</strong></a><strong> GSIs, as they are bootable on almost any device.</strong></li><li><a href="https://github.com/TrebleDroid/treble_experimentations/releases/latest">You can download them from here</a>.</li><li>So, I’m downloading the <strong><em>system-td-arm64-ab-vanilla.img.xz</em></strong> image, which is the suitable GSI for my device’s configurations.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E7VA4UBJq0pGdHUA9_kM5A.png" /><figcaption>Downloading</figcaption></figure><ul><li><strong>Now, copy the downloaded .xz file to your PC and extract the .img file from it using WinRAR or 7zip :)</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H4iAOdMjwCSTrNcvYjagWA.png" /><figcaption>extracting the xz file</figcaption></figure><ul><li><strong>Now, copy the .img file back to your phone’s internal storage.</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/666/1*26eZAd6g_FnC4S-GH1yTXw.png" /></figure><h4>Phase 6: Prepare the GSI Image to Boot via Dynamic System Updates (DSU)!</h4><ul><li><strong>To boot our GSI .img file,</strong> there’s an open-source tool called <strong><em>“</em></strong><a href="https://github.com/VegaBobo/DSU-Sideloader"><strong><em>DSU Sideloader</em></strong></a><strong><em>” </em></strong>🙊</li><li><strong>To use DSU Sideloader,</strong> we need to configure <a href="https://github.com/RikkaApps/Shizuku"><strong>Shizuku</strong></a><strong> </strong>on our system.</li><li><strong>To configure Shizuku, </strong>download it, install it, open it and <strong>connect to a Wi-Fi network</strong>, <strong>turn on Wireless Debugging</strong>, and <a href="https://shizuku.rikka.app/guide/setup/#start-via-wireless-debugging"><strong><em>follow the steps provided there</em></strong></a><strong><em>.</em></strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VJHF-BngQtJDrCmb6_6kdQ.jpeg" /><figcaption>Shizuku with Wireless debugigng</figcaption></figure><p><strong>Now, download, install, and open the “</strong><a href="https://github.com/VegaBobo/DSU-Sideloader"><strong>DSU Sideloader</strong></a><strong>” app, then grant it the “Shizuku Permission” when prompted.</strong></p><ul><li><strong>In DSU Sideloader,</strong> select the image to be installed, set the userdata size to at least 2GB, and <strong>tap the blue “Install” button.</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l-qVicnr4YXnMDd_g3PBHQ.jpeg" /><figcaption>DSU Sideloader configuration</figcaption></figure><ul><li><strong>Once you’ve pressed “Install”, a pop-up called “Proceed Installation” will appear. Just press the “Proceed” button :)</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GvEWTYoaFL1aUmUIy6Zq0Q.jpeg" /><figcaption>Proceed?</figcaption></figure><ul><li><strong>Once you’ve pressed “Proceed,” it will prepare the GSI image for installation.</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZEYEOZK6HP-F68H8asKpVw.jpeg" /><figcaption>Preparing the image</figcaption></figure><ul><li><strong>Once the image is prepared, a pop-up should appear like this. Simply tap “Allow one-time access”.</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mKC_JcM1MkrtXN-z4RfYBA.jpeg" /><figcaption>Prepared :)</figcaption></figure><ul><li><strong>Once you allow it, the system will start processing the GSI image that is going to be installed (temporarily).</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P2wv8-xYeNMxXalixohMyQ.jpeg" /><figcaption>Processing the system(1)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z9C05ZV8Hntw1dmF75tc8Q.jpeg" /><figcaption>Processing the system(2)</figcaption></figure><h4>If everything went smoothly, you should see a notification like this saying, “Your GSI is ready to boot, sir.” xD</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dVD2Ot4icWk7IhfeCz09CA.jpeg" /><figcaption>BE READY..!</figcaption></figure><h4>Phase 7: Booting the GSI Image via Dynamic System Updates (DSU)!</h4><ul><li><strong>Once you press the “Restart” button on that notification, our new GSI should boot like this! (Remember, this is like a live Android environment)</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g9PSXMzXz23kkTFbO40vQg.jpeg" /><figcaption>Booting our live GSI !</figcaption></figure><ul><li><strong>Once it has booted, the interface should look like this :)</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CWMBwVC2kVVTGpYDH64x6g.jpeg" /><figcaption>Booted GSI</figcaption></figure><h4>Phase 8: Dumping the Required Partitions for Root..!</h4><ul><li><strong>First, enable the Developer Options on our newly booted GSI, and enable USB debugging through it like this:</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F-JnyYh5gE1q2lhOZIcvwA.png" /><figcaption>enabled USB Debugging</figcaption></figure><ul><li><strong>Now, connect the phone via USB cable to your PC and access the ADB root shell using these commands:</strong></li></ul><pre>adb devices<br>adb root<br>adb shell</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4oWLrDJ5fss0Lsok4zYXmw.png" /><figcaption>Successfully Accessed the root shell !</figcaption></figure><p><strong>As you can see, we are “root” 🗿</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/474/1*Bd1a1ntzXEddxBpiCYQqgA.png" /><figcaption>whoami ?</figcaption></figure><p><strong>Now, all we have to do is dump the required partitions as .img files, which are needed to be patched to gain permanent root access via Magisk or APatch 🧠</strong></p><ul><li><strong>To dump a partition</strong> and <strong>save it as a .img file inside your internal storage</strong>, simply use this command template:</li></ul><pre>dd if=/dev/block/by-name/partition_name of=/sdcard/partition_name.img</pre><ul><li><strong>In our case, we are going to dump the boot, vbmeta, and init_boot partitions to root our phone.</strong></li></ul><p><strong>Note: </strong>init_boot is not required, but I dumped it because this is a GKI device, and I can patch the init_boot to root with KernelSU too..!</p><p><strong>So, the required commands should look like this:</strong></p><pre>#to dump boot<br>dd if=/dev/block/by-name/boot of=/sdcard/boot.img<br><br>#to dump vbmeta<br>dd if=/dev/block/by-name/vbmeta of=/sdcard/vbmeta.img<br><br>#to dump init_boot<br>dd if=/dev/block/by-name/init_boot of=/sdcard/init_boot.img</pre><p><strong>Screenshot:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0peW3zq7-OF2kyGXpLPWbA.png" /><figcaption>Dumping images…</figcaption></figure><h4>Phase 9: Copying the Dumped Images to Our PC</h4><ul><li>This is the easiest process.</li><li><strong>Just allow “USB File Sharing” via the notification and copy the images to your PC 🥱</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X3qZvrGBGM4cgI5G5ckryw.png" /><figcaption>copying the dumped images</figcaption></figure><h4>Phase 10: Booting back to our original OS and rooting the phone.</h4><ul><li><strong>Since we did our job with the live system, all we have to do is go back to our original system, patch those dumped images, and root our phone🗿</strong></li><li><strong>To go back to the original system, just press the “RESTART” button on this notification.</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y_DXDrDLqJzoizS84evmlw.png" /><figcaption>Restart to use the original Android version</figcaption></figure><ul><li><strong>Once booted into the original Android version, copy the dumped images to the internal storage of your original Android system.</strong></li><li><strong>Now, use Magisk/APatch to patch the dumped boot.img and inject them to gain root access:</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xeKEGMY0YnDBG9Wb1mikXw.jpeg" /><figcaption>Patch with APatch</figcaption></figure><ul><li><strong>Once patched,</strong> copy the patched image to your PC.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m-r_ceLskI_u8g2ThmstHg.png" /><figcaption>copying the patched image to PC.</figcaption></figure><ul><li><strong>Now, reboot your phone into ODIN/fastbootd mode to flash the patched image 😎</strong></li></ul><p><strong>Command required to flash the patched image for non-Samsung phones:</strong></p><pre>#flashing the patched image<br>fastboot flash boot xxxx_patched_xxxx.img<br><br>#rebooting the system<br>fastboot reboot</pre><p><strong>Procedure required to flash the patched image for Samsung phones:</strong></p><ol><li>Rename the <strong><em>“xxxx_patched_xxxx.img”</em></strong> to <strong><em>“boot.img”</em></strong>.</li><li>Make a tar file using that renamed boot.img using <strong>7zip</strong>.</li><li>Flash that tar file using <strong>ODIN</strong>..!</li></ol><h3>- Important -</h3><ul><li><strong>If the system bootlooped and prompted you to perform a factory reset, just do it :)</strong></li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F00ueb6Wvc80%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fshorts%2F00ueb6Wvc80&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F00ueb6Wvc80%2Fhq2.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/f63b3e8459e8ebc8011459dda9c430c9/href">https://medium.com/media/f63b3e8459e8ebc8011459dda9c430c9/href</a></iframe><h3>- The Result -</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eecmEPA3dNBakJP7-1mdFg.jpeg" /><figcaption>Working😋</figcaption></figure><h4>🐧 Enjoy…!</h4><p><strong>Written by: </strong><a href="https://github.com/ravindu644">ravindu644</a></p><p><strong>For more tips, </strong><a href="https://t.me/SamsungTweaks"><strong>join my Telegram channel..!</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b5fde350059b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Edited the Android vendor_boot.img to Remove AVB and Add Ext4 Support]]></title>
            <link>https://ravindu644.medium.com/how-i-edited-the-android-vendor-boot-img-to-remove-avb-and-add-ext4-support-ae16ef98ef46?source=rss-ba8ee2c61c85------2</link>
            <guid isPermaLink="false">https://medium.com/p/ae16ef98ef46</guid>
            <category><![CDATA[magisk]]></category>
            <category><![CDATA[vendor-boot]]></category>
            <category><![CDATA[roots]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[ext4]]></category>
            <dc:creator><![CDATA[Ravindu Deshan]]></dc:creator>
            <pubDate>Wed, 29 Jan 2025 06:30:52 GMT</pubDate>
            <atom:updated>2025-01-29T06:46:21.126Z</atom:updated>
            <content:encoded><![CDATA[<pre>In this guide, you&#39;ll learn how to:  <br>  - Unpack and repack Android vendor_boot images.  <br>  - Completely disable AVB.<br>  - Add ext4 mount points for all system partitions.</pre><p>I’ve been using <a href="https://github.com/SebaUbuntu/AIK-Linux-mirror">AIK-Linux</a> for a long time <strong>to unpack and repack boot images to replace the kernel and editing the boot ramdisk inside.</strong></p><p><strong>But, When I used it to unpack the vendor_boot image and repack it, it succeeded,</strong> but my device did not accept the image created via AIK. As a result, <strong>my device became unbootable.</strong></p><p><strong>So, after doing some research on GitHub, I accidentally found a cool repository that does exactly what I wanted :)</strong></p><blockquote>Repository: <a href="https://github.com/cfig/Android_boot_image_editor">https://github.com/cfig/Android_boot_image_editor</a></blockquote><h4>Phase 1: Setting up Android_boot_image_editor</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Puw6edhsBMWqWFep8SDeOA.png" /><figcaption>Android boot image editor</figcaption></figure><ol><li>Download the <strong><em>“boot_editor_vxx_xx.zip”</em></strong> from its <a href="https://github.com/cfig/Android_boot_image_editor/releases/latest/">releases</a> and extract it somewhere.</li><li><a href="https://github.com/cfig/Android_boot_image_editor#requirements">As mentioned</a> in the <strong>official documentation of Android_boot_image_editor,</strong> install the required dependencies using the following command:</li></ol><pre>sudo apt install git device-tree-compiler lz4 xz-utils zlib1g-dev openjdk-17-jdk gcc g++ python3 python-is-python3 p7zip-full android-sdk-libsparse-utils erofs-utils</pre><h4><strong>Phase 2: Unpacking the “<em>vendor_boot.img”</em></strong></h4><p><strong>01. Place your vendor_boot </strong>inside the boot_editor folder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HiCc02Mf1zjIdzO-jP57gQ.png" /><figcaption>placed vendor_boot.img.lz4</figcaption></figure><ul><li>Since I got the vendor_boot.img from the stock ROM, <strong>it’s lz4 compressed. </strong>I decompressed it using the following command:</li></ul><pre>lz4 vendor_boot.img.lz4</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/654/1*qODrzyWh1A1oQP-X4FBMrA.png" /><figcaption>decompressed lz4 vendor_boot</figcaption></figure><p><strong>02. </strong>Run this command<strong> to unpack the vendor_boot image:</strong></p><pre>./gradlew unpack</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/894/1*RvgU0bkASPvB64EsB-GHFA.png" /><figcaption>Unpacked vendor_boot</figcaption></figure><ul><li><strong><em>As the output says, the files we need to edit are located inside the build/unzip_boot/root.1 directory. :)</em></strong></li></ul><h4>Phase 3: Disabling AVB</h4><ul><li><strong>Disabling AVB,</strong> also known as<strong> Android Verified Boot</strong>, is required if you are dealing with custom ROMs, custom partitions, custom recoveries, etc.</li><li><strong>Otherwise, the system might refuse to boot due to hash mismatches of your custom images :(</strong></li></ul><p><strong>Example kernel message:</strong></p><pre>[    2.140582] [6:           init:    1] init: [libfs_avb]Built verity table: &#39;1 /dev/block/dm-5 /dev/block/dm-5 4096 4096 236722 236722 sha256 a2aab2f47a4343a3fb4419f20bc8de456dfcd774dc8ac333d3d768e9fcbd91fa 5afc64f2444e11e48bc6bb3dbc90f7842afaccd6faa065dbfe1b83495b6a26c8 10 use_fec_from_device /dev/block/dm-5 fec_roots 2 fec_blocks 238588 fec_start 238588 restart_on_corruption ignore_zero_blocks&#39;<br>[    2.140821] [6:           init:    1] device-mapper: verity: sha256 using implementation &quot;sha256-ce&quot;<br>[    2.140840] [6:           init:    1] dm-verity-debug : dev_name = 254:5<br>[    2.140845] [6:           init:    1] dm-verity-debug : b_info already exists<br>[    2.141004] [6:           init:    1] device-mapper: table: 254:10: verity: Hash device is too small<br>[    2.141010] [6:           init:    1] device-mapper: ioctl: error adding target to table<br>[    2.141023] [6:           init:    1] init: DM_TABLE_LOAD failed: Argument list too long<br>[    2.142756] [7:           init:    1] init: Didn&#39;t generate uevent for [vendor-verity] removal<br>[    2.142766] [7:           init:    1] init: [libfs_avb]Couldn&#39;t create verity device!<br>[    2.142777] [7:           init:    1] init: Failed to setup verity for &#39;/vendor&#39;: No such file or directory<br>[    2.142786] [7:           init:    1] init: Failed to mount /vendor: No such file or directory<br>[    2.142885] [7:           init:    1] init: Failed to mount required partitions early ...<br>[    2.143158] [7:           init:    1] init: InitFatalReboot: signal 6</pre><p><strong>To disable AVB,</strong> we need to <strong>edit </strong>the<strong> fstab files located inside the vendor_boot. </strong>Open the <strong><em>build/unzip_boot/root.1</em></strong> folder (where the boot editor indicates the <strong><em>extracted rootfs</em></strong> is<strong> located</strong>)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I88dLQsro2ODzItFtKiVWA.png" /><figcaption>rootfs of vendor_boot</figcaption></figure><p><strong>Now, open the fstab file (there might be multiple fstab files) and edit them as follows to disable AVB:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FWHps0dHwwYKlF8O9s9WHw.png" /><figcaption>Disabled AVB</figcaption></figure><p><strong>What I did was remove all the AVB related flags from the fstab (just select the flag with a comma and replace it with nothing using CTRL+H)</strong></p><p><strong>Refer the commit: </strong><a href="https://github.com/ravindu644/Simple-Android-Guides/commit/a20fa426e756e815ca96a4e11262d8bc460e08f0">https://github.com/ravindu644/Simple-Android-Guides/commit/a20fa426e756e815ca96a4e11262d8bc460e08f0</a></p><h4>Phase 4: Add ext4 mount points for all system partitions.</h4><ul><li><strong>The first thing I did was</strong> separate all the fstab entries related to my logical partitions (the partitions located inside the super.img) with spaces<strong> for better clarity</strong>, like this:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*266c8bNSRi-wg25Prc-Qag.png" /></figure><p><strong>Refer the commit: </strong><a href="https://github.com/ravindu644/Simple-Android-Guides/commit/dce391bc464f4fad017e92f987ba3cdfefea4e7d">https://github.com/ravindu644/Simple-Android-Guides/commit/dce391bc464f4fad017e92f987ba3cdfefea4e7d</a></p><ul><li><strong>Then, I added mount points for ext4 and f2fs dynamic partitions like this:</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f8-JPH5EulH7z4O3DpTXUQ.png" /></figure><p><strong>Refer the commit: </strong><a href="https://github.com/ravindu644/Simple-Android-Guides/commit/a900d50c87f22928524eb0fa7cc132a4ce891bc0">https://github.com/ravindu644/Simple-Android-Guides/commit/a900d50c87f22928524eb0fa7cc132a4ce891bc0</a></p><p><strong>After making all these changes, save your fstab file. If there are more fstab files, repeat the same process for them :)</strong></p><h4>Phase 5: Repacking the “vendor_boot.img”</h4><ul><li><strong>Once you’ve done everything correctly,</strong> you can<strong> repack the edited vendor_boot.img</strong> using the following command:</li></ul><pre>./gradlew pack</pre><p><strong>Result:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/894/1*RA1NvNDol3mFE-vMQLWczg.png" /><figcaption>Repacked vendor_boot</figcaption></figure><p><strong>Now, copy the vendor_boot.img.signed image to a location of your choice and rename it to vendor_boot.img. Then, flash it to your phone.</strong></p><p><strong><em>Enjoy :)</em></strong></p><p><strong>References: </strong><a href="https://github.com/ravindu644/Simple-Android-Guides/commits/vendor_boot/">https://github.com/ravindu644/Simple-Android-Guides/commits/vendor_boot/</a></p><p><strong>Written by: </strong><a href="https://github.com/ravindu644">ravindu644</a></p><p><strong>For more tips, </strong><a href="https://t.me/SamsungTweaks"><strong>join my Telegram channel..!</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ae16ef98ef46" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Removing read-only Attributes from ext4 GSI Images]]></title>
            <link>https://ravindu644.medium.com/removing-read-only-attributes-from-ext4-gsi-images-0dd12419441d?source=rss-ba8ee2c61c85------2</link>
            <guid isPermaLink="false">https://medium.com/p/0dd12419441d</guid>
            <category><![CDATA[custom-rom]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[gsi]]></category>
            <category><![CDATA[magisk]]></category>
            <category><![CDATA[roots]]></category>
            <dc:creator><![CDATA[Ravindu Deshan]]></dc:creator>
            <pubDate>Sat, 25 Jan 2025 16:37:31 GMT</pubDate>
            <atom:updated>2025-01-25T16:41:44.158Z</atom:updated>
            <content:encoded><![CDATA[<h4>To flash GApps and more :)</h4><p><strong>Note:<em> </em></strong><em>In this guide, you will learn:</em></p><blockquote>1. How to add more space inside a GSI image. <br>2. How to remove the read-only mode from GSI images to edit the system using Root Explorer or install GApps.</blockquote><p><strong>Well, I tried to install some vanilla GSIs from the </strong><a href="https://github.com/phhusson/treble_experimentations/wiki/Generic-System-Image-%28GSI%29-list"><strong>Phh’s list</strong></a><strong> later this month on my spare phone :)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*Hsar2yhylqLxhKaONn1cwQ.png" /><figcaption>LineageOS on my A01</figcaption></figure><blockquote><strong>Even though I succeeded, </strong>I faced trouble when flashing GApps using TWRP. <strong>I wondered, even though the Lineage GSI’s filesystem is ext4, why can’t I write anything to it..?</strong></blockquote><p><strong>See, I can see it’s file system is ext2:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/734/1*aSIO0fBCjoX5eAWckO2nBA.png" /><figcaption>info about the linage GSI image</figcaption></figure><p><strong>But when I tried to mount that image into a folder, this error popped up:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/966/1*hEU3gzR46RVeQM6T4E3gog.png" /><figcaption>error occured when I try ot mount it</figcaption></figure><p><strong>After doing some research,</strong> I found that this error occurs when a filesystem feature called <strong><em>shared_blocks</em></strong> is turned on. If we turn it off, we can actually mount the image and write stuff to it :)</p><p><strong>Then, I checked if the shared blocks feature was actually turned on using this command:</strong></p><pre>tune2fs -l lineage-20.0-20241118-UNOFFICIAL-a64_bvN.img | grep &quot;Filesystem features&quot;</pre><p><strong>Actually, it is..!</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VHDAtzD9eFgpyzHvF_8O5w.png" /><figcaption>shared_blocks are turned on..!</figcaption></figure><h4>So, what we’re going to do is:</h4><ol><li><strong>Add more space to the existing GSI image</strong> because the system size expands when we disable shared blocks.</li><li>Run filesystem checks.</li><li>Disable shared blocks.</li><li>Run filesystem checks again, and done..!</li></ol><h4>Step 1: <strong>Add more space to the existing GSI image</strong> because the system size expands when we disable shared blocks.</h4><ul><li>We can do this using the following simple template:</li></ul><pre>truncate -s new_size_in_bytes file_name.img</pre><ul><li><strong>To calculate the new size in bytes, we can simply use the following formula:</strong></li></ul><pre>new_size_in_bytes = original_size_in_bytes + the_size_to_add_in_bytes</pre><p>~ I can get the value for <strong><em>original_size_in_bytes</em></strong> using this command:</p><pre>ls -l file_name.img</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/911/1*AuAD-gecMI2eeY947I4iiw.png" /><figcaption>So, 1650200576 is the size of the gsi image in bytes</figcaption></figure><p>~ I can get the value for <strong><em>the_size_to_add_in_bytes</em></strong> using this formula:</p><pre>the_size_to_add_in_bytes = the_size_to_add_in_megabytes * 1024 * 1024</pre><p><strong>In my case, since I am going to add more space to install GApps, I’ll add 300MB to my Lineage GSI image :)</strong></p><p><em>So, here are my nerdy calculations 🤓</em></p><blockquote>original_size_in_bytes = <strong>1650200576</strong></blockquote><blockquote>the_size_to_add_in_megabytes = 300</blockquote><blockquote>the_size_to_add_in_bytes = 300 * 1024 *1024 = <strong>314572800</strong></blockquote><blockquote>new_size_in_bytes = <strong>1650200576</strong> + <strong>314572800</strong> = <em>1964773376</em></blockquote><p><strong><em>Finally, we can resize the image to the new size using the following template:</em></strong></p><pre>truncate -s new_size_in_bytes file_name.img</pre><p><strong><em>In my case, it will look like this:</em></strong></p><pre>truncate -s 1964773376 lineage-20.0-20241118-UNOFFICIAL-a64_bvN.img</pre><h4>Result:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/998/1*Bu5e8eKd4WU-7vF5UNtUQQ.png" /><figcaption>successfully resized to our new value :)</figcaption></figure><h4>Step 2: Run filesystem checks</h4><ul><li>To run a check and fix the resized GSI image, simply use these two commands:</li></ul><pre>e2fsck -f filename.img<br>resize2fs filename.img</pre><ul><li><strong>In my case, </strong>they looked like this:</li></ul><pre>e2fsck -f lineage-20.0-20241118-UNOFFICIAL-a64_bvN.img<br>resize2fs lineage-20.0-20241118-UNOFFICIAL-a64_bvN.img</pre><h4>Step 3: Disable shared blocks</h4><ul><li><strong>To disable shared_blocks, </strong>you can simply use this command in the terminal:</li></ul><pre>sudo e2fsck -E unshare_blocks filename.img</pre><ul><li>In my case, it looked like this:</li></ul><pre>sudo e2fsck -E unshare_blocks lineage-20.0-20241118-UNOFFICIAL-a64_bvN.img</pre><p><strong>Result:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/898/1*Q1dRAoELfZ4B35uKsZVf1Q.png" /><figcaption>result after removing shared blocks flag with e2fsck</figcaption></figure><p><strong>To verify that shared blocks are actually disabled, you can re-run this command:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gv_TYGgWzrjKz2XtvvuK3g.png" /><figcaption>success !</figcaption></figure><ul><li><strong>As expected, you can see that shared blocks are no longer present in the filesystem features :)</strong></li></ul><h4>Step 4: Run filesystem checks again, and done..!</h4><ul><li><strong>Finally, we’ve come to the end.</strong> So, re-run the commands that we ran earlier before removing shared blocks. Here are the commands again:</li></ul><pre>e2fsck -f filename.img<br>resize2fs filename.img</pre><p><strong>Result:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*B23WmSkQ5JHFpqRAleoWnA.png" /></figure><h4>Conclusion:</h4><ul><li><strong>So, that’s it.</strong> We’ve successfully removed the read-only mode from our GSI image and added more space inside it to install GApps as well.</li><li><strong>All you have to do is flash our modified image to your phone :)</strong></li><li>I hope this guide helps you someday. Thank you!</li></ul><p><strong>Written by: </strong><a href="https://github.com/ravindu644">ravindu644</a></p><p><strong>For more tips, </strong><a href="https://t.me/SamsungTweaks"><strong>join my Telegram channel..!</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0dd12419441d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Repartitioning Android Devices to Modify Partition Sizes]]></title>
            <link>https://ravindu644.medium.com/repartitioning-android-devices-to-modify-partition-sizes-c6a6aa1ec7e2?source=rss-ba8ee2c61c85------2</link>
            <guid isPermaLink="false">https://medium.com/p/c6a6aa1ec7e2</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[partition]]></category>
            <category><![CDATA[roots]]></category>
            <category><![CDATA[repartition]]></category>
            <category><![CDATA[magisk]]></category>
            <dc:creator><![CDATA[Ravindu Deshan]]></dc:creator>
            <pubDate>Fri, 24 Jan 2025 10:05:02 GMT</pubDate>
            <atom:updated>2025-10-20T04:30:12.665Z</atom:updated>
            <content:encoded><![CDATA[<h4>To Flash Something Larger Than the Actual Block Size</h4><blockquote>This guide demonstrates <strong>the method I used to increase the size of my product partition from 80MB to 750MB.</strong></blockquote><blockquote>So, I recommend you get the idea from this guide instead of just copying and pasting my commands (of course, they won’t work for you).</blockquote><blockquote>I am not responsible for any damage that may occur to your device as a result of following this guide.</blockquote><p><strong>Requirements :</strong> PC, USB Cable, Any custom recovery like TWRP, <a href="https://developer.android.com/tools/releases/platform-tools">SDK Platform tools</a>, <a href="https://github.com/ravindu644/android-partition-tools/raw/refs/heads/main/parted">Parted</a></p><p><strong>Step 1: Boot the phone into TWRP Recovery and connect your phone to PC with USB cable.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*dACK-C3QI91XQM3E.jpg" /><figcaption>TWRP</figcaption></figure><blockquote>Make sure to “unmount” all the partitions from TWRP by going to the “Mount” menu.</blockquote><p><strong>Step 2: Push the “parted” binary to “/sbin” using this command:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/891/0*5u22plD7j2qGd6IE.png" /><figcaption>Pushed parted binary</figcaption></figure><p><strong>Step 3: Now, type “<em>adb shell</em>” to access Android’s shell interface.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*pu2wZayXZkC9IChe.png" /></figure><p><strong>Now, give “parted” executable permissions using this command in the Android’s shell interface:</strong></p><pre>chmod +x /sbin/parted</pre><p><strong>Step 4: Now, type the command below to get the name of the primary block device:</strong></p><pre>ls /dev/block/</pre><p><strong>Note: </strong>Normally, it should be <strong><em>mmcblk0</em></strong> or <strong><em>sda</em></strong></p><ul><li><strong>In my case,</strong> it’s <strong><em>“sda”</em></strong></li><li><strong>So, I typed this command to get started with parted:</strong></li></ul><pre># Replace the value &quot;sda&quot; with your block name<br>parted /dev/block/sda</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/0*3CuIYf6RaiUylrR0.png" /><figcaption>We are in..!</figcaption></figure><p><strong>Step 5: Now, enter “p” to list the partition table :</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*GfYgZPnBK3vP8fCx.png" /><figcaption>Partition table</figcaption></figure><p><strong><em>Then, copy the entire text and paste it in a note editor :</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/865/0*I2N8OzxqFCkE0l4q.png" /></figure><p><strong>Step 6: Since my plan is to increase the <em>product’s </em>size, all I have to do is slice a piece from our “userdata” partition and merge that sliced piece into my “product” partition, just like a cake!</strong></p><ul><li>You can see that the partition number for “product” is 28 in the above screenshots of the partition table.</li><li>To increase the product’s size, we have to <strong>delete all the partitions</strong> below it (including product). This means we have to delete all the partitions <strong>starting from “product” to “userdata”.</strong></li><li>To delete a partition, you can use this command in the “parted” menu:</li></ul><pre>rm {partition number}</pre><p><strong>In this case, we have to delete the partitions from 28 to 33. To do that, we can simply use these commands one by one:</strong></p><pre>rm 28<br>rm 29<br>rm 30<br>rm 31<br>rm 32<br>rm 33</pre><p><strong>After deleting all the selected partitions, the partition table should look like this:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/876/0*OQgQZjQkTq2ZVkMy.png" /></figure><p><strong>Now, we have to recreate all the deleted partitions (respectively) one by one. Since our main goal is increasing the size of “product”, we will also be adding more space to “product” too.</strong></p><p><strong>Step 7: Now, we are going to create a new “product” partition with a new size for the partition number 28.</strong></p><p>This is the line for my current partition (vendor) which is at the bottom of the table:</p><pre><strong>Number Start  End     Size    File system    Name    Flags</strong><br>27     6373MB 7527MB  1153MB                 vendor  msftdata</pre><ul><li>In my case, the “<strong>End</strong>” value for my 27th partition (vendor) is <strong>“7527MB”</strong>.</li><li>It must be the “<strong>Start</strong>” value for partition 28, which is supposed to be “<strong>product</strong>” and which we are also <strong>going to create</strong>.</li></ul><blockquote>✔️ So, our “Start” value for the “product” is <strong>7527MB</strong></blockquote><ul><li>Now, we should choose an<strong> “End” </strong>value for our partition.</li><li>I decided to make a “<strong>product</strong>” partition at least “<strong>750MB</strong>”. So, <strong>To calculate the “End” value, just use this equation :</strong></li></ul><pre>{Start value} + {Partition size} = &quot;End&quot; value</pre><p><strong>In my case, I calculated it like this :</strong></p><pre>7527MB + 750MB = 8277MB</pre><blockquote>✔️ Finally, our “End” for the “product” is “<strong>8277MB</strong>”</blockquote><p><strong>Since we have both the “Start” and “End” values for our product partition that we’re going to create, you can use this command to create the new product partition:</strong></p><pre>mkpart {partition name} {file system} {Start value} {End value}</pre><p><strong>Example:</strong></p><pre>mkpart product ext2 7527MB 8277MB</pre><p><strong>Result :</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/0*Z_r5TwTipefSvbrv.png" /><figcaption>Newly created product partition</figcaption></figure><ul><li>Now, we should name that created partition as “<strong>product</strong>”.</li></ul><p><strong>You can use this command to assign a name to any desired partition:</strong></p><pre>name {Number} {Any name}</pre><p><strong>Example:</strong></p><pre>name 28 product</pre><p><strong>Also, we need to set the <em>msftdata </em>flag as well using this command:</strong></p><pre>set 28 msftdata on</pre><ul><li><strong>Note: </strong>Not all devices have this flag, so <strong>make sure the original partition table has this flag enabled for the created partition.</strong></li></ul><h4>Final result:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/805/0*ET10_ZBlQwiGIYEW.png" /></figure><ul><li><strong>Since we created the “product” partition</strong> (which is our main goal), the next step is creating the other deleted partitions with their original sizes.</li></ul><p><strong>Step 8: Do the same procedure to create the rest of the partitions.</strong></p><ul><li>You can refer to the “partition size” from the previous partition table, which is in our text editor, and “add” it to the “<strong>Start</strong>” value to calculate the “<strong>End</strong>” values for each of the partitions.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/793/0*iXdqnJqQ5issSPzg.png" /><figcaption>Partitions with their sizes.</figcaption></figure><p><strong>Creating rest of the partitions using the calculator and 🧠:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*sg7TIQerpvEULaDN.png" /><figcaption>Creating partitions</figcaption></figure><p><strong>Naming them and applying their flags:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/376/0*LzX_ZGupnC8zD8tC.png" /><figcaption>names + flags</figcaption></figure><h3>Final Result:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/828/0*DnrhyAUcwvoTufe6.png" /><figcaption>Partition table after the repartition procedure.</figcaption></figure><h4>Important :</h4><ul><li><strong>You can leave a space for the partitions which don’t have a mentioned file system.</strong></li><li>Since<strong> cp_debug partitions are sized in kilobytes</strong>, I calculated their values by subtracting the “<strong>Start</strong>” value from the “<strong>End</strong>” value to calculate their sizes (which gave me the sizes of 5MB and 6MB respectively).</li><li><strong>If you encounter any warnings,</strong> just type “<strong><em>ignore</em></strong>” and they won’t brick your device, so just chill.</li></ul><p><strong>Step 9: Now go to “Reboot &gt; Recovery” in your TWRP.</strong></p><ul><li>Once you boot again into TWRP, you’ll see infinite mount errors like this:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*Q4m2eTgdjyX-IWZH.jpg" /><figcaption>Creepy mount errors.</figcaption></figure><p><em>(Sorry for the mounting error for vendor because my previous ROM’s vendor is EROFS).</em></p><h4>Let’s fix these errors, One by One:</h4><ul><li>Go to “<strong>Wipe” &gt; “Format Data</strong>” &gt; “Yes” in TWRP. Then go to TWRP’s home screen and select “<strong>Reboot” &gt; “Recovery</strong>” to reboot again to TWRP and apply the changes.</li><li>Then, go to “<strong>Wipe” &gt; “Advanced Wipe</strong>” &gt; select “<strong>Product</strong>” and “<strong>Cache</strong>” and drag the slider to wipe these partitions. After that, <strong>reboot to TWRP</strong> again.</li></ul><p><strong>Now, you can see all the errors are gone..!</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*CF3h7_JozweK4-pF.jpg" /><figcaption>Done!</figcaption></figure><h4>How to Revert to the Original Partition Table?</h4><p><strong>For Samsung Devices:</strong></p><ul><li>Simply flash the stock ROM with the PIT file.</li></ul><p><strong>For Other Devices:</strong></p><ul><li>I honestly don’t know :(</li><li>Maybe you should try restoring the original partition sizes manually.</li></ul><p><strong>Written by: </strong><a href="https://github.com/ravindu644">ravindu644</a></p><p><strong>For more tips, </strong><a href="https://t.me/SamsungTweaks"><strong>join my Telegram channel..!</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c6a6aa1ec7e2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Editing Android DTB and DTBO images without needing the kernel source]]></title>
            <link>https://ravindu644.medium.com/editing-android-dtb-and-dtbo-images-without-needing-the-kernel-source-8abce427b7e8?source=rss-ba8ee2c61c85------2</link>
            <guid isPermaLink="false">https://medium.com/p/8abce427b7e8</guid>
            <category><![CDATA[dtbo]]></category>
            <category><![CDATA[magisk]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[roots]]></category>
            <category><![CDATA[overclock]]></category>
            <dc:creator><![CDATA[Ravindu Deshan]]></dc:creator>
            <pubDate>Thu, 23 Jan 2025 16:38:57 GMT</pubDate>
            <atom:updated>2025-01-23T19:32:32.442Z</atom:updated>
            <content:encoded><![CDATA[<h4>to overclock the display</h4><pre><strong>Note:</strong><br><br>I don&#39;t like to call this an &quot;overclocking&quot; guide. <strong>Instead, my aim is to provide information about decompiling and recompiling Android DT images without the kernel source.</strong><br><br>You can achieve far more than just this, such as tinkering with GPU and CPU frequencies, removing AVB completely, or implementing a ramdisk on a phone that doesn&#39;t have a boot ramdisk, and so on.<br><br>I am not responsible for any damage that may occur to your device as a result of following this guide.<br><br>Even though I’m demonstrating how to decompile the DTBO image, you can use the same technique to modify the DTB image as well, which is most likely located inside your boot partition.</pre><p><strong>Did you know</strong> that you don’t need any kernel source to edit Android DTB and DTBO images? :)</p><p><strong>Unlike the Linux kernel, we can actually decompile the existing DT files, edit them, recompile them, and boot the system with our changes..!</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DwFNzuzO4L_yZIMbzTyMYA.png" /><figcaption>This is me, who overclocked my display just by editing the DTBO partition of my device</figcaption></figure><h4><strong>In this guide, we’ll cover the following steps:</strong></h4><ol><li>Dump the dtbo.img from your Android device</li><li>Extracting the <strong>DTB files</strong> from the<strong> dtbo.img</strong></li><li><strong>Decompiling </strong>the<strong> extracted DTB files</strong> into an <strong>editable file format called “DTS”</strong></li><li><strong>Editing </strong>the decompiled <strong>DTS</strong> files</li><li><strong>Recompiling</strong> the <strong>edited</strong> <strong>DTS</strong> files back into <strong>DTB</strong> format</li><li><strong>Creating</strong> a new<strong> dtbo.img</strong> <strong>from</strong> the modified <strong>DTB</strong> files</li></ol><h4>Requirements:</h4><ul><li>You should <a href="https://ravindu644.medium.com/modifying-android-erofs-partitions-to-remove-encryption-and-more-32e167da6440">read this article</a> to install <strong>Android partition tools </strong>and <strong>learn how to</strong> <strong>dump the images from your Android device.</strong></li><li>Linux PC</li><li>🧠</li></ul><h4>Step 1: Dump the dtbo.img from your Android device</h4><ul><li>Run this command in Termux to dump your DTBO partition as dtbo.img inside your internal storage :</li></ul><pre>su<br>dd if=/dev/block/by-name/dtbo of=/sdcard/dtbo.img</pre><ul><li>Copy it to your Linux PC and put it inside a new folder.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*1DBVFEW64uPn69QPumLXYw.png" /><figcaption>dtbo inside a new folder</figcaption></figure><h4>Step 2: Extracting the <strong>DTB files</strong> from the<strong> dtbo.img</strong></h4><ul><li>Open the terminal <strong>inside that extracted folder </strong>and run the following command:</li></ul><pre>imjtool dtbo.img extract</pre><p><strong>Result:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vnayxjwq-VUm_skANBvFrg.png" /><figcaption>dtbs are extracted into the “extraced&quot; folder</figcaption></figure><h4><strong>Step 3: Decompiling </strong>the<strong> extracted DTB files</strong> into an <strong>editable file format called “DTS”</strong></h4><ul><li>Open the terminal inside that “extracted” folder.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9Veh0eI4PRK-m1uA3L4ScQ.png" /><figcaption>inside the extracted folder</figcaption></figure><ul><li><strong>Run the following code to decompile the DTB files to DTS:</strong></li></ul><pre>(for file in DeviceTree*.dtb; do<br>    dtc -I dtb -O dts -o &quot;${file%.dtb}.dts&quot; &quot;$file&quot;<br>done) &amp;&amp; rm *.dtb</pre><p><strong>Result:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1007/1*6KJQbuAVjRDD0TdPPhQm-A.png" /><figcaption>created dts files by decompiling dtbs</figcaption></figure><h4>Step 4: <strong>Editing </strong>the decompiled <strong>DTS</strong> files</h4><ul><li>If you want to overclock the screen, the line you need to find is:</li></ul><pre>timing,refresh = &lt;0x3c&gt;;</pre><ul><li><strong>3C is a hexadecimal number equivalent to decimal 60.</strong> So, “<em>timing, refresh</em>” is the place where the <strong>refresh rate of the display is defined </strong>:)</li><li>You can use a <a href="https://www.rapidtables.com/convert/number/decimal-to-hex.html">Decimal to Hex Converter</a> to get the hex value for your desired refresh rate. <strong>In my case,</strong> I’ll choose <strong>75</strong> as the new refresh rate.</li><li><strong>Decimal 75 is equal to hex 4B. So, I’ll edit the “timing, refresh” like this:</strong></li></ul><pre>timing,refresh = &lt;0x4B&gt;;</pre><ul><li><strong>Then, select the entire original line, including tab spaces, press CTRL+H, paste your new line below the original value, and press “Replace All”</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mOXDlgOaPnepD7ppTYvwlQ.png" /><figcaption>Find and replace</figcaption></figure><p><strong>Repeat this for all of your dts files.</strong></p><h4><strong>Step 05: Recompiling</strong> the <strong>edited</strong> <strong>DTS</strong> files back into <strong>DTB</strong> format</h4><ul><li><strong>Once you’ve edited all of the DTS files, you can compile them back to the DTB format using the following code piece:</strong></li></ul><pre>(for file in DeviceTree*.dts; do<br>    dtc -I dts -O dtb -o &quot;${file%.dts}.dtb&quot; &quot;$file&quot;<br>done) &amp;&amp; rm *.dts</pre><h4>Step 06: <strong>Creating</strong> a new<strong> dtbo.img</strong> <strong>from</strong> the modified <strong>DTB</strong> files</h4><ul><li><strong>Well, this is the trickiest part.</strong> Instead of writing the further procedure, <strong>I made an entire video demonstrating this process with proof</strong>.</li></ul><blockquote>Take a look to get an idea of how to recreate the dtbo.img</blockquote><h3><strong>Entire Procedure in One video:</strong></h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FHyGtnaBHzNM%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DHyGtnaBHzNM&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FHyGtnaBHzNM%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/2da8e45aa28a42f43efa26d03ab9d899/href">https://medium.com/media/2da8e45aa28a42f43efa26d03ab9d899/href</a></iframe><p><strong>Written by: </strong><a href="https://github.com/ravindu644">ravindu644</a></p><p><strong>For more tips, </strong><a href="https://t.me/SamsungTweaks"><strong>join my Telegram channel..!</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8abce427b7e8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Modifying Android EroFS Partitions to Remove Encryption and More]]></title>
            <link>https://ravindu644.medium.com/modifying-android-erofs-partitions-to-remove-encryption-and-more-32e167da6440?source=rss-ba8ee2c61c85------2</link>
            <guid isPermaLink="false">https://medium.com/p/32e167da6440</guid>
            <category><![CDATA[roots]]></category>
            <category><![CDATA[readonly]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[magisk]]></category>
            <category><![CDATA[erofs]]></category>
            <dc:creator><![CDATA[Ravindu Deshan]]></dc:creator>
            <pubDate>Tue, 21 Jan 2025 11:14:01 GMT</pubDate>
            <atom:updated>2025-07-23T18:17:57.398Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Update (2025.07.23):</strong> This article is outdated because <em>`tar</em>`<strong> cannot apply contexts to symlinks.</strong> Therefore, check out my new <a href="https://github.com/ravindu644/erofs-tools">erofs-tools</a> to <strong>easily unpack and repack Android EROFS images — </strong>just like CRB Kitchen, but completely free and 100% functional.</p><blockquote>This is not a guide to convert EroFS to ext4 to gain read/write access. This is my own unique method to edit EroFS without converting it to a different filesystem and without using any Proprietary softwares.</blockquote><blockquote>This guide demonstrates how to disable encryption by editing the fstab files inside the EroFS vendor partition. You can use this guide for much more than that, such as tweaking, debloating, etc.</blockquote><h3>~ Probelm:</h3><ul><li>Since modern Android devices are shipped with partitions in <a href="https://en.wikipedia.org/wiki/EROFS">EroFS</a> instead of ext4, they have become read-only because EroFS is a read-only file system.</li><li>This means we can’t edit/create or delete a single file on the phone <strong>because the system files and partitions are immutable</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IP_MIIFJ-162WWgUPgDSFA.jpeg" /><figcaption>failed edit or create any files inside an erofs partition</figcaption></figure><ul><li>Even though this issue can be <strong><em>partially fixable</em></strong> using the <a href="https://github.com/HuskyDG/magic_overlayfs">Magisk OverlayFS module by HuskyDG</a> (it’s dead lol), <strong>the changes are not permanent</strong>. The modifications do not persist <strong>outside the Android userspace,</strong> <strong>such as in recovery mode.</strong></li><li><strong>The biggest problem with this EroFS chaos is that if our custom recovery (TWRP, Orange Fox, etc.) doesn’t have any implementation to decrypt the userdata partition, the recovery will show our internal storage size as 0MB or display an “unable to mount /data” error.</strong></li></ul><blockquote>This is because we can’t edit the <strong>/vendor/etc/fstab.xxxx</strong> files to remove encryption, as the vendor partition is read-only and therefore immutable.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/0*xxjVOfiYvUKy4BkZ.jpg" /><figcaption>Internal storage shows as 0MB because the userdata partition is encrypted, and TWRP is unable to decrypt it.</figcaption></figure><h3>~ Solution(s):</h3><p>Actually, there are <strong>two solutions</strong> to fix these problems.</p><ol><li><strong>Convert the EroFS partitions to the ext4 filesystem</strong>, which makes the partitions read/write again.</li><li>Edit the required <strong>EroFS </strong>partition on our PC, save the changes, and flash it to apply the modifications.</li></ol><p><strong>I don’t recommend converting EroFS to ext4, as it’s more complex than what we’re going to do here. Additionally, it tends to cause endless difficulties when the partition sizes exceed the device’s actual block size, which may require repartitioning the device </strong>🫥</p><h3>~ The Idea</h3><ul><li>My idea follows a <strong>simple logic</strong> :)</li></ul><ol><li>Install <strong>Android partition tools</strong> and <strong>erofs-utils</strong> in our Linux PC</li><li>Dump the <strong><em>super.img</em></strong> from the phone.</li><li><strong>Unpack</strong> it to get the <strong>system</strong>, <strong>vendor</strong>, and other partitions.</li><li>Mount the desired partition to <strong><em>folder1</em></strong>.</li><li>Make a <strong><em>folder2</em></strong> and copy all the contents of <strong><em>folder1</em></strong> while <strong>preserving SELinux contexts, permissions,</strong> and <strong>ownerships</strong>.</li><li>Edit the contents of <strong><em>folder2</em></strong></li><li><strong>Create a new EroFS image out of that folder</strong>.</li><li><strong>Flash the new image.</strong></li></ol><h3>~ Method:</h3><ul><li>Now, let’s talk about editing EroFS partitions <strong>without converting them to a read/write filesystem</strong> :)</li></ul><p><strong><em>Requirements for the tutorial:</em></strong></p><blockquote>- PC with Linux/WSL installed<br>- Unlocked bootloader with root access on your phone<br>- USB cable<br>- Android partition tools</blockquote><h4>Step 1.1: Setting up Android partition tools</h4><ul><li>Download the android-partition-tools.zip and extract it to a location of your choice [ <a href="https://t.me/ravindu644/590">Link</a>, <a href="https://cloud.ravindu-deshan.workers.dev/0:/android-partition-tools.zip">Mirror</a> ]</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*hoQjnxZV5ZZTzX3W2_gFhg.png" /><figcaption>Extraced location</figcaption></figure><ul><li><strong>Open the android-partition-tools folder,</strong> launch a terminal window there, and <strong>type the following command to give the binaries inside executable permissions:</strong></li></ul><pre>chmod +x *</pre><ul><li>Now, type this command to <strong>get the full path for that folder </strong>:</li></ul><pre>pwd</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/881/1*Bf9RpDl8tFxxlNMZp0ezBg.png" /><figcaption>getting the full path</figcaption></figure><blockquote><strong>In my case, the output is:</strong> /home/ravindu644/Documents/android-partition-tools</blockquote><ul><li>Now, open the <strong><em>.bashrc</em></strong> file using this command:</li></ul><pre>nano ~/.bashrc</pre><blockquote>This will open a hidden file called <strong><em>.bashrc</em></strong>, which is located inside your home folder, using the nano text editor.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*_nDyxmlKXiPkLX4wI_vB4w.png" /><figcaption>opened .bashrc with nano</figcaption></figure><ul><li>Add this piece of code to the top of the file:</li></ul><p><strong>Note: </strong>replace <strong><em>/home/ravindu644/Documents/android-partition-tools </em></strong>with the value you got from the <strong><em>pwd</em></strong> command above.</p><pre>#custom path<br>export PATH=/home/ravindu644/Documents/android-partition-tools:$PATH<br>#end custom path</pre><p><strong>The final result should look like this :</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*QvrVliqCQI6tpGrBSr2sTg.png" /><figcaption>edited custom path</figcaption></figure><p><strong>Now, press CTRL + X, press Y, and hit Enter to save the edited file :)</strong></p><p><strong>How can you test if the above step worked for you..?</strong></p><ol><li>Open a new terminal window.</li><li>Type <strong><em>lpunpack</em></strong> and ensure the output looks like this screenshot:</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/1*NSzvGNXVxnfES6Q8LFvjeA.png" /><figcaption>lpunpack</figcaption></figure><h4>Step 1.2: Setting up erofs-utils</h4><ul><li>Before we edit the partitions, we need to install <strong><em>erofs-utils</em></strong>, which provides <strong>the ability to mount EroFS images, create EroFS images</strong>, and more.</li><li><strong>But keep in mind,</strong> since EroFS is a read-only file system, we can’t edit it using the traditional method of mounting the image, applying changes, and then unmounting it again.</li></ul><p><strong>To install <em>erofs-utils</em> with just a single command, kindly run the following in the terminal:</strong></p><pre>sudo apt install make automake libtool liblz4-dev git libfuse3-dev fuse3 uuid-dev -y<br>cd ~ &amp;&amp; git clone https://github.com/erofs/erofs-utils.git<br>cd ~/erofs-utils<br>make clean<br>./autogen.sh<br>./configure<br>make<br>sudo make install</pre><p><strong>If everything went smoothly, </strong>you will be able to run the<strong> <em>mkfs.erofs</em> command like this:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/932/1*8ycHLBXFaoxU3ZQIsIFLSA.png" /><figcaption>mkfs.erofs is successfully installed :)</figcaption></figure><h4>Step 2: Dumping the super.img from your device</h4><ul><li>This is the easiest step ever :)</li><li>Install the <a href="https://github.com/termux/termux-app/releases/download/v0.118.1/termux-app_v0.118.1+github-debug_arm64-v8a.apk"><strong>Termux arm64 variant from here</strong></a><strong> </strong>and <strong>grant it root permissions using APatch or KernelSU Manager; or </strong>you can run <strong><em>su</em></strong> to get the root prompt and accept the request if you are using <strong>Magisk</strong>.</li><li>Open Termux and type <strong><em>su</em></strong> to access the root shell.</li><li><strong>Then, type this command to change the directory to Internal Storage:</strong></li></ul><pre>cd /sdcard</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mFVaTyeaKBETEaH_ivw3bg.jpeg" /></figure><p><strong>To dump the super.img from your phone, simply run the below command. It will create a file called “super.img” inside your storage :</strong></p><pre>dd if=/dev/block/by-name/super of=super.img</pre><p><strong>Result:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3qsO-v0DuKT3IZ57OUAAFA.jpeg" /><figcaption>dumping super.img</figcaption></figure><ul><li>Now, copy the dumped <strong><em>super.img</em></strong> located <strong>inside your internal storage </strong>on your phone <strong>to a new folder</strong> on your PC <strong>using the USB cable and MTP</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8CFN2Ueqe2N6FfyT2kb9ig.png" /><figcaption>copying super.img to a new folder :)</figcaption></figure><h4><strong>Step 3: Unpack</strong> <strong>super.img</strong> to get the <strong>system</strong>, <strong>vendor</strong>, and other partitions</h4><ul><li>To unpack your <strong><em>super.img</em></strong>, <strong>open the terminal inside the folder where <em>super.img</em> is located</strong> and run the below command:</li></ul><pre>lpunpack super.img</pre><p><strong>Result:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kfc44z0ddl_sgfbsSzIozw.png" /><figcaption>Unpacked super :)</figcaption></figure><h4>Step 4: Mount the desired partition to <strong><em>folder1</em></strong></h4><ul><li>Since <strong>We</strong> want to edit our vendor fstab to remove the <strong>Forced Disk Encryption</strong>, We will choose to edit the <strong>vendor</strong> partition now.</li><li>Create a new folder called <strong><em>vendor</em></strong> using this command:</li></ul><pre>mkdir vendor</pre><ul><li><strong>Once you have created the folder,</strong> mount the EroFS <strong><em>vendor.img</em></strong> t<strong>o the vendor folder</strong> using this command:</li></ul><pre>sudo mount -o loop vendor.img vendor</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A6xMFpbl0mHuzsEDq1dtCw.png" /><figcaption>mounted erofs vendor</figcaption></figure><h4>Step 5: Make a folder2 and copy all the contents of folder1 while preserving SELinux contexts, permissions, and ownerships.</h4><ul><li><strong>As I mentioned earlier</strong>, we can’t edit the files inside the mounted EroFS vendor.</li><li>So, we will copy all the files and folders inside that mounted folder to a new folder, making it possible to edit the files afterward.</li></ul><p><strong>But, we can’t copy the files in a normal way. We must preserve the SELinux contexts, groups, owners, and permissions, exactly as they are in the mounted EroFS image. Let’s do it now :)</strong></p><ol><li>Create a new folder called <strong><em>vendor_new</em></strong> using this command:</li></ol><pre>mkdir vendor_new</pre><p>2. Use this command to copy files from the <strong><em>vendor</em></strong> folder to the <strong><em>vendor_new</em></strong> folder <strong>while preserving SELinux contexts and other attributes</strong>:</p><pre>(cd vendor &amp;&amp; sudo tar --selinux -cf - .) | (cd vendor_new &amp;&amp; sudo tar --selinux -xf -)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jOpRta_L10LP278KFCU6Tw.png" /><figcaption>vendor &gt; vendor_new</figcaption></figure><p><strong>Results:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*OnSG5_O3dnWKOZrxW7dcGA.png" /><figcaption>inside of the vendor_new (a clone of vendor)</figcaption></figure><h4>Step 6: Edit the contents of <strong><em>folder2</em></strong></h4><ul><li>Okay, all that’s left to do is edit the contents of <strong><em>vendor_new</em></strong> as we want.</li><li>To do this, <strong>we need to open the file manager of your Linux distro as root.</strong></li></ul><p><strong>If you’re using an Ubuntu like distro that uses the GNOME desktop environment, you can open the file manager as root using this simple command:</strong></p><pre>sudo nautilus</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GRFKXETzbfwpF0KZQJbi3w.png" /><figcaption>file manager as root</figcaption></figure><blockquote>Otherwise, you can right click inside the folder and choose “Open as Root” (in Cinnamon, KDE desktop environments)</blockquote><p><strong>Then, navigate to the vendor_new folder, located in the folder where we extracted the super.img using the “root” file manager.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*MEsvW4IcRcydUZkT8bQb8g.png" /><figcaption>inside vendor_new folder using root</figcaption></figure><p><strong>We are going to disable the encryption now. To do that, we need to edit the fstab files located inside the <em>vendor_new/etc</em> folder.</strong></p><ul><li>There are <strong>3 fstab files</strong> inside my <strong>vendor_new/etc.</strong></li><li><strong>They are: </strong><em>fstab.default, fstab.emmc, fstab.ramplus</em></li><li><strong>In our situation</strong>, where we are going to disable the encryption, we only need to edit <strong><em>fstab.default</em></strong> and <strong><em>fstab.emmc</em></strong></li></ul><p><strong>Let’s open and edit both files respectively. So, double click to open <em>fstab.default</em> inside the root file manager.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lPFWyzyi9oU0jckjlmWQKQ.png" /><figcaption>1. fstab.default</figcaption></figure><p><strong>Now, navigate to the fstab mount point corresponding to the <em>userdata</em> partition. In my case, it looks like this:</strong></p><pre>/dev/block/bootdevice/by-name/userdata  /data  f2fs  noatime,nosuid,nodev,discard,usrquota,grpquota,fsync_mode=nobarrier,reserve_root=32768,resgid=5678,whint_mode=fs-based,inlinecrypt  latemount,wait,check,,quota,reservedsize=128M,checkpoint=fs,fscompress,fileencryption=aes-256-xts:aes-256-cts:v2+inlinecrypt_optimized,keydirectory=/metadata/vold/metadata_encryption</pre><p><strong>Then, I changed the above entry to this:</strong></p><pre>/dev/block/bootdevice/by-name/userdata  /data  f2fs  noatime,nosuid,nodev,discard,usrquota,grpquota,fsync_mode=nobarrier,reserve_root=32768,resgid=5678,whint_mode=fs-based,latemount,wait,check,quota,reservedsize=128M,checkpoint=fs,fscompress</pre><blockquote>What I did was, removed the <strong><em>,inlinecrypt </em></strong>and <strong><em>,fileencryption=aes-256-xts:aes-256-cts:v2+inlinecrypt_optimized,keydirectory=/metadata/vold/metadata_encryption </em></strong>parts from the mount point which removes the encryption.</blockquote><ul><li><strong>I did the same thing for <em>fstab.emmc </em>file as well :)</strong></li><li><a href="https://github.com/ravindu644/Simple-Android-Guides/commits/fstab-decryption/"><strong>Here’s the reference commit for this procedure in case you didn’t understand</strong></a></li></ul><h4>Step 7: Create a new EroFS image out of vendor_new</h4><ul><li><strong>Once we apply our changes to the new folder,</strong> all we need to do is <strong>cook a new EroFS image</strong> :)</li><li><strong>Before cooking,</strong> we need to get these values first from the <strong>mounted EroFS vendor image</strong>: <strong><em>UUID</em></strong>, <strong><em>BLOCK_SIZE</em></strong>, and <strong><em>LABEL</em></strong></li><li>To get them, just run the below command:</li></ul><pre>sudo blkid | grep loop</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*BK5811oxiKIIcfwDUNhuEg.png" /><figcaption>blkid</figcaption></figure><p><strong>In my case, the values are:</strong></p><blockquote>UUID=”dd3a2296–1e02–5499-bdea-f95aa86b2fac”</blockquote><blockquote>BLOCK_SIZE=”4096&quot;</blockquote><blockquote>LABEL= (empty lol)</blockquote><p><strong>To create an EroFS image, all we need to do is run this single command. Here’s the template:</strong></p><pre>sudo mkfs.erofs -b BLOCK_SIZE -L LABEL -U UUID output_erofs.img input_folder</pre><p><strong>In my case, the command to create a <em>new EroFS image</em> from my <em>vendor_new</em> folder looked like this:</strong></p><pre>sudo mkfs.erofs -b 4096 -U dd3a2296-1e02-5499-bdea-f95aa86b2fac vendor_new.img vendor_new</pre><p><strong>Note: </strong>I didn’t use the “<strong><em>-L LABEL”</em></strong> flag since my<strong><em> LABEL</em></strong> is <strong>empty</strong> when I ran the <strong><em>sudo blkid</em></strong> command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2BKTrXKVPX4Gh95TB5z-fA.png" /><figcaption>successfully created a new erofs image</figcaption></figure><p><strong>Since everything went smoothly, you can see the created <em>vendor_new.img</em> in the above screenshot :)</strong></p><ul><li><strong>Now, unmount the previously mounted EroFS vendor with this command since we have finished our work:</strong></li></ul><pre>sudo umount vendor</pre><h4>Step 8: <strong>Flash the new image</strong></h4><ul><li>After all of this, finally, we’ve arrived at our last step! 😅</li><li><strong>I recommend you flash the new EroFS image using <em>fastboot mode</em>, as we don’t need to repack the super.img, which is more complex than this whole process..! 🗿</strong></li><li>Why do we go through all this when we have fastboot mode in our custom recovery, right..? 😌</li></ul><p><strong>Since I modified the vendor, I rebooted the phone into fastboot mode from TWRP recovery and ran this command to flash the <em>vendor_new.img</em> to the vendor block of my phone :)</strong></p><pre>fastboot flash vendor vendor_new.img</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yiOhRL9MswvkTSKtBut80g.png" /><figcaption>flashing edited vendor_new.img using fastboot</figcaption></figure><p><strong>Note: </strong>After flashing the edited vendor image with disabled encryption, <strong>we must format data using TWRP </strong>by going to <strong><em>“Wipe &gt; Format Data &gt; Yes”</em></strong> to remove the encryption :)</p><h4>If everything went smoothly, this is the final result of our work 😉</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*crCeyKaAFJLpKCAmstSjvg.jpeg" /><figcaption>userdata without encryption</figcaption></figure><blockquote>That’s it, folks! Hope you learned something new from this guide :)</blockquote><p><strong>Written by: </strong><a href="https://github.com/ravindu644">ravindu644</a></p><p><strong>For more tips, </strong><a href="https://t.me/SamsungTweaks"><strong>join my Telegram channel..!</strong></a><strong> 😊</strong></p><p><strong>Last Updated:</strong> 2025.07.23</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=32e167da6440" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Installing Dolby Atmos and Sound on any AOSP Based ROM.]]></title>
            <link>https://ravindu644.medium.com/installing-dolby-atmos-and-sound-on-any-aosp-based-rom-4948e5c54e8a?source=rss-ba8ee2c61c85------2</link>
            <guid isPermaLink="false">https://medium.com/p/4948e5c54e8a</guid>
            <category><![CDATA[dolby-atmos]]></category>
            <category><![CDATA[magisk]]></category>
            <category><![CDATA[kernelsu]]></category>
            <category><![CDATA[audio-mods]]></category>
            <category><![CDATA[samsung]]></category>
            <dc:creator><![CDATA[Ravindu Deshan]]></dc:creator>
            <pubDate>Mon, 20 Jan 2025 05:56:23 GMT</pubDate>
            <atom:updated>2025-01-20T14:09:20.085Z</atom:updated>
            <content:encoded><![CDATA[<h3>Installing Dolby Atmos and Spatial Sound on any AOSP Based ROM.</h3><p>Since my Galaxy S10 5G is outdated in 2025 and updates stopped at Android 12, I decided to install an AOSP-based ROM like <a href="https://wiki.lineageos.org/devices/beyondx/"><strong>LineageOS</strong></a> on it.</p><figure><img alt="LineageOS on S10 5G" src="https://cdn-images-1.medium.com/max/1024/1*Fhwfp-Tpwhz_uO2LkMr12Q.png" /><figcaption>LineageOS on S10 5G</figcaption></figure><ul><li>Although the user experience is s<strong>moother than the OEM software</strong>, the <strong>sound quality from stereo speakers</strong> are <strong>horrible</strong>. I felt them like sound coming out from a <strong>cheap 70$ budget phone</strong>, and there’s 0 bass and low midranges in the sound which makes them harder to listen at all.</li><li>However, with the help of our friend <a href="https://github.com/reiryuki">Ryuki’s</a> work, I finally managed to <strong>fix all my problems</strong>. Now, the sound quality is better than ever, even surpassing that of the Stock ROM itself..!</li><li>What I did was <strong>uninstall the stock sound effects</strong> from my LineageOS and install the “<a href="https://github.com/reiryuki/Dolby-Atmos-Spatial-Sound-Moto-Edge-30-Ultra-Magisk-Module">Dolby Atmos and Spatial Sound Moto Edge 30 Ultra Magisk Module</a>” along with its requirements. :)</li></ul><h4>Screenshots of the Final work :</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Kadcp75p-1yqqUxQVHlPhA.jpeg" /><figcaption>Final results after installing the Dolby module</figcaption></figure><blockquote><strong><em>Disclaimer: </em></strong><em>Motorola and Dolby apps and blobs are owned by Motorola™ and Dolby™. I am not involved in any act of porting these apps. This is just an honest review and a user-end installation guide.</em></blockquote><h3>~ Installation ~</h3><p><strong>Requirements:</strong></p><ul><li>Any root solution like Magisk, KernelSU or APatch installed.</li><li>An AOSP based ROM.</li></ul><h4>Phase 1 ~ Removing the built in Dolby (if exists)</h4><ul><li>First of all, <strong>we need to remove any remaining pre-built Dolby</strong> that came with our ROM. In this case, there’s a hidden app called “<strong>SamsungDAP</strong>” which provides Lineage’s Dolby Atmos, and it’s almost horrible.</li></ul><p><strong>Note: </strong>This is not required if your ROM doesn’t have any Dolby pre-built with it.</p><ul><li>To remove it, I recommend using <a href="https://github.com/samolego/Canta"><strong>Canta</strong></a><strong> with </strong><a href="https://play.google.com/store/apps/details?id=moe.shizuku.privileged.api&amp;hl=en"><strong>Shizuku</strong></a>, which disables the package from the system without removing it permanently.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UWImYYrFQWgn4zGNyVl7vQ.png" /><figcaption>Uninstall SamsungDAP with Canta</figcaption></figure><h4>Phase 2 ~ Installing the Requirements</h4><ul><li><strong>After removing the “SamsungDAP,”</strong> install the <a href="https://www.pling.com/p/1978575/"><strong>Moto Core</strong></a> and <a href="https://www.pling.com/p/1531943"><strong>AOSP Sound Effects Remover</strong></a><strong> modules</strong>, respectively, from Magisk, KernelSU, or APatch.</li></ul><p><strong>KernelSU and APatch only requirement:</strong></p><ul><li>Navigate to the settings of the corresponding root manager and disable the <strong>“Umount modules by default” </strong>option :)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aGv0WEo3Smp8gPQlzYvRaQ.png" /><figcaption><strong>Umount modules by default</strong></figcaption></figure><ul><li>Then, reboot your system.</li></ul><h4><strong>Phase 3 ~ Installing our new Dolby module</strong></h4><ul><li>Once you did the above steps, all we need to do is install the “<a href="https://github.com/reiryuki/Dolby-Atmos-Spatial-Sound-Moto-Edge-30-Ultra-Magisk-Module">Dolby Atmos and Spatial Sound Moto Edge 30 Ultra Magisk Module</a>”</li><li>To do that, Download both “<a href="https://github.com/reiryuki/Dolby-Atmos-Spatial-Sound-Moto-Edge-30-Ultra-Magisk-Module">Dolby Atmos and Spatial Sound Moto Edge 30 Ultra</a>” and “<a href="https://www.pling.com/p/1981006/">Audio Modification Library Ryuki Mod</a> (AML)”, and install them respectivly.</li><li>That means, <strong>install the Dolby module first, then install AML afterward</strong> :)</li></ul><p><strong>Once you’ve done everything correctly, reboot the system, and you will find both Dolby Atmos and Spatial Sound apps in the app drawer.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mlIY9OINK9KYMV51bEHAqg.png" /><figcaption>Dolby apps in the app drawer</figcaption></figure><h4>My personal preferences:</h4><ul><li>I’m using<strong> Dolby Atmos’s “</strong>Music” profile with the <strong>equalizer set to “Bass Boost”</strong> and the <strong>profile setting “Surround Virtualizer” turned on</strong> to fix my problem with the speaker on AOSP ROMs in my S10 5G.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gIdEhgoRXhIPmMDanyj23Q.jpeg" /><figcaption>My custom Dolby settings</figcaption></figure><ul><li><strong>This Dolby app also remembers the settings for all of your connected devices.</strong> So, you can use this profile for the speaker while using a completely different profile for AUX or Bluetooth, and the app will automatically switch the profiles once you connect the phone to your external audio device.</li></ul><h4><strong>Conclusion:</strong></h4><ul><li>That’s it for enhancing your audio experience! Hope this guide helps you get the best sound on your device.</li></ul><p><strong>Written by: </strong><a href="https://github.com/ravindu644">ravindu644</a></p><p><strong>For more tips, </strong><a href="https://t.me/SamsungTweaks"><strong>join my Telegram channel..!</strong></a><strong> 😊</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4948e5c54e8a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>