0

I'm working on a script that analyzes the AndroidManifest.xml of decompiled apps and detects if they contain a TWA or not.

Is there a better approach for detecting a TWA than analyzing the AndroidManifest? I'm currently checking if the below activity is defined in the manifest or not, but almost all the apps from my dataset gave negative results;

<activity android:name="com.google.androidbrowserhelper.trusted.LauncherActivity">
ankur1812
  • 97
  • 4

1 Answers1

0

Apps generated by Bubblewrap (via the CLI, PWA Builder, etc) will have a twa_generator meta-tag. Checking com.google.androidbrowserhelper.trusted.LauncherActivity won't work for current Bubblewrap generated apps since each application will have its own LauncherActivity implementation.

Checking for com.google.androidbrowserhelper.trusted.LauncherActivity or if the twa-generator may work better.

andreban
  • 4,621
  • 1
  • 20
  • 49
  • 1
    Thank you Andre, I'll try this approach. (PS: I was just watching your Google I/O'19 session on TWAs when I got this notification..! : ) – ankur1812 Sep 14 '22 at 21:44
  • Is it a better idea to detect TWAs with more parameters. I found few manifests in the Google Chrome/android-browser-helper repo which will fail to be detected [https://github.com/GoogleChrome/android-browser-helper/tree/main/demos] [1.] The twa-firebase-analytics and twa-offline-first have custom implementation but its manifest includes ***androidbrowserhelper.trusted.FocusActivity*** and ***support.customtabs.trusted.DEFAULT_URL*** [2.] The twa-custom-launcher includes ***androidbrowserhelper.launchtwa.LaunchTwaActivity*** – ankur1812 Sep 18 '22 at 15:07
  • So in that case, is it a better idea to also include checks for **androidbrowserhelper.trusted**, **androidbrowserhelper.launchtwa** and **support.customtabs.trusted**? – ankur1812 Sep 18 '22 at 15:08