Turn your website into an Android app in seconds with the free and open-source Website-to-APK

Website-to-APK: An efficient open source WebView application building framework

In the field of mobile application development, the need to quickly package existing websites into native Android APKs is becoming increasingly prominent, especially for developers seeking to minimize development cycles and resource investment. Website-to-APK is a refined open source tool that uses the WebView component to achieve seamless conversion, allowing you to convert any website into a fully functional APK wrapper without the need for Android Studio or Java programming expertise. This framework not only simplifies the build process but also ensures cross-device compatibility and security, and is suitable for a variety of use cases, from static sites to dynamic web applications. According to GitHub data, the project has helped thousands of developers deploy production-level applications, significantly lowering the threshold for mobile transformation.

Turn your website into an APP in seconds with the free and open-source Website-to-APK-1

 

Core Features

  • Completely free and open source**: Based on the MIT license agreement, the source code is open and transparent, and users can freely review, modify and extend it to ensure compliance and maintainability.
  • Intuitive Command Line Interface**: With colorful output formats and a user-friendly interactive experience, even beginners can navigate efficiently.
  • Automated environment dependencies: Built-in automatic download and installation mechanism for OpenJDK 17 and Android SDK tools, eliminating the complexity of manual configuration.
  • Complete APK lifecycle management: **This includes full-chain automation covering signing, building, and testing, supporting production-grade deployment.
  • User script integration**: Compatible with Tampermonkey-style script injection, extending application functionality without core modifications.
  • Low resource usage: The optimized build process minimizes system requirements and is suitable for resource-constrained environments.

Quick Start

Clone this repository:

git clone https://github.com/Jipok/website-to-apk cd website-to-apk

Create a configuration file webapk.conf:

id = myapp # Application ID (will be com.myapp.webtoapk) name = My App Name # Display name of the app mainURL = https://example.com # Target website URL icon = example.png # Path to your app icon (PNG format) allowSubdomains = true # Allow navigation between example.com and sub.example.com requireDoubleBackToExit = true # Require double back press to exit app enableExternalLinks = true # Allow external links openExternalLinksInBrowser = true # If allowed: open external links in browser or WebView confirmOpenInBrowser = true # Show confirmation before opening external browser allowOpenMobileApp = false # Block external app links/schemes

Generate a signing key (only needed once, keep the generated file safe):

./make.sh keygen

Apply the configuration and build:

./make.sh build

The final APK will be created in the current directory.

Note: If you get an error when building the application, please check the configuration file. The id option in the configuration file cannot contain a dot.

 YouTube Example

Pre-configured profiles for YouTube are available in the directory confs/youtubeTo build the YouTube APK, simply execute the following command:

./make.sh build confs/youtube/webapk.conf

 

Available commands

./make.sh build [config] - Apply configuration and build
./make.sh keygen - Generate signing key
./make.sh test - installs and tests the APK on the connected device
./make.sh clean - cleans the build files
./make.sh apk - Build APK without apply_config
./make.sh apply_config - applies settings from a configuration file
./make.sh get_java - Download OpenJDK 17 locally

App Links/Deep Links

You can have your app handle deep linking to your website by setting an option in your configuration file. Once set, links to your website that are clicked on a device will open in your app instead of in a browser.

For example, if your website is For https://example.com, please set:

deeplink = example.com

User script support

The application supports user scripts (similar to Tampermonkey/Violentmonkey scripts) via configuration options scripts:

scripts = scripts/*.js # Load all .js files from scripts directory # OR scripts = site-*.js # Load all files matching pattern # OR scripts = script1*.js script20.js # Load specific script files

How user scripts work:
- Scripts can be used with Tampermonkey/Violentmonkey/etc @match and @run-at Instructions, others are ignored
- If not @match If specified, the script will run on all pages
- only GM_addStyle Greasemonkey API support
- have toast("short message") Function
- You can monitor the script console output using the following methods (console.log/alert/warn):

./make.sh test

Common use cases include:
- Add dark mode to the website
- Customize your website's appearance
- Add new features
- Fixed mobile compatibility issues

Some useful script examples:
dark-mode.js - A universal dark theme that respects system preferences
instant.js - Preload pages when users click on them, speeding up page loading

Additional WebView options

You can also configure the following advanced options:

cookies = "key1=value1; key2=value2" # Cookies for mainURL host basicAuth = login:password # HTTP Basic Auth for mainURL host userAgent = "MyCustomUserAgent/1.0" # Custom UserAgent header JSEnabled = true # Enable JavaScript execution JSCanOpenWindowsAutomatically = true # Allow JS to open new credentials windows/popups DomStorageEnabled = true # Enable HTML5 DOM storage DatabaseEnabled = true # Enable HTML5 Web SQL Database SavePassword = true # Allow saving passwords in WebView AllowFileAccess = true AllowFileAccessFromFileURLs = true forceLandscapeMode = false # Lock screen orientation to landscape showDetailsOnErrorScreen = false # Show connection error details for user confirmOpenExternalApp = true # Show confirmation before opening external app blockLocalhostRequests = true # Block requests to 127.0.0.1 trustUserCA = false # Allow app to trust user-installed SSL certs geolocationEnabled = false # Block geolocation API

Technical Details

  1. - Target Android API: 33 (Android 13)
  2. - Minimum Android API: 24 (Android 7.0)
  3. - Build Tools version: 33.0.2
  4. - Gradle version: 7.4
  5. - Required Java version: 17
  6. - All application data is stored in the application's private directory
  7. - Keystore app/my-release-key.jks The default password is "123456"

Website-to-APK stands out among mobile development toolchains for its modularity and extensibility, making it ideal for rapid prototyping and converting web assets into native distribution packages. Whether you're a solo developer or collaborating with a team, this framework significantly shortens the timeline from concept to deployment while maintaining high compatibility and security. Clone the repository now to explore its potential—the power of the open source community will help you turn your ideas into reality.

score

Leave a Reply

Your email address will not be published. Required fields are marked *