🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.mobile.android
Article #711

Re: Can we programmatically get package names of icons in a homescreen folder?

#711
From: Maria Sophia
Date: Thu, 19 Nov 2026 23:09
157 lines
12457 bytes
Maria Sophia wrote:
> But I got what I needed (although it took, oh, an hour or so).

It always takes longer to write it up so anyone else can do it
than it takes to hack out the solution, but here's the writeup.

This is so that every thread adds value to the group knowledge.

Note I tried first to do it purely on Android, but failed.
So that's why this is a Windows-only solution (over Wi-Fi).

How to extract app titles & package names from an Android homescreen folder 
(over Wi-Fi/USB using Nova Launcher & Windows commands & coreutils).

Dependencies:
 a. Android Debug Bridge (ADB) is installed and accessible through %PATH%.
 b. GNU Coreutils are installed and accessible through %PATH%.
 c. SQLite is available at the specified Android SDK platform-tools location.
I originally used the graphical user interface but found a CLI method instead:
 d. DB Browser for SQLite is available for graphical use, but it is optional.

1. Create a Nova Launcher backup on Android.
   NovaSettings > Backup & Restore > Backup > 2026-11-19_12-57.novabackup

2. Copy the backup file from Android to Windows.
    C:\> where pwd
          => C:\Program Files\coreutils\bin\pwd.exe
    C:\> pwd
          => C:\app\editor\android\scrcpy
    C:\> mkdir nova
    C:\> cd nova
    C:\> adb pull /storage/emulated/0/0000/bck/nova_backup/2026-11-19_12-57.novabackup
         => /storage/emulated/0/0000/bck/nova_backup/2026-... 
         => 0 skipped. 4.1 MB/s (6564861 bytes in 1.536s)

3. Rename the backup file to a zip file.
    C:\> rename 2026-11-19_12-57.novabackup backup.zip

4. Extract the backup.zip to obtain the SQL database & supporting files.
    C:\> powershell -NoProfile -Command "Expand-Archive -LiteralPath backup.zip -DestinationPath backup_extracted -Force"


5. Locate the nova.db SQLite database file.
    C:\> dir backup_extracted
          11/19/2026  12:58 PM         7,688,192 nova.db
          11/19/2026  12:58 PM             6,455 nova.xml
          11/19/2026  12:58 PM             4,818 supportDetails.txt

Steps 6 to 8 use the optional GUI called "DB Browser for SQLite" to open the 
database and to run the SQL query. Those steps were used when I was honing
the steps, so at this point, the GUI is vestigial. To do everything from 
the command line, skip steps 6 to 8 and go directly to step 9 which runs 
the honed query using the command-line sqlite3.exe instead of the GUI.
 
6. OPTIONAL: Open nova.db with DB Browser for SQLite.
    C:\> "C:\app\editor\sql\db4s\App\SQLiteDatabaseBrowser64\DB Browser for SQLite.exe" C:\app\editor\android\scrcpy\nova\backup_extracted\nova.db

7. OPTIONAL: Run the SQL query to retrieve contents of the weather folder.
   a. Open the 'Execute SQL' tab in the DB Browswer for SQLite GUI
   b. Paste the code below into that tab & press the "run" button
   c. The result will be the desired output in tabular form

8. OPTIONAL: This is the code:
  /*
  Pulls all items stored inside the "weather" folder (container = 2921)
  from Nova Launcher favorites table and extracts each app package name.
  */
   SELECT
       f._id AS item_id,              -- Unique row id of the item in favorites
       f.title AS app_title,          -- Display name shown on the homescreen or folder
       CASE
           -- Use explicit icon package if populated
           WHEN f.iconPackage IS NOT NULL AND f.iconPackage != '' THEN f.iconPackage
   
           -- Otherwise read package name between component= and / in intent
           WHEN INSTR(f.intent, 'component=') > 0 THEN
               SUBSTR(
                   -- Slice from right after component= (10 chars) to end of string
                   SUBSTR(f.intent, INSTR(f.intent, 'component=') + 10),
                   1,
                   -- Take characters up to the first /
                   INSTR(SUBSTR(f.intent, INSTR(f.intent, 'component=') + 10), '/') - 1
               )
           ELSE ''                    -- Fallback when no package name is found
       END AS package_name,
       f.intent                       -- Raw Android intent string for reference
   FROM favorites f
   WHERE f.container = 2921           -- 2921 is the _id of the weather folder
   ORDER BY f.rank, f._id;             -- Keep folder item order
   /* end */
   

9. Export SQL results to output.txt using sqlite3.exe.
   C:\> where sqlite3
         => C:\app\editor\android\sdk\platform-tools\sqlite3.exe
   C:\> C:\app\editor\android\sdk\platform-tools\sqlite3.exe --version
         => 3.32.2
   C:\> sqlite3.exe -header -cmd ".mode tabs" "C:\app\editor\android\scrcpy\nova\backup_extracted\nova.db" "SELECT f._id AS item_id, f.title AS app_title, CASE WHEN f.iconPackage IS NOT NULL AND f.iconPackage != '' THEN f.iconPackage WHEN INSTR(f.intent, 'component=') > 0 THEN SUBSTR(SUBSTR(f.intent, INSTR(f.intent, 'component=') + 10), 1, INSTR(SUBSTR(f.intent, INSTR(f.intent, 'component=') + 10), '/') - 1) ELSE '' END AS package_name, f.intent FROM favorites f WHERE f.container = 2921 ORDER BY f.rank, f._id;" > output.txt

10. Check the output
     C:\> type output.txt
           item_id	app_title	package_name	intent
           1892	AccuWeather	com.accuweather.android	#Intent;action=android.intent.action.MAIN;category=android.intent.category.LAUNCHER;launchFlags=0x10200000;component=com.accuweather.android/.splashscreen.ui.SplashActivity;end
           1830	Windy.app	co.windyapp.android	#Intent;action=android.intent.action.MAIN;category=android.intent.category.LAUNCHER;launchFlags=0x10200000;component=co.windyapp.android/.ui.mainscreen.container.MainActivity;end
           2456	AeroWind	aerow.us.aerowind	#Intent;action=android.intent.action.MAIN;category=android.intent.category.LAUNCHER;launchFlags=0x10200000;component=aerow.us.aerowind/.GetWeather;end
           2448	AirVisual	com.airvisual	#Intent;action=android.intent.action.MAIN;category=android.intent.category.LAUNCHER;launchFlags=0x10200000;component=com.airvisual/.ui.activity.SplashActivity;end
           1878	Good Weather	org.asdtm.goodweather	#Intent;action=android.intent.action.MAIN;category=android.intent.category.LAUNCHER;launchFlags=0x10200000;component=org.asdtm.goodweather/.MainActivity;end
           2266	Hey Sunrise	com.macca895.sunriise	#Intent;action=android.intent.action.MAIN;category=android.intent.category.LAUNCHER;launchFlags=0x10200000;component=com.macca895.sunriise/.main.MainActivity;end
           2455	hiweather	com.lholman.hiweather	#Intent;action=android.intent.action.MAIN;category=android.intent.category.LAUNCHER;launchFlags=0x10200000;component=com.lholman.hiweather/.MainActivity;end
           2471	just weather	com.neverads.just_weather	#Intent;action=android.intent.action.MAIN;category=android.intent.category.LAUNCHER;launchFlags=0x10200000;component=com.neverads.just_weather/com.neverads.myapp.MainActivity;end
           2469	Klara	org.androworks.klara	#Intent;action=android.intent.action.MAIN;category=android.intent.category.LAUNCHER;launchFlags=0x10200000;component=org.androworks.klara/.MainActivity;end
           2472	OpenWeather	uk.co.openweather	#Intent;action=android.intent.action.MAIN;category=android.intent.category.LAUNCHER;launchFlags=0x10200000;component=uk.co.openweather/.MainActivity;end
           2509	RadarWeather	org.woheller69.weather	#Intent;action=android.intent.action.MAIN;category=android.intent.category.LAUNCHER;launchFlags=0x10200000;component=org.woheller69.weather/.activities.SplashActivity;end
           2460	Rain	com.yoshi.rain	#Intent;action=android.intent.action.MAIN;category=android.intent.category.LAUNCHER;launchFlags=0x10200000;component=com.yoshi.rain/.MainActivity;end
           2914	Weather	org.breezyweather	#Intent;action=android.intent.action.MAIN;category=android.intent.category.LAUNCHER;launchFlags=0x10200000;component=org.breezyweather/.ui.main.MainActivity;end
           2618	Weather	wangdaye.com.geometricweather	#Intent;action=android.intent.action.MAIN;category=android.intent.category.LAUNCHER;launchFlags=0x10200000;component=wangdaye.com.geometricweather/.main.MainActivity;end
           2473	Weather	com.alexplas.weathernew	#Intent;action=android.intent.action.MAIN;category=android.intent.category.LAUNCHER;launchFlags=0x10200000;component=com.alexplas.weathernew/.ui.MainActivity;end
           1821	Weather Alerts	info.vazquezsoftware.weatheralarms	#Intent;action=android.intent.action.MAIN;category=android.intent.category.LAUNCHER;launchFlags=0x10200000;component=info.vazquezsoftware.weatheralarms/.LoadingActivity;end
           2453	Weather Forecast	com.la.local.weather.forecast.app	#Intent;action=android.intent.action.MAIN;category=android.intent.category.LAUNCHER;launchFlags=0x10200000;component=com.la.local.weather.forecast.app/.activities.SplashActivity;end
           1831	WindHub	com.windhub.marine.weather	#Intent;action=android.intent.action.MAIN;category=android.intent.category.LAUNCHER;launchFlags=0x10200000;component=com.windhub.marine.weather/wind.hub.ui.launcher.LauncherActivity;end
           1824	Windy	com.windyty.android	#Intent;action=android.intent.action.MAIN;category=android.intent.category.LAUNCHER;launchFlags=0x10200000;component=com.windyty.android/.MainActivity;end
           2468	Yr	no.nrk.yr	#Intent;action=android.intent.action.MAIN;category=android.intent.category.LAUNCHER;launchFlags=0x10200000;component=no.nrk.yr/.MainActivity;end


11. Filter columns with coreutils cut.
     C:\> where cut
           => C:\Program Files\coreutils\bin\cut.exe
     C:\> cut -f2,3 output.txt > weather_apps.txt

    Note: The SQLite output uses tab delimiters, so cut -f2,3 extracts 
          the second and third columns (app_title and package_name).

12. Final result.
     C:\> type weather_apps.txt
           app_title       package_name
           AccuWeather     com.accuweather.android
           Windy.app       co.windyapp.android
           AeroWind        aerow.us.aerowind
           AirVisual       com.airvisual
           Good Weather    org.asdtm.goodweather
           Hey Sunrise     com.macca895.sunriise
           hiweather       com.lholman.hiweather
           just weather    com.neverads.just_weather
           Klara           org.androworks.klara
           OpenWeather     uk.co.openweather
           RadarWeather    org.woheller69.weather
           Rain            com.yoshi.rain
           Weather         org.breezyweather
           Weather         wangdaye.com.geometricweather
           Weather         com.alexplas.weathernew
           Weather Alerts  info.vazquezsoftware.weatheralarms
           Weather Forecast com.la.local.weather.forecast.app
           WindHub         com.windhub.marine.weather
           Windy           com.windyty.android
           Yr              no.nrk.yr
-- 
The greatest thing about Americans is we never give up innovating.
Technical Details
Message-ID: <11dnvjh$2iq8$1@nnrp.usenet.blueworldhosting.com>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!nnrp.usenet.blueworldhosting.com!.POSTED.public-nat-02.vpngate.v4.open.ad.jp!not-for-mail
References: <11dnkrt$2pjn$1@nnrp.usenet.blueworldhosting.com> <11dnp91$1eem$1@nnrp.usenet.blueworldhosting.com> <11dnre3$1266$1@nnrp.usenet.blueworldhosting.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!nnrp.usenet.blueworldhosting.com!.POSTED.public-nat-02.vpngate.v4.open.ad.jp!not-for-mail
From: Maria Sophia <mariasophia@comprehension.com>
Newsgroups: comp.mobile.android,alt.comp.os.windows-10
Subject: Re: Can we programmatically get package names of icons in a homescreen folder?
Date: Thu, 19 Nov 2026 19:09:38 -0400
Organization: BWH Usenet Archive (https://usenet.blueworldhosting.com)
Message-ID: <11dnvjh$2iq8$1@nnrp.usenet.blueworldhosting.com>
References: <11dnkrt$2pjn$1@nnrp.usenet.blueworldhosting.com> <11dnp91$1eem$1@nnrp.usenet.blueworldhosting.com> <11dnre3$1266$1@nnrp.usenet.blueworldhosting.com>
Reply-To: pusvul@getTjewytR4so+mqe2.invalid
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 19 Nov 2026 23:09:37 -0000 (UTC)
Injection-Info: nnrp.usenet.blueworldhosting.com; posting-account="l//KxG3Ge2LojWvwJg0Igv8F0ChK8RUC9RtOxMPUo3U"; posting-host="IfCZz72xNNlHXBkfV9B6WJEa9xVhaehMJfhAC6fCwnM";
	logging-data="84808"; mail-complaints-to="usenet@blueworldhosting.com"
User-Agent: Mojibake v24p7
Cancel-Lock: sha1:DD+AMFUxq5NL91oflt4ur9oNUOw= sha256:KgGRDpH0TeE/Ck09aOwC1nMzVkkdREcMMxky6H1YHto=
	sha1:Axq3sjsyvuF5C5mB9we5ZWyOGg0= sha256:Azu1QpfaviHOuIv4q3neFRXTCQZhQquAHwl/obT1zEU=
Content-Language: en-GB