<?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 H. M. Masum Billah on Medium]]></title>
        <description><![CDATA[Stories by H. M. Masum Billah on Medium]]></description>
        <link>https://medium.com/@masum-billah?source=rss-0efccca62f4d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*3HUQyXJlyxUKODPb5hf1hQ.jpeg</url>
            <title>Stories by H. M. Masum Billah on Medium</title>
            <link>https://medium.com/@masum-billah?source=rss-0efccca62f4d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 13:23:35 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@masum-billah/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[Your Lights Are Gossiping: How Bluetooth Mesh Lets 1,000 Devices Talk Without a Router]]></title>
            <link>https://masum-billah.medium.com/your-lights-are-gossiping-how-bluetooth-mesh-lets-1-000-devices-talk-without-a-router-fd538f36e0a9?source=rss-0efccca62f4d------2</link>
            <guid isPermaLink="false">https://medium.com/p/fd538f36e0a9</guid>
            <category><![CDATA[bluetooth-mesh]]></category>
            <category><![CDATA[bluetooth]]></category>
            <category><![CDATA[bluetooth-low-energy]]></category>
            <category><![CDATA[ble]]></category>
            <dc:creator><![CDATA[H. M. Masum Billah]]></dc:creator>
            <pubDate>Mon, 05 Oct 2026 08:10:14 GMT</pubDate>
            <atom:updated>2026-10-05T08:12:51.822Z</atom:updated>
            <content:encoded><![CDATA[<p>No hub. No Wi-Fi. No routing tables. Just tiny radios passing notes. Here’s how it works, and how to build one this weekend.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zdbt_N-iOn4wn92TA-VxXg.png" /></figure><p><strong>Quick take (for the skimmers):</strong></p><ul><li>Bluetooth Mesh turns ordinary BLE chips into a many-to-many network.</li><li>It doesn’t route messages. It floods them, then carefully limits the flood.</li><li>Every message is encrypted with layered keys, so a hacked light bulb can’t read your door lock.</li><li>Battery sensors can last for years by sleeping while a “Friend” node holds their mail.</li></ul><h3>The office where nobody is in charge</h3><p>Picture a 40-floor office tower with 5,000 smart lights. There’s no central controller and no cables running between them. You press a switch in the lobby and a light on floor 32 turns on.</p><p>The command doesn’t travel in a straight line. It hops from lamp to lamp, a bit like office gossip. If a lamp breaks or a door blocks the signal, the message takes another route. Nobody planned the route, and nobody has to repair it.</p><p>That’s <strong>Bluetooth Mesh</strong>. To see why it’s clever, you first need to see why normal Bluetooth can’t do this.</p><h3>Step 1: Why normal BLE hits a wall</h3><p><strong>Bluetooth Low Energy (BLE)</strong> arrived in 2010 as a different radio protocol from classic Bluetooth. It was built for small bursts of data and years of battery life, which makes it good for fitness bands, beacons, and sensors.</p><p>It works on the 2.4 GHz band, which it splits into 40 channels. Three of those (37, 38, 39) are <strong>advertising channels</strong>, where devices shout “I’m here!” to anyone listening. The other 37 carry connections.</p><p>The catch is that BLE is built around a <strong>star</strong>. Your phone (the central) connects to a heart-rate strap (the peripheral), one to one. A phone can only hold a handful of connections at once and can’t reach across a building. Five thousand light bulbs don’t fit that model.</p><p>So the Bluetooth SIG did something smart. They didn’t invent a new radio. They built a networking layer on top of the existing one.</p><h3>Step 2: The mesh stack</h3><p>Bluetooth Mesh (Profile 1.0, July 2017) is software layered over standard BLE 4.0+ hardware. That’s why cheap chips from Nordic, Silicon Labs, Espressif, and Telink can all run it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fu314olKD7Ku69WzsORHUg.png" /></figure><p>Read the diagram from the bottom up:</p><ul><li><strong>Bearer:</strong> how packets physically travel. Mesh messages mostly ride inside ordinary BLE advertising packets (the ADV bearer). A second option, the GATT bearer, lets a normal smartphone connect.</li><li><strong>Network layer:</strong> addressing, relaying, and encryption with the network key.</li><li><strong>Lower and upper transport:</strong> splitting large messages into pieces and encrypting application data.</li><li><strong>Access layer, foundation models, and models:</strong> the application behavior, such as “turn on” or “report temperature.”</li></ul><h3>Step 3: Meet the cast</h3><p>Mesh has its own vocabulary, but only three words matter:</p><ul><li><strong>Node:</strong> any device in the network (a bulb, a switch, a sensor).</li><li><strong>Element:</strong> an addressable part of a node. A two-channel LED driver has two elements, each with its own address.</li><li><strong>Model:</strong> the behavior of an element. It defines the <strong>states</strong> (like OnOff or Brightness) and the <strong>messages</strong> (Get, Set, Status) it understands.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OH8VUQ9II54jVE73nyu7Aw.png" /></figure><p>The Bluetooth SIG standardizes models for lighting, sensors, time, and scenes. A switch from one vendor can control a bulb from another, because both speak the same model language.</p><h4>Publish and subscribe: the part that makes it feel like magic</h4><p>Devices don’t send commands to each other directly. Instead:</p><ol><li>A wall switch <strong>publishes</strong> “ON” to a group address, say “Living Room.”</li><li>Every bulb <strong>subscribed</strong> to “Living Room” turns on.</li></ol><p>The switch has no idea which bulbs exist. To rearrange your house, you change subscriptions rather than rewire anything.</p><h3>Step 4: How a message actually travels</h3><p>Most people assume the network works out the best path, like Wi-Fi or the internet. It doesn’t. <strong>Bluetooth Mesh has no routing tables.</strong> It uses <strong>managed flooding</strong>:</p><ol><li>A node broadcasts the message.</li><li>Every node in range hears it.</li><li>Nodes with the <strong>Relay</strong> feature rebroadcast it.</li><li>Repeat until the message has reached everyone.</li></ol><p>Pure flooding would drown the network in duplicates. Mesh keeps it in check with a few rules:</p><ul><li><strong>TTL (Time To Live):</strong> a hop counter that drops by one at each relay. At zero, the message dies (maximum 127 hops).</li><li><strong>Message cache:</strong> nodes remember what they’ve already seen and never relay the same packet twice.</li><li><strong>Random delays:</strong> small jitters keep neighbors from transmitting at the same moment.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-tHy8IilNYHa1tKxg14BRQ.png" /></figure><p>Notice what happens at Relay C. It hears the message from both A and B, and its cache drops the second copy. If Relay A died, B’s copy would still get through. That redundancy is the self-healing: <strong>a dead node or a closed door is just another obstacle the flood goes around.</strong></p><h3>Step 5: Not all nodes are equal</h3><p>Any node can take on special roles:</p><p>FeatureWhat it does<strong>Relay</strong>Rebroadcasts messages to extend range<strong>Proxy</strong>Lets a phone join using normal BLE connections<strong>Friend</strong>Stores messages for a sleeping neighbor<strong>Low Power Node</strong>Sleeps most of the time to save battery</p><p>The last two are the trick behind years-long battery life. A door sensor can’t keep its radio listening all day. So it pairs with a mains-powered <strong>Friend</strong> that holds its mail. The Low Power Node wakes up every few seconds or minutes, asks “anything for me?”, collects its messages, and goes back to sleep.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0tUHoWX_Qm6nw4gmTplpgw.png" /></figure><h3>Step 6: Joining the network (provisioning)</h3><p>A brand-new device is just an “unprovisioned device” shouting beacons. Turning it into a node is called <strong>provisioning</strong>:</p><ol><li>The device advertises that it wants to join.</li><li>A <strong>Provisioner</strong> (usually a phone app) invites it.</li><li>The two exchange public keys (ECDH P-256) to create a shared secret.</li><li>They authenticate out of band, for example by entering a number the LED blinks.</li><li>The Provisioner sends the network key, an address, and the current IV Index.</li><li>The Provisioner configures the node: application keys, publish and subscribe addresses, and features.</li></ol><p>Once that’s done, the device is a full member of the mesh.</p><h3>Step 7: Why a hacked bulb can’t open your door</h3><p>Mesh was designed with security first. Everything is encrypted and authenticated with AES-CCM (128-bit), using three layers of keys:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xuqoD-ePlioTsD2Mg9mgpg.png" /></figure><ul><li><strong>Network key (NetKey):</strong> shared by every node. It lets any node relay, but it doesn’t reveal the application data.</li><li><strong>Application key (AppKey):</strong> shared only within one application. Lights share one, HVAC has another.</li><li><strong>Device key (DevKey):</strong> unique per node, known only to the node and the Provisioner. Used for configuration.</li></ul><p>So a relay node can pass along a message without reading it. A compromised bulb can’t decrypt the door lock’s traffic. Replay attacks are blocked by sequence numbers tied to a network-wide IV Index. Message headers are obfuscated to make tracking harder, and keys can be refreshed if one is suspected to be compromised.</p><h3>The honest part: what mesh is bad at</h3><p>Bluetooth Mesh is not magic, and it’s worth knowing the limits before you commit:</p><ul><li><strong>Tiny messages.</strong> A mesh packet carries about 11 bytes of payload. Segmentation stretches that to 384 bytes. Think commands and sensor readings, not firmware downloads or audio.</li><li><strong>Flooding gets noisy.</strong> In very dense networks, all those rebroadcasts cause congestion.</li><li><strong>Relays can’t sleep.</strong> A relay’s radio stays on, so it needs real power.</li><li><strong>Latency grows with hops.</strong> Ten hops is slower than two.</li></ul><h3>What’s new in Mesh 1.1 (2023)</h3><p>The 2023 update targeted exactly those weaknesses:</p><ul><li><strong>Directed forwarding</strong> builds efficient paths for specific traffic instead of flooding everything.</li><li><strong>Remote provisioning</strong> adds devices that are out of the Provisioner’s direct range.</li><li><strong>Over-the-mesh firmware updates</strong> (DFU and BLOB transfer).</li><li><strong>Subnet bridging</strong> and <strong>private beacons</strong> for better isolation and privacy.</li></ul><h3>Where you’ll actually find it</h3><ul><li><strong>Smart lighting:</strong> the flagship use case, with thousands of luminaires, scenes, and occupancy sensing.</li><li><strong>Building automation:</strong> HVAC, access control, environmental sensing.</li><li><strong>Industrial IoT:</strong> sensors across factory floors.</li><li><strong>Asset tracking:</strong> finding equipment in hospitals and warehouses.</li></ul><h3>Build one this weekend</h3><p>You don’t need a lab. Here’s a two-board project:</p><ol><li>Grab two <strong>Nordic nRF52840 DKs</strong> (or ESP32 boards using ESP-BLE-MESH).</li><li>Flash one with a <strong>Generic OnOff Client</strong> (a button) and the other with a <strong>Generic OnOff Server</strong> (an LED).</li><li>Install the <strong>nRF Mesh</strong> app on your phone.</li><li>Provision both boards, assign an AppKey, and set the client to publish to a group the server subscribes to.</li><li>Press the button on board A and watch the LED light on board B.</li></ol><p>Then add a third board in the middle with Relay enabled and move the boards apart until the link only works through the relay. The first time a message hops through a device you didn’t directly address, mesh clicks.</p><h3>The takeaway</h3><p>Bluetooth Mesh takes the humblest thing BLE does, a small advertising broadcast, and turns it into a secure, self-healing, many-to-many network. It does that with no hub, no routing tables, and no special radio.</p><p>It won’t stream your music. But if you need a thousand lights, sensors, and switches to cooperate reliably on coin cells and cheap chips, it’s one of the most practical tools around.</p><p><em>Enjoyed this? Clap, follow, and tell me what you want next: provisioning internals, a hands-on nRF52 tutorial, or a head-to-head with Thread and Zigbee.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fd538f36e0a9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ProGuard in React Native: Shrinking Your Android App Without Breaking It]]></title>
            <link>https://masum-billah.medium.com/proguard-in-react-native-shrinking-your-android-app-without-breaking-it-445c51273a22?source=rss-0efccca62f4d------2</link>
            <guid isPermaLink="false">https://medium.com/p/445c51273a22</guid>
            <category><![CDATA[proguard-rules]]></category>
            <category><![CDATA[proguard]]></category>
            <category><![CDATA[react-native-app]]></category>
            <category><![CDATA[android-proguard]]></category>
            <category><![CDATA[react-native-development]]></category>
            <dc:creator><![CDATA[H. M. Masum Billah]]></dc:creator>
            <pubDate>Wed, 30 Sep 2026 05:41:42 GMT</pubDate>
            <atom:updated>2026-09-30T05:41:42.027Z</atom:updated>
            <content:encoded><![CDATA[<p>Smaller APKs, harder-to-read code, and the release-build crash that only shows up in production.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*31x4qGTwFoixbdzKNOuXkA.png" /></figure><p>You’ve spent weeks building your React Native app. It works perfectly in debug. You generate a release build, install it, tap a button, and the app dies instantly.</p><p>If that has happened to you, there’s a good chance ProGuard (or more precisely, R8) is the culprit. This post covers what it does, how to enable it in a React Native project, and how to write the rules that keep it from breaking your app.</p><h3>What is ProGuard (and what about R8)?</h3><p>ProGuard is a tool that processes Java/Kotlin bytecode. It does four things:</p><ul><li><strong>Shrinks</strong> the code by removing classes, methods, and fields nobody uses.</li><li><strong>Optimizes</strong> the bytecode by inlining methods, removing dead branches, and so on.</li><li><strong>Obfuscates</strong> names, so com.myapp.PaymentService.validateCard() becomes something like a.b.c().</li><li><strong>Preverifies</strong> the code (a legacy step on Android).</li></ul><p>A small clarification: modern Android builds don’t actually run ProGuard anymore. Since Android Gradle Plugin 3.4, the default tool is <strong>R8</strong>, Google’s replacement. R8 reads the same configuration format, so everything called “ProGuard rules” still applies. The file is still named proguard-rules.pro, and everyone still says &quot;ProGuard.&quot;</p><h3>What it does and doesn’t touch in React Native</h3><p>This trips up many developers, so it’s worth being clear:</p><ul><li><strong>Your JavaScript is not affected.</strong> Metro and Hermes handle the JS bundle. ProGuard/R8 never sees it.</li><li><strong>Only the native Android layer is processed.</strong> That means React Native’s own Java/Kotlin classes, your custom native modules, and every native library your dependencies pull in.</li></ul><p>React Native relies heavily on <strong>reflection</strong>. The bridge finds native modules by name, calls methods through annotations, and instantiates classes dynamically. R8 can’t see those usages during static analysis, so it assumes the classes are unused and removes or renames them. The result is crashes like ClassNotFoundException, NoSuchMethodError, or a native module that comes back undefined in JS.</p><p>Keep rules are how you tell R8, “Leave this alone.”</p><h3>Enabling ProGuard in React Native</h3><p>Open android/app/build.gradle. Depending on your React Native version, you&#39;ll find something like this near the top:</p><pre>/**<br> * Set this to true to Run Proguard on Release builds to minify the Java bytecode.<br> */<br>def enableProguardInReleaseBuilds = false</pre><p>Flip it to true, then check the release build type:</p><pre>android {<br>    buildTypes {<br>        release {<br>            minifyEnabled enableProguardInReleaseBuilds<br>            shrinkResources true<br>            proguardFiles getDefaultProguardFile(&quot;proguard-android.txt&quot;), &quot;proguard-rules.pro&quot;<br>            signingConfig signingConfigs.release<br>        }<br>    }<br>}</pre><p>What each line does:</p><ul><li>minifyEnabled turns on code shrinking, obfuscation, and optimization.</li><li>shrinkResources removes unused resources. It only works when minifyEnabled is on.</li><li>proguardFiles lists the rule files. The first is Android&#39;s default set, and the second is your own file at android/app/proguard-rules.pro.</li></ul><p>Then build a release version:</p><pre>cd android<br>./gradlew assembleRelease<br># or, for the Play Store<br>./gradlew bundleRelease</pre><h3>The anatomy of a ProGuard rule</h3><p>Rules look cryptic at first, but there are only a handful of patterns you’ll use regularly.</p><p><strong>Keep a class and everything inside it:</strong></p><pre>-keep class com.mylibrary.** { *; }</pre><p><strong>Keep only the members of a class if the class itself survives:</strong></p><pre>-keepclassmembers class com.myapp.models.** { *; }</pre><p><strong>Keep classes that have annotated members</strong> (very common in RN):</p><pre>-keepclasseswithmembers class * {<br>    @com.facebook.react.bridge.ReactMethod &lt;methods&gt;;<br>}</pre><p><strong>Suppress warnings for classes you know are safe to ignore:</strong></p><pre>-dontwarn com.somelibrary.**</pre><p><strong>Keep attributes</strong> that reflection and serialization depend on:</p><pre>-keepattributes *Annotation*, Signature, InnerClasses, EnclosingMethod</pre><p>A quick note on wildcards: * matches within one package level, ** matches across packages, and { *; } means &quot;all fields and methods.&quot;</p><h3>A solid baseline for React Native</h3><p>React Native ships with its own consumer rules, so a fresh project needs very little. But as you add libraries, you’ll usually need entries like these in proguard-rules.pro:</p><pre># Hermes<br>-keep class com.facebook.hermes.unicode.** { *; }<br>-keep class com.facebook.jni.** { *; }<br><br># React Native Reanimated<br>-keep class com.swmansion.reanimated.** { *; }<br>-keep class com.facebook.react.turbomodule.** { *; }<br><br># Keep your own native modules<br>-keep class com.myapp.nativemodules.** { *; }<br><br># Keep model classes used with JSON serialization (Gson, Moshi, etc.)<br>-keep class com.myapp.models.** { *; }<br><br># Common warnings you can safely silence<br>-dontwarn okhttp3.**<br>-dontwarn okio.**<br>-dontwarn javax.annotation.**</pre><p>Always check each library’s README for its recommended rules. Libraries like Reanimated, react-native-mmkv, Firebase, and Stripe usually document exactly what to add. Some bundle their own consumer rules, so you may not need to add anything.</p><h3>Debugging a ProGuard crash</h3><p>When a release build crashes and debug doesn’t, work through this checklist.</p><p><strong>1. Confirm it’s actually R8.</strong> Set enableProguardInReleaseBuilds = false, rebuild, and see if the crash disappears. If it does, you&#39;ve found your cause.</p><p><strong>2. Read the stack trace carefully.</strong> Look for ClassNotFoundException, NoSuchMethodException, NoSuchFieldError, or AbstractMethodError. The class name in the error is usually what needs a keep rule.</p><p><strong>3. Check the R8 output.</strong> After a build, look in android/app/build/outputs/mapping/release/. You&#39;ll find:</p><ul><li>mapping.txt maps obfuscated names back to originals.</li><li>usage.txt lists everything R8 removed.</li><li>seeds.txt lists everything your keep rules matched.</li></ul><p>Searching usage.txt for the class in your crash is often the fastest way to confirm it was stripped.</p><p><strong>4. Add a rule, rebuild, retest.</strong> Start narrow (-keep class com.foo.SpecificClass) before reaching for broad wildcards.</p><h3>De-obfuscating crash reports</h3><p>Once obfuscation is on, production stack traces look like this:</p><pre>at a.b.c.d(Unknown Source:12)</pre><p>That’s useless without the mapping file. Two options:</p><ul><li><strong>Upload the mapping file</strong> to your crash reporter. Firebase Crashlytics and Sentry both support it, and Crashlytics’ Gradle plugin can do it automatically. Google Play Console also accepts mapping files when you upload an AAB.</li><li><strong>Retrace manually</strong> using the retrace tool from the Android SDK:</li></ul><pre>retrace mapping.txt stacktrace.txt</pre><p>Keep the mapping.txt for <strong>every release</strong> you ship. A mapping file only works for the exact build that produced it.</p><h3>Best practices</h3><ul><li><strong>Test the release build, not just debug.</strong> Make assembleRelease part of your regular QA routine or CI pipeline.</li><li><strong>Be specific with keep rules.</strong> -keep class ** { *; } will &quot;fix&quot; everything, but it disables most of the benefit.</li><li><strong>Add rules when you add libraries,</strong> not after the crash reports come in.</li><li><strong>Archive mapping files</strong> alongside your release artifacts.</li><li><strong>Don’t treat obfuscation as security.</strong> It slows down casual reverse engineering but won’t stop a determined attacker. Never store secrets in your app.</li></ul><h3>Wrapping up</h3><p>ProGuard/R8 gives you smaller APKs and a slightly harder-to-read native layer for a few lines of Gradle config. The price is that reflection-heavy frameworks like React Native need explicit keep rules to survive shrinking.</p><p>The workflow is simple: enable it, test the release build early, read the crash carefully, and add the narrowest rule that fixes it. Do that consistently, and ProGuard becomes something you set up once instead of a source of production surprises.</p><p><em>Found this helpful? Give it a clap and follow for more React Native deep dives.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=445c51273a22" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cybersecurity in the AI Era: Why the Rules of the Game Just Changed]]></title>
            <link>https://masum-billah.medium.com/cybersecurity-in-the-ai-era-why-the-rules-of-the-game-just-changed-dddb43e407c2?source=rss-0efccca62f4d------2</link>
            <guid isPermaLink="false">https://medium.com/p/dddb43e407c2</guid>
            <category><![CDATA[cyberattack]]></category>
            <category><![CDATA[cyber-security-awareness]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[information-security]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[H. M. Masum Billah]]></dc:creator>
            <pubDate>Wed, 16 Sep 2026 09:16:23 GMT</pubDate>
            <atom:updated>2026-09-16T09:16:23.235Z</atom:updated>
            <content:encoded><![CDATA[<h4>A few years ago, cybersecurity was a fairly predictable game. Hackers wrote malware, security teams wrote detection rules, and the two sides played a slow game of cat and mouse. Then AI showed up, and it didn’t just add a new player to the board — it rewrote the rules entirely.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hd43uOMovVVAr9f1TSKqKg.png" /><figcaption>Cybersecurity in the New AI Era</figcaption></figure><p>Today, AI is both the best weapon defenders have and the sharpest tool attackers have ever held. Understanding that double-edged reality is no longer optional — especially if you’re a developer, since so much of this fight now happens inside code, pipelines, and the tools you use every day.</p><h3>Before AI vs. After AI: A Side-by-Side Look</h3><p>The clearest way to see the shift is to compare how things used to work against how they work now.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/765/1*fPu5reXjoHJYTvtXHvxuKQ.png" /></figure><p>The pattern is clear: AI hasn’t just made existing threats faster — it’s lowered the skill floor for attackers while raising the ceiling for what defenders can catch. Both sides leveled up, but the game itself became faster and less forgiving of mistakes.</p><h3>What Changed for Attackers</h3><ul><li><strong>Generative AI writes convincing phishing content</strong> in seconds, in any tone or language, tailored to a specific target using scraped public data.</li><li><strong>AI-assisted malware</strong> can adapt its own behavior to evade detection instead of relying on a fixed signature.</li><li><strong>Automated exploit discovery</strong> means attackers can scan codebases and infrastructure for weaknesses far faster than manual pentesting ever allowed.</li><li><strong>Deepfakes</strong> make voice and video impersonation attacks (like fake “CEO calls” asking for wire transfers) far more convincing than a spoofed email ever was.</li></ul><h3>What Changed for Defenders</h3><ul><li><strong>Real-time anomaly detection</strong> across massive datasets — the kind of pattern-spotting no human team could do manually.</li><li><strong>Predictive vulnerability management</strong>, flagging likely weak points before they’re exploited rather than after.</li><li><strong>Automated incident response</strong>, isolating compromised systems in seconds instead of waiting on a human to act.</li><li><strong>Smarter alert triage</strong>, cutting through noise so security teams spend time on real threats instead of false positives.</li></ul><h3>Why This Matters Even More for Developers</h3><p>If you write code, AI has changed your threat model directly — not just the abstract “cybersecurity landscape” but the actual software supply chain you work in every day.</p><p><strong>1. AI-generated code introduces new risk.</strong> Copilot-style tools are incredible for speed, but studies have repeatedly found that AI-suggested code can include insecure patterns — hardcoded secrets, outdated dependencies, SQL injection-prone queries, or weak cryptographic defaults — because the model is pattern-matching on public code, not reasoning about your specific security context. Treat AI-generated code the way you’d treat a pull request from a junior contributor: useful, but it needs review.</p><p><strong>2. Your dependencies are now an AI attack surface.</strong> Package repositories (npm, PyPI, crates.io) have seen a rise in AI-assisted “slopsquatting” — malicious packages with names close to popular ones, sometimes generated because an AI coding assistant hallucinated a package name that didn’t exist, and an attacker registered it first. Always verify package names and sources before installing, especially ones suggested by an AI tool.</p><p><strong>3. Prompt injection is the new SQL injection.</strong> If you’re building anything that feeds user input into an LLM — a chatbot, an AI agent, a RAG pipeline — you now have a new class of vulnerability to defend against. Malicious input can trick a model into leaking system prompts, exposing data it shouldn’t, or taking unintended actions if it has tool access. This is a genuinely new category of bug, and traditional input sanitization doesn’t fully solve it.</p><p><strong>4. Secrets management matters more than ever.</strong> AI coding assistants often have broad context access (your codebase, sometimes your terminal or file system). If an assistant is compromised, misconfigured, or tricked via injected instructions in a file it reads, it could inadvertently expose API keys, credentials, or internal logic. Keep secrets out of code and context wherever possible, and be deliberate about what an AI tool can access.</p><p><strong>5. CI/CD pipelines are a bigger target.</strong> As more of the build-test-deploy pipeline gets automated (sometimes with AI-assisted scripts), attackers increasingly target the pipeline itself rather than the running application — because compromising a pipeline can mean compromising every downstream deployment.</p><p><strong>6. Model and data security is now part of the job.</strong> If your team fine-tunes models or builds ML pipelines, data poisoning (corrupting training data to bias or backdoor a model) and model extraction (attackers querying a model to steal its behavior) are real, documented risks — not hypothetical ones.</p><h3>A practical checklist for developers</h3><ul><li>Review AI-generated code for security issues the same way you’d review a human’s — don’t assume it’s safe because it “looks right.”</li><li>Pin dependency versions and verify package names before installing, especially ones an AI assistant suggests.</li><li>Treat any LLM-facing input as untrusted, the same way you’d treat raw user input in a web form.</li><li>Limit what your AI coding tools can access — scope permissions, avoid feeding secrets into context.</li><li>Add security scanning (SAST/dependency scanning) directly into your CI/CD pipeline rather than treating it as a separate, later step.</li><li>If you’re shipping an AI feature, threat-model it separately: what happens if a user tries to manipulate the prompt, the outputs, or the tool calls?</li></ul><h3>The Uncomfortable Middle Ground</h3><p>It’s not just AI versus humans anymore — it’s AI versus AI. Attackers use AI to probe defenses; defenders use AI to anticipate that probing. Because both sides can now operate at machine speed, a breach that once took days to unfold might happen in minutes.</p><p>There’s also a subtler risk: AI systems themselves have vulnerabilities. Securing AI isn’t only about using it defensively — it’s about protecting the AI systems from becoming the next weak link.</p><h3>What This Means Beyond the Codebase</h3><p>For everyday users and businesses, the practical takeaways are simpler but just as important:</p><ul><li><strong>Be skeptical of “urgent” messages</strong>, even ones that sound exactly like someone you know — impersonation has never been easier.</li><li><strong>Multi-factor authentication is non-negotiable.</strong> A password alone is no longer a meaningful barrier.</li><li><strong>Audit your AI tools, not just your network.</strong> If your company uses AI chatbots, automation, or ML models, those need security reviews too.</li><li><strong>Human judgment still matters.</strong> AI flags anomalies well, but understanding context and intent is still a human strength — the best strategies combine both.</li></ul><h3>Looking Ahead</h3><p>We’re at an inflection point. AI isn’t a passing trend in cybersecurity — it’s becoming the foundation of how both attacks and defenses operate. Organizations and developers who treat AI security as an afterthought will find themselves outpaced by adversaries who don’t.</p><p>The encouraging part: this isn’t a battle defenders are doomed to lose. AI gives security teams — and individual developers — capabilities that simply didn’t exist a decade ago. The future of cybersecurity won’t be humans versus machines. It’ll be about how well we pair human judgment with intelligent systems, because the other side is doing exactly the same thing.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dddb43e407c2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What Actually Happens When You Tap an App Icon: A Deep Dive Into Mobile Architecture]]></title>
            <link>https://masum-billah.medium.com/what-actually-happens-when-you-tap-an-app-icon-a-deep-dive-into-mobile-architecture-f55a47e23fce?source=rss-0efccca62f4d------2</link>
            <guid isPermaLink="false">https://medium.com/p/f55a47e23fce</guid>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[react-native-development]]></category>
            <category><![CDATA[flutter-app-development]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <dc:creator><![CDATA[H. M. Masum Billah]]></dc:creator>
            <pubDate>Thu, 10 Sep 2026 06:42:54 GMT</pubDate>
            <atom:updated>2026-09-10T06:52:18.137Z</atom:updated>
            <content:encoded><![CDATA[<h4>Android, iOS, Flutter, and React Native — stripped down to the six problems every mobile framework is really solving</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p-6iy40q4a43fSuGoVIybw.png" /></figure><p>Every mobile developer eventually hits the same wall. You’ve shipped a few apps, you know your framework’s APIs cold, you can wire up a ViewModel or a SwiftUI view without thinking — and then something breaks in a way your framework knowledge can’t explain. A screen randomly loses its state. A background task silently stops running. An animation stutters and you have no idea which layer of the stack is actually responsible.</p><p>That wall exists because most of us learn mobile development top-down: we learn the framework’s API surface long before we learn what’s actually happening underneath it. We memorize onCreate() and viewDidLoad() without ever asking <em>why</em> those callbacks exist in the first place, or what problem they were invented to solve.</p><p>This piece is the bottom-up version. We’re going to start at the operating system and work upward — through native Android, native iOS, and the two dominant cross-platform frameworks — so that by the end, you’re not just able to recite lifecycle callbacks, you understand <em>why</em> every mobile framework that has ever existed, and every one that will exist after Flutter and React Native, has to solve the exact same handful of problems.</p><h3>Part 1: What “Mobile App” Actually Means at the OS Level</h3><p>Before any framework talk, you need the substrate every mobile app sits on.</p><p><strong>Android</strong> runs on a modified <strong>Linux kernel</strong>. Every app runs in its own process, and that process runs inside its own instance of the <strong>Android Runtime (ART)</strong> — a virtual machine that executes compiled bytecode (.dex files), which is compiled Ahead-Of-Time into native machine code at install time, with JIT augmentation at runtime.</p><p><strong>iOS</strong> runs on <strong>XNU</strong>, a hybrid kernel derived from Mach and BSD. Apps compile directly to native ARM64 machine code — there’s no VM or bytecode layer at runtime at all. This is one of the deepest differences between the two platforms: Android interposes a managed runtime between your code and the metal; iOS doesn’t.</p><h3>The sandbox is the whole game</h3><p>Each app gets its own sandboxed process, its own memory space, and its own user ID (Android) or entitlements (iOS). It cannot reach into another app’s memory or files directly. Cross-app communication only happens through OS-mediated channels — Intents and Content Providers on Android, URL Schemes and App Extensions on iOS.</p><p>This sandboxing is <em>why</em> mobile OSes can kill and restart apps aggressively without one app’s crash taking down the whole device. And it’s <em>why</em> your app has to be able to save and restore its own state at any moment — a constraint that turns out to explain almost every “mysterious” bug you’ll ever debug in production.</p><h3>The rendering pipeline nobody teaches you</h3><p>Here’s the part that ties every framework together, no matter how different they look on the surface. UIKit, SwiftUI, Jetpack Compose, XML Views, React Native, Flutter — they all eventually bottom out in the same place: <strong>the GPU drawing pixels into a framebuffer that gets composited to the screen.</strong></p><p>The pipeline looks roughly like this everywhere:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A_pdkiyPpf35firxcc9n7A.png" /></figure><p>Every performance bug you will ever chase in a mobile app is a bottleneck somewhere in this pipeline — too much work in layout (deep view hierarchies), too much work in paint (overdraw, unnecessary redraws), or something blocking the main thread so it can’t even <em>start</em> the frame in time. That last one is what actually causes jank. Not “slow rendering” — a blocked thread that never got a chance to render at all.</p><h3>The bug that isn’t a bug: process death</h3><p>This is the single most misunderstood concept on every mobile platform, and it’s worth its own callout:</p><blockquote><em>Your app can be killed by the OS at any time you’re not in the foreground, to reclaim memory for other apps. This is not a crash. It’s normal, expected behavior — and when the user returns, the OS may relaunch your process from scratch and expect you to restore the UI as if nothing happened.</em></blockquote><p>This single fact is <em>why</em> Android has onSaveInstanceState/SavedStateHandle, why iOS has state restoration APIs, and why — no matter what cross-platform framework you&#39;re using — your global JS store or Dart provider is gone the instant the process dies unless you&#39;ve explicitly persisted it. No framework can paper over this. It&#39;s an OS-level contract every layer above it has to respect.</p><h3>The one-thread rule</h3><p>Every platform enforces some version of the same law: <strong>only one thread may touch the UI.</strong></p><ul><li>Android: the Main/UI thread. Touch a View off it and you get a CalledFromWrongThreadException.</li><li>iOS: the Main thread/RunLoop. Touch UIKit off it and you get <em>undefined behavior</em> — sometimes it silently works, sometimes it crashes, sometimes it just corrupts state. Worse than an explicit exception, honestly.</li><li>React Native and Flutter both have to marshal UI updates back onto this same native main thread eventually, no matter how their own internal threading works.</li></ul><p>This single constraint is the reason every mobile concurrency model exists at all — Coroutines and Dispatchers.Main, GCD&#39;s DispatchQueue.main, Flutter&#39;s isolates, RN&#39;s bridge/JSI hop. They all exist to do heavy work <em>off</em> the main thread and get the result safely back <em>onto</em> it.</p><h3>Part 2: Native Android, From the Inside</h3><p>Kotlin or Java compiles down to bytecode, gets packaged into .dex files, and ART AOT-compiles that to native code at install time (with JIT filling in the hot paths at runtime). Distribution today happens almost entirely through the <strong>Android App Bundle (AAB)</strong> format, from which Google Play generates optimized, device-specific APKs.</p><p><strong>The four pillars</strong> of an Android app are Activities (a single focused screen), Fragments (a reusable UI portion with its own lifecycle, nested inside an Activity), Services (background execution without UI — foreground vs. background, with background heavily restricted since Android 8 for battery reasons), and Broadcast Receivers (responding to system-wide or app-wide events).</p><p>Jetpack is Android’s “batteries included” layer on top of these primitives, and it exists almost entirely to compensate for how unforgiving the raw Activity lifecycle is: <strong>Lifecycle</strong> for auto-cleanup of observers, <strong>ViewModel</strong> for surviving configuration changes, <strong>Room</strong> for type-safe SQLite, <strong>WorkManager</strong> for guaranteed deferred background work that respects Doze mode, and <strong>DataStore</strong> as the modern, Flow-based replacement for SharedPreferences.</p><p><strong>Jetpack Compose</strong> flips the whole model from imperative to declarative: your UI is a function of state, and when observed state changes, only the composables that actually read that state re-execute — a compiler-inserted “smart skip” rather than a full tree walk. If you’ve ever wondered why Compose feels so different from XML Views, that’s the core of it: Views mutate, Compose recomposes.</p><h3>Part 3: Native iOS, From the Inside</h3><p>Swift and Objective-C compile through LLVM straight to native ARM64 — no VM layer at all. Memory is managed by <strong>ARC (Automatic Reference Counting)</strong>, which inserts retain/release calls at compile time rather than relying on a garbage collector. This is a genuinely different mental model from Android’s GC: there’s no background process eventually cleaning up your mess. If two objects strongly reference each other — the classic case being a closure capturing self — you get a silent, permanent leak. Nothing ever comes to collect it.</p><p><strong>AppDelegate</strong> handles app-wide lifecycle events; <strong>SceneDelegate</strong> (iOS 13+) manages a single <em>instance</em> of your UI, which matters enormously for iPad multi-window support, since one app can have multiple scenes alive at once. The newer <strong>SwiftUI App lifecycle</strong> can subsume both.</p><p>UIKit is imperative — delegate/target-action patterns, manual view lifecycle callbacks, Auto Layout solved via the Cassowary constraint algorithm. SwiftUI is declarative, conceptually close to Compose: @State for local state, @Bindingfor two-way references, @Observable/@Published for external reactive state. Most production iOS codebases today are hybrids — SwiftUI hosted inside UIKit via UIHostingController, or the reverse — because full migrations take years.</p><p>On the concurrency side, Swift’s newer async/await plus <strong>Actors</strong> is a genuine leap forward: Actors serialize access to their own internal state automatically, which eliminates a whole category of data races <em>by construction</em>, not by convention. @MainActor replaces &quot;remember to dispatch to the main queue&quot; with something the compiler actually enforces.</p><h3>Part 4: How Cross-Platform Frameworks Actually Bridge to Native</h3><p>This is the part most tutorials skip entirely, and it’s the part that actually determines what a framework is good at.</p><p>Every cross-platform framework has to solve the same fundamental problem: your app logic runs in one language and runtime, but the OS only understands native code. <em>How</em> each framework crosses that boundary is the single architectural decision that defines its performance ceiling.</p><h3>React Native: the bridge approach</h3><p>JS runs on its own thread inside a JS engine (Hermes, JSC, or V8). In the old architecture, every native call crossed an <strong>asynchronous, batched, JSON-serialized bridge</strong> — a real bottleneck for anything high-frequency, like gestures or fast list scrolling.</p><p>The <strong>New Architecture</strong>, now standard, replaces this with <strong>JSI (JavaScript Interface)</strong>: JS holds direct references to native C++ objects and calls native methods <em>synchronously</em>, with no serialization step. <strong>Fabric</strong> is the renderer built on top of this, and <strong>TurboModules</strong> lazily load native modules instead of initializing everything at startup.</p><p>The part worth remembering: RN’s UI is still made of <em>real native widgets</em>. A &lt;View&gt; becomes an actual UIView or Android View. Unlike Flutter, React Native never draws its own pixels — it just got a much faster way to ask the native side to draw them.</p><h3>Flutter: bring your own renderer</h3><p>Dart compiles to native ARM machine code. But Flutter doesn’t use native UI widgets at all — it draws <em>every single pixel itself</em>, through its own rendering engine (Skia, increasingly being replaced by Impeller), straight onto a surface the OS hands it.</p><p>This buys you pixel-perfect consistency: a Flutter button looks identical on iOS and Android because Flutter painted it, not the OS. The cost is that Flutter has to reimplement platform look-and-feel from scratch (the Material and Cupertino widget sets), and it can never automatically pick up a native OS design refresh — a new iOS visual paradigm requires a Flutter widget update, not a free ride.</p><h3>Kotlin Multiplatform: share logic, not UI</h3><p>KMP takes a completely different philosophy: share <em>only</em> business logic — networking, data layers, use cases — as compiled native code per platform, while UI stays 100% native (Compose on Android, SwiftUI or UIKit on iOS). No bridge, no shared UI, no runtime interop cost for rendering, because there’s nothing crossing the UI boundary in the first place. You trade “write once” convenience for full native fidelity.</p><p>FrameworkUI RenderingNative Interop CostUI FidelityReact NativeReal native widgetsLow (JSI, new arch)Native-accurateFlutterSelf-drawn (Skia/Impeller)Low internallyConsistent, not nativeKMP100% native per platformNone (no shared UI)Fully native</p><h3>Part 5: The App Lifecycle, Side by Side</h3><p>If there’s one section worth bookmarking, it’s this one — because lifecycle bugs are the single most common source of “it works on my machine” reports in mobile development.</p><p><strong>Android’s Activity lifecycle</strong> is the most explicit and least forgiving of the four:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Sp_PMqwK4R5O5BwjdpkD1A.png" /><figcaption>Android’s Activity Lifecycle</figcaption></figure><p>Two things trip people up constantly. First, a simple screen rotation <strong>destroys and recreates the Activity by default</strong> — which is exactly why ViewModel exists, so your state survives that specific event. Second, process death is a different, scarier thing than onDestroy(): the OS can kill your entire process with no callback guarantee beyond onSaveInstanceState, which only holds small, serializable data. Your ViewModel&#39;s in-memory fields vanish right along with everything else unless you&#39;ve routed them through SavedStateHandle.</p><p><strong>iOS</strong> is friendlier day-to-day — it doesn’t destroy your view controller on rotation — but that friendliness hides the same underlying trap:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cUQc_1xU9-ekQHdHXQO32g.png" /><figcaption>iOS Activity Lifecycle</figcaption></figure><p>iOS gives you seconds, not minutes, to save state once you enter the background, and there’s no OS-enforced restoration mechanism as visible as Android’s — which ironically makes it <em>easier</em> to under-architect for the exact same process-death problem.</p><p><strong>Flutter</strong> exposes a unified, platform-agnostic version of both — resumed, inactive, paused, detached — via WidgetsBindingObserver. But underneath, it&#39;s still hosted inside a real Activity or View Controller, so it inherits whatever that platform does to it. Flutter provides zero magic state restoration of its own beyond what you build with persistent storage.</p><p><strong>React Native</strong> has to reason about <em>two</em> lifecycles simultaneously: the native one (exactly as above) and React’s own component lifecycle on the JS side, tied together by an AppState API that forwards native events into the JS runtime. The RN-specific gotcha: because the JS thread is separate from the native UI thread, a component can technically still be &quot;mounted&quot; from React&#39;s perspective for a brief moment after the native screen has already been backgrounded — the classic source of &quot;setState called on an unmounted component&quot; warnings.</p><p>The pattern underneath all four: <strong>Android is the most explicit and unforgiving about lifecycle</strong>, which is exactly why its ecosystem produced the most formalized lifecycle tooling. iOS, Flutter, and RN all handle rotation gracefully without destroying your screen — which feels friendlier, but makes it easy to forget the one thing all four platforms share unconditionally: <em>the OS can kill your whole process in the background, and only explicit persistence saves you from it.</em></p><h3>Part 6: The Six Problems Every Framework Is Actually Solving</h3><p>Strip away the branding, the marketing, the framework-of-the-year hype cycle, and every mobile app you’ll ever build reduces to six problems:</p><ol><li><strong>Present UI without blocking the single UI thread.</strong></li><li><strong>Survive being paused, backgrounded, and killed without warning.</strong></li><li><strong>Move data reliably between a remote source, local persistence, and the UI</strong> — this is why the repository pattern and “single source of truth” keep showing up no matter what stack you’re in.</li><li><strong>Cross the boundary between your app logic and native OS capabilities safely and efficiently</strong> — whether that’s Kotlin talking to the OS directly, or JS crossing a bridge via JSI.</li><li><strong>Keep business logic testable and decoupled from UI framework churn</strong> — this is the entire reason MVVM, MVI, and Clean Architecture exist.</li><li><strong>Ship it through platform-specific build, signing, and store-review pipelines.</strong></li></ol><p>Every specific technology covered above — Coroutines, Actors, JSI, Skia, WorkManager, SavedStateHandle — is an implementation detail in service of one of these six problems. Once you see them clearly, picking up the <em>next</em>framework (whatever ends up succeeding Flutter or React Native) stops being a fight against unfamiliar APIs and becomes a much faster exercise in recognizing the same six problems wearing a new syntax.</p><p>The OS-level constraints — sandboxing, the single UI thread, unpredictable process death, native compilation targets — aren’t going anywhere. <strong>Learn those, and every framework you’ll ever touch gets easier to reason about, including the ones that don’t exist yet.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f55a47e23fce" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>