A cheap attempt at a native Bluesky client for Android
1#!/bin/bash
2
3# Check if a file path argument is provided
4if [ $# -eq 0 ]; then
5 echo "Usage: $0 <path-to-apk-file>"
6 exit 1
7fi
8
9# Get the input file path
10INPUT_APK="$1"
11
12# Check if the file exists
13if [ ! -f "$INPUT_APK" ]; then
14 echo "Error: File '$INPUT_APK' not found"
15 exit 1
16fi
17
18# Get the current UNIX timestamp
19TIMESTAMP=$(date +%s)
20
21# Move APK file to its new home
22mv "$INPUT_APK" monarch-release-$TIMESTAMP.apk
23
24# Export the final APK path as an environment variable
25export MONARCH_APK_PATH="$(pwd)/monarch-release-$TIMESTAMP.apk"
26export MONARCH_APK_FILENAME="monarch-release-$TIMESTAMP.apk"
27
28# Define the output filename
29OUTPUT_FILE="index.html"
30
31# Create the HTML file with a HERE document
32cat > $OUTPUT_FILE <<EOF
33<!DOCTYPE html>
34<html lang="en">
35<head>
36 <meta charset="UTF-8">
37 <meta name="viewport" content="width=device-width, initial-scale=1.0">
38 <title>Download</title>
39</head>
40<body>
41 <!-- File generated at UNIX timestamp: $TIMESTAMP -->
42 <a href="/monarch-release-$TIMESTAMP.apk">monarch-release-$TIMESTAMP.apk</a>
43</body>
44</html>
45EOF
46
47# Print a confirmation message to the console
48echo "Successfully created $OUTPUT_FILE"