File size: 679 Bytes
cfed92e
9ebdcbe
cfed92e
 
 
 
 
 
 
 
 
102fb60
9ebdcbe
cfed92e
 
688982f
cfed92e
 
688982f
cfed92e
 
 
 
 
 
 
688982f
cfed92e
9ebdcbe
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import gradio as gr
import subprocess
import os
import uuid

def convert_to_apk(manifest_url):
    apk_id = str(uuid.uuid4())
    result = subprocess.run(
        ["bash", "entrypoint.sh", manifest_url, apk_id],
        capture_output=True,
        text=True
    )

    apk_path = f"{apk_id}/app-release-signed.apk"
    if os.path.exists(apk_path):
        return apk_path
    else:
        return f"Error:\n{result.stderr}"

iface = gr.Interface(
    fn=convert_to_apk,
    inputs=gr.Textbox(label="Manifest.json URL"),
    outputs=gr.File(label="Download APK"),
    title="URL to APK",
    description="Paste the public URL of a manifest.json from your PWA"
)

iface.launch()