DEV Community

Cover image for How I Removed Persistent Adware Pop-Ups from Android Phone Without a Factory Reset
Mustafa El-Helbawy
Mustafa El-Helbawy

Posted on • Edited on

How I Removed Persistent Adware Pop-Ups from Android Phone Without a Factory Reset

🔧 How I Removed Persistent Adware Pop-Ups from Android Phone Without a Factory Reset

If your Android phone (especially Samsung Galaxy devices) suddenly starts showing random app download ads or popup banners even when idle, you might be dealing with hidden adware.

This guide walks you through how I diagnosed and removed a hidden malicious app — without performing a factory reset or losing any data.


🛠️ Step 0: Validate the Issue in Safe Mode

Before suspecting system corruption or malware, first confirm if the problem is caused by a third-party app.

  1. Hold the Power button on your Samsung phone.
  2. Tap and hold Power off until Safe mode appears.
  3. Tap Safe mode to reboot.
  4. Observe for 15–30 minutes:
    • If ads disappear, the issue comes from an installed app.
    • ⚠️ If they persist, it could be a deeper system issue.

If the ads stop in Safe Mode, you can safely continue to the ADB-based cleanup.


🧭 Step 1: Preparation

1. Enable Developer Options

  • Go to Settings → About phone → Software information
  • Tap Build number 7 times until you see “You are now a developer!”

2. Enable USB Debugging

  • Go to Settings → Developer options → USB debugging → Enable

3. Install the Required Tools on Your Computer

You’ll need two tools to connect ADB:

Extract the Platform Tools ZIP (e.g., C:\platform-tools) and install the Samsung driver.

4. Connect the phone via USB

When prompted on your phone, allow USB debugging.


🧩 Step 2: Verify the Connection

Run the following command in the Platform Tools directory:

adb devices
Enter fullscreen mode Exit fullscreen mode

If you see a serial number, the device is connected successfully.


🔍 Step 3: List Installed Apps

adb shell pm list packages -3
Enter fullscreen mode Exit fullscreen mode

This lists all user-installed apps.

Search for suspicious packages (e.g., containing “ad”, “service”, “update”, etc.):

adb shell pm list packages | findstr /i ad
adb shell pm list packages | findstr /i service
adb shell pm list packages | findstr /i update
adb shell pm list packages | findstr /i folder
Enter fullscreen mode Exit fullscreen mode

🕵️ Step 4: Identify the Pop-Up Source

When an ad appears, run:

adb shell dumpsys window | findstr mCurrentFocus
Enter fullscreen mode Exit fullscreen mode

This command reveals which app’s window is currently displayed.
Example output that identifies the offender:

mCurrentFocus=Window{... u0 my.tasks.mtt/com.mbridge.msdk.reward.player.MBRewardVideoActivity}
Enter fullscreen mode Exit fullscreen mode

The above output indicates the pop-ups were coming from the app my.tasks.mtt.


🧹 Step 5: Disable and Uninstall the App

Temporarily disable the app for your current user:

adb shell pm disable-user --user 0 my.tasks.mtt
Enter fullscreen mode Exit fullscreen mode

Uninstall it for your user:

adb shell pm uninstall -k --user 0 my.tasks.mtt
Enter fullscreen mode Exit fullscreen mode

Optional: clear the launcher’s cache (helps remove leftover shortcuts or intents):

adb shell pm clear com.sec.android.app.launcher
Enter fullscreen mode Exit fullscreen mode

Reboot the device:

adb reboot
Enter fullscreen mode Exit fullscreen mode

✅ Step 6: Verify the Removal

After reboot, confirm the adware is gone with these checks:

adb shell pm list packages | findstr my.tasks.mtt
adb shell ps | findstr my.tasks.mtt
adb shell dumpsys window | findstr my.tasks.mtt
Enter fullscreen mode Exit fullscreen mode

If all commands return no output, the package and any running services are removed.


🛡️ Step 7: Prevent Future Infections

  • Install apps only from Google Play or trusted developers.
  • Avoid “free reward”, “utility booster”, or suspicious AI/assistant clone apps.
  • Regularly audit overlay permissions:
  • Settings → Apps → Special access → Appear on top — disable unknown entries.
  • Keep Play Protect enabled.
  • Optionally use a reputable mobile security app (e.g., ESET Mobile, Bitdefender, Malwarebytes).

🏁 Result

After identifying and uninstalling the offending package, the random ads stopped completely — with no factory reset and no data loss. These ADB-based steps provide a safe, targeted way to diagnose and remove hidden adware on Android devices.

Top comments (0)