<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Vishal pathak</title>
    <description>The latest articles on DEV Community by Vishal pathak (@vishal_pathak_209).</description>
    <link>https://dev.to/vishal_pathak_209</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3713830%2Fb80812d3-2085-4d54-a1f6-8b004cd3422f.jpeg</url>
      <title>DEV Community: Vishal pathak</title>
      <link>https://dev.to/vishal_pathak_209</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vishal_pathak_209"/>
    <language>en</language>
    <item>
      <title>I Reverse-Engineered YouTube to Delete Just the Shorts (Here is the Code)</title>
      <dc:creator>Vishal pathak</dc:creator>
      <pubDate>Sat, 17 Jan 2026 11:20:13 +0000</pubDate>
      <link>https://dev.to/vishal_pathak_209/i-reverse-engineered-youtube-to-delete-just-the-shorts-here-is-the-code-3b84</link>
      <guid>https://dev.to/vishal_pathak_209/i-reverse-engineered-youtube-to-delete-just-the-shorts-here-is-the-code-3b84</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiw8w4qztxvvmnfx6l5xb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiw8w4qztxvvmnfx6l5xb.png" alt="Person sitting on chair with phone in hand" width="800" height="446"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I didn’t block YouTube.&lt;br&gt;
I made Shorts physically impossible to open — in 16ms — using an Android Accessibility Service.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I have a confession: I am a Senior Engineer, and I have the attention span of a goldfish.&lt;/p&gt;

&lt;p&gt;Last month, I sat down to watch a 10-minute tutorial on &lt;strong&gt;Go routines&lt;/strong&gt;.&lt;br&gt;
45 minutes later, I was watching a video of a guy pressure-washing a driveway.&lt;/p&gt;

&lt;p&gt;I tried the standard "App Blockers." They are useless. They are &lt;strong&gt;Hammers&lt;/strong&gt;. They see &lt;code&gt;com.google.android.youtube&lt;/code&gt; and they smash the entire app. But I &lt;em&gt;need&lt;/em&gt; YouTube for learning. I &lt;em&gt;need&lt;/em&gt; LinkedIn for jobs. I just don't want the &lt;strong&gt;Brain Rot&lt;/strong&gt; (Shorts, Reels, Feeds).&lt;/p&gt;

&lt;p&gt;So, I stopped trying to use willpower.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;I built a Scalpel.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I created &lt;strong&gt;&lt;a href="https://play.google.com/store/apps/details?id=company.hashinclude.blokr" rel="noopener noreferrer"&gt;Blokr&lt;/a&gt;&lt;/strong&gt;: A database-driven, accessibility-layer interceptor that surgically removes &lt;em&gt;parts&lt;/em&gt; of an app while keeping the rest alive.&lt;/p&gt;

&lt;p&gt;Here is how I engineered my way out of dopamine addiction.&lt;/p&gt;
&lt;h2&gt;
  
  
  🏗️ The Architecture of a "Digital Scalpel"
&lt;/h2&gt;

&lt;p&gt;Most blockers work at the &lt;strong&gt;OS Layer&lt;/strong&gt; (checking &lt;code&gt;usageStats&lt;/code&gt;).&lt;br&gt;
I decided to go deeper. I went to the &lt;strong&gt;UI Layer&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;To block a &lt;em&gt;specific button&lt;/em&gt; inside an external app (like the "Shorts" tab in YouTube), you have to read the screen faster than the user can click.&lt;/p&gt;
&lt;h3&gt;
  
  
  The Stack
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Brain:&lt;/strong&gt; Flutter (BLoC + Clean Arch)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Muscle:&lt;/strong&gt; Kotlin (Native Accessibility Services)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Eyes:&lt;/strong&gt; Recursive Node Traversal&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Memory:&lt;/strong&gt; Isar DB (Local) + Firestore (Remote Config)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  🧠 The Logic: Traversing the Node Tree
&lt;/h2&gt;

&lt;p&gt;Every Android app is just a tree of &lt;code&gt;AccessibilityNodeInfo&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;When you open YouTube, the OS sees a hierarchy. Most developers use Accessibility Services to help blind users navigate. I used it to &lt;strong&gt;hunt down specific View IDs&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Here is the logic I wrote to detect &lt;em&gt;intent&lt;/em&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;Listen:&lt;/strong&gt; The Service waits for &lt;code&gt;TYPE_WINDOW_CONTENT_CHANGED&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Fetch:&lt;/strong&gt; It pulls the "Blacklist Rules" from my local DB.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Hunt:&lt;/strong&gt; It traverses the UI tree looking for specific &lt;code&gt;resource-id&lt;/code&gt; or &lt;code&gt;content-description&lt;/code&gt; tags.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;
  
  
  The "Kill Switch" Code (Kotlin)
&lt;/h3&gt;

&lt;p&gt;This is the actual native code running on the metal. It’s recursive, it’s dangerous, and it’s beautiful.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight kotlin"&gt;&lt;code&gt;&lt;span class="k"&gt;fun&lt;/span&gt; &lt;span class="nf"&gt;scanTree&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;node&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;AccessibilityNodeInfo&lt;/span&gt;&lt;span class="p"&gt;?,&lt;/span&gt; &lt;span class="n"&gt;targetId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="nc"&gt;Boolean&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;node&lt;/span&gt; &lt;span class="p"&gt;==&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;false&lt;/span&gt;

    &lt;span class="c1"&gt;// 1. Check if this specific node is the "Enemy" (e.g., Shorts Tab)&lt;/span&gt;
    &lt;span class="c1"&gt;// We check viewIdResourceName OR contentDescription&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;node&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;viewIdResourceName&lt;/span&gt;&lt;span class="o"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;contains&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;targetId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;==&lt;/span&gt; &lt;span class="k"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;true&lt;/span&gt; &lt;span class="c1"&gt;// FOUND IT!&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="c1"&gt;// 2. Recursive Search through children&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="n"&gt;until&lt;/span&gt; &lt;span class="n"&gt;node&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;childCount&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;scanTree&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;node&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getChild&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;targetId&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;true&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;false&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If scanTree returns true, Blokr immediately triggers a Global Back Action and overlays a Neo-Brutalist "Access Denied" screen.&lt;/p&gt;

&lt;p&gt;It happens in 16ms. You literally cannot open the Shorts tab. The code is faster than your thumb.&lt;/p&gt;

&lt;h1&gt;
  
  
  🚀 The "Live" Database (Why this is cool)
&lt;/h1&gt;

&lt;p&gt;Here is the problem: &lt;strong&gt;Instagram changes their View IDs every week&lt;/strong&gt;. If I hardcoded &lt;code&gt;id/reel_tab&lt;/code&gt;, the app would break next Tuesday.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Solution:&lt;/strong&gt; I made &lt;a href="https://play.google.com/store/apps/details?id=company.hashinclude.blokr" rel="noopener noreferrer"&gt;Blokr&lt;/a&gt; &lt;strong&gt;Database Driven&lt;/strong&gt;. I have a remote database of "Block Definitions."&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"app_name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Instagram"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"package"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"com.instagram.android"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"features"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Reels Tab"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"target_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"com.instagram.android:id/tab_clips"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; 
      &lt;/span&gt;&lt;span class="nl"&gt;"action"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"BLOCK"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Direct Messages"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"target_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"com.instagram.android:id/action_bar_inbox"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"action"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"ALLOW"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When Instagram updates their app, I don't need to push a release to the Play Store. I just update the JSON in my DB, and &lt;strong&gt;BOOM&lt;/strong&gt;—every user's Blokr app instantly learns the new layout.&lt;/p&gt;

&lt;h2&gt;
  
  
  🎨 Design: Neo-Brutalism or Nothing
&lt;/h2&gt;

&lt;p&gt;I didn't want a "calm" UI. I wanted a UI that yells at you.&lt;br&gt;
I used a &lt;strong&gt;Dark Mode Neo-Brutalist&lt;/strong&gt; aesthetic.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Hard Shadows&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;#000000 Backgrounds&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Neon Accents&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When Blokr stops you, it doesn't say "Please close this." It looks like a system error. It breaks the immersion immediately.&lt;/p&gt;
&lt;h3&gt;
  
  
  🎮 Can you spot the memory leak?
&lt;/h3&gt;

&lt;p&gt;I initially ran the recursive scan on every scroll event. My battery died in 3 hours.&lt;br&gt;
Here is the fix I implemented:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;  // The Bug (Battery Killer) 💀
&lt;span class="gd"&gt;- accessibilityService.on('TYPE_VIEW_SCROLLED', scanNodeTree);
&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;  // The Fix (Debounced) ✅
&lt;span class="gi"&gt;+ accessibilityService.on('TYPE_WINDOW_STATE_CHANGED', debounce(scanNodeTree, 300));
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  🧪 The "Strict Mode" (No Escape)
&lt;/h2&gt;

&lt;p&gt;I know you. You're a dev. You'll just Force Stop the app.&lt;br&gt;
That’s why I implemented &lt;strong&gt;Device Admin Privileges&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;When you enter "Deep Work Mode" in Blokr, I disable the ability to uninstall the app or kill the service until the timer runs out.&lt;br&gt;
I effectively turn your $1,000 Samsung S24 into a Nokia 3310 for 2 hours. It’s terrifying. It’s effective.&lt;/p&gt;

&lt;h2&gt;
  
  
  🔥 The Community Challenge
&lt;/h2&gt;

&lt;p&gt;I am currently mapping the "View IDs" for every major distracting app. But I can't do it alone.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;I need your help to build the ultimate blacklist.&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;👇 Comment below with the ONE specific feature you hate.&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;Is it the LinkedIn "News" feed?&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Is it the Twitter "For You" tab?&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Is it the Facebook "Marketplace" notification?&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Tell me the app and the feature.&lt;/strong&gt; I will reverse-engineer it, find the ID, and add it to the global database this weekend.&lt;/p&gt;

&lt;p&gt;Let's reclaim our brains from the algorithms.&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>android</category>
      <category>productivity</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
