diff --git a/PassThroughBrowser.aia b/PassThroughBrowser.aia new file mode 100644 index 0000000..203dbe5 Binary files /dev/null and b/PassThroughBrowser.aia differ diff --git a/PassThroughBrowser.apk b/PassThroughBrowser.apk new file mode 100644 index 0000000..712830d Binary files /dev/null and b/PassThroughBrowser.apk differ diff --git a/README.md b/README.md index 244a886..8fff8ae 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,28 @@ # passthroughbrowser -Waydroid Passthrough Browser - Open links in host browser \ No newline at end of file +Waydroid Passthrough Browser - Open links in host browser + +Passthrough Browser has two components --- a server and a client. The server is +a Python program written with Flask, while the client is an Android app written +using [MIT App Inventor](https://appinventor.mit.edu). The server listens for +HTTP POST connections on TCP port 8888 on an IP address only accessible to +programs running on the host or in the Waydroid container. When it receives a +properly formatted request, it opens the host's browser to the URL specified in +the request. The client, when installed in Waydroid, is intended to be set as +the default browser. After this is done, whenever an Android app attempts to +open a Web page, it will open the Passthrough Browser client just as it would +launch any other browser. The client then sends the URL to the server, which +causes the host browser to open. + +## Installation + +Run `./install_both.sh`. (Make sure Waydroid is running first.) Installing the +client requires running a command as root; the script uses `sudo`. You may need +to enter your password during installation. + +## Credits + +The client app uses the +[CustomWebView](https://github.com/vknow360/CustomWebView/tree/beta) (beta +version) App Inventor extension by Sunny Gupta. CustomWebView is used under the +MIT licese. diff --git a/install_both.sh b/install_both.sh new file mode 100755 index 0000000..acd35c1 --- /dev/null +++ b/install_both.sh @@ -0,0 +1,4 @@ +#!/bin/bash +./install_server.sh +echo "----------" +./install_client.sh diff --git a/install_client.sh b/install_client.sh new file mode 100755 index 0000000..9375a32 --- /dev/null +++ b/install_client.sh @@ -0,0 +1,12 @@ +#!/bin/bash +echo "Running 'sudo waydroid app install PassThroughBrowser.apk'. Please enter your" +echo "password if prompted:" +sudo waydroid app install PassThroughBrowser.apk +cat << HERE +To set up the Passthrough Browser client: + 1. Open Settings in Waydroid. + 2. Click/tap "Apps and Notifications." + 3. Click/tap "Default apps." + 4. Click/tap "Browser app." + 5. Click/tap "Passthrough Browser." +HERE diff --git a/install_server.sh b/install_server.sh new file mode 100755 index 0000000..97aa8c0 --- /dev/null +++ b/install_server.sh @@ -0,0 +1,12 @@ +#!/bin/bash +mkdir -p ~/.config/autostart +mkdir -p ~/.local/bin/ +cat > ~/.config/autostart/passthrough_browser_server.desktop << HERE +[Desktop Entry] +Type=Application +Name=Passthrough Browser Server +Exec=$HOME/.local/bin/passthrough_browser_server +HERE +cp server.py ~/.local/bin/passthrough_browser_server +echo "To start the Passthrough Browser server, log out and log back in. (Wait until" +echo "you have set the client up, if it isn't already installed.)" diff --git a/server.py b/server.py new file mode 100755 index 0000000..9fc83a9 --- /dev/null +++ b/server.py @@ -0,0 +1,44 @@ +#!/usr/bin/env python3 +from flask import Flask +from flask import request, Response +import webbrowser +import time + +app = Flask(__name__) + +@app.route('/', methods = ['GET', 'POST']) +def page(): + if request.method == 'GET': + return """\ + + +
+ +This is the server for Passthrough Browser. Passthrough Browser is an Android app that, when set as the default browser in Waydroid, causes links to open in the host computer's browser.
+If you have not yet installed the client app in Waydroid, follow these steps to install it:
+cd
to the directory where you downloaded Passthrough Browser./install_client.sh