Skip to content

Commit

Permalink
Add assetlinks.json to link android app to app.khoj.dev domain
Browse files Browse the repository at this point in the history
Add sha cert of android upload, signing keys to open debug, prod apps
as TWA in fullscreen on android phones
  • Loading branch information
debanjum committed Nov 26, 2024
1 parent a97a45b commit 29315f4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/khoj/interface/web/.well-known/assetlinks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[{
"relation": ["delegate_permission/common.handle_all_urls"],
"target": {
"namespace": "android_app",
"package_name": "dev.khoj.app",
"sha256_cert_fingerprints": [
"CC:98:4A:0A:F1:CC:84:26:AC:02:86:49:AA:69:64:B9:5E:63:A3:EF:18:56:EA:CA:13:C1:3A:15:CA:49:77:46",
"D4:5A:6F:6C:18:28:D2:1C:78:27:92:C6:AC:DB:4C:12:C4:52:A1:88:9B:A1:F5:67:D1:22:FE:A0:0F:B1:AE:92"
]
}
}]
5 changes: 5 additions & 0 deletions src/khoj/routers/web_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,8 @@ def automations_config_page(
"request": request,
},
)


@web_client.get("/.well-known/assetlinks.json", response_class=FileResponse)
def assetlinks(request: Request):
return FileResponse(constants.assetlinks_file_path)
1 change: 1 addition & 0 deletions src/khoj/utils/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
web_directory = app_root_directory / "khoj/interface/web/"
next_js_directory = app_root_directory / "khoj/interface/built/"
pypi_static_directory = app_root_directory / "khoj/interface/compiled/"
assetlinks_file_path = web_directory / ".well-known/assetlinks.json"
empty_escape_sequences = "\n|\r|\t| "
app_env_filepath = "~/.khoj/env"
telemetry_server = "https://khoj.beta.haletic.com/v1/telemetry"
Expand Down

0 comments on commit 29315f4

Please sign in to comment.