Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/elliotjreed/www.elliotjreed.com-twa
My website (www.elliotjreed.com) wrapped-up as a Trusted Web Activity for Android (see: "Elliot J. Reed" in the Google Play app store)
https://github.com/elliotjreed/www.elliotjreed.com-twa
Last synced: 2 days ago
JSON representation
My website (www.elliotjreed.com) wrapped-up as a Trusted Web Activity for Android (see: "Elliot J. Reed" in the Google Play app store)
- Host: GitHub
- URL: https://github.com/elliotjreed/www.elliotjreed.com-twa
- Owner: elliotjreed
- Created: 2019-11-01T14:44:13.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2019-11-01T14:52:19.000Z (about 5 years ago)
- Last Synced: 2024-12-06T22:43:56.591Z (22 days ago)
- Language: Shell
- Size: 739 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Trusted Web Activity
This project uses the [Trusted Web Activities](https://developers.google.com/web/updates/2017/10/using-twa) technology to wrap [www.elliotjreed.com](https://www.elliotjreed.com) in an Android Application.
## Running the Demo
1. Clone the project
``
git clone https://github.com/elliotjreed/www.elliotjreed.com-twa.git
``2. Import the Project into Android Studio, using File > New > Import Project, and select the folder to which the project was cloned.
3. Run the Project (Ctrl+R)
### Enabling Debug
TWAs require [Digital AssetLinks](https://developers.google.com/digital-asset-links/) to be setup on both the application and on the website, in order to enable the validation that allows Chrome to open the page in full-screen.
For security reasons, the signing key compatible with the setup on
https://www.elliotjreed.com is not committed with the sample code.It is possible to setup Chrome to skip validation on device to enable testing.
Here are the 2 steps required to achieve this:
1. Enable Chrome to accept command-line parameters:
On the Android Device, go to the Chrome version being used to test the TWA and navigate to `chrome://flags`. Search for a setting called `Enable commmand line on non-rooted devices` and change it to `Enabled`. Restarting the browser *multiple* times may be required.
2. Create an Android file with the command-line parameters that allow skipping the TWA validation.
Add a file at `/data/local/tmp/chrome-command-line`, with the content `_ --disable-digital-asset-link-verification-for-url="https://www.elliotjreed.com"`. Make sure there's no newline at the end of the line, or it may break the launcher.
For convenience, a shell script that creates this file is available in this repository. Run it
by executing `./enable-debug.sh https://www.elliotjreed.com`.To debug a different PWA, execute the script with a different host:
`./enable-debug.sh https://example.com`### Debugging Digital Asset Links
As the debug certificate is different from the release one, and the fingerprint for debug should not be listed on the assetlinks.json file, is important to check if your Digital Asset Link is linked and verified.
After you generated your [signed APK](https://developer.android.com/studio/publish/app-signing#sign-apk). it can be installed into a test device, using adb:
``
adb install app-release.apk
``If the verification step fails it is possible to check for error messages using the Android Debug Bridge, from your OS’s terminal and with the test device connected.
``
adb logcat | grep -e OriginVerifier -e digital_asset_links
``If it is failing you'll see ``Statement failure matching fingerprint. Verification failed.`` message. Therefore is important to *review* *AndroidManifest.xml* and *build.gradle* files and check if the configurations are matching with the *assetlinks.json*.
Otherwise ``Verification succeeded.`` message should appear.