Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: 20
node-version: 24
cache: npm

- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: 20
node-version: 24
cache: npm

- name: Set up Java
Expand Down
20 changes: 3 additions & 17 deletions apk/app/src/main/java/com/t3code/app/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.graphics.Color;
import android.graphics.PorterDuff;
import android.net.ConnectivityManager;
import android.net.Network;
import android.net.NetworkCapabilities;
Expand Down Expand Up @@ -53,6 +52,7 @@

import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URI;
import java.net.URL;
import java.text.SimpleDateFormat;
import java.util.Date;
Expand Down Expand Up @@ -292,7 +292,6 @@ private void loadWebView(String url) {
WebSettings settings = webView.getSettings();
settings.setJavaScriptEnabled(true);
settings.setDomStorageEnabled(true);
settings.setDatabaseEnabled(true);
settings.setMediaPlaybackRequiresUserGesture(false);
settings.setCacheMode(WebSettings.LOAD_DEFAULT);
settings.setMixedContentMode(isHttpsUrl(url)
Expand All @@ -304,8 +303,6 @@ private void loadWebView(String url) {
settings.setJavaScriptCanOpenWindowsAutomatically(false);
settings.setSupportMultipleWindows(false);
settings.setUserAgentString(settings.getUserAgentString() + " T3CodeMobile/" + getAppVersionName());
settings.setAllowFileAccessFromFileURLs(false);
settings.setAllowUniversalAccessFromFileURLs(false);
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
settings.setSafeBrowsingEnabled(true);
}
Expand Down Expand Up @@ -386,17 +383,6 @@ public void onPageFinished(WebView view, String url) {
injectImageButton();
}

@Override
public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
super.onReceivedError(view, errorCode, description, failingUrl);
cancelLoadTimeout();
currentLoadFailed = true;
lastErrorMessage = description != null ? description : "Unknown network error";
lastSuggestedFix = "Verify the host, port, and Tailscale or LAN reachability, then try again.";
updateWebViewPresentation();
showPageError("Connection problem", lastErrorMessage);
}

@Override
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
super.onReceivedError(view, request, error);
Expand Down Expand Up @@ -503,7 +489,7 @@ public boolean onShowFileChooser(WebView view, ValueCallback<Uri[]> callback, Fi

loadingBar = new ProgressBar(this, null, android.R.attr.progressBarStyleHorizontal);
loadingBar.setMax(100);
loadingBar.getProgressDrawable().setColorFilter(Color.parseColor("#6C63FF"), PorterDuff.Mode.SRC_IN);
loadingBar.getProgressDrawable().setTint(Color.parseColor("#6C63FF"));
FrameLayout.LayoutParams loadingParams = new FrameLayout.LayoutParams(
FrameLayout.LayoutParams.MATCH_PARENT,
dp(3)
Expand Down Expand Up @@ -854,7 +840,7 @@ private ProbeResult probeUrl(String urlString) {
HttpURLConnection connection = null;

try {
URL url = new URL(urlString);
URL url = URI.create(urlString).toURL();
connection = (HttpURLConnection) url.openConnection();
connection.setConnectTimeout(DIAGNOSTIC_TIMEOUT_MS);
connection.setReadTimeout(DIAGNOSTIC_TIMEOUT_MS);
Expand Down
2 changes: 1 addition & 1 deletion build-apk.bat
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ echo [4/8] Compiling Java sources
dir /s /b "%SRC%\java\*.java" > "%BUILD%\sources.txt"
dir /s /b "%GEN%\*.java" >> "%BUILD%\sources.txt"

javac -source 11 -target 11 ^
javac --release 11 ^
-classpath "%PLATFORM%\android.jar" ^
-d "%CLASSES%" ^
@"%BUILD%\sources.txt"
Expand Down
89 changes: 89 additions & 0 deletions eslint.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
const nodeGlobals = {
__dirname: "readonly",
__filename: "readonly",
Buffer: "readonly",
clearInterval: "readonly",
clearTimeout: "readonly",
console: "readonly",
exports: "writable",
global: "readonly",
module: "writable",
process: "readonly",
require: "readonly",
setInterval: "readonly",
setTimeout: "readonly",
URL: "readonly",
URLSearchParams: "readonly",
};

const browserGlobals = {
Blob: "readonly",
ClipboardEvent: "readonly",
CustomEvent: "readonly",
DataTransfer: "readonly",
document: "readonly",
Event: "readonly",
File: "readonly",
FileReader: "readonly",
FormData: "readonly",
HTMLElement: "readonly",
Image: "readonly",
localStorage: "readonly",
location: "readonly",
MutationObserver: "readonly",
navigator: "readonly",
Notification: "readonly",
window: "readonly",
};

const serviceWorkerGlobals = {
caches: "readonly",
clients: "readonly",
fetch: "readonly",
Request: "readonly",
Response: "readonly",
self: "readonly",
};

module.exports = [
{
ignores: ["node_modules/**", "apk/**", "harness-pages/**"],
},
{
files: ["**/*.js"],
languageOptions: {
ecmaVersion: 2020,
globals: nodeGlobals,
sourceType: "commonjs",
},
rules: {
eqeqeq: "error",
"no-console": "off",
"no-implicit-globals": "error",
"no-throw-literal": "error",
"no-undef": "error",
"no-unused-vars": ["warn", { argsIgnorePattern: "^_" }],
"no-var": "error",
"prefer-const": "warn",
},
},
{
files: ["lib/**/*.js", "test/**/*.js"],
languageOptions: {
globals: {
...nodeGlobals,
...browserGlobals,
},
},
},
{
files: ["sw.js"],
languageOptions: {
globals: serviceWorkerGlobals,
sourceType: "script",
},
rules: {
"no-implicit-globals": "off",
},
},
];
Loading