Compare commits
	
		
			37 Commits
		
	
	
		
			v0.0.20
			...
			221f276c4b
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 221f276c4b | |||
| 24cec21465 | |||
| 9f71ec6194 | |||
| bb36afc390 | |||
| b53bf0ff64 | |||
| 3ebc6f2436 | |||
| 2eef6778a6 | |||
| 81fabec810 | |||
| dc6e7924b5 | |||
| 48dec5a2c8 | |||
| 9b500e1da9 | |||
| a038820112 | |||
| 70a15973b6 | |||
| 09b6a00731 | |||
| 883c3cf0e9 | |||
| a46bb8183c | |||
| d5d5a7b012 | |||
| a120efdc91 | |||
| d48f4b06eb | |||
| f078912736 | |||
| 63b0f0dedd | |||
| 84c22dbf5f | |||
| b8cd1232be | |||
| a518ab07f4 | |||
| 9e5a1ee975 | |||
| 95bf3f0316 | |||
| d69dd513bc | |||
| 525cdf571a | |||
| 9cfe0a8804 | |||
| 50b54599ef | |||
| ed6bef6d24 | |||
| 71268636df | |||
| 568729ecd6 | |||
| 9139725be6 | |||
| 
						
						
							
						
						969a8da6bf
	
				 | 
					
					
						|||
| 2338b26329 | |||
| d4df206740 | 
							
								
								
									
										40
									
								
								.fdroid.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										40
									
								
								.fdroid.yml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,40 @@
 | 
			
		||||
Categories:
 | 
			
		||||
  - Internet
 | 
			
		||||
License: MIT
 | 
			
		||||
 | 
			
		||||
AutoName: tildefriends
 | 
			
		||||
AuthorName: Cory McWilliams
 | 
			
		||||
AuthorEmail: cory@tildefriends.net
 | 
			
		||||
 | 
			
		||||
RepoType: git
 | 
			
		||||
Repo: https://dev.tildefriends.net/cory/tildefriends.git
 | 
			
		||||
 | 
			
		||||
Builds:
 | 
			
		||||
  - versionName: 0.0.21-wip
 | 
			
		||||
    versionCode: 22
 | 
			
		||||
    commit: 09b6a00731d45fa160b23a2c44be6def98d92d6a
 | 
			
		||||
    subdir: src/android
 | 
			
		||||
    submodules: true
 | 
			
		||||
    sudo:
 | 
			
		||||
      - apt-get update
 | 
			
		||||
      - apt-get install -y ant make zip
 | 
			
		||||
    androidupdate:
 | 
			
		||||
      - no
 | 
			
		||||
    scandelete:
 | 
			
		||||
      - deps/libuv/docs/src/static/diagrams.key/Index.zip
 | 
			
		||||
      - deps/openssl_src/cloudflare-quiche/*
 | 
			
		||||
      - deps/openssl_src/fuzz/*
 | 
			
		||||
      - deps/openssl_src/gost-engine/*
 | 
			
		||||
      - deps/openssl_src/test/*
 | 
			
		||||
      - deps/openssl_src/tlslite-ng/*
 | 
			
		||||
    prebuild:
 | 
			
		||||
      - sdkmanager "platforms;android-34" "build-tools;34.0.0"
 | 
			
		||||
    build:
 | 
			
		||||
      - mkdir bin/
 | 
			
		||||
      - ANDROID_SDK=$$SDK$$ ANDROID_NDK=$$NDK$$ ANDROID_NDK_ROOT=$$NDK$$ make -C ../../ -j`nproc` fdroid
 | 
			
		||||
    ndk: r26d
 | 
			
		||||
 | 
			
		||||
AutoUpdateMode: Version ^v[0-9\.]+$
 | 
			
		||||
UpdateCheckMode: Tags
 | 
			
		||||
CurrentVersion: 0.0.21-wip
 | 
			
		||||
CurrentVersionCode: 22
 | 
			
		||||
							
								
								
									
										20
									
								
								.gitea/workflows/build.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								.gitea/workflows/build.yaml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,20 @@
 | 
			
		||||
name: Build Tilde Friends
 | 
			
		||||
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
 | 
			
		||||
on: [push]
 | 
			
		||||
 | 
			
		||||
jobs:
 | 
			
		||||
  Build-All:
 | 
			
		||||
    runs-on: ubuntu-latest
 | 
			
		||||
    steps:
 | 
			
		||||
      - run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event."
 | 
			
		||||
      - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!"
 | 
			
		||||
      - run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
 | 
			
		||||
      - name: Check out repository code
 | 
			
		||||
        uses: actions/checkout@v4
 | 
			
		||||
        with:
 | 
			
		||||
          submodules: true
 | 
			
		||||
      - run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner."
 | 
			
		||||
      - run: echo "🖥️ The workflow is now ready to test your code on the runner."
 | 
			
		||||
      - run: sudo apt update && sudo apt install -y mingw-w64
 | 
			
		||||
      - run: make all -j`nproc`
 | 
			
		||||
      - run: echo "🍏 This job's status is ${{ job.status }}."
 | 
			
		||||
							
								
								
									
										8
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										8
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@@ -1,11 +1,17 @@
 | 
			
		||||
build/
 | 
			
		||||
*.core
 | 
			
		||||
db.*
 | 
			
		||||
deps/ios_toolchain/
 | 
			
		||||
deps/openssl/
 | 
			
		||||
dist/
 | 
			
		||||
.keys
 | 
			
		||||
logs/
 | 
			
		||||
**/node_modules
 | 
			
		||||
out
 | 
			
		||||
repo/
 | 
			
		||||
result
 | 
			
		||||
*.swo
 | 
			
		||||
*.swp
 | 
			
		||||
tmp/
 | 
			
		||||
unsigned/
 | 
			
		||||
.zsign_cache/
 | 
			
		||||
result
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										3
									
								
								.gitmodules
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								.gitmodules
									
									
									
									
										vendored
									
									
								
							@@ -19,3 +19,6 @@
 | 
			
		||||
[submodule "deps/picohttpparser"]
 | 
			
		||||
	path = deps/picohttpparser
 | 
			
		||||
	url = https://github.com/h2o/picohttpparser.git
 | 
			
		||||
[submodule "deps/openssl_src"]
 | 
			
		||||
	path = deps/openssl_src
 | 
			
		||||
	url = https://github.com/openssl/openssl.git
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										147
									
								
								GNUmakefile
									
									
									
									
									
								
							
							
						
						
									
										147
									
								
								GNUmakefile
									
									
									
									
									
								
							@@ -3,12 +3,13 @@
 | 
			
		||||
MAKEFLAGS += --warn-undefined-variables
 | 
			
		||||
MAKEFLAGS += --no-builtin-rules
 | 
			
		||||
 | 
			
		||||
VERSION_CODE := 20
 | 
			
		||||
VERSION_NUMBER := 0.0.20
 | 
			
		||||
VERSION_NAME := They gave you a small cup.
 | 
			
		||||
VERSION_CODE := 23
 | 
			
		||||
VERSION_NUMBER := 0.0.21-wip
 | 
			
		||||
VERSION_NAME := Psst.  Look behind you.
 | 
			
		||||
 | 
			
		||||
SQLITE_URL := https://www.sqlite.org/2024/sqlite-amalgamation-3460000.zip
 | 
			
		||||
LIBUV_URL := https://dist.libuv.org/dist/v1.48.0/libuv-v1.48.0.tar.gz
 | 
			
		||||
BUNDLETOOL_URL := https://github.com/google/bundletool/releases/download/1.17.0/bundletool-all-1.17.0.jar
 | 
			
		||||
 | 
			
		||||
PROJECT = tildefriends
 | 
			
		||||
BUILD_DIR ?= out
 | 
			
		||||
@@ -16,6 +17,7 @@ UNAME_S := $(shell uname -s)
 | 
			
		||||
UNAME_M := $(shell uname -m)
 | 
			
		||||
 | 
			
		||||
ANDROID_SDK ?= ~/Android/Sdk
 | 
			
		||||
BUNDLETOOL = out/bundletool.jar
 | 
			
		||||
 | 
			
		||||
HAVE_WIN := 0
 | 
			
		||||
 | 
			
		||||
@@ -61,7 +63,11 @@ ANDROID_MIN_SDK_VERSION := 24
 | 
			
		||||
ANDROID_TARGET_SDK_VERSION := 34
 | 
			
		||||
ANDROID_BUILD_TOOLS := $(ANDROID_SDK)/build-tools/34.0.0
 | 
			
		||||
ANDROID_PLATFORM := $(ANDROID_SDK)/platforms/android-$(ANDROID_TARGET_SDK_VERSION)
 | 
			
		||||
ifneq "$(wildcard $(ANDROID_SDK)/ndk/27.0.12077973/.)" ""
 | 
			
		||||
ANDROID_NDK ?= $(ANDROID_SDK)/ndk/27.0.12077973
 | 
			
		||||
else
 | 
			
		||||
ANDROID_NDK ?= $(ANDROID_SDK)/ndk/26.2.11394342
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
ANDROID_ARMV7A_TARGETS := \
 | 
			
		||||
	out/androiddebug-armv7a/tildefriends \
 | 
			
		||||
@@ -90,7 +96,7 @@ BUILD_TYPES += \
 | 
			
		||||
	androidrelease-x86 \
 | 
			
		||||
	androiddebug-x86_64 \
 | 
			
		||||
	androidrelease-x86_64
 | 
			
		||||
all: out/TildeFriends-arm-debug.apk out/TildeFriends-arm-release.apk out/TildeFriends-x86-debug.apk out/TildeFriends-x86-release.apk
 | 
			
		||||
all: out/TildeFriends-arm-debug.apk out/TildeFriends-arm-release.apk out/TildeFriends-x86-debug.apk out/TildeFriends-x86-release.apk out/TildeFriends-release.fdroid.apk
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
WINDOWS_TARGETS := \
 | 
			
		||||
@@ -150,9 +156,10 @@ ANDROID_RELEASE_TARGETS := $(filter-out $(DEBUG_TARGETS),$(ANDROID_TARGETS))
 | 
			
		||||
NONANDROID_RELEASE_TARGETS := $(filter-out $(ANDROID_ARM64_TARGETS),$(RELEASE_TARGETS))
 | 
			
		||||
NONANDROID_TARGETS := $(filter-out $(ANDROID_TARGETS),$(ALL_TARGETS))
 | 
			
		||||
NONMACOS_TARGETS := $(filter-out $(MACOS_TARGETS) $(IOS_TARGETS) $(IOSSIM_TARGETS),$(ALL_TARGETS))
 | 
			
		||||
DEADSTRIP_TARGETS := $(filter-out $(ANDROID_TARGETS),$(NONMACOS_TARGETS))
 | 
			
		||||
 | 
			
		||||
$(NONANDROID_TARGETS): CFLAGS += -fno-omit-frame-pointer
 | 
			
		||||
$(filter-out $(ANDROID_TARGETS) $(WINDOWS_TARGETS),$(ALL_TARGETS)): LDFLAGS += -rdynamic
 | 
			
		||||
$(filter-out $(WINDOWS_TARGETS),$(ALL_TARGETS)): LDFLAGS += -rdynamic
 | 
			
		||||
$(ANDROID_TARGETS): CFLAGS += \
 | 
			
		||||
	--sysroot $(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64/sysroot \
 | 
			
		||||
	-fPIC \
 | 
			
		||||
@@ -205,7 +212,7 @@ $(ANDROID_X86_TARGETS): LDFLAGS += -Ldeps/openssl/android/x86/usr/local/lib
 | 
			
		||||
$(ANDROID_X86_64_TARGETS): CFLAGS += -Ideps/openssl/android/x86_64/usr/local/include
 | 
			
		||||
$(ANDROID_X86_64_TARGETS): LDFLAGS += -Ldeps/openssl/android/x86_64/usr/local/lib
 | 
			
		||||
$(NONMACOS_TARGETS): CFLAGS += -Wno-cast-function-type
 | 
			
		||||
$(NONMACOS_TARGETS): LDFLAGS += -Wl,--gc-sections
 | 
			
		||||
$(DEADSTRIP_TARGETS): LDFLAGS += -Wl,--gc-sections
 | 
			
		||||
$(IOS_TARGETS): CFLAGS += -mios-version-min=9.0 -Ideps/openssl/ios/ios64-xcrun/usr/local/include
 | 
			
		||||
$(IOS_TARGETS): LDFLAGS += -Ldeps/openssl/ios/ios64-xcrun/usr/local/lib
 | 
			
		||||
$(IOSSIM_TARGETS): CFLAGS += -Ideps/openssl/ios/iossimulator-xcrun/usr/local/include
 | 
			
		||||
@@ -616,7 +623,7 @@ $(IOS_TARGETS) $(IOSSIM_TARGETS): LDFLAGS += \
 | 
			
		||||
 | 
			
		||||
unix: debug release
 | 
			
		||||
win: windebug winrelease
 | 
			
		||||
all: $(BUILD_TYPES) default.nix
 | 
			
		||||
all: $(BUILD_TYPES)
 | 
			
		||||
.PHONY: all win unix
 | 
			
		||||
 | 
			
		||||
ALL_APP_OBJS := \
 | 
			
		||||
@@ -664,19 +671,6 @@ src/version.h : $(firstword $(MAKEFILE_LIST))
 | 
			
		||||
	@echo "#define VERSION_NUMBER \"$(VERSION_NUMBER)\"" > $@
 | 
			
		||||
	@echo "#define VERSION_NAME \"$(VERSION_NAME)\"" >> $@
 | 
			
		||||
 | 
			
		||||
src/android/AndroidManifest.xml : $(firstword $(MAKEFILE_LIST))
 | 
			
		||||
	@echo "[android_version] $@"
 | 
			
		||||
	@sed -i \
 | 
			
		||||
		-e 's/versionCode=".*"/versionCode="$(VERSION_CODE)"/' \
 | 
			
		||||
		-e 's/versionName=".*"/versionName="$(VERSION_NUMBER)"/' \
 | 
			
		||||
		-e 's/android:minSdkVersion="[[:digit:]]*"/android:minSdkVersion="$(ANDROID_MIN_SDK_VERSION)"/' \
 | 
			
		||||
		-e 's/android:targetSdkVersion="[[:digit:]]*"/android:targetSdkVersion="$(ANDROID_TARGET_SDK_VERSION)"/' \
 | 
			
		||||
		$@
 | 
			
		||||
 | 
			
		||||
default.nix : $(firstword $(MAKEFILE_LIST))
 | 
			
		||||
	@echo "[version] $@"
 | 
			
		||||
	@sed -i -e 's/version = ".*";/version = "$(VERSION_NUMBER)";/' $@
 | 
			
		||||
 | 
			
		||||
# Android support.
 | 
			
		||||
out/res/layout_activity_main.xml.flat: src/android/res/layout/activity_main.xml
 | 
			
		||||
	@mkdir -p $(dir $@)
 | 
			
		||||
@@ -689,8 +683,29 @@ out/res/drawable_icon.xml.flat: src/android/res/drawable/icon.xml
 | 
			
		||||
	@$(ANDROID_BUILD_TOOLS)/aapt2 compile -o out/res/ src/android/res/drawable/icon.xml
 | 
			
		||||
 | 
			
		||||
out/apk/res.apk out/gen/com/unprompted/tildefriends/R.java: out/res/layout_activity_main.xml.flat out/res/drawable_icon.xml.flat src/android/AndroidManifest.xml
 | 
			
		||||
	@mkdir -p $(dir $@)
 | 
			
		||||
	@$(ANDROID_BUILD_TOOLS)/aapt2 link -I $(ANDROID_PLATFORM)/android.jar out/res/layout_activity_main.xml.flat out/res/drawable_icon.xml.flat --manifest src/android/AndroidManifest.xml -o out/apk/res.apk --java out/gen/
 | 
			
		||||
	@echo [aapt2 link] res.apk
 | 
			
		||||
	@mkdir -p out/apk/
 | 
			
		||||
	@$(ANDROID_BUILD_TOOLS)/aapt2 link -I $(ANDROID_PLATFORM)/android.jar out/res/layout_activity_main.xml.flat out/res/drawable_icon.xml.flat \
 | 
			
		||||
		--version-code $(VERSION_CODE) \
 | 
			
		||||
		--version-name $(VERSION_NUMBER) \
 | 
			
		||||
		--min-sdk-version $(ANDROID_MIN_SDK_VERSION) \
 | 
			
		||||
		--target-sdk-version $(ANDROID_TARGET_SDK_VERSION) \
 | 
			
		||||
		--manifest src/android/AndroidManifest.xml \
 | 
			
		||||
		-o out/apk/res.apk \
 | 
			
		||||
		--java out/gen/
 | 
			
		||||
 | 
			
		||||
out/apk/res.fdroid.apk out/gen_fdroid/com/unprompted/tildefriends/R.java: out/res/layout_activity_main.xml.flat out/res/drawable_icon.xml.flat src/android/AndroidManifest.xml
 | 
			
		||||
	@echo [aapt2 link] res.fdroid.apk
 | 
			
		||||
	@mkdir -p out/apk/
 | 
			
		||||
	@$(ANDROID_BUILD_TOOLS)/aapt2 link -I $(ANDROID_PLATFORM)/android.jar out/res/layout_activity_main.xml.flat out/res/drawable_icon.xml.flat \
 | 
			
		||||
		--version-code $(VERSION_CODE) \
 | 
			
		||||
		--version-name $(VERSION_NUMBER) \
 | 
			
		||||
		--min-sdk-version $(ANDROID_MIN_SDK_VERSION) \
 | 
			
		||||
		--target-sdk-version $(ANDROID_TARGET_SDK_VERSION) \
 | 
			
		||||
		--rename-manifest-package com.unprompted.tildefriends.fdroid \
 | 
			
		||||
		--manifest src/android/AndroidManifest.xml \
 | 
			
		||||
		-o out/apk/res.fdroid.apk \
 | 
			
		||||
		--java out/gen_fdroid/
 | 
			
		||||
 | 
			
		||||
JAVA_FILES := out/gen/com/unprompted/tildefriends/R.java $(wildcard src/android/com/unprompted/tildefriends/*.java)
 | 
			
		||||
CLASS_FILES := $(foreach src,$(JAVA_FILES),out/classes/com/unprompted/tildefriends/$(notdir $(src:.java=.class)))
 | 
			
		||||
@@ -702,7 +717,7 @@ $(CLASS_FILES) &: $(JAVA_FILES)
 | 
			
		||||
out/apk/classes.dex: $(CLASS_FILES)
 | 
			
		||||
	@mkdir -p $(dir $@)
 | 
			
		||||
	@echo "[d8] $@"
 | 
			
		||||
	@$(ANDROID_BUILD_TOOLS)/d8 --$(BUILD_TYPE) --lib $(ANDROID_PLATFORM)/android.jar --output $(dir $@) out/classes/com/unprompted/tildefriends/*.class
 | 
			
		||||
	@$(ANDROID_BUILD_TOOLS)/d8 --lib $(ANDROID_PLATFORM)/android.jar --output $(dir $@) out/classes/com/unprompted/tildefriends/*.class
 | 
			
		||||
 | 
			
		||||
PACKAGE_DIRS := \
 | 
			
		||||
	apps/ \
 | 
			
		||||
@@ -717,19 +732,59 @@ out/apk/TildeFriends-arm-debug.unsigned.apk: BUILD_TYPE := debug
 | 
			
		||||
out/apk/TildeFriends-arm-release.unsigned.apk: BUILD_TYPE := release
 | 
			
		||||
out/apk/TildeFriends-x86-debug.unsigned.apk: BUILD_TYPE := debug
 | 
			
		||||
out/apk/TildeFriends-x86-release.unsigned.apk: BUILD_TYPE := release
 | 
			
		||||
out/apk/TildeFriends-release.fdroid.unsigned.apk: BUILD_TYPE := release
 | 
			
		||||
 | 
			
		||||
out/apk/TildeFriends-arm-debug.unsigned.apk: out/apk/classes.dex out/androiddebug/tildefriends out/androiddebug-armv7a/tildefriends $(RAW_FILES) out/apk/res.apk
 | 
			
		||||
out/apk/TildeFriends-arm-release.unsigned.apk: out/apk/classes.dex out/androidrelease/tildefriends out/androidrelease-armv7a/tildefriends $(RAW_FILES) out/apk/res.apk
 | 
			
		||||
out/apk/TildeFriends-x86-debug.unsigned.apk: out/apk/classes.dex out/androiddebug-x86_64/tildefriends out/androiddebug-x86/tildefriends $(RAW_FILES) out/apk/res.apk
 | 
			
		||||
out/apk/TildeFriends-x86-release.unsigned.apk: out/apk/classes.dex out/androidrelease-x86_64/tildefriends out/androidrelease-x86/tildefriends $(RAW_FILES) out/apk/res.apk
 | 
			
		||||
out/apk/TildeFriends-release.fdroid.unsigned.apk: out/apk/classes.dex out/androidrelease/tildefriends out/androidrelease-armv7a/tildefriends out/androidrelease-x86_64/tildefriends out/androidrelease-x86/tildefriends $(RAW_FILES) out/apk/res.fdroid.apk
 | 
			
		||||
 | 
			
		||||
$(BUNDLETOOL):
 | 
			
		||||
	@echo [curl] $(BUNDLETOOL_URL) TO $@
 | 
			
		||||
	@curl -q -L --create-dirs -o $@ $(BUNDLETOOL_URL)
 | 
			
		||||
 | 
			
		||||
out/TildeFriends.aab: out/apk/classes.dex $(filter-out %debug%, $(ANDROID_TARGETS)) $(RAW_FILES) out/apk/res.apk src/android/AndroidManifest.xml $(BUNDLETOOL)
 | 
			
		||||
	@rm -rf out/aab/staging/
 | 
			
		||||
	@mkdir -p out/aab/staging
 | 
			
		||||
	@$(ANDROID_BUILD_TOOLS)/aapt2 link --proto-format -o out/aab/temporary.apk -I $(ANDROID_PLATFORM)/android.jar --manifest src/android/AndroidManifest.xml -R out/res/layout_activity_main.xml.flat -R out/res/drawable_icon.xml.flat --auto-add-overlay
 | 
			
		||||
	@unzip out/aab/temporary.apk -d out/aab/staging/
 | 
			
		||||
	@mkdir -p out/aab/staging/root/deps
 | 
			
		||||
	@mkdir -p out/aab/staging/classes
 | 
			
		||||
	@mkdir -p out/aab/staging/dex
 | 
			
		||||
	@mkdir -p out/aab/staging/manifest
 | 
			
		||||
	@mv out/aab/staging/AndroidManifest.xml out/aab/staging/manifest/AndroidManifest.xml
 | 
			
		||||
	@cp out/apk/classes.dex out/aab/staging/dex/
 | 
			
		||||
	@rm -fv out/base.zip
 | 
			
		||||
	@cp -r out/apk-arm-release/lib/ out/aab/staging/
 | 
			
		||||
	@cp -r out/apk-x86-release/lib/ out/aab/staging/
 | 
			
		||||
	@cp -r apps/ out/aab/staging/root/
 | 
			
		||||
	@rm -rf out/aab/staging/root/apps/welcome*
 | 
			
		||||
	@cp -r core/ out/aab/staging/root/
 | 
			
		||||
	@cp -r deps/prettier/ out/aab/staging/root/deps/
 | 
			
		||||
	@cp -r deps/lit/ out/aab/staging/root/deps/
 | 
			
		||||
	@cp -r deps/codemirror/ out/aab/staging/root/deps/
 | 
			
		||||
	@cd out/aab/staging/; zip -r ../base.zip *; cd ../../../
 | 
			
		||||
	@java -jar $(BUNDLETOOL) build-bundle --overwrite --config=src/android/BundleConfig.json --modules=out/aab/base.zip --output=$@
 | 
			
		||||
	@jarsigner -keystore .keys/android.jks $@ androidKey -storepass android
 | 
			
		||||
 | 
			
		||||
aab: out/TildeFriends.aab
 | 
			
		||||
.PHONY: aab
 | 
			
		||||
 | 
			
		||||
out/TildeFriends.apks: out/TildeFriends.aab $(BUNDLETOOL)
 | 
			
		||||
	@java -jar $(BUNDLETOOL) build-apks --bundle out/TildeFriends.aab --overwrite --output $@ --ks .keys/android.jks --ks-key-alias androidKey --ks-pass pass:android
 | 
			
		||||
 | 
			
		||||
aabgo: out/TildeFriends.apks $(BUNDLETOOL)
 | 
			
		||||
	@java -jar $(BUNDLETOOL) install-apks --apks out/TildeFriends.apks
 | 
			
		||||
	@adb shell am start com.unprompted.tildefriends/.TildeFriendsActivity
 | 
			
		||||
 | 
			
		||||
out/apk/TildeFriends-arm-%.unsigned.apk:
 | 
			
		||||
	@mkdir -p $(dir $@) out/apk-arm-$(BUILD_TYPE)/lib/arm64-v8a/ out/apk-arm-$(BUILD_TYPE)/lib/armeabi-v7a/
 | 
			
		||||
	@echo "[aapt] $@"
 | 
			
		||||
	@cp out/android$(BUILD_TYPE)/tildefriends out/apk-arm-$(BUILD_TYPE)/lib/arm64-v8a/tildefriends.so
 | 
			
		||||
	@cp out/android$(BUILD_TYPE)-armv7a/tildefriends out/apk-arm-$(BUILD_TYPE)/lib/armeabi-v7a/tildefriends.so
 | 
			
		||||
	@$(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip out/apk-arm-$(BUILD_TYPE)/lib/arm64-v8a/tildefriends.so
 | 
			
		||||
	@$(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip out/apk-arm-$(BUILD_TYPE)/lib/armeabi-v7a/tildefriends.so
 | 
			
		||||
	@cp out/android$(BUILD_TYPE)/tildefriends out/apk-arm-$(BUILD_TYPE)/lib/arm64-v8a/libtildefriends.so
 | 
			
		||||
	@cp out/android$(BUILD_TYPE)-armv7a/tildefriends out/apk-arm-$(BUILD_TYPE)/lib/armeabi-v7a/libtildefriends.so
 | 
			
		||||
	@$(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip out/apk-arm-$(BUILD_TYPE)/lib/arm64-v8a/libtildefriends.so
 | 
			
		||||
	@$(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip out/apk-arm-$(BUILD_TYPE)/lib/armeabi-v7a/libtildefriends.so
 | 
			
		||||
	@cp out/apk/res.apk $@.zip
 | 
			
		||||
	@cp out/apk/classes.dex out/apk-arm-$(BUILD_TYPE)/
 | 
			
		||||
	@cd out/apk-arm-$(BUILD_TYPE) && zip -u ../../$@.zip -q -9 -r . && cd ../../
 | 
			
		||||
@@ -739,16 +794,33 @@ out/apk/TildeFriends-arm-%.unsigned.apk:
 | 
			
		||||
out/apk/TildeFriends-x86-%.unsigned.apk:
 | 
			
		||||
	@mkdir -p $(dir $@) out/apk-x86-$(BUILD_TYPE)/lib/x86_64/ out/apk-x86-$(BUILD_TYPE)/lib/x86/
 | 
			
		||||
	@echo "[aapt] $@"
 | 
			
		||||
	@cp out/android$(BUILD_TYPE)-x86_64/tildefriends out/apk-x86-$(BUILD_TYPE)/lib/x86_64/tildefriends.so
 | 
			
		||||
	@cp out/android$(BUILD_TYPE)-x86/tildefriends out/apk-x86-$(BUILD_TYPE)/lib/x86/tildefriends.so
 | 
			
		||||
	@$(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip out/apk-x86-$(BUILD_TYPE)/lib/x86_64/tildefriends.so
 | 
			
		||||
	@$(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip out/apk-x86-$(BUILD_TYPE)/lib/x86/tildefriends.so
 | 
			
		||||
	@cp out/android$(BUILD_TYPE)-x86_64/tildefriends out/apk-x86-$(BUILD_TYPE)/lib/x86_64/libtildefriends.so
 | 
			
		||||
	@cp out/android$(BUILD_TYPE)-x86/tildefriends out/apk-x86-$(BUILD_TYPE)/lib/x86/libtildefriends.so
 | 
			
		||||
	@$(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip out/apk-x86-$(BUILD_TYPE)/lib/x86_64/libtildefriends.so
 | 
			
		||||
	@$(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip out/apk-x86-$(BUILD_TYPE)/lib/x86/libtildefriends.so
 | 
			
		||||
	@cp out/apk/res.apk $@.zip
 | 
			
		||||
	@cp out/apk/classes.dex out/apk-x86-$(BUILD_TYPE)/
 | 
			
		||||
	@cd out/apk-x86-$(BUILD_TYPE) && zip -u ../../$@.zip -q -9 -r . && cd ../../
 | 
			
		||||
	@zip -u $@.zip -q -9 $(RAW_FILES)
 | 
			
		||||
	@$(ANDROID_BUILD_TOOLS)/zipalign -f 4 $@.zip $@
 | 
			
		||||
 | 
			
		||||
out/apk/TildeFriends-%.fdroid.unsigned.apk:
 | 
			
		||||
	@mkdir -p $(dir $@) out/apk-fdroid-$(BUILD_TYPE)/lib/x86_64/ out/apk-fdroid-$(BUILD_TYPE)/lib/x86/ out/apk-fdroid-$(BUILD_TYPE)/lib/arm64-v8a/ out/apk-fdroid-$(BUILD_TYPE)/lib/armeabi-v7a/
 | 
			
		||||
	@echo "[aapt] $@"
 | 
			
		||||
	@cp out/android$(BUILD_TYPE)-x86_64/tildefriends out/apk-fdroid-$(BUILD_TYPE)/lib/x86_64/libtildefriends.so
 | 
			
		||||
	@cp out/android$(BUILD_TYPE)-x86/tildefriends out/apk-fdroid-$(BUILD_TYPE)/lib/x86/libtildefriends.so
 | 
			
		||||
	@cp out/android$(BUILD_TYPE)/tildefriends out/apk-fdroid-$(BUILD_TYPE)/lib/arm64-v8a/libtildefriends.so
 | 
			
		||||
	@cp out/android$(BUILD_TYPE)-armv7a/tildefriends out/apk-fdroid-$(BUILD_TYPE)/lib/armeabi-v7a/libtildefriends.so
 | 
			
		||||
	@$(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip out/apk-fdroid-$(BUILD_TYPE)/lib/x86_64/libtildefriends.so
 | 
			
		||||
	@$(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip out/apk-fdroid-$(BUILD_TYPE)/lib/x86/libtildefriends.so
 | 
			
		||||
	@$(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip out/apk-fdroid-$(BUILD_TYPE)/lib/arm64-v8a/libtildefriends.so
 | 
			
		||||
	@$(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip out/apk-fdroid-$(BUILD_TYPE)/lib/armeabi-v7a/libtildefriends.so
 | 
			
		||||
	@cp out/apk/res.fdroid.apk $@.zip
 | 
			
		||||
	@cp out/apk/classes.dex out/apk-fdroid-$(BUILD_TYPE)/classes.dex
 | 
			
		||||
	@cd out/apk-fdroid-$(BUILD_TYPE) && zip -u ../../$@.zip -q -9 -r . && cd ../../
 | 
			
		||||
	@zip -u $@.zip -q -9 $(RAW_FILES)
 | 
			
		||||
	@$(ANDROID_BUILD_TOOLS)/zipalign -f 4 $@.zip $@
 | 
			
		||||
 | 
			
		||||
out/%.apk: out/apk/%.unsigned.apk
 | 
			
		||||
	@echo "[apksigner] $(notdir $@)"
 | 
			
		||||
	@$(ANDROID_BUILD_TOOLS)/apksigner sign --ks .keys/android.jks --ks-key-alias androidKey --ks-pass pass:android --key-pass pass:android --min-sdk-version $(ANDROID_MIN_SDK_VERSION) --out $@ $<
 | 
			
		||||
@@ -761,6 +833,11 @@ out/%.zopfli.apk: out/%.apk
 | 
			
		||||
release-apk: out/TildeFriends-arm-release.zopfli.apk out/TildeFriends-x86-release.zopfli.apk
 | 
			
		||||
.PHONY: release-apk
 | 
			
		||||
 | 
			
		||||
apkgo: out/TildeFriends-arm-debug.apk
 | 
			
		||||
	@adb install -r $<
 | 
			
		||||
	@adb shell am start com.unprompted.tildefriends/.TildeFriendsActivity
 | 
			
		||||
.PHONY: apkgo
 | 
			
		||||
 | 
			
		||||
releaseapkgo: out/TildeFriends-arm-release.apk
 | 
			
		||||
	@adb install -r $<
 | 
			
		||||
	@adb shell am start com.unprompted.tildefriends/.TildeFriendsActivity
 | 
			
		||||
@@ -841,7 +918,7 @@ fetchdeps:
 | 
			
		||||
 | 
			
		||||
ANDROID_DEPS := deps/openssl/android/arm64-v8a/usr/local/lib/libssl.a
 | 
			
		||||
$(ANDROID_DEPS):
 | 
			
		||||
	+@tools/ssl-android
 | 
			
		||||
	+@ANDROID_NDK_ROOT=$(ANDROID_NDK) tools/ssl-android
 | 
			
		||||
$(filter $(BUILD_DIR)/android%,$(APP_OBJS)): | $(ANDROID_DEPS)
 | 
			
		||||
 | 
			
		||||
ifeq ($(HAVE_WIN),1)
 | 
			
		||||
@@ -862,7 +939,7 @@ clean:
 | 
			
		||||
	rm -rf $(BUILD_DIR)
 | 
			
		||||
.PHONY: clean
 | 
			
		||||
 | 
			
		||||
dist: release-apk iosrelease-ipa $(if $(HAVE_WIN), out/winrelease/tildefriends.standalone.exe) default.nix
 | 
			
		||||
dist: release-apk iosrelease-ipa $(if $(HAVE_WIN), out/winrelease/tildefriends.standalone.exe)
 | 
			
		||||
	@echo [archive] dist/tildefriends-$(VERSION_NUMBER).tar.xz
 | 
			
		||||
	@rm -rf out/tildefriends-$(VERSION_NUMBER)
 | 
			
		||||
	@mkdir -p dist/ out/tildefriends-$(VERSION_NUMBER)
 | 
			
		||||
@@ -893,6 +970,7 @@ dist: release-apk iosrelease-ipa $(if $(HAVE_WIN), out/winrelease/tildefriends.s
 | 
			
		||||
	@cp out/tildefriends-release.ipa dist/TildeFriends-$(VERSION_NUMBER).ipa
 | 
			
		||||
	@test $(HAVE_WIN) && echo "[cp] tildefriends-$(VERSION_NUMBER).exe"
 | 
			
		||||
	@test $(HAVE_WIN) && cp out/winrelease/tildefriends.standalone.exe dist/tildefriends-$(VERSION_NUMBER).exe
 | 
			
		||||
	@cp out/TildeFriends.aab dist/TildeFriends-$(VERSION_NUMBER).aab
 | 
			
		||||
.PHONY: dist
 | 
			
		||||
 | 
			
		||||
dist-test: dist
 | 
			
		||||
@@ -913,3 +991,6 @@ prettier:
 | 
			
		||||
docs:
 | 
			
		||||
	@doxygen
 | 
			
		||||
.PHONY: docs
 | 
			
		||||
 | 
			
		||||
fdroid: out/apk/TildeFriends-release.fdroid.unsigned.apk
 | 
			
		||||
.PHONE: fdroid
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,5 @@
 | 
			
		||||
{
 | 
			
		||||
	"type": "tildefriends-app",
 | 
			
		||||
	"emoji": "🐌",
 | 
			
		||||
	"previous": "&TqpkOAi38Oi6gW6guh95KIvWY2M/vjBE8NLLNHK+M00=.sha256"
 | 
			
		||||
	"previous": "&2xK//SIpjFb0+uT5I7MSAGJ3d1FKuI/rlzhcCQd3NME=.sha256"
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -538,7 +538,7 @@ class TfComposeElement extends LitElement {
 | 
			
		||||
							id="edit"
 | 
			
		||||
							@input=${this.input}
 | 
			
		||||
							@paste=${this.paste}
 | 
			
		||||
							contenteditable
 | 
			
		||||
							contenteditable="plaintext-only"
 | 
			
		||||
							.innerText=${live(draft.text ?? '')}
 | 
			
		||||
						></span>
 | 
			
		||||
					</div>
 | 
			
		||||
 
 | 
			
		||||
@@ -211,10 +211,6 @@ async function socket(request, response, client) {
 | 
			
		||||
				if (process && process.timeout > 0) {
 | 
			
		||||
					setTimeout(ping, process.timeout);
 | 
			
		||||
				}
 | 
			
		||||
			} else if (message.action == 'enableStats') {
 | 
			
		||||
				if (process) {
 | 
			
		||||
					core.enableStats(process, message.enabled);
 | 
			
		||||
				}
 | 
			
		||||
			} else if (message.action == 'resetPermission') {
 | 
			
		||||
				if (process) {
 | 
			
		||||
					process.resetPermission(message.permission);
 | 
			
		||||
 
 | 
			
		||||
@@ -1274,7 +1274,6 @@ function _receive_websocket_message(message) {
 | 
			
		||||
		document.getElementById('viewPane').style.display = message.edit_only
 | 
			
		||||
			? 'none'
 | 
			
		||||
			: 'flex';
 | 
			
		||||
		send({action: 'enableStats', enabled: true});
 | 
			
		||||
	} else if (message && message.action == 'ping') {
 | 
			
		||||
		send({action: 'pong'});
 | 
			
		||||
	} else if (message && message.action == 'stats') {
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										53
									
								
								core/core.js
									
									
									
									
									
								
							
							
						
						
									
										53
									
								
								core/core.js
									
									
									
									
									
								
							@@ -8,10 +8,6 @@ let gStatsTimer = false;
 | 
			
		||||
const k_content_security_policy =
 | 
			
		||||
	'sandbox allow-downloads allow-top-navigation-by-user-activation';
 | 
			
		||||
 | 
			
		||||
let k_static_files = [
 | 
			
		||||
	{uri: '/', path: 'index.html', type: 'text/html; charset=UTF-8'},
 | 
			
		||||
];
 | 
			
		||||
 | 
			
		||||
const k_global_settings = {
 | 
			
		||||
	index: {
 | 
			
		||||
		type: 'string',
 | 
			
		||||
@@ -290,7 +286,6 @@ async function getProcessBlob(blobId, key, options) {
 | 
			
		||||
			process.lastActive = Date.now();
 | 
			
		||||
			process.lastPing = null;
 | 
			
		||||
			process.timeout = options.timeout;
 | 
			
		||||
			process.stats = false;
 | 
			
		||||
			process.ready = new Promise(function (resolve, reject) {
 | 
			
		||||
				resolveReady = resolve;
 | 
			
		||||
				rejectReady = reject;
 | 
			
		||||
@@ -782,6 +777,10 @@ async function getProcessBlob(blobId, key, options) {
 | 
			
		||||
			}
 | 
			
		||||
			await process.task.execute({name: appSourceName, source: appSource});
 | 
			
		||||
			resolveReady(process);
 | 
			
		||||
			if (!gStatsTimer) {
 | 
			
		||||
				gStatsTimer = true;
 | 
			
		||||
				sendStats();
 | 
			
		||||
			}
 | 
			
		||||
		} catch (error) {
 | 
			
		||||
			if (process.app) {
 | 
			
		||||
				if (process?.task?.onError) {
 | 
			
		||||
@@ -918,34 +917,6 @@ async function useAppHandler(
 | 
			
		||||
 * @returns
 | 
			
		||||
 */
 | 
			
		||||
async function blobHandler(request, response, blobId, uri) {
 | 
			
		||||
	// TODO(tasiaiso): break this down ?
 | 
			
		||||
	for (let i in k_static_files) {
 | 
			
		||||
		if (uri === k_static_files[i].uri && k_static_files[i].path) {
 | 
			
		||||
			let stat = await File.stat('core/' + k_static_files[i].path);
 | 
			
		||||
			let id = `${stat.mtime}_${stat.size}`;
 | 
			
		||||
 | 
			
		||||
			if (request.headers['if-none-match'] === '"' + id + '"') {
 | 
			
		||||
				response.writeHead(304, {'Content-Length': '0'});
 | 
			
		||||
				response.end();
 | 
			
		||||
			} else {
 | 
			
		||||
				let data = await File.readFile('core/' + k_static_files[i].path);
 | 
			
		||||
				response.writeHead(
 | 
			
		||||
					200,
 | 
			
		||||
					Object.assign(
 | 
			
		||||
						{
 | 
			
		||||
							'Content-Type': k_static_files[i].type,
 | 
			
		||||
							'Content-Length': data.byteLength,
 | 
			
		||||
							etag: '"' + id + '"',
 | 
			
		||||
						},
 | 
			
		||||
						k_static_files[i].headers || {}
 | 
			
		||||
					)
 | 
			
		||||
				);
 | 
			
		||||
				response.end(data);
 | 
			
		||||
			}
 | 
			
		||||
			return;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (!uri) {
 | 
			
		||||
		response.writeHead(303, {
 | 
			
		||||
			Location:
 | 
			
		||||
@@ -1232,7 +1203,7 @@ async function loadSettings() {
 | 
			
		||||
 */
 | 
			
		||||
function sendStats() {
 | 
			
		||||
	let apps = Object.values(gProcesses)
 | 
			
		||||
		.filter((process) => process.app && process.stats)
 | 
			
		||||
		.filter((process) => process.app)
 | 
			
		||||
		.map((process) => process.app);
 | 
			
		||||
	if (apps.length) {
 | 
			
		||||
		let stats = getStats();
 | 
			
		||||
@@ -1245,19 +1216,6 @@ function sendStats() {
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * TODOC
 | 
			
		||||
 * @param {*} process
 | 
			
		||||
 * @param {*} enabled
 | 
			
		||||
 */
 | 
			
		||||
function enableStats(process, enabled) {
 | 
			
		||||
	process.stats = enabled;
 | 
			
		||||
	if (!gStatsTimer) {
 | 
			
		||||
		gStatsTimer = true;
 | 
			
		||||
		sendStats();
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * TODOC
 | 
			
		||||
 */
 | 
			
		||||
@@ -1374,7 +1332,6 @@ function storePermission(user, packageOwner, packageName, permission, allow) {
 | 
			
		||||
export {
 | 
			
		||||
	gGlobalSettings as globalSettings,
 | 
			
		||||
	setGlobalSettings,
 | 
			
		||||
	enableStats,
 | 
			
		||||
	invoke,
 | 
			
		||||
	getSessionProcessBlob,
 | 
			
		||||
};
 | 
			
		||||
 
 | 
			
		||||
@@ -25,6 +25,17 @@
 | 
			
		||||
			max-height: 100%;
 | 
			
		||||
		"
 | 
			
		||||
	>
 | 
			
		||||
		<noscript>
 | 
			
		||||
			<div class="w3-container">
 | 
			
		||||
				<div class="w3-panel w3-red w3-padding w3-card-4">
 | 
			
		||||
					<h1>TildeFriends requires JavaScript.</h1>
 | 
			
		||||
					<p>
 | 
			
		||||
						It looks like JavaScript is disabled or unsupported. This isn't
 | 
			
		||||
						going to work.
 | 
			
		||||
					</p>
 | 
			
		||||
				</div>
 | 
			
		||||
			</div>
 | 
			
		||||
		</noscript>
 | 
			
		||||
		<tf-navigation></tf-navigation>
 | 
			
		||||
		<div id="content" class="hbox" style="flex: 1 0; overflow: auto">
 | 
			
		||||
			<div
 | 
			
		||||
 
 | 
			
		||||
@@ -28,7 +28,7 @@ pkgs.stdenv.mkDerivation rec {
 | 
			
		||||
    owner = "cory";
 | 
			
		||||
    repo = "tildefriends";
 | 
			
		||||
    rev = "v${version}";
 | 
			
		||||
    hash = "sha256-ttqL2wz06Jvn2f6kKIAGpF0nSSle+g4nSlj4jL0D+Fk=";
 | 
			
		||||
    hash = "sha256-q7PQS/OnfPyU74FBsTmuwWn+G8XTJ11ulvTxf1sgUQk=";
 | 
			
		||||
    fetchSubmodules = true;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								deps/codemirror/cm6.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								deps/codemirror/cm6.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										181
									
								
								deps/codemirror_src/package-lock.json
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										181
									
								
								deps/codemirror_src/package-lock.json
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -19,9 +19,9 @@
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/@codemirror/autocomplete": {
 | 
			
		||||
      "version": "6.16.2",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.16.2.tgz",
 | 
			
		||||
      "integrity": "sha512-MjfDrHy0gHKlPWsvSsikhO1+BOh+eBHNgfH1OXs1+DAf30IonQldgMM3kxLDTG9ktE7kDLaA1j/l7KMPA4KNfw==",
 | 
			
		||||
      "version": "6.17.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.17.0.tgz",
 | 
			
		||||
      "integrity": "sha512-fdfj6e6ZxZf8yrkMHUSJJir7OJkHkZKaOZGzLWIYp2PZ3jd+d+UjG8zVPqJF6d3bKxkhvXTPan/UZ1t7Bqm0gA==",
 | 
			
		||||
      "dependencies": {
 | 
			
		||||
        "@codemirror/language": "^6.0.0",
 | 
			
		||||
        "@codemirror/state": "^6.0.0",
 | 
			
		||||
@@ -111,9 +111,9 @@
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/@codemirror/lint": {
 | 
			
		||||
      "version": "6.8.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@codemirror/lint/-/lint-6.8.0.tgz",
 | 
			
		||||
      "integrity": "sha512-lsFofvaw0lnPRJlQylNsC4IRt/1lI4OD/yYslrSGVndOJfStc58v+8p9dgGiD90ktOfL7OhBWns1ZETYgz0EJA==",
 | 
			
		||||
      "version": "6.8.1",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@codemirror/lint/-/lint-6.8.1.tgz",
 | 
			
		||||
      "integrity": "sha512-IZ0Y7S4/bpaunwggW2jYqwLuHj0QtESf5xcROewY6+lDNwZ/NzvR4t+vpYgg9m7V8UXLPYqG+lu3DF470E5Oxg==",
 | 
			
		||||
      "dependencies": {
 | 
			
		||||
        "@codemirror/state": "^6.0.0",
 | 
			
		||||
        "@codemirror/view": "^6.0.0",
 | 
			
		||||
@@ -147,9 +147,9 @@
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/@codemirror/view": {
 | 
			
		||||
      "version": "6.28.1",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.28.1.tgz",
 | 
			
		||||
      "integrity": "sha512-BUWr+zCJpMkA/u69HlJmR+YkV4yPpM81HeMkOMZuwFa8iM5uJdEPKAs1icIRZKkKmy0Ub1x9/G3PQLTXdpBxrQ==",
 | 
			
		||||
      "version": "6.28.6",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.28.6.tgz",
 | 
			
		||||
      "integrity": "sha512-bhwB1AZ6zU4M3dNKm8Aa2BXwj5mWDqE9IWpqxYKJoLCnx+AcwcMuLO01tLWgc1mx4vT1IVYVqx86YoqUsATrqQ==",
 | 
			
		||||
      "dependencies": {
 | 
			
		||||
        "@codemirror/state": "^6.4.0",
 | 
			
		||||
        "style-mod": "^4.1.0",
 | 
			
		||||
@@ -199,9 +199,9 @@
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/@jridgewell/sourcemap-codec": {
 | 
			
		||||
      "version": "1.4.15",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz",
 | 
			
		||||
      "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==",
 | 
			
		||||
      "version": "1.5.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz",
 | 
			
		||||
      "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==",
 | 
			
		||||
      "dev": true
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/@jridgewell/trace-mapping": {
 | 
			
		||||
@@ -343,9 +343,9 @@
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/@rollup/rollup-android-arm-eabi": {
 | 
			
		||||
      "version": "4.18.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.18.0.tgz",
 | 
			
		||||
      "integrity": "sha512-Tya6xypR10giZV1XzxmH5wr25VcZSncG0pZIjfePT0OVBvqNEurzValetGNarVrGiq66EBVAFn15iYX4w6FKgQ==",
 | 
			
		||||
      "version": "4.19.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.19.0.tgz",
 | 
			
		||||
      "integrity": "sha512-JlPfZ/C7yn5S5p0yKk7uhHTTnFlvTgLetl2VxqE518QgyM7C9bSfFTYvB/Q/ftkq0RIPY4ySxTz+/wKJ/dXC0w==",
 | 
			
		||||
      "cpu": [
 | 
			
		||||
        "arm"
 | 
			
		||||
      ],
 | 
			
		||||
@@ -355,9 +355,9 @@
 | 
			
		||||
      ]
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/@rollup/rollup-android-arm64": {
 | 
			
		||||
      "version": "4.18.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.18.0.tgz",
 | 
			
		||||
      "integrity": "sha512-avCea0RAP03lTsDhEyfy+hpfr85KfyTctMADqHVhLAF3MlIkq83CP8UfAHUssgXTYd+6er6PaAhx/QGv4L1EiA==",
 | 
			
		||||
      "version": "4.19.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.19.0.tgz",
 | 
			
		||||
      "integrity": "sha512-RDxUSY8D1tWYfn00DDi5myxKgOk6RvWPxhmWexcICt/MEC6yEMr4HNCu1sXXYLw8iAsg0D44NuU+qNq7zVWCrw==",
 | 
			
		||||
      "cpu": [
 | 
			
		||||
        "arm64"
 | 
			
		||||
      ],
 | 
			
		||||
@@ -367,9 +367,9 @@
 | 
			
		||||
      ]
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/@rollup/rollup-darwin-arm64": {
 | 
			
		||||
      "version": "4.18.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.18.0.tgz",
 | 
			
		||||
      "integrity": "sha512-IWfdwU7KDSm07Ty0PuA/W2JYoZ4iTj3TUQjkVsO/6U+4I1jN5lcR71ZEvRh52sDOERdnNhhHU57UITXz5jC1/w==",
 | 
			
		||||
      "version": "4.19.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.19.0.tgz",
 | 
			
		||||
      "integrity": "sha512-emvKHL4B15x6nlNTBMtIaC9tLPRpeA5jMvRLXVbl/W9Ie7HhkrE7KQjvgS9uxgatL1HmHWDXk5TTS4IaNJxbAA==",
 | 
			
		||||
      "cpu": [
 | 
			
		||||
        "arm64"
 | 
			
		||||
      ],
 | 
			
		||||
@@ -379,9 +379,9 @@
 | 
			
		||||
      ]
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/@rollup/rollup-darwin-x64": {
 | 
			
		||||
      "version": "4.18.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.18.0.tgz",
 | 
			
		||||
      "integrity": "sha512-n2LMsUz7Ynu7DoQrSQkBf8iNrjOGyPLrdSg802vk6XT3FtsgX6JbE8IHRvposskFm9SNxzkLYGSq9QdpLYpRNA==",
 | 
			
		||||
      "version": "4.19.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.19.0.tgz",
 | 
			
		||||
      "integrity": "sha512-fO28cWA1dC57qCd+D0rfLC4VPbh6EOJXrreBmFLWPGI9dpMlER2YwSPZzSGfq11XgcEpPukPTfEVFtw2q2nYJg==",
 | 
			
		||||
      "cpu": [
 | 
			
		||||
        "x64"
 | 
			
		||||
      ],
 | 
			
		||||
@@ -391,9 +391,9 @@
 | 
			
		||||
      ]
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/@rollup/rollup-linux-arm-gnueabihf": {
 | 
			
		||||
      "version": "4.18.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.18.0.tgz",
 | 
			
		||||
      "integrity": "sha512-C/zbRYRXFjWvz9Z4haRxcTdnkPt1BtCkz+7RtBSuNmKzMzp3ZxdM28Mpccn6pt28/UWUCTXa+b0Mx1k3g6NOMA==",
 | 
			
		||||
      "version": "4.19.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.19.0.tgz",
 | 
			
		||||
      "integrity": "sha512-2Rn36Ubxdv32NUcfm0wB1tgKqkQuft00PtM23VqLuCUR4N5jcNWDoV5iBC9jeGdgS38WK66ElncprqgMUOyomw==",
 | 
			
		||||
      "cpu": [
 | 
			
		||||
        "arm"
 | 
			
		||||
      ],
 | 
			
		||||
@@ -403,9 +403,9 @@
 | 
			
		||||
      ]
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/@rollup/rollup-linux-arm-musleabihf": {
 | 
			
		||||
      "version": "4.18.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.18.0.tgz",
 | 
			
		||||
      "integrity": "sha512-l3m9ewPgjQSXrUMHg93vt0hYCGnrMOcUpTz6FLtbwljo2HluS4zTXFy2571YQbisTnfTKPZ01u/ukJdQTLGh9A==",
 | 
			
		||||
      "version": "4.19.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.19.0.tgz",
 | 
			
		||||
      "integrity": "sha512-gJuzIVdq/X1ZA2bHeCGCISe0VWqCoNT8BvkQ+BfsixXwTOndhtLUpOg0A1Fcx/+eA6ei6rMBzlOz4JzmiDw7JQ==",
 | 
			
		||||
      "cpu": [
 | 
			
		||||
        "arm"
 | 
			
		||||
      ],
 | 
			
		||||
@@ -415,9 +415,9 @@
 | 
			
		||||
      ]
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/@rollup/rollup-linux-arm64-gnu": {
 | 
			
		||||
      "version": "4.18.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.18.0.tgz",
 | 
			
		||||
      "integrity": "sha512-rJ5D47d8WD7J+7STKdCUAgmQk49xuFrRi9pZkWoRD1UeSMakbcepWXPF8ycChBoAqs1pb2wzvbY6Q33WmN2ftw==",
 | 
			
		||||
      "version": "4.19.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.19.0.tgz",
 | 
			
		||||
      "integrity": "sha512-0EkX2HYPkSADo9cfeGFoQ7R0/wTKb7q6DdwI4Yn/ULFE1wuRRCHybxpl2goQrx4c/yzK3I8OlgtBu4xvted0ug==",
 | 
			
		||||
      "cpu": [
 | 
			
		||||
        "arm64"
 | 
			
		||||
      ],
 | 
			
		||||
@@ -427,9 +427,9 @@
 | 
			
		||||
      ]
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/@rollup/rollup-linux-arm64-musl": {
 | 
			
		||||
      "version": "4.18.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.18.0.tgz",
 | 
			
		||||
      "integrity": "sha512-be6Yx37b24ZwxQ+wOQXXLZqpq4jTckJhtGlWGZs68TgdKXJgw54lUUoFYrg6Zs/kjzAQwEwYbp8JxZVzZLRepQ==",
 | 
			
		||||
      "version": "4.19.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.19.0.tgz",
 | 
			
		||||
      "integrity": "sha512-GlIQRj9px52ISomIOEUq/IojLZqzkvRpdP3cLgIE1wUWaiU5Takwlzpz002q0Nxxr1y2ZgxC2obWxjr13lvxNQ==",
 | 
			
		||||
      "cpu": [
 | 
			
		||||
        "arm64"
 | 
			
		||||
      ],
 | 
			
		||||
@@ -439,9 +439,9 @@
 | 
			
		||||
      ]
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/@rollup/rollup-linux-powerpc64le-gnu": {
 | 
			
		||||
      "version": "4.18.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.18.0.tgz",
 | 
			
		||||
      "integrity": "sha512-hNVMQK+qrA9Todu9+wqrXOHxFiD5YmdEi3paj6vP02Kx1hjd2LLYR2eaN7DsEshg09+9uzWi2W18MJDlG0cxJA==",
 | 
			
		||||
      "version": "4.19.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.19.0.tgz",
 | 
			
		||||
      "integrity": "sha512-N6cFJzssruDLUOKfEKeovCKiHcdwVYOT1Hs6dovDQ61+Y9n3Ek4zXvtghPPelt6U0AH4aDGnDLb83uiJMkWYzQ==",
 | 
			
		||||
      "cpu": [
 | 
			
		||||
        "ppc64"
 | 
			
		||||
      ],
 | 
			
		||||
@@ -451,9 +451,9 @@
 | 
			
		||||
      ]
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/@rollup/rollup-linux-riscv64-gnu": {
 | 
			
		||||
      "version": "4.18.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.18.0.tgz",
 | 
			
		||||
      "integrity": "sha512-ROCM7i+m1NfdrsmvwSzoxp9HFtmKGHEqu5NNDiZWQtXLA8S5HBCkVvKAxJ8U+CVctHwV2Gb5VUaK7UAkzhDjlg==",
 | 
			
		||||
      "version": "4.19.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.19.0.tgz",
 | 
			
		||||
      "integrity": "sha512-2DnD3mkS2uuam/alF+I7M84koGwvn3ZVD7uG+LEWpyzo/bq8+kKnus2EVCkcvh6PlNB8QPNFOz6fWd5N8o1CYg==",
 | 
			
		||||
      "cpu": [
 | 
			
		||||
        "riscv64"
 | 
			
		||||
      ],
 | 
			
		||||
@@ -463,9 +463,9 @@
 | 
			
		||||
      ]
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/@rollup/rollup-linux-s390x-gnu": {
 | 
			
		||||
      "version": "4.18.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.18.0.tgz",
 | 
			
		||||
      "integrity": "sha512-0UyyRHyDN42QL+NbqevXIIUnKA47A+45WyasO+y2bGJ1mhQrfrtXUpTxCOrfxCR4esV3/RLYyucGVPiUsO8xjg==",
 | 
			
		||||
      "version": "4.19.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.19.0.tgz",
 | 
			
		||||
      "integrity": "sha512-D6pkaF7OpE7lzlTOFCB2m3Ngzu2ykw40Nka9WmKGUOTS3xcIieHe82slQlNq69sVB04ch73thKYIWz/Ian8DUA==",
 | 
			
		||||
      "cpu": [
 | 
			
		||||
        "s390x"
 | 
			
		||||
      ],
 | 
			
		||||
@@ -475,9 +475,9 @@
 | 
			
		||||
      ]
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/@rollup/rollup-linux-x64-gnu": {
 | 
			
		||||
      "version": "4.18.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.18.0.tgz",
 | 
			
		||||
      "integrity": "sha512-xuglR2rBVHA5UsI8h8UbX4VJ470PtGCf5Vpswh7p2ukaqBGFTnsfzxUBetoWBWymHMxbIG0Cmx7Y9qDZzr648w==",
 | 
			
		||||
      "version": "4.19.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.19.0.tgz",
 | 
			
		||||
      "integrity": "sha512-HBndjQLP8OsdJNSxpNIN0einbDmRFg9+UQeZV1eiYupIRuZsDEoeGU43NQsS34Pp166DtwQOnpcbV/zQxM+rWA==",
 | 
			
		||||
      "cpu": [
 | 
			
		||||
        "x64"
 | 
			
		||||
      ],
 | 
			
		||||
@@ -487,9 +487,9 @@
 | 
			
		||||
      ]
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/@rollup/rollup-linux-x64-musl": {
 | 
			
		||||
      "version": "4.18.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.18.0.tgz",
 | 
			
		||||
      "integrity": "sha512-LKaqQL9osY/ir2geuLVvRRs+utWUNilzdE90TpyoX0eNqPzWjRm14oMEE+YLve4k/NAqCdPkGYDaDF5Sw+xBfg==",
 | 
			
		||||
      "version": "4.19.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.19.0.tgz",
 | 
			
		||||
      "integrity": "sha512-HxfbvfCKJe/RMYJJn0a12eiOI9OOtAUF4G6ozrFUK95BNyoJaSiBjIOHjZskTUffUrB84IPKkFG9H9nEvJGW6A==",
 | 
			
		||||
      "cpu": [
 | 
			
		||||
        "x64"
 | 
			
		||||
      ],
 | 
			
		||||
@@ -499,9 +499,9 @@
 | 
			
		||||
      ]
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/@rollup/rollup-win32-arm64-msvc": {
 | 
			
		||||
      "version": "4.18.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.18.0.tgz",
 | 
			
		||||
      "integrity": "sha512-7J6TkZQFGo9qBKH0pk2cEVSRhJbL6MtfWxth7Y5YmZs57Pi+4x6c2dStAUvaQkHQLnEQv1jzBUW43GvZW8OFqA==",
 | 
			
		||||
      "version": "4.19.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.19.0.tgz",
 | 
			
		||||
      "integrity": "sha512-HxDMKIhmcguGTiP5TsLNolwBUK3nGGUEoV/BO9ldUBoMLBssvh4J0X8pf11i1fTV7WShWItB1bKAKjX4RQeYmg==",
 | 
			
		||||
      "cpu": [
 | 
			
		||||
        "arm64"
 | 
			
		||||
      ],
 | 
			
		||||
@@ -511,9 +511,9 @@
 | 
			
		||||
      ]
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/@rollup/rollup-win32-ia32-msvc": {
 | 
			
		||||
      "version": "4.18.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.18.0.tgz",
 | 
			
		||||
      "integrity": "sha512-Txjh+IxBPbkUB9+SXZMpv+b/vnTEtFyfWZgJ6iyCmt2tdx0OF5WhFowLmnh8ENGNpfUlUZkdI//4IEmhwPieNg==",
 | 
			
		||||
      "version": "4.19.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.19.0.tgz",
 | 
			
		||||
      "integrity": "sha512-xItlIAZZaiG/u0wooGzRsx11rokP4qyc/79LkAOdznGRAbOFc+SfEdfUOszG1odsHNgwippUJavag/+W/Etc6Q==",
 | 
			
		||||
      "cpu": [
 | 
			
		||||
        "ia32"
 | 
			
		||||
      ],
 | 
			
		||||
@@ -523,9 +523,9 @@
 | 
			
		||||
      ]
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/@rollup/rollup-win32-x64-msvc": {
 | 
			
		||||
      "version": "4.18.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.18.0.tgz",
 | 
			
		||||
      "integrity": "sha512-UOo5FdvOL0+eIVTgS4tIdbW+TtnBLWg1YBCcU2KWM7nuNwRz9bksDX1bekJJCpu25N1DVWaCwnT39dVQxzqS8g==",
 | 
			
		||||
      "version": "4.19.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.19.0.tgz",
 | 
			
		||||
      "integrity": "sha512-xNo5fV5ycvCCKqiZcpB65VMR11NJB+StnxHz20jdqRAktfdfzhgjTiJ2doTDQE/7dqGaV5I7ZGqKpgph6lCIag==",
 | 
			
		||||
      "cpu": [
 | 
			
		||||
        "x64"
 | 
			
		||||
      ],
 | 
			
		||||
@@ -545,9 +545,9 @@
 | 
			
		||||
      "integrity": "sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q=="
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/acorn": {
 | 
			
		||||
      "version": "8.12.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.0.tgz",
 | 
			
		||||
      "integrity": "sha512-RTvkC4w+KNXrM39/lWCUaG0IbRkWdCv7W/IOW9oU6SawyxulvkQy5HQPVTKxEjczcUvapcrw3cFx/60VN/NRNw==",
 | 
			
		||||
      "version": "8.12.1",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz",
 | 
			
		||||
      "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==",
 | 
			
		||||
      "dev": true,
 | 
			
		||||
      "bin": {
 | 
			
		||||
        "acorn": "bin/acorn"
 | 
			
		||||
@@ -658,11 +658,14 @@
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/is-core-module": {
 | 
			
		||||
      "version": "2.13.1",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz",
 | 
			
		||||
      "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==",
 | 
			
		||||
      "version": "2.15.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.0.tgz",
 | 
			
		||||
      "integrity": "sha512-Dd+Lb2/zvk9SKy1TGCt1wFJFo/MWBPMX5x7KcvLajWTGuomczdQX61PvY5yK6SVACwpoexWo81IfFyoKY2QnTA==",
 | 
			
		||||
      "dependencies": {
 | 
			
		||||
        "hasown": "^2.0.0"
 | 
			
		||||
        "hasown": "^2.0.2"
 | 
			
		||||
      },
 | 
			
		||||
      "engines": {
 | 
			
		||||
        "node": ">= 0.4"
 | 
			
		||||
      },
 | 
			
		||||
      "funding": {
 | 
			
		||||
        "url": "https://github.com/sponsors/ljharb"
 | 
			
		||||
@@ -715,9 +718,9 @@
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/rollup": {
 | 
			
		||||
      "version": "4.18.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.18.0.tgz",
 | 
			
		||||
      "integrity": "sha512-QmJz14PX3rzbJCN1SG4Xe/bAAX2a6NpCP8ab2vfu2GiUr8AQcr2nCV/oEO3yneFarB67zk8ShlIyWb2LGTb3Sg==",
 | 
			
		||||
      "version": "4.19.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.19.0.tgz",
 | 
			
		||||
      "integrity": "sha512-5r7EYSQIowHsK4eTZ0Y81qpZuJz+MUuYeqmmYmRMl1nwhdmbiYqt5jwzf6u7wyOzJgYqtCRMtVRKOtHANBz7rA==",
 | 
			
		||||
      "dependencies": {
 | 
			
		||||
        "@types/estree": "1.0.5"
 | 
			
		||||
      },
 | 
			
		||||
@@ -729,22 +732,22 @@
 | 
			
		||||
        "npm": ">=8.0.0"
 | 
			
		||||
      },
 | 
			
		||||
      "optionalDependencies": {
 | 
			
		||||
        "@rollup/rollup-android-arm-eabi": "4.18.0",
 | 
			
		||||
        "@rollup/rollup-android-arm64": "4.18.0",
 | 
			
		||||
        "@rollup/rollup-darwin-arm64": "4.18.0",
 | 
			
		||||
        "@rollup/rollup-darwin-x64": "4.18.0",
 | 
			
		||||
        "@rollup/rollup-linux-arm-gnueabihf": "4.18.0",
 | 
			
		||||
        "@rollup/rollup-linux-arm-musleabihf": "4.18.0",
 | 
			
		||||
        "@rollup/rollup-linux-arm64-gnu": "4.18.0",
 | 
			
		||||
        "@rollup/rollup-linux-arm64-musl": "4.18.0",
 | 
			
		||||
        "@rollup/rollup-linux-powerpc64le-gnu": "4.18.0",
 | 
			
		||||
        "@rollup/rollup-linux-riscv64-gnu": "4.18.0",
 | 
			
		||||
        "@rollup/rollup-linux-s390x-gnu": "4.18.0",
 | 
			
		||||
        "@rollup/rollup-linux-x64-gnu": "4.18.0",
 | 
			
		||||
        "@rollup/rollup-linux-x64-musl": "4.18.0",
 | 
			
		||||
        "@rollup/rollup-win32-arm64-msvc": "4.18.0",
 | 
			
		||||
        "@rollup/rollup-win32-ia32-msvc": "4.18.0",
 | 
			
		||||
        "@rollup/rollup-win32-x64-msvc": "4.18.0",
 | 
			
		||||
        "@rollup/rollup-android-arm-eabi": "4.19.0",
 | 
			
		||||
        "@rollup/rollup-android-arm64": "4.19.0",
 | 
			
		||||
        "@rollup/rollup-darwin-arm64": "4.19.0",
 | 
			
		||||
        "@rollup/rollup-darwin-x64": "4.19.0",
 | 
			
		||||
        "@rollup/rollup-linux-arm-gnueabihf": "4.19.0",
 | 
			
		||||
        "@rollup/rollup-linux-arm-musleabihf": "4.19.0",
 | 
			
		||||
        "@rollup/rollup-linux-arm64-gnu": "4.19.0",
 | 
			
		||||
        "@rollup/rollup-linux-arm64-musl": "4.19.0",
 | 
			
		||||
        "@rollup/rollup-linux-powerpc64le-gnu": "4.19.0",
 | 
			
		||||
        "@rollup/rollup-linux-riscv64-gnu": "4.19.0",
 | 
			
		||||
        "@rollup/rollup-linux-s390x-gnu": "4.19.0",
 | 
			
		||||
        "@rollup/rollup-linux-x64-gnu": "4.19.0",
 | 
			
		||||
        "@rollup/rollup-linux-x64-musl": "4.19.0",
 | 
			
		||||
        "@rollup/rollup-win32-arm64-msvc": "4.19.0",
 | 
			
		||||
        "@rollup/rollup-win32-ia32-msvc": "4.19.0",
 | 
			
		||||
        "@rollup/rollup-win32-x64-msvc": "4.19.0",
 | 
			
		||||
        "fsevents": "~2.3.2"
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
@@ -819,9 +822,9 @@
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/terser": {
 | 
			
		||||
      "version": "5.31.1",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/terser/-/terser-5.31.1.tgz",
 | 
			
		||||
      "integrity": "sha512-37upzU1+viGvuFtBo9NPufCb9dwM0+l9hMxYyWfBA+fbwrPqNJAhbZ6W47bBFnZHKHTUBnMvi87434qq+qnxOg==",
 | 
			
		||||
      "version": "5.31.3",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/terser/-/terser-5.31.3.tgz",
 | 
			
		||||
      "integrity": "sha512-pAfYn3NIZLyZpa83ZKigvj6Rn9c/vd5KfYGX7cN1mnzqgDcxWvrU5ZtAfIKhEXz9nRecw4z3LXkjaq96/qZqAA==",
 | 
			
		||||
      "dev": true,
 | 
			
		||||
      "dependencies": {
 | 
			
		||||
        "@jridgewell/source-map": "^0.3.3",
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								deps/libbacktrace
									
									
									
									
										vendored
									
									
								
							
							
								
								
								
								
								
							
						
						
									
										2
									
								
								deps/libbacktrace
									
									
									
									
										vendored
									
									
								
							 Submodule deps/libbacktrace updated: 4ead348bb4...7e2b7da3d6
									
								
							
							
								
								
									
										1
									
								
								deps/openssl_src
									
									
									
									
										vendored
									
									
										Submodule
									
								
							
							
								
								
								
								
								
							
						
						
									
										1
									
								
								deps/openssl_src
									
									
									
									
										vendored
									
									
										Submodule
									
								
							 Submodule deps/openssl_src added at db2ac4f6eb
									
								
							
							
								
								
									
										3
									
								
								metadata/en-US/full_description.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								metadata/en-US/full_description.txt
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,3 @@
 | 
			
		||||
Tilde Friends is both a peer-to-peer social network client, participating in
 | 
			
		||||
Secure Scuttlebutt, as well as a platform for writing and running web
 | 
			
		||||
applications.
 | 
			
		||||
							
								
								
									
										1
									
								
								metadata/en-US/short_description.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								metadata/en-US/short_description.txt
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
A tool for making and sharing
 | 
			
		||||
							
								
								
									
										1
									
								
								metadata/en-US/title.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								metadata/en-US/title.txt
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
Tilde Friends
 | 
			
		||||
@@ -1,15 +1,12 @@
 | 
			
		||||
<?xml version="1.0" encoding="utf-8"?>
 | 
			
		||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
 | 
			
		||||
	package="com.unprompted.tildefriends"
 | 
			
		||||
	android:versionCode="20"
 | 
			
		||||
	android:versionName="0.0.20">
 | 
			
		||||
	<uses-sdk android:minSdkVersion="24" android:targetSdkVersion="34"/>
 | 
			
		||||
	android:versionName="0.0.21-wip">
 | 
			
		||||
	<uses-permission android:name="android.permission.INTERNET"/>
 | 
			
		||||
	<application
 | 
			
		||||
		android:label="Tilde Friends"
 | 
			
		||||
		android:usesCleartextTraffic="true"
 | 
			
		||||
		android:debuggable="true"
 | 
			
		||||
		android:extractNativeLibs="true">
 | 
			
		||||
		android:debuggable="false">
 | 
			
		||||
		<meta-data android:name="android.max_aspect" android:value="2.1"/>
 | 
			
		||||
		<activity
 | 
			
		||||
			android:name=".TildeFriendsActivity"
 | 
			
		||||
@@ -21,5 +18,10 @@
 | 
			
		||||
				<category android:name="android.intent.category.LAUNCHER"/>
 | 
			
		||||
			</intent-filter>
 | 
			
		||||
		</activity>
 | 
			
		||||
		<service
 | 
			
		||||
			android:name=".TildeFriendsSandboxService"
 | 
			
		||||
			android:exported="false"
 | 
			
		||||
			android:isolatedProcess="true"
 | 
			
		||||
			android:process=":sandbox"/>
 | 
			
		||||
	</application>
 | 
			
		||||
</manifest>
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										5
									
								
								src/android/BundleConfig.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								src/android/BundleConfig.json
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,5 @@
 | 
			
		||||
{
 | 
			
		||||
	"optimizations" : {
 | 
			
		||||
		"uncompress_native_libraries" : {}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										6
									
								
								src/android/build.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								src/android/build.xml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,6 @@
 | 
			
		||||
<project>
 | 
			
		||||
	<target name="clean"></target>
 | 
			
		||||
	<target name="release">
 | 
			
		||||
		<echo>Creating ../../../out/apk/TildeFriends-release.fdroid.unsigned.apk for release.</echo>
 | 
			
		||||
	</target>
 | 
			
		||||
</project>
 | 
			
		||||
@@ -3,15 +3,18 @@ package com.unprompted.tildefriends;
 | 
			
		||||
import android.app.Activity;
 | 
			
		||||
import android.app.AlertDialog;
 | 
			
		||||
import android.app.DownloadManager;
 | 
			
		||||
import android.content.ComponentName;
 | 
			
		||||
import android.content.DialogInterface;
 | 
			
		||||
import android.content.Intent;
 | 
			
		||||
import android.content.ServiceConnection;
 | 
			
		||||
import android.net.Uri;
 | 
			
		||||
import android.os.Bundle;
 | 
			
		||||
import android.os.CountDownTimer;
 | 
			
		||||
import android.os.Environment;
 | 
			
		||||
import android.os.IBinder;
 | 
			
		||||
import android.os.Parcel;
 | 
			
		||||
import android.os.ParcelFileDescriptor;
 | 
			
		||||
import android.os.RemoteException;
 | 
			
		||||
import android.os.StrictMode;
 | 
			
		||||
import android.os.SystemClock;
 | 
			
		||||
import android.os.strictmode.Violation;
 | 
			
		||||
import android.util.Base64;
 | 
			
		||||
import android.util.Log;
 | 
			
		||||
import android.view.KeyEvent;
 | 
			
		||||
@@ -29,19 +32,13 @@ import android.webkit.WebChromeClient;
 | 
			
		||||
import android.webkit.WebResourceRequest;
 | 
			
		||||
import android.webkit.WebView;
 | 
			
		||||
import android.webkit.WebViewClient;
 | 
			
		||||
import android.widget.Button;
 | 
			
		||||
import android.widget.TextView;
 | 
			
		||||
import android.widget.Toast;
 | 
			
		||||
import java.io.BufferedInputStream;
 | 
			
		||||
import java.io.BufferedReader;
 | 
			
		||||
import java.io.File;
 | 
			
		||||
import java.io.FileInputStream;
 | 
			
		||||
import java.io.FileOutputStream;
 | 
			
		||||
import java.io.OutputStream;
 | 
			
		||||
import java.io.FileReader;
 | 
			
		||||
import java.io.InputStream;
 | 
			
		||||
import java.lang.Process;
 | 
			
		||||
import java.lang.Thread;
 | 
			
		||||
import java.io.OutputStream;
 | 
			
		||||
import java.nio.file.FileSystems;
 | 
			
		||||
import java.nio.file.Paths;
 | 
			
		||||
import java.nio.file.StandardWatchEventKinds;
 | 
			
		||||
@@ -51,17 +48,30 @@ import java.nio.file.WatchService;
 | 
			
		||||
import java.util.concurrent.TimeUnit;
 | 
			
		||||
 | 
			
		||||
public class TildeFriendsActivity extends Activity {
 | 
			
		||||
	static TildeFriendsActivity s_activity;
 | 
			
		||||
	TildeFriendsWebView web_view;
 | 
			
		||||
	String base_url;
 | 
			
		||||
	Process process;
 | 
			
		||||
	String port_file_path;
 | 
			
		||||
	Thread thread;
 | 
			
		||||
	Thread server_thread;
 | 
			
		||||
	ServiceConnection service_connection;
 | 
			
		||||
 | 
			
		||||
	private ValueCallback<Uri[]> upload_message;
 | 
			
		||||
	private final static int FILECHOOSER_RESULT = 1;
 | 
			
		||||
	private float touch_down_y;
 | 
			
		||||
 | 
			
		||||
	static {
 | 
			
		||||
		Log.w("tildefriends", "Calling system.loadLibrary().");
 | 
			
		||||
		System.loadLibrary("tildefriends");
 | 
			
		||||
		Log.w("tildefriends", "system.loadLibrary() completed.");
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public static native int tf_server_main(String files_dir, String apk_path, String out_port_file_path);
 | 
			
		||||
	public static native int tf_sandbox_main(int pipe_fd);
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	protected void onCreate(Bundle savedInstanceState) {
 | 
			
		||||
		s_activity = this;
 | 
			
		||||
		StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder()
 | 
			
		||||
			.detectLeakedClosableObjects()
 | 
			
		||||
			.penaltyLog()
 | 
			
		||||
@@ -76,7 +86,7 @@ public class TildeFriendsActivity extends Activity {
 | 
			
		||||
		Log.w("tildefriends", String.format("getPackageResourcePath() is %s", getPackageResourcePath().toString()));
 | 
			
		||||
		Log.w("tildefriends", String.format("nativeLibraryDir is %s", getApplicationInfo().nativeLibraryDir));
 | 
			
		||||
 | 
			
		||||
		String port_file_path = getFilesDir().toString() + "/port.txt";
 | 
			
		||||
		port_file_path = getFilesDir().toString() + "/port.txt";
 | 
			
		||||
		new File(port_file_path).delete();
 | 
			
		||||
		base_url = "http://127.0.0.1:12345/";
 | 
			
		||||
 | 
			
		||||
@@ -134,17 +144,15 @@ public class TildeFriendsActivity extends Activity {
 | 
			
		||||
		thread.start();
 | 
			
		||||
 | 
			
		||||
		set_status("Starting server...");
 | 
			
		||||
		String exe = getApplicationInfo().nativeLibraryDir + "/tildefriends.so";
 | 
			
		||||
		ProcessBuilder builder = new ProcessBuilder(exe, "run", "-z", getPackageResourcePath().toString(), "-a", "out_http_port_file=" + port_file_path, "-p", "0");
 | 
			
		||||
		Log.w("tildefriends", "files = " + getFilesDir().toString());
 | 
			
		||||
		Log.w("tildefriends", "exe = " + exe);
 | 
			
		||||
		builder.directory(getFilesDir());
 | 
			
		||||
		builder.inheritIO();
 | 
			
		||||
		try {
 | 
			
		||||
			process = builder.start();
 | 
			
		||||
		} catch (java.io.IOException e) {
 | 
			
		||||
			Log.w("tildefriends", "IOException starting process: " + e.toString());
 | 
			
		||||
		server_thread = new Thread(new Runnable() {
 | 
			
		||||
			@Override
 | 
			
		||||
			public void run() {
 | 
			
		||||
				Log.w("tildefriends", "Calling tf_server_main.");
 | 
			
		||||
				int result = tf_server_main(getFilesDir().toString(), getPackageResourcePath().toString(), port_file_path);
 | 
			
		||||
				Log.w("tildefriends", "tf_server_main returned " + result + ".");
 | 
			
		||||
			}
 | 
			
		||||
		});
 | 
			
		||||
		server_thread.start();
 | 
			
		||||
 | 
			
		||||
		web_view.getSettings().setJavaScriptEnabled(true);
 | 
			
		||||
		web_view.getSettings().setDatabaseEnabled(true);
 | 
			
		||||
@@ -266,13 +274,8 @@ public class TildeFriendsActivity extends Activity {
 | 
			
		||||
	@Override
 | 
			
		||||
	protected void onDestroy()
 | 
			
		||||
	{
 | 
			
		||||
		if (process != null) {
 | 
			
		||||
			Log.w("tildefriends", "Killing process.");
 | 
			
		||||
			process.destroyForcibly();
 | 
			
		||||
			Log.w("tildefriends", "Process killed.");
 | 
			
		||||
			process = null;
 | 
			
		||||
		}
 | 
			
		||||
		super.onDestroy();
 | 
			
		||||
		s_activity = null;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
@@ -374,4 +377,49 @@ public class TildeFriendsActivity extends Activity {
 | 
			
		||||
		web_view.setVisibility(View.VISIBLE);
 | 
			
		||||
		text_view.setVisibility(View.GONE);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public static void start_sandbox(int pipe_fd) {
 | 
			
		||||
		Log.w("tildefriends", "starting service with fd: " + pipe_fd);
 | 
			
		||||
		Intent intent = new Intent(s_activity, TildeFriendsSandboxService.class);
 | 
			
		||||
		s_activity.service_connection = new ServiceConnection() {
 | 
			
		||||
			@Override
 | 
			
		||||
			public void onBindingDied(ComponentName name) {
 | 
			
		||||
				Log.w("tildefriends", "onBindingDied");
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			@Override
 | 
			
		||||
			public void onNullBinding(ComponentName name) {
 | 
			
		||||
				Log.w("tildefriends", "onNullBinding");
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			@Override
 | 
			
		||||
			public void onServiceConnected(ComponentName name, IBinder binder) {
 | 
			
		||||
				Log.w("tildefriends", "onServiceConnected");
 | 
			
		||||
				Parcel data = Parcel.obtain();
 | 
			
		||||
				ParcelFileDescriptor pfd = ParcelFileDescriptor.adoptFd(pipe_fd);
 | 
			
		||||
				data.writeParcelable(pfd, 0);
 | 
			
		||||
				try {
 | 
			
		||||
					binder.transact(TildeFriendsSandboxService.START_CALL,  data, null, IBinder.FLAG_ONEWAY);
 | 
			
		||||
				} catch (RemoteException e) {
 | 
			
		||||
					Log.w("tildefriends", "RemoteException");
 | 
			
		||||
				} finally {
 | 
			
		||||
					data.recycle();
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			@Override
 | 
			
		||||
			public void onServiceDisconnected(ComponentName name) {
 | 
			
		||||
				Log.w("tildefriends", "onServiceDisconnected");
 | 
			
		||||
			}
 | 
			
		||||
		};
 | 
			
		||||
		s_activity.bindService(intent, s_activity.service_connection, BIND_AUTO_CREATE);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public static void stop_sandbox() {
 | 
			
		||||
		Log.w("tildefriends", "stop_sandbox");
 | 
			
		||||
		if (s_activity.service_connection != null) {
 | 
			
		||||
			s_activity.unbindService(s_activity.service_connection);
 | 
			
		||||
			s_activity.service_connection = null;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -0,0 +1,59 @@
 | 
			
		||||
package com.unprompted.tildefriends;
 | 
			
		||||
 | 
			
		||||
import android.app.Service;
 | 
			
		||||
import android.content.Intent;
 | 
			
		||||
import android.os.Binder;
 | 
			
		||||
import android.os.IBinder;
 | 
			
		||||
import android.os.Parcel;
 | 
			
		||||
import android.os.ParcelFileDescriptor;
 | 
			
		||||
import android.util.Log;
 | 
			
		||||
 | 
			
		||||
public class TildeFriendsSandboxService extends Service {
 | 
			
		||||
	public static final int START_CALL = IBinder.FIRST_CALL_TRANSACTION;
 | 
			
		||||
 | 
			
		||||
	Thread thread;
 | 
			
		||||
 | 
			
		||||
	public int onStartCommand(Intent intent, int flags, int start_id) {
 | 
			
		||||
		Log.w("tildefriends", "TildeFriendsSandboxService: onStartCommand");
 | 
			
		||||
		return super.onStartCommand(intent, flags, start_id);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public void onDestroy() {
 | 
			
		||||
		Log.w("tildefriends", "TildeFriendsSandboxService: onDestroy");
 | 
			
		||||
		super.onDestroy();
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	private void start_thread(int pipe_fd) {
 | 
			
		||||
		thread = new Thread(new Runnable() {
 | 
			
		||||
			@Override
 | 
			
		||||
			public void run() {
 | 
			
		||||
				Log.w("tildefriends", "Calling tf_sandbox_main.");
 | 
			
		||||
				int result = TildeFriendsActivity.tf_sandbox_main(pipe_fd);
 | 
			
		||||
				Log.w("tildefriends", "tf_sandbox_main returned " + result + ".");
 | 
			
		||||
			}
 | 
			
		||||
		});
 | 
			
		||||
		thread.start();
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	public IBinder onBind(Intent intent) {
 | 
			
		||||
		return new Binder() {
 | 
			
		||||
			@Override
 | 
			
		||||
			protected boolean onTransact(int code, Parcel data, Parcel reply, int flags) {
 | 
			
		||||
				if (code == START_CALL) {
 | 
			
		||||
					ParcelFileDescriptor pfd = data.readParcelable(ParcelFileDescriptor.class.getClassLoader(), ParcelFileDescriptor.class);
 | 
			
		||||
					if (pfd != null) {
 | 
			
		||||
						Log.w("tildefriends", "fd is " + pfd.getFd());
 | 
			
		||||
						start_thread(pfd.detachFd());
 | 
			
		||||
						try {
 | 
			
		||||
							pfd.close();
 | 
			
		||||
						} catch (java.io.IOException e) {
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
					return true;
 | 
			
		||||
				}
 | 
			
		||||
				return false;
 | 
			
		||||
			}
 | 
			
		||||
		};
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
@@ -2,7 +2,6 @@ package com.unprompted.tildefriends;
 | 
			
		||||
 | 
			
		||||
import android.content.Context;
 | 
			
		||||
import android.util.AttributeSet;
 | 
			
		||||
import android.util.Log;
 | 
			
		||||
 | 
			
		||||
public class TildeFriendsWebView extends android.webkit.WebView {
 | 
			
		||||
	boolean overscrolledY = false;
 | 
			
		||||
 
 | 
			
		||||
@@ -905,14 +905,23 @@ static void _httpd_endpoint_static(tf_http_request_t* request)
 | 
			
		||||
	const char* file_path = NULL;
 | 
			
		||||
	for (int i = 0; i < tf_countof(k_map) && !after; i++)
 | 
			
		||||
	{
 | 
			
		||||
		after = _after(request->path, k_map[i][0]);
 | 
			
		||||
		const char* next_after = _after(request->path, k_map[i][0]);
 | 
			
		||||
		if (next_after)
 | 
			
		||||
		{
 | 
			
		||||
			after = next_after;
 | 
			
		||||
			file_path = k_map[i][1];
 | 
			
		||||
		is_core = is_core || (after && i == 0);
 | 
			
		||||
			is_core = after && i == 0;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (strcmp(request->path, "/speedscope/") == 0)
 | 
			
		||||
	if ((!after || !*after) && request->path[strlen(request->path) - 1] == '/')
 | 
			
		||||
	{
 | 
			
		||||
		after = "index.html";
 | 
			
		||||
		if (!file_path)
 | 
			
		||||
		{
 | 
			
		||||
			file_path = "core/";
 | 
			
		||||
			is_core = true;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (!after || strstr(after, ".."))
 | 
			
		||||
@@ -1668,6 +1677,7 @@ void tf_httpd_register(JSContext* context)
 | 
			
		||||
	tf_http_add_handler(http, "/speedscope/*", _httpd_endpoint_static, NULL, task);
 | 
			
		||||
	tf_http_add_handler(http, "/static/*", _httpd_endpoint_static, NULL, task);
 | 
			
		||||
	tf_http_add_handler(http, "/.well-known/*", _httpd_endpoint_static, NULL, task);
 | 
			
		||||
	tf_http_add_handler(http, "/~*/*/", _httpd_endpoint_static, NULL, task);
 | 
			
		||||
 | 
			
		||||
	tf_http_add_handler(http, "/robots.txt", _httpd_endpoint_robots_txt, NULL, NULL);
 | 
			
		||||
	tf_http_add_handler(http, "/debug", _httpd_endpoint_debug, NULL, task);
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										164
									
								
								src/main.c
									
									
									
									
									
								
							
							
						
						
									
										164
									
								
								src/main.c
									
									
									
									
									
								
							@@ -34,6 +34,10 @@
 | 
			
		||||
#include <unistd.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if defined(__ANDROID__)
 | 
			
		||||
#include "jni.h"
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if !defined(_countof)
 | 
			
		||||
#define _countof(a) ((int)(sizeof((a)) / sizeof(*(a))))
 | 
			
		||||
#endif
 | 
			
		||||
@@ -603,14 +607,16 @@ static int _tf_command_run(const char* file, int argc, char* argv[])
 | 
			
		||||
static int _tf_command_sandbox(const char* file, int argc, char* argv[])
 | 
			
		||||
{
 | 
			
		||||
	bool show_usage = false;
 | 
			
		||||
	int fd = STDIN_FILENO;
 | 
			
		||||
 | 
			
		||||
	while (!show_usage)
 | 
			
		||||
	{
 | 
			
		||||
		static const struct option k_options[] = {
 | 
			
		||||
			{ "fd", required_argument, NULL, 'f' },
 | 
			
		||||
			{ "help", no_argument, NULL, 'h' },
 | 
			
		||||
			{ 0 },
 | 
			
		||||
		};
 | 
			
		||||
		int c = getopt_long(argc, argv, "h", k_options, NULL);
 | 
			
		||||
		int c = getopt_long(argc, argv, "f:h", k_options, NULL);
 | 
			
		||||
		if (c == -1)
 | 
			
		||||
		{
 | 
			
		||||
			break;
 | 
			
		||||
@@ -622,6 +628,9 @@ static int _tf_command_sandbox(const char* file, int argc, char* argv[])
 | 
			
		||||
		default:
 | 
			
		||||
			show_usage = true;
 | 
			
		||||
			break;
 | 
			
		||||
		case 'f':
 | 
			
		||||
			fd = atoi(optarg);
 | 
			
		||||
			break;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -630,6 +639,7 @@ static int _tf_command_sandbox(const char* file, int argc, char* argv[])
 | 
			
		||||
		tf_printf("\nUsage: %s sandbox [options]\n\n", file);
 | 
			
		||||
		tf_printf("options:\n");
 | 
			
		||||
		tf_printf("  -h, --help    Show this usage information.\n");
 | 
			
		||||
		tf_printf("  -f, --fd      File descriptor with which to communicate with parent process.\n");
 | 
			
		||||
		return EXIT_FAILURE;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -637,7 +647,7 @@ static int _tf_command_sandbox(const char* file, int argc, char* argv[])
 | 
			
		||||
	prctl(PR_SET_PDEATHSIG, SIGHUP);
 | 
			
		||||
#endif
 | 
			
		||||
	tf_task_t* task = tf_task_create();
 | 
			
		||||
	tf_task_configure_from_fd(task, STDIN_FILENO);
 | 
			
		||||
	tf_task_configure_from_fd(task, fd);
 | 
			
		||||
	_shed_privileges();
 | 
			
		||||
	/* The caller will trigger tf_task_activate with a message. */
 | 
			
		||||
	tf_task_run(task);
 | 
			
		||||
@@ -685,10 +695,6 @@ static void _startup(int argc, char* argv[])
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
#if defined(__ANDROID__)
 | 
			
		||||
	setenv("UV_USE_IO_URING", "0", 1);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	tf_mem_startup(tracking);
 | 
			
		||||
	g_backtrace_state = backtrace_create_state(argv[0], 0, _backtrace_error, NULL);
 | 
			
		||||
 | 
			
		||||
@@ -716,7 +722,7 @@ static void _startup(int argc, char* argv[])
 | 
			
		||||
	{
 | 
			
		||||
		if (
 | 
			
		||||
#if !defined(_WIN32)
 | 
			
		||||
			signal(SIGSYS, _error_handler) == SIG_ERR ||
 | 
			
		||||
			signal(SIGSYS, _error_handler) == SIG_ERR || signal(SIGABRT, _error_handler) == SIG_ERR ||
 | 
			
		||||
#endif
 | 
			
		||||
			signal(SIGSEGV, _error_handler) == SIG_ERR)
 | 
			
		||||
		{
 | 
			
		||||
@@ -726,23 +732,137 @@ static void _startup(int argc, char* argv[])
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#if defined(__ANDROID__)
 | 
			
		||||
static JNIEnv* s_jni_env;
 | 
			
		||||
 | 
			
		||||
static void _tf_service_start(int pipe_fd)
 | 
			
		||||
{
 | 
			
		||||
	tf_printf("_tf_service_start\n");
 | 
			
		||||
	jclass c = (*s_jni_env)->FindClass(s_jni_env, "com/unprompted/tildefriends/TildeFriendsActivity");
 | 
			
		||||
	jmethodID start_sandbox = (*s_jni_env)->GetStaticMethodID(s_jni_env, c, "start_sandbox", "(I)V");
 | 
			
		||||
	(*s_jni_env)->CallStaticVoidMethod(s_jni_env, c, start_sandbox, pipe_fd);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void _tf_service_stop()
 | 
			
		||||
{
 | 
			
		||||
	tf_printf("_tf_service_stop\n");
 | 
			
		||||
	jclass c = (*s_jni_env)->FindClass(s_jni_env, "com/unprompted/tildefriends/TildeFriendsActivity");
 | 
			
		||||
	jmethodID stop_sandbox = (*s_jni_env)->GetStaticMethodID(s_jni_env, c, "stop_sandbox", "()V");
 | 
			
		||||
	(*s_jni_env)->CallStaticVoidMethod(s_jni_env, c, stop_sandbox);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static jint _tf_server_main(JNIEnv* env, jobject this_object, jstring files_dir, jstring apk_path, jstring out_port_file_path)
 | 
			
		||||
{
 | 
			
		||||
	s_jni_env = env;
 | 
			
		||||
 | 
			
		||||
	tf_printf("This is tf_server_main main.\n");
 | 
			
		||||
	_startup(0, (char*[]) { NULL });
 | 
			
		||||
	tf_printf("That was startup.\n");
 | 
			
		||||
 | 
			
		||||
	const char* files = (*env)->GetStringUTFChars(env, files_dir, NULL);
 | 
			
		||||
	const char* apk = (*env)->GetStringUTFChars(env, apk_path, NULL);
 | 
			
		||||
	const char* out_port_file = (*env)->GetStringUTFChars(env, out_port_file_path, NULL);
 | 
			
		||||
 | 
			
		||||
	tf_printf("FILES = %s\n", files);
 | 
			
		||||
	tf_printf("APK = %s\n", apk);
 | 
			
		||||
	tf_printf("OUT_PORT = %s\n", out_port_file);
 | 
			
		||||
 | 
			
		||||
	int result = uv_chdir(files);
 | 
			
		||||
	if (result)
 | 
			
		||||
	{
 | 
			
		||||
		tf_printf("uv_chdir: %s\n", uv_strerror(result));
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	size_t port_file_arg_length = strlen(out_port_file) + strlen("out_http_port_file=") + 1;
 | 
			
		||||
	char* port_file_arg = alloca(port_file_arg_length);
 | 
			
		||||
	snprintf(port_file_arg, port_file_arg_length, "out_http_port_file=%s", out_port_file);
 | 
			
		||||
 | 
			
		||||
	const char* args[] = {
 | 
			
		||||
		"run",
 | 
			
		||||
		"-z",
 | 
			
		||||
		apk,
 | 
			
		||||
		"-a",
 | 
			
		||||
		port_file_arg,
 | 
			
		||||
		"-p",
 | 
			
		||||
		"0",
 | 
			
		||||
	};
 | 
			
		||||
 | 
			
		||||
	tf_task_set_android_service_callbacks(_tf_service_start, _tf_service_stop);
 | 
			
		||||
	result = _tf_command_run(apk, _countof(args), (char**)args);
 | 
			
		||||
	tf_task_set_android_service_callbacks(NULL, NULL);
 | 
			
		||||
 | 
			
		||||
	(*env)->ReleaseStringUTFChars(env, files_dir, files);
 | 
			
		||||
	(*env)->ReleaseStringUTFChars(env, apk_path, apk);
 | 
			
		||||
	(*env)->ReleaseStringUTFChars(env, out_port_file_path, out_port_file);
 | 
			
		||||
 | 
			
		||||
	tf_mem_shutdown();
 | 
			
		||||
	tf_printf("tf_server_main finished with %d.", result);
 | 
			
		||||
 | 
			
		||||
	s_jni_env = NULL;
 | 
			
		||||
	return result;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static jint _tf_sandbox_main(JNIEnv* env, jobject this_object, int pipe_fd)
 | 
			
		||||
{
 | 
			
		||||
	s_jni_env = env;
 | 
			
		||||
 | 
			
		||||
	tf_printf("This is tf_sandbox_main main (fd=%d).\n", pipe_fd);
 | 
			
		||||
	_startup(0, (char*[]) { NULL });
 | 
			
		||||
	tf_printf("That was startup.\n");
 | 
			
		||||
 | 
			
		||||
	char fd[32] = { 0 };
 | 
			
		||||
	snprintf(fd, sizeof(fd), "%d", pipe_fd);
 | 
			
		||||
	const char* args[] = {
 | 
			
		||||
		"sandbox",
 | 
			
		||||
		"-f",
 | 
			
		||||
		fd,
 | 
			
		||||
	};
 | 
			
		||||
 | 
			
		||||
	int result = _tf_command_sandbox(NULL, _countof(args), (char**)args);
 | 
			
		||||
 | 
			
		||||
	tf_mem_shutdown();
 | 
			
		||||
	tf_printf("tf_sandbox_main finished with %d.", result);
 | 
			
		||||
 | 
			
		||||
	s_jni_env = NULL;
 | 
			
		||||
	return result;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved)
 | 
			
		||||
{
 | 
			
		||||
	tf_printf("JNI_Onload called.\n");
 | 
			
		||||
	JNIEnv* env;
 | 
			
		||||
	if ((*vm)->GetEnv(vm, (void**)&env, JNI_VERSION_1_6) != JNI_OK)
 | 
			
		||||
	{
 | 
			
		||||
		tf_printf("Failed to get JNI environment.\n");
 | 
			
		||||
		return JNI_ERR;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	tf_printf("Finding class.\n");
 | 
			
		||||
	jclass c = (*env)->FindClass(env, "com/unprompted/tildefriends/TildeFriendsActivity");
 | 
			
		||||
	if (!c)
 | 
			
		||||
	{
 | 
			
		||||
		tf_printf("Failed to find TildeFriendsActivity class.\n");
 | 
			
		||||
		return JNI_ERR;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	tf_printf("Registering method.\n");
 | 
			
		||||
	static const JNINativeMethod methods[] = {
 | 
			
		||||
		{ "tf_server_main", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I", _tf_server_main },
 | 
			
		||||
		{ "tf_sandbox_main", "(I)I", _tf_sandbox_main },
 | 
			
		||||
	};
 | 
			
		||||
	int result = (*env)->RegisterNatives(env, c, methods, (int)_countof(methods));
 | 
			
		||||
	if (result != JNI_OK)
 | 
			
		||||
	{
 | 
			
		||||
		return result;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	tf_printf("Done.\n");
 | 
			
		||||
	return JNI_VERSION_1_6;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int main(int argc, char* argv[])
 | 
			
		||||
{
 | 
			
		||||
	_startup(argc, argv);
 | 
			
		||||
	int result = -1;
 | 
			
		||||
	if (argc > 1)
 | 
			
		||||
	{
 | 
			
		||||
		if (strcmp(argv[1], "run") == 0)
 | 
			
		||||
		{
 | 
			
		||||
			result = _tf_command_run(argv[0], argc - 1, argv + 1);
 | 
			
		||||
		}
 | 
			
		||||
		else if (strcmp(argv[1], "sandbox") == 0)
 | 
			
		||||
		{
 | 
			
		||||
			result = _tf_command_sandbox(argv[0], argc - 1, argv + 1);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	tf_mem_shutdown();
 | 
			
		||||
	return result;
 | 
			
		||||
	tf_printf("Welcome to Tilde Friends.  This is not the way to run on Android.\n");
 | 
			
		||||
	return EXIT_FAILURE;
 | 
			
		||||
}
 | 
			
		||||
#elif TARGET_OS_IPHONE
 | 
			
		||||
void tf_run_thread_start(const char* zip_path)
 | 
			
		||||
 
 | 
			
		||||
@@ -16,6 +16,10 @@
 | 
			
		||||
#include <time.h>
 | 
			
		||||
#include <unistd.h>
 | 
			
		||||
 | 
			
		||||
#if !defined(_WIN32)
 | 
			
		||||
#include <sys/wait.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if defined(_WIN32)
 | 
			
		||||
#define WIFEXITED(x) 1
 | 
			
		||||
#define WEXITSTATUS(x) (x)
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										19
									
								
								src/task.c
									
									
									
									
									
								
							
							
						
						
									
										19
									
								
								src/task.c
									
									
									
									
									
								
							@@ -50,6 +50,9 @@
 | 
			
		||||
static JSClassID _import_class_id;
 | 
			
		||||
static int _count;
 | 
			
		||||
 | 
			
		||||
static tf_android_start_service_t* s_android_start_service;
 | 
			
		||||
static tf_android_stop_service_t* s_android_stop_service;
 | 
			
		||||
 | 
			
		||||
extern struct backtrace_state* g_backtrace_state;
 | 
			
		||||
 | 
			
		||||
typedef struct _export_record_t export_record_t;
 | 
			
		||||
@@ -2160,3 +2163,19 @@ static JSValue _tf_task_pokeSandbox(JSContext* context, JSValueConst this_val, i
 | 
			
		||||
#endif
 | 
			
		||||
	return JS_NewInt32(context, WEXITSTATUS(result));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void tf_task_set_android_service_callbacks(tf_android_start_service_t* start_service, tf_android_stop_service_t* stop_service)
 | 
			
		||||
{
 | 
			
		||||
	s_android_start_service = start_service;
 | 
			
		||||
	s_android_stop_service = stop_service;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
tf_android_start_service_t* tf_task_get_android_start_service()
 | 
			
		||||
{
 | 
			
		||||
	return s_android_start_service;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
tf_android_stop_service_t* tf_task_get_android_stop_service()
 | 
			
		||||
{
 | 
			
		||||
	return s_android_stop_service;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										31
									
								
								src/task.h
									
									
									
									
									
								
							
							
						
						
									
										31
									
								
								src/task.h
									
									
									
									
									
								
							@@ -333,4 +333,35 @@ char* tf_task_get_debug(tf_task_t* task);
 | 
			
		||||
*/
 | 
			
		||||
char* tf_task_get_hitches(tf_task_t* task);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
** A callback used to start an Android service.
 | 
			
		||||
** @param pipe_fd A file descriptor with which to communicate with the invoking
 | 
			
		||||
** task.
 | 
			
		||||
*/
 | 
			
		||||
typedef void(tf_android_start_service_t)(int pipe_fd);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
** A callback used to stop an Android service.
 | 
			
		||||
*/
 | 
			
		||||
typedef void(tf_android_stop_service_t)();
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
** Set Android service callbacks.
 | 
			
		||||
** @param start_service Start service callback.
 | 
			
		||||
** @param stop_service Stop service callback.
 | 
			
		||||
*/
 | 
			
		||||
void tf_task_set_android_service_callbacks(tf_android_start_service_t* start_service, tf_android_stop_service_t* stop_service);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
** Get the callback registered for starting an Android service.
 | 
			
		||||
** @return the callback.
 | 
			
		||||
*/
 | 
			
		||||
tf_android_start_service_t* tf_task_get_android_start_service();
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
** Get the callback registered for stopping an Android service.
 | 
			
		||||
** @return the callback.
 | 
			
		||||
*/
 | 
			
		||||
tf_android_stop_service_t* tf_task_get_android_stop_service();
 | 
			
		||||
 | 
			
		||||
/** @} */
 | 
			
		||||
 
 | 
			
		||||
@@ -122,10 +122,11 @@ static JSValue _taskstub_create(JSContext* context, JSValueConst this_val, int a
 | 
			
		||||
	char arg1[] = "sandbox";
 | 
			
		||||
	char* command_argv[] = { _executable, arg1, 0 };
 | 
			
		||||
 | 
			
		||||
	tf_android_start_service_t* start_service = tf_task_get_android_start_service();
 | 
			
		||||
	JSValue result = JS_NULL;
 | 
			
		||||
	if (tf_task_get_one_proc(parent))
 | 
			
		||||
	if (tf_task_get_one_proc(parent) || start_service)
 | 
			
		||||
	{
 | 
			
		||||
		uv_os_sock_t fds[2];
 | 
			
		||||
		uv_os_sock_t fds[2] = { 0 };
 | 
			
		||||
		int pipe_result = uv_socketpair(SOCK_STREAM, 0, fds, 0, 0);
 | 
			
		||||
		if (pipe_result)
 | 
			
		||||
		{
 | 
			
		||||
@@ -133,7 +134,7 @@ static JSValue _taskstub_create(JSContext* context, JSValueConst this_val, int a
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		uv_pipe_t* pipe = tf_packetstream_get_pipe(stub->_stream);
 | 
			
		||||
		memset(pipe, 0, sizeof(*pipe));
 | 
			
		||||
		*pipe = (uv_pipe_t) { 0 };
 | 
			
		||||
		pipe_result = uv_pipe_init(tf_task_get_loop(parent), pipe, 1);
 | 
			
		||||
		if (pipe_result != 0)
 | 
			
		||||
		{
 | 
			
		||||
@@ -145,8 +146,16 @@ static JSValue _taskstub_create(JSContext* context, JSValueConst this_val, int a
 | 
			
		||||
			tf_printf("uv_pipe_open failed: %s\n", uv_strerror(pipe_result));
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		if (start_service)
 | 
			
		||||
		{
 | 
			
		||||
			start_service(fds[1]);
 | 
			
		||||
		}
 | 
			
		||||
		else
 | 
			
		||||
		{
 | 
			
		||||
			/* XXX: This is a leak. */
 | 
			
		||||
			uv_thread_t* thread = tf_malloc(sizeof(uv_thread_t));
 | 
			
		||||
			uv_thread_create(thread, _tf_taskstub_run_sandbox_thread, (void*)(intptr_t)fds[1]);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		tf_packetstream_set_on_receive(stub->_stream, tf_task_on_receive_packet, stub);
 | 
			
		||||
		tf_packetstream_start(stub->_stream);
 | 
			
		||||
@@ -442,9 +451,17 @@ JSValue tf_taskstub_kill(tf_taskstub_t* stub)
 | 
			
		||||
{
 | 
			
		||||
	JSValue result = JS_UNDEFINED;
 | 
			
		||||
	if (!tf_task_get_one_proc(stub->_owner))
 | 
			
		||||
	{
 | 
			
		||||
		tf_android_stop_service_t* stop_service = tf_task_get_android_stop_service();
 | 
			
		||||
		if (stop_service)
 | 
			
		||||
		{
 | 
			
		||||
			stop_service();
 | 
			
		||||
		}
 | 
			
		||||
		else
 | 
			
		||||
		{
 | 
			
		||||
			uv_process_kill(&stub->_process, SIGKILL);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	else
 | 
			
		||||
	{
 | 
			
		||||
		promiseid_t promise = -1;
 | 
			
		||||
 
 | 
			
		||||
@@ -1,2 +1,2 @@
 | 
			
		||||
#define VERSION_NUMBER "0.0.20"
 | 
			
		||||
#define VERSION_NAME "They gave you a small cup."
 | 
			
		||||
#define VERSION_NUMBER "0.0.21-wip"
 | 
			
		||||
#define VERSION_NAME "Psst.  Look behind you."
 | 
			
		||||
 
 | 
			
		||||
@@ -11,23 +11,13 @@ BUILD_DIR=out/openssl_android_build
 | 
			
		||||
 | 
			
		||||
BUILD_TARGETS="x86_64 x86 arm64-v8a armeabi-v7a"
 | 
			
		||||
 | 
			
		||||
rm -rf out/openssl-${OPENSSL_VERSION}
 | 
			
		||||
WORK_DIR=out/openssl-${OPENSSL_VERSION}-android
 | 
			
		||||
rm -rf $WORK_DIR
 | 
			
		||||
cp -arf deps/openssl_src/ $WORK_DIR
 | 
			
		||||
 | 
			
		||||
if [ ! -d out/openssl-${OPENSSL_VERSION} ]
 | 
			
		||||
then
 | 
			
		||||
    if [ ! -f out/openssl-${OPENSSL_VERSION}.tar.gz ]
 | 
			
		||||
    then
 | 
			
		||||
        wget https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz -O out/openssl-${OPENSSL_VERSION}.tar.gz | exit 128
 | 
			
		||||
    fi
 | 
			
		||||
    tar -C out/ -xzf out/openssl-${OPENSSL_VERSION}.tar.gz || exit 128
 | 
			
		||||
fi
 | 
			
		||||
WORK_DIR=out/openssl-${OPENSSL_VERSION}
 | 
			
		||||
 | 
			
		||||
##### export ndk directory. Required by openssl-build-scripts #####
 | 
			
		||||
export ANDROID_NDK_ROOT
 | 
			
		||||
echo ANDROID_NDK_ROOT=$ANDROID_NDK_ROOT
 | 
			
		||||
 | 
			
		||||
##### build-function #####
 | 
			
		||||
build_the_thing() {
 | 
			
		||||
    TOOLCHAIN=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64
 | 
			
		||||
    export PATH=$TOOLCHAIN/$TRIBLE/bin:$TOOLCHAIN/bin:$PATH
 | 
			
		||||
@@ -80,14 +70,13 @@ build_the_thing() {
 | 
			
		||||
        -Os
 | 
			
		||||
        -DOPENSSL_SMALL_FOOTPRINT"
 | 
			
		||||
    pwd
 | 
			
		||||
    echo "./Configure $SSL_TARGET $OPTIONS $GLOBAL_OPTIONS -fuse-ld=$TOOLCHAIN/bin/ld" && \
 | 
			
		||||
    ./Configure $SSL_TARGET $OPTIONS $GLOBAL_OPTIONS -fuse-ld=$TOOLCHAIN/bin/ld no-tests && \
 | 
			
		||||
    echo "./Configure $SSL_TARGET $OPTIONS $GLOBAL_OPTIONS" && \
 | 
			
		||||
    ./Configure $SSL_TARGET $OPTIONS $GLOBAL_OPTIONS && \
 | 
			
		||||
    make clean && \
 | 
			
		||||
    make build_generated && \
 | 
			
		||||
    make libcrypto.a libssl.a || exit 128
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
##### set variables according to build-tagret #####
 | 
			
		||||
for build_target in $BUILD_TARGETS
 | 
			
		||||
do
 | 
			
		||||
    echo "Building $build_target"
 | 
			
		||||
@@ -128,7 +117,6 @@ do
 | 
			
		||||
    rm -rf $DESTDIR
 | 
			
		||||
    build_the_thing
 | 
			
		||||
    popd
 | 
			
		||||
#### copy libraries and includes to output-directory #####
 | 
			
		||||
    echo WORK_DIR=$WORK_DIR
 | 
			
		||||
    rm -rf deps/openssl/android/$build_target/
 | 
			
		||||
    mkdir -p deps/openssl/android/$build_target/usr/local/include/
 | 
			
		||||
 
 | 
			
		||||
@@ -8,21 +8,10 @@ BUILD_DIR=out/openssl_ios_build
 | 
			
		||||
 | 
			
		||||
BUILD_TARGETS="ios64-xcrun iossimulator-xcrun"
 | 
			
		||||
 | 
			
		||||
rm -rfv out/openssl-${OPENSSL_VERSION}
 | 
			
		||||
WORK_DIR=out/openssl-${OPENSSL_VERSION}-ios
 | 
			
		||||
rm -rf $WORK_DIR
 | 
			
		||||
cp -arf deps/openssl_src/ $WORK_DIR
 | 
			
		||||
 | 
			
		||||
if [ ! -d out/openssl-${OPENSSL_VERSION} ]
 | 
			
		||||
then
 | 
			
		||||
    if [ ! -f out/openssl-${OPENSSL_VERSION}.tar.gz ]
 | 
			
		||||
    then
 | 
			
		||||
        curl -L https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz -o out/openssl-${OPENSSL_VERSION}.tar.gz || exit 128
 | 
			
		||||
    fi
 | 
			
		||||
    tar -C out/ -xzf out/openssl-${OPENSSL_VERSION}.tar.gz || exit 128
 | 
			
		||||
fi
 | 
			
		||||
WORK_DIR=out/openssl-${OPENSSL_VERSION}
 | 
			
		||||
 | 
			
		||||
##### export ndk directory. Required by openssl-build-scripts #####
 | 
			
		||||
 | 
			
		||||
##### build-function #####
 | 
			
		||||
build_the_thing() {
 | 
			
		||||
    export PATH=$TOOLCHAIN/$TRIBLE/bin:$TOOLCHAIN/bin:$PATH
 | 
			
		||||
    echo $PATH
 | 
			
		||||
@@ -33,7 +22,6 @@ build_the_thing() {
 | 
			
		||||
    make libcrypto.a libssl.a || exit 128
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
##### set variables according to build-tagret #####
 | 
			
		||||
for build_target in $BUILD_TARGETS
 | 
			
		||||
do
 | 
			
		||||
    echo "Building $build_target"
 | 
			
		||||
@@ -60,7 +48,6 @@ do
 | 
			
		||||
    rm -rf $DESTDIR
 | 
			
		||||
    build_the_thing
 | 
			
		||||
    popd
 | 
			
		||||
#### copy libraries and includes to output-directory #####
 | 
			
		||||
    echo WORK_DIR=$WORK_DIR
 | 
			
		||||
    rm -rf deps/openssl/ios/$build_target/
 | 
			
		||||
    mkdir -p deps/openssl/ios/$build_target/usr/local/include/
 | 
			
		||||
 
 | 
			
		||||
@@ -8,19 +8,10 @@ BUILD_DIR=out/openssl_mingw64_build
 | 
			
		||||
 | 
			
		||||
BUILD_TARGETS="mingw64"
 | 
			
		||||
 | 
			
		||||
rm -rfv out/openssl-${OPENSSL_VERSION}
 | 
			
		||||
WORK_DIR=out/openssl-${OPENSSL_VERSION}-mingw64
 | 
			
		||||
rm -rf $WORK_DIR
 | 
			
		||||
cp -arf deps/openssl_src/ $WORK_DIR
 | 
			
		||||
 | 
			
		||||
if [ ! -d out/openssl-${OPENSSL_VERSION} ]
 | 
			
		||||
then
 | 
			
		||||
    if [ ! -f out/openssl-${OPENSSL_VERSION}.tar.gz ]
 | 
			
		||||
    then
 | 
			
		||||
        wget https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz -O out/openssl-${OPENSSL_VERSION}.tar.gz || exit 128
 | 
			
		||||
    fi
 | 
			
		||||
    tar -C out/ -xzf out/openssl-${OPENSSL_VERSION}.tar.gz || exit 128
 | 
			
		||||
fi
 | 
			
		||||
WORK_DIR=out/openssl-${OPENSSL_VERSION}
 | 
			
		||||
 | 
			
		||||
##### build-function #####
 | 
			
		||||
build_the_thing() {
 | 
			
		||||
    export GLOBAL_OPTIONS="no-trace no-asm no-threads no-md2 no-md4 no-dso no-async no-multiblock no-dgram no-filenames no-shared no-ssl3 no-engine no-dynamic-engine no-zlib no-comp no-psk no-idea no-srp no-weak-ssl-ciphers no-dtls no-egd no-tests -Os"
 | 
			
		||||
    echo "./Configure $SSL_TARGET $OPTIONS $GLOBAL_OPTIONS" && \
 | 
			
		||||
@@ -30,7 +21,6 @@ build_the_thing() {
 | 
			
		||||
    make libcrypto.a libssl.a || exit 128
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
##### set variables according to build-tagret #####
 | 
			
		||||
for build_target in $BUILD_TARGETS
 | 
			
		||||
do
 | 
			
		||||
    echo "Building $build_target"
 | 
			
		||||
@@ -47,7 +37,6 @@ do
 | 
			
		||||
    rm -rf $DESTDIR
 | 
			
		||||
    build_the_thing
 | 
			
		||||
    popd
 | 
			
		||||
#### copy libraries and includes to output-directory #####
 | 
			
		||||
    echo WORK_DIR=$WORK_DIR
 | 
			
		||||
    rm -rf deps/openssl/$build_target/
 | 
			
		||||
    mkdir -p deps/openssl/$build_target/usr/local/include/
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user