From Newsgroup: comp.mobile.android
R.Wieser wrote:
What about posting the links to the articles, so we can read it, and
possible user contributions for ourselves ? Possibly even read other articles.
I agree with anyone, no matter their past history, when they state a
logically sensible remark, so I must agree the article would be nice.
What I did, when I read the information, was (1) summarize it for the team,
so that what was posted, was summarized to make it easier to digest.
Then, I wrote up a way to identify if my phone has those advertising sdks
Newsgroups: comp.mobile.android
Subject: PSA: A quick Android location and network access audit using adb
Date: Wed, 5 Aug 2026 15:15:11 -0800
Message-ID: <1150g5v$1lsp$
1@nnrp.usenet.blueworldhosting.com>
Where others can perform the tasks I ran in response to the information.
1. No ad SDK ever requested location
2. No ad SDK ever registered for location
3. No ad SDK opened any network sockets (ad SDKs always open sockets!)
4. No unknown or hidden packages exist that accessed the network
5. No background location requests were made (ad SDKs often do that)
6. No ad libraries opened sockets
I'm currently writing a script which others can use to scan their entire device to locate the exact apps and the exact advertisment sdks.
But... I'm not as good at Windows batch programming as Rudy is.
It's still failing to properly run the findstr on the unzip APKs.
Here it is, in its current version, but I can't get the findstr to work.
:: ------------------------------------------------------------------
:: Note Windows thinks Android /data is a Windows path!
:: The failure is only inside CMD's batch parser.
:: ------------------------------------------------------------------
:: scanads.bat
:: Scans non-rooted Android 10+ to look inside all apps for ad SDKs
:: ------------------------------------------------------------------
:: Debug: scanads.bat > full_console_output.txt 2>&1
:: cmd /v /c "echo on & call scanads.bat > full_trace.txt 2>&1"
:: ------------------------------------------------------------------
:: v2p1 20260806 debugging
:: v2p0 20260806 Created scanads_patterns.txt file containing SDKs
:: Because these strings only appear in apps that actually embed ad SDKs.
:: com/facebook/ads/AdManager
:: com/mopub/mobileads
:: com/applovin/mediation
:: com/unity3d/ads/android
:: com/ironsource/mediationsdk
:: com/bytedance/sdk/openads
:: com/chartboost/sdk
:: com/inmobi/ads
:: com/vungle/publisher
:: com/mintegral/msdk
:: com/tapjoy/TJAdUnit
:: com/adcolony/sdk
:: com/amazon/device/ads/AdRegistration
:: v1p9 20260806 added "setlocal enabledelayedexpansion"
:: v1p8 20260805 List APKs with ad SDKs in the summary and into a file
:: v1p7 20260805 Cleaned up minor errors and strengthened the summary
:: v1p6 20260805 Changed to match SDK classpaths, not metadata filenames
:: v1p5 20260805 Tightened grep from "ads" to a list of known ad packages
:: v1p4 20260805 Added result summary for packages found with ad SDKs
:: v1p3 20260805 Set temporary file names via easily-modified variables
:: v1p2 20260805 Added separate output folder and consistent file names
:: v1p1 20260805 Added checks to make sure adb is working first
:: v1p0 20260805 Scans all Android apps for ad-related packages
:: ------------------------------------------------------------------
:: This program connects to an Android device over ADB, collects the
:: full list of installed apps, extracts the file paths of their APKs,
:: and then scans each APK for known ad-network SDKs. For every APK,
:: it uses unzip -l on the device to list all files inside the package,
:: then it searches that file list for specific SDK classpaths. If any
:: of those classpaths appear, the app is counted as containing an ad SDK.
:: Otherwise, the app is counted as clean. At the end, the script prints
:: a summary showing how many APKs were scanned, how many contained ad SDKs,
:: and how many did not. Here is my first output on my daily drive:
:: Total APKs scanned: 986
:: APKs containing ad-related files: 3
:: APKs with no ad-related files: 983
:: ------------------------------------------------------------------
@echo off
setlocal enabledelayedexpansion
echo Android APK Ad Network Scanner
echo.
REM Working directory and filenames and counters
:: Define the directory name for temp working files
set WORKDIR=scanads
:: Define the file name for the list of package names and APK paths
set RAWPKG=%WORKDIR%\scanads_1packages_raw.txt
:: Define the file name for the list of APKs scanned
set APKPATHS=%WORKDIR%\scanads_2apkpaths.txt
:: Define the file name for the APK unzip showing every file in the APK
set APKCONTENTS=%WORKDIR%\scanads_3apkcontents.tmp
:: Define the ephemeral file name for ad-SDK classpath matches
set MATCHES=%WORKDIR%\scanads_4matches.tmp
:: Define the file where we save all APKs that contain ad SDKs
set ADSOUT=%WORKDIR%\scanads_5adsfound.txt
:: Define a pattern file that contains the desired search keywords
set PATTERNS=scanads_patterns.txt
:: Start counters at zero
set COUNT_TOTAL=0
set COUNT_ADS=0
set COUNT_NOADS=0
REM Create working directory if missing
if not exist %WORKDIR% mkdir %WORKDIR%
REM Check ADB connection
adb get-state > nul 2>&1
if errorlevel 1 (
echo No device detected. Connect Android and enable USB debugging.
exit /b
)
REM Check unzip availability
adb shell which unzip > nul 2>&1
if errorlevel 1 (
echo Device does not have unzip. Install BusyBox or enable unzip.
exit /b
)
REM Dump package list
echo Pulling package list...
adb shell pm list packages -f > %RAWPKG%
echo Package list saved.
echo.
REM Extract APK paths
echo Extracting APK paths...
powershell -NoLogo -NoProfile -Command "(Get-Content '%RAWPKG%' | ForEach-Object { ($_ -replace '^package:','') -replace '=[^=]+$','' }) | Set-Content '%APKPATHS%'"
echo APK paths saved.
echo.
REM Scan APKs
echo Scanning for ad networks...
echo.
:: v1p8: clear output file for ad-SDK results
echo Ad SDKs found in these APKs: > "%ADSOUT%"
:: begin scan loop
for /f "usebackq delims=" %%A in ("%APKPATHS%") do (
set /a COUNT_TOTAL+=1
echo Scanning %%A
:: v1p8: clear APKCONTENTS before unzip to avoid stale data
echo. > "%APKCONTENTS%"
adb shell unzip -l "%%A" > "%APKCONTENTS%" 2>nul
:: v1p8: clear MATCHES to avoid stale data
echo. > "%MATCHES%"
:: Find ad SDKs inside of the list of files in every APK
:: findstr /i "com/facebook/ads/AdManager com/mopub/mobileads com/applovin/mediation com/unity3d/ads/android com/ironsource/mediationsdk com/bytedance/sdk/openads com/chartboost/sdk com/inmobi/ads com/vungle/publisher com/mintegral/msdk com/tapjoy/TJAdUnit com/adcolony/sdk com/amazon/device/ads/AdRegistration" %APKCONTENTS% > %MATCHES%
findstr /i /g:"%PATTERNS%" "%APKCONTENTS%" > "%MATCHES%"
:: errorlevel=0 means matches found, therefore it has ads
:: errorlevel=1 means no matches, therefore it does not have ads
if errorlevel 1 (
set /a COUNT_NOADS+=1
del %MATCHES% 2>nul
) else (
echo [ADS] %%A
for /f %%X in (%MATCHES%) do echo %%X
:: v1p8: append results to ADSOUT file
echo APK: %%A >> "%ADSOUT%"
for /f %%X in (%MATCHES%) do echo %%X >> "%ADSOUT%"
echo. >> "%ADSOUT%"
set /a COUNT_ADS+=1
:: Save it for debugging
copy "%MATCHES%" "scanads\matches_%%~nA.tmp" >nul
del %MATCHES% 2>nul
)
)
:: end scan loop
echo.
echo Scan complete.
echo.
echo Summary:
echo Total APKs scanned: %COUNT_TOTAL%
echo APKs containing ad-related files: %COUNT_ADS%
echo APKs with no ad-related files: %COUNT_NOADS%
echo.
:: v1p8 show the file containing detailed ad-SDK results
echo Detailed list saved to: %ADSOUT%
echo.
gvim %ADSOUT%
pause
:: end of scanads.bat
--
Usenet allows old friends to discuss unique topics of mutual interest.
--- Synchronet 3.22a-Linux NewsLink 1.2