<?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 Chinmaya Sharma on Medium]]></title>
        <description><![CDATA[Stories by Chinmaya Sharma on Medium]]></description>
        <link>https://medium.com/@chinmayasharma_56001?source=rss-40194a2e5210------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Iv7EQl1V0f263KaO</url>
            <title>Stories by Chinmaya Sharma on Medium</title>
            <link>https://medium.com/@chinmayasharma_56001?source=rss-40194a2e5210------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 11:11:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@chinmayasharma_56001/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[Norse God Conundrum — GSIs on Exynos Samsungs]]></title>
            <link>https://medium.com/@chinmayasharma_56001/norse-god-conundrum-gsis-on-exynos-samsungs-0e7b1b45a594?source=rss-40194a2e5210------2</link>
            <guid isPermaLink="false">https://medium.com/p/0e7b1b45a594</guid>
            <category><![CDATA[samsung]]></category>
            <category><![CDATA[custom-rom]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[project-treble]]></category>
            <category><![CDATA[open-source]]></category>
            <dc:creator><![CDATA[Chinmaya Sharma]]></dc:creator>
            <pubDate>Sat, 18 Apr 2026 11:56:19 GMT</pubDate>
            <atom:updated>2026-04-18T11:56:19.929Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x8PsCLkDwPg9DG4RL8yihQ.png" /></figure><h3>What to expect</h3><p>This is a high level overview on how to install GSIs (Generic System Images) on Exynos Samsungs and challenges faced.</p><p>Reader can expect to learn the following from this article :</p><ul><li>Project Treble</li><li>What is GSI (Generic System Image)</li><li>Overcoming challenges to flash Samsung devices</li><li>Dealing with dynamic partitions</li><li>Repackaging super images</li><li>Lack of a full fastboot mode</li><li>Download mode and its utility (Odin, Heimdall and other norse gods)</li></ul><p>For more hands on guides, check out these articles:</p><p>Repackaging Super images — <a href="https://medium.com/@chinmayasharma_56001/ultimate-guide-to-repacking-samsung-super-images-with-custom-gsis-fde5f96d8c23">https://medium.com/@chinmayasharma_56001/ultimate-guide-to-repacking-samsung-super-images-with-custom-gsis-fde5f96d8c23</a></p><p>Flashing repackages super images for Samsung devices — <a href="https://medium.com/@chinmayasharma_56001/how-to-flash-gsis-on-samsung-devices-a-guide-to-patching-vbmeta-and-repackged-super-images-4db5be14f6b7">https://medium.com/@chinmayasharma_56001/how-to-flash-gsis-on-samsung-devices-a-guide-to-patching-vbmeta-and-repackged-super-images-4db5be14f6b7</a></p><h3>Prologue</h3><p>Behold the Galaxy F13: a budget-friendly device that, unfortunately, was so weighed down by Samsung’s One UI services that running Google Maps and Spotify simultaneously felt like a stress test. To transform this into a my lean navigation machine, I had to strip away the overhead. Though as my 2 hour project became much more than that I learned, flashing an Exynos-based Samsung isn’t exactly a walk in the park.</p><h3>Project Treble — A modular base for android</h3><p>Treble is an architectural overhaul by Google starting Android 8, it separates Android’s operating system framework from vendor specific low level hardware code. This allows updates to the system without redoing the chipset manufacturer’s work, which is what allows GSIs to exist</p><p><em>For more read — </em><a href="https://android-developers.googleblog.com/2017/05/here-comes-treble-modular-base-for.html"><em>https://android-developers.googleblog.com/2017/05/here-comes-treble-modular-base-for.html</em></a></p><h3>GSI</h3><p>A Generic System Image is exactly as it sounds, it is an OS image that can be installed on multiple devices across different hardware as long as they share the same framework (ARM/ARM64/x86/etc). You can draw an analogy with linux, where a GSI is a distro that is compatible across multiple devices given they share the same framework.</p><p>GSIs are specific to each CPU and Binder architecture as well as partition type combo. For example the F13 uses ARM32 CPU architecture and 64 bit Binder architecture along with dynamic partitions.</p><h3>GSI Image Identifier Summary</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2e01020b5a187cfe24ddc995dadbde48/href">https://medium.com/media/2e01020b5a187cfe24ddc995dadbde48/href</a></iframe><h3>Decoding Example</h3><p>If you see a file named system-a64-bgN.img.xz, it translates to:</p><ul><li><strong>a64</strong>: 32-bit OS for a 64-bit CPU.</li><li><strong>b</strong>: A/B Partition (System-as-root).</li><li><strong>g</strong>: Includes GApps.</li><li><strong>N</strong>: No built-in Root.</li></ul><p><strong><em>For F13</em></strong><em> GSI names will be similar to </em><strong>system-a64-bxx.img.xz</strong></p><p><em>To check support for treble on your device and specific CPU, binder &amp; dynamic partition details you can use the treble info app — </em><a href="https://f-droid.org/packages/tk.hack5.treblecheck/"><em>https://f-droid.org/packages/tk.hack5.treblecheck/</em></a></p><p><em>Some links to browse GSI images : </em><a href="https://github.com/phhusson/treble_experimentations/wiki/Generic-System-Image-%28GSI%29-list"><em>https://github.com/phhusson/treble_experimentations/wiki/Generic-System-Image-(GSI)-list</em></a></p><p><a href="https://sourceforge.net/projects/andyyan-gsi/files/"><em>https://sourceforge.net/projects/andyyan-gsi/files/</em></a></p><h3>Samsung specific challenges</h3><p>In most android devices flashing a GSI is fairly straight forward. Enable dev options &gt; Unlock Bootloader &gt; Enable USB debugging &gt; Go to fastboot mode &gt; flash your desired GSI and you’re done. But if you’ve been a Samsung user for a while you’ll already know it will be more complex than that for Samsung, with its Knox security and and entire set of services built on top of Android other than Google Play services and the <em>ever so smooth</em> One UI. The 3 major hurdles are :</p><ul><li>Lack of a fastboot mode — after unlocking the bootloader and enabling usb debugging you can run <em>adb reboot fastboot</em> or <em>adb reboot bootloader</em> and you will come to a fastboot esque mode which will be recognized by <em>fastboot devices</em> command but will not respond to any commands.</li><li>Dynamic partitions — Due to a lack of fastboot mode, we are forced to use samsung’s <em>Download Mode</em> the problem here is that where fastboot reads physical partitions and can directly flash a file to the system partition, download mode only sees the <em>Super</em> block which has system in it. This is effect means that you have to repackage the super.img file from the original firmware with your system.img file (which must fit within the strict byte-limit of the device’s physical storage allocation)</li><li>Vbmeta — For most android devices flashing a null Vbmeta file is good enough to disable AVB (Android Verified Boot) but for Samsung that will throw you into a bootloop or soft brick your device, hence you have to patch the stock Vbmeta image</li></ul><h3>Download mode and Odin protocol</h3><p>Since Samsung has disabled traditional fastboot mode and it has created its own protocol <em>Odin</em> and a <em>Download</em> mode to go with it.</p><p><em>Download</em> mode is a pre boot state and runs at a very low level. It allows the device to be connect to a pc via USB cable and receive firmware files, kernels, etc via the <em>Odin</em> protocol. While <em>Odin</em> was never officially released to the public, it found its way to enthusiasts and has become the gold standard for Samsung customization.</p><h3>Choosing Your Norse God</h3><h3>Odin: The All-Father (Official/Leaked)</h3><p>Odin is the internal tool used by Samsung technicians. While it was never officially released to the public, various versions have leaked over the years.</p><p><strong>The Good</strong>: It is the most “stable” way to flash official firmware packages (.tar files).</p><p><strong>The Bad</strong>: It’s rigid. Odin expects a specific file structure (BL, AP, CP, CSC). If you want to flash a single specific partition (like a patched vbmeta), Odin can be clunky.</p><h3>Heimdall: The Gatekeeper (Open Source)</h3><p>Named after the god who guards the Bifröst, Heimdall is a cross-platform, open-source alternative to Odin.</p><p><strong>The Good</strong>: It allows for “surgical” flashes. You can target specific partitions (e.g., heimdall flash — VBMETA vbmeta.img) without needing to repackage an entire firmware archive.</p><p><strong>The Bad</strong>: It can be temperamental with drivers on Windows (requires Zadig).</p><h3>Thor: The New Contender</h3><p>Thor is a newer, high-performance CLI tool designed to handle the Odin protocol.</p><p><strong>The Good</strong>: It’s fast and often more descriptive with error codes than Odin.</p><p><strong>The Bad</strong>: It is a newer arrival in the scene and may lack the decades of community troubleshooting documentation that Odin and Heimdall enjoy.</p><p>The Verdict: For this project, I found Heimdall to be the most useful. It gave me the granular control needed to swap out specific images during the trial-and-error phase of bypassing Android Verified Boot (AVB).</p><h3>The solution</h3><p>After soft-bricking the phone more times than I want to admit, I came upon the repackaged super image solution. Essentially you extract a stock super image from Samsung’s firmware and repackage it replacing its system image with you GSI create a new image that fits within the strict byte-limit of the device’s physical storage allocation.</p><p>A silver lining here is that given the bloat in Samsung’s system images, most GSI’s are actually fairly smaller than the system image which makes it possible to stay within the limit.</p><p>After attaining a patched vbmeta and repackaging super image you just have to pick y our favorite norse God and flash the 2 and you’ll have a bloat free android to use.</p><h3>My specific solution for f13</h3><p>I went a step further from removing Samsung bloat and even thinned out the Google bloat by using a vanilla Lineage 21 image to repackage the super image. To make sure I could still use Maps and some other applications, I installed MicroG with Fdroid and that takes care of everything a secondary device may need. You can always go with GApps versions for a much simpler experience.</p><h3>What Works: The Post-Flash Reality</h3><p>The difference is night and day, the Exynos 850 doesn’t become a flagship chip all of a sudden but it become much more snappier you can open multiple applications switch between them and actually use the phone without getting frustrated. However, as with any GSI on Samsung hardware, there is usually a “final boss” to defeat: VoLTE.</p><p>Out of the box, everything from Wi-Fi and Bluetooth to GPS and camera worked flawlessly. But, as expected on an Exynos chip, cellular calling was silent. If you are using this as a daily driver, you’ll need to perform the “IMS Ritual” to get it working.</p><h3>The Fix for VoLTE &amp; Sensors:</h3><ul><li>IMS Support: Download and install the FLOSS IMS APK from Settings &gt; Phh Treble Settings &gt; IMS Features.</li><li>While in IMS features Toggle Request IMS Network to ON and Force presence of 4G calling to ON</li><li>Samsung Specifics: To ensure your brightness and proximity sensors don’t act up, go to Phh Treble Settings &gt; Samsung Features and toggle Enable extra sensors, this is wierdly also required for VoLTE support.</li></ul><p>Once these are set, a quick reboot should bring your VoLTE back from the dead.</p><h3>Final Thoughts</h3><p>While a lot of manufacturers have shifted to bloat free or near stock android builds, Samsung doesn’t seem to be bothered by it and it shows in the laggy nature of its budget models. The budget phone doesn’t need to be much it is not a gaming machine, but what it needs to be is snappy in day to day tasks. It doesn’t need a whole ecosystem operating in it right from Samsung’s own appstore to wallet to a host of non-removable services and apps. The GSI path maybe a path to get snappy performance out of these devices.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0e7b1b45a594" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Flash GSIs on Samsung Devices: A Guide to Patching VBMeta and Repackged Super Images]]></title>
            <link>https://medium.com/@chinmayasharma_56001/how-to-flash-gsis-on-samsung-devices-a-guide-to-patching-vbmeta-and-repackged-super-images-4db5be14f6b7?source=rss-40194a2e5210------2</link>
            <guid isPermaLink="false">https://medium.com/p/4db5be14f6b7</guid>
            <category><![CDATA[custom-rom]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[lineageos]]></category>
            <category><![CDATA[samsung]]></category>
            <dc:creator><![CDATA[Chinmaya Sharma]]></dc:creator>
            <pubDate>Fri, 17 Apr 2026 09:39:24 GMT</pubDate>
            <atom:updated>2026-04-17T09:39:24.511Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B9FfvRcevmKjznzY6Hd1Dg.png" /></figure><h3>For this guide I will focus on the following :</h3><ul><li>Extracting vbmeta image from stock firmware</li><li>Patching vbmeta image</li><li>Flashing repackaged super image</li></ul><p>To learn more about repackaging process check — <a href="https://medium.com/@chinmayasharma_56001/ultimate-guide-to-repacking-samsung-super-images-with-custom-gsis-fde5f96d8c23"><em>https://medium.com/@chinmayasharma_56001/ultimate-guide-to-repacking-samsung-super-images-with-custom-gsis-fde5f96d8c23</em></a></p><h3>Step 1 — Preparation</h3><h3>Download stock firmware</h3><p>You can download stock firmware for your device from — <a href="https://samfw.com/"><em>https://samfw.com/</em></a><em> </em>, Do check your specific version and region before downloading the firmware</p><h3>Get vbmeta patching script</h3><p>Clone/Download this git repository — <a href="https://github.com/WessellUrdata/vbmeta-disable-verification?tab=readme-ov-file"><em>https://github.com/WessellUrdata/vbmeta-disable-verification?tab=readme-ov-file</em></a></p><h3>Install Heimdall</h3><p>For Deb/Ubuntu and Arch distros you can install it via package managers</p><pre>sudo apt install heimdall-flash<br>pacman -S heimdall</pre><p><em>For windows, mac and other distros see — </em><a href="https://glassechidna.com.au/heimdall/#downloads"><em>https://glassechidna.com.au/heimdall/#downloads</em></a></p><p><em>Windows users might need to use Zadig to replace samsung USB driver with libusb</em></p><h3>Step 2 — Extraction</h3><ul><li>Extract the stock firmware zip into a folder</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/0*mDCTXDzO823LCphR.png" /></figure><ul><li>Extract Vbmeta from <em>AP.tar</em> or <em>BL.tar</em> file, it usually exists in <em>BL.tar</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ll1Juitmh9KGZYKjcKb4Nw.png" /></figure><ul><li>Extract <em>vbmeta.img</em> from <em>vbmeta.img.lz4</em></li></ul><h3>Step 3 — Patch Vbmeta image</h3><p>It is important to flash a patched Vbmeta image with Super as patched Vbmeta will disable <em>Android Verified Boot (AVB)</em> and prevent bootloops.</p><ul><li>Copy <em>vbmeta.img</em> in same folder as the patching script</li><li>Run the command</li></ul><pre>$ python patch-vbmeta.py vbmeta.img</pre><ul><li>This will patch the file in place</li><li>Move this patched file to a different folder</li></ul><h3>Step 4 — Unlock OEM boot loader on your Samsung (This step will wipe all data and void your warranty)</h3><p>If you are on One UI 7 or lower this is a fairly straight forward process, if you are on a higher version you’ll need to downgrade. This is an instructive video on how to downgrade — <a href="https://www.youtube.com/watch?v=GkcCHDBYDQM"><em>https://www.youtube.com/watch?v=GkcCHDBYDQM</em></a></p><ul><li>Once you’ve downgraded to One UI 7 (or are on a lower version), go to settings &gt; about phone &gt; software information and tap the build number until you see “You are now a developer” popup.</li><li>Go to settings&gt;developer options and enable oem unlocking and usb debugging</li><li>Plug your phone into your pc and give permission for usb debugging</li><li>Restart phone while plugged in</li><li>Press volume up and down key as soon as Samsung Logo disappears and keep it pressed till you see a teal blue warning screen</li><li>Press and hold volume up to unlock bootloader</li><li>Press volume up to confirm</li><li>Setup the device again</li><li>Enable developer options</li><li>You’ll OEM Unlocking is enabled and greyed out</li><li>Enable usb debugging</li></ul><p><em>You can also watch this video as a guide </em><a href="https://www.youtube.com/watch?v=P8U5F8dfi4U"><em>https://www.youtube.com/watch?v=P8U5F8dfi4U</em></a></p><h3>Step 5 — Flash</h3><ul><li>Restart the device while plugged in and press volume and down together till you see a teal blue warning screen</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/769/1*F9ofQIzhPPdprVun0G7DVg.jpeg" /></figure><ul><li>Press volume up to enter Download mode</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/762/1*en3cx4EkRgT-tQtnwOen0g.jpeg" /></figure><ul><li>On your pc go to the folder which has patched vbmeta and repackaged super images</li><li>Run the following command</li></ul><pre>heimdall flash --SUPER super.img --VBMETA vbmeta.img</pre><ul><li>After both of these are flashed your device will restart</li><li>You’ll see a Samsung warning, press the power button to continue</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/743/1*94vSVzr9RMrAoVt00bEFGQ.jpeg" /></figure><ul><li>First Reboot will take you to recovery select ‘reboot’ or ‘try again’</li><li>When you come to recovery again select ‘wipe data’ or ‘format data’</li><li>After this device will load into your GSI</li></ul><blockquote>If you are on F13(SM-E135F/D) you can download a repacked super from — <a href="https://1drv.ms/f/c/868c86347ddc9bb6/IgAFz7xnKMapTJiPEJ2xKZRQAe3pWVu33gsbrQ7PWXfxSRA?e=OcoBat">https://1drv.ms/f/c/868c86347ddc9bb6/IgAFz7xnKMapTJiPEJ2xKZRQAe3pWVu33gsbrQ7PWXfxSRA?e=OcoBat</a> or repackage your own with this guide — <a href="https://medium.com/@chinmayasharma_56001/ultimate-guide-to-repacking-samsung-super-images-with-custom-gsis-fde5f96d8c23">https://medium.com/@chinmayasharma_56001/ultimate-guide-to-repacking-samsung-super-images-with-custom-gsis-fde5f96d8c23</a></blockquote><blockquote>I have used Andy Yan’s Lineage OS 21 builds to create my super images, do check them out here — <a href="https://sourceforge.net/projects/andyyan-gsi/files/">https://sourceforge.net/projects/andyyan-gsi/files/</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4db5be14f6b7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ultimate Guide to Repacking Samsung Super Images with Custom GSIs]]></title>
            <link>https://medium.com/@chinmayasharma_56001/ultimate-guide-to-repacking-samsung-super-images-with-custom-gsis-fde5f96d8c23?source=rss-40194a2e5210------2</link>
            <guid isPermaLink="false">https://medium.com/p/fde5f96d8c23</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[custom-rom]]></category>
            <category><![CDATA[exynos]]></category>
            <category><![CDATA[samsung]]></category>
            <dc:creator><![CDATA[Chinmaya Sharma]]></dc:creator>
            <pubDate>Fri, 17 Apr 2026 05:09:58 GMT</pubDate>
            <atom:updated>2026-04-18T11:57:12.463Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AAuGwHK1D7H7Sp3zpwbp8A.png" /></figure><p>This is a simple step by step guide to repackage the Super Image for Samsung androids with GSIs. This is particularly useful if you want to flash GSIs to samsung devices via Heimdall or similar tools. In this guide I’ll use Samsung F13 as an example.</p><p><em>Do checkout these articles as well <br>Step by step guide to the whole flashing process — </em><a href="https://medium.com/@chinmayasharma_56001/how-to-flash-gsis-on-samsung-devices-a-guide-to-patching-vbmeta-and-repackged-super-images-4db5be14f6b7"><em>https://medium.com/@chinmayasharma_56001/how-to-flash-gsis-on-samsung-devices-a-guide-to-patching-vbmeta-and-repackged-super-images-4db5be14f6b7</em></a><em><br>A deeper dive into GSI and Samsung specific challenges — </em><a href="https://medium.com/@chinmayasharma_56001/norse-god-conundrum-gsis-on-exynos-samsungs-0e7b1b45a594"><em>https://medium.com/@chinmayasharma_56001/norse-god-conundrum-gsis-on-exynos-samsungs-0e7b1b45a594</em></a></p><h3>Step 1 — Preparation</h3><p>Download stock firmware and GSI for your specific device.</p><p>You can use the treble info app to find out which type of GSI you might need.</p><p>F13 has a ARM 32 CPU with a 64 bit binder and dynamic partition, hence the GSI name will look similar to <em>system-a64-bxx.img.xz</em></p><p>Get lpmake and lpunmake , these are the tools we’ll use to repackage the image.</p><pre># Clone a mirror of the AOSP partition tools<br>git clone https://github.com/Exynos-nigg/lpunpack-lpmake-mirror.git<br>cd lpunpack-lpmake-mirror<br><br># Give the binaries execution permissions<br># This is not required in windows<br>chmod +x binary/lpmake binary/lpunpack<br># Move them to your local bin so you can run them from anywhere<br># Linux<br>sudo cp binary/lpmake /usr/local/bin/<br>sudo cp binary/lpunpack /usr/local/bin/<br># Windows, run this in powershell run as administrator<br>[Environment]::SetEnvironmentVariable(&quot;Path&quot;, $env:Path + &quot;;&quot; + (Get-Item &quot;.\binary&quot;).FullName, &quot;User&quot;)<br># Alternatively you can also copy the lpmake and lpunpack files to a permanent folder (e.g., C:\tools\aosp-tools\) <br># and then edit user variables under environment variables</pre><p><em>Some links to browse GSI images :<br></em><a href="https://github.com/phhusson/treble_experimentations/wiki/Generic-System-Image-(GSI)-list"><em>https://github.com/phhusson/treble_experimentations/wiki/Generic-System-Image-(GSI)-list</em></a><em><br></em><a href="https://sourceforge.net/projects/andyyan-gsi/files/"><em>https://sourceforge.net/projects/andyyan-gsi/files/</em></a></p><p><em>Download stock firmware from — </em><a href="https://samfw.com/"><em>https://samfw.com/</em></a><em><br>lpmake and lpunmake repo — </em><a href="https://github.com/Exynos-nigg/lpunpack-lpmake-mirror.git"><em>https://github.com/Exynos-nigg/lpunpack-lpmake-mirror.git</em></a></p><h3>Step 2 — Extraction</h3><p>Once you have downloaded the stock firmware and GSI (for this example I have <em>lineage-21.0–20250621-UNOFFICIAL-a64_bvS.img.gz</em> GSI and F13 stock firmware) we will extract super.img and system.img files.</p><h4>Extraction of super image from stock firmware</h4><ul><li>Extract the firmware zip file, that will give you multiple tar files</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/864/1*IoG4jwUXncdJjGYYkyOGFQ.png" /></figure><ul><li>Extract the tar file starting with <em>AP</em></li><li>Extracted <em>AP</em> will have <em>super.img.lz4</em> file in it we will extract this to get <em>super.img</em> file</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/862/1*xV_G6TrAxa4cgT3RG48uXQ.png" /></figure><ul><li>Extract <em>super.img</em> in a separate folder, this will form the basis of our repackaged <em>super.img</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/869/1*ZPTY37vOkviZXueqhjXpKQ.png" /></figure><h4>Extraction of system image from GSI</h4><ul><li>Extract the downloaded GSI</li><li>You will find a single <em>.img</em> file with the same name as the compressed file, in this example <em>lineage-21.0–20250621-UNOFFICIAL-a64_bvS.img</em></li></ul><h3>Step 3 —Size calculations</h3><p>Due to lack of a normal fastboot mode, we cannot resize the super partition this means the repackaged file must fit within the strict byte-limit of the device’s physical storage allocation. Now this is not very tough because samsung’s own <em>system.img</em> is filled with bloatware and most GSIs will be smaller than it by some margin. However if you face a difficulty in size try going to vanilla images without GApps, you can always add MicroG later.</p><h4>Finding the “Magic Number”</h4><p>You cannot guess this size. You must use a tool like Thor or Heimdall to print the PIT (Partition Information Table). Look for the SUPER entry and find the Block Count.The Formula: &gt; BlockCount×512=TotalBytes<em>BlockCount</em>×512=<em>TotalBytes</em></p><h3>Step 4 — Repackage</h3><ul><li>Rename the GSI image to <em>system.img</em></li><li>Copy and paste this file into the folder where you extracted <em>super.img</em> and overwrite the existing <em>system.img</em></li><li>In this folder run the following command using sizes we calculated earlier</li></ul><pre>lpmake --metadata-size 65536 \<br>       --super-name super \<br>       --metadata-slots 2 \<br>       --device super:[TOTAL_BYTES] \<br>       --group main:[TOTAL_BYTES] \<br>       --partition system:readonly:$(stat -c%s system.img):main --image system=system.img \<br>       --partition vendor:readonly:$(stat -c%s vendor.img):main --image vendor=vendor.img \<br>       --partition product:readonly:$(stat -c%s product.img):main --image product=product.img \<br>       --partition odm:readonly:$(stat -c%s odm.img):main --image odm=odm.img \<br>       --sparse --output [name_of_new_file].img</pre><blockquote>All this is good for theory in practice you can just give your super block output from PIT command and the generic lpmake command to any AI tool and it should be able to fill it up for you</blockquote><p>Now that you have a super image you can flash it via Heimdall or package it further as the AP file in from stock firmware and flash it via Odin.\</p><blockquote><strong>Note</strong> Flashing just this super image will likely not work, you need to flash a patched version of vbmeta.img as well, I explan that further here —</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fde5f96d8c23" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>