From df5780f02943d4cf9c024f52e24646235cf4481e Mon Sep 17 00:00:00 2001 From: ZHAO Xudong Date: Tue, 28 Jul 2026 11:39:49 +0800 Subject: [PATCH 1/3] fix types --- entry/src/main/ets/entryability/EntryAbility.ets | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/entry/src/main/ets/entryability/EntryAbility.ets b/entry/src/main/ets/entryability/EntryAbility.ets index 4f5eee3..658b336 100644 --- a/entry/src/main/ets/entryability/EntryAbility.ets +++ b/entry/src/main/ets/entryability/EntryAbility.ets @@ -21,7 +21,7 @@ import window from '@ohos.window'; import Want from '@ohos.app.ability.Want'; import AbilityConstant from '@ohos.app.ability.AbilityConstant'; import { Configuration } from '@ohos.app.ability.Configuration'; -import { abilityAccessCtrl, common } from '@kit.AbilityKit'; +import { abilityAccessCtrl, common, Permissions, PermissionRequestResult } from '@kit.AbilityKit'; import { Environment } from '@kit.CoreFileKit'; import fs from '@ohos.file.fs'; @@ -33,7 +33,7 @@ const TAG: string = 'ElectermEntryAbility'; // Permissions without "reason"/"usedScene" (INTERNET, GET_NETWORK_INFO, // ACCESS_CERT_MANAGER, PRINT, GYROSCOPE, ACCELEROMETER) are normal or // system-grant permissions that don't need runtime request. -const ALL_USER_PERMISSIONS: string[] = [ +const ALL_USER_PERMISSIONS: Permissions[] = [ 'ohos.permission.READ_WRITE_DOWNLOAD_DIRECTORY', 'ohos.permission.READ_WRITE_DOCUMENTS_DIRECTORY', 'ohos.permission.READ_WRITE_DESKTOP_DIRECTORY', @@ -95,8 +95,9 @@ export default class EntryAbility extends WebAbility { try { const atManager = abilityAccessCtrl.createAtManager(); const context = this.context as common.UIAbilityContext; - const result = await atManager.requestPermissionsFromUser(context, ALL_USER_PERMISSIONS); - const authResults = result.authResults; + const result: PermissionRequestResult = + await atManager.requestPermissionsFromUser(context, ALL_USER_PERMISSIONS); + const authResults: number[] = result.authResults; for (let i = 0; i < authResults.length; i++) { if (authResults[i] === 0) { console.info(`[${TAG}] Permission granted: ${ALL_USER_PERMISSIONS[i]}`); From 97d01c60f863fbcd1ace7deae200cbc412036841 Mon Sep 17 00:00:00 2001 From: ZHAO Xudong Date: Tue, 28 Jul 2026 12:20:09 +0800 Subject: [PATCH 2/3] fox1 --- .../main/ets/entryability/EntryAbility.ets | 9 ++--- entry/src/main/module.json5 | 40 ------------------- src/app/lib/create-window.js | 4 +- 3 files changed, 4 insertions(+), 49 deletions(-) diff --git a/entry/src/main/ets/entryability/EntryAbility.ets b/entry/src/main/ets/entryability/EntryAbility.ets index 658b336..30898af 100644 --- a/entry/src/main/ets/entryability/EntryAbility.ets +++ b/entry/src/main/ets/entryability/EntryAbility.ets @@ -33,16 +33,13 @@ const TAG: string = 'ElectermEntryAbility'; // Permissions without "reason"/"usedScene" (INTERNET, GET_NETWORK_INFO, // ACCESS_CERT_MANAGER, PRINT, GYROSCOPE, ACCELEROMETER) are normal or // system-grant permissions that don't need runtime request. +// Removed LOCATION, MICROPHONE, CAMERA, ACCESS_BLUETOOTH — a terminal/SSH +// app has no use for geolocation, audio/video capture, or Bluetooth. const ALL_USER_PERMISSIONS: Permissions[] = [ 'ohos.permission.READ_WRITE_DOWNLOAD_DIRECTORY', 'ohos.permission.READ_WRITE_DOCUMENTS_DIRECTORY', 'ohos.permission.READ_WRITE_DESKTOP_DIRECTORY', - 'ohos.permission.LOCATION', - 'ohos.permission.APPROXIMATELY_LOCATION', - 'ohos.permission.MICROPHONE', - 'ohos.permission.CAMERA', - 'ohos.permission.READ_PASTEBOARD', - 'ohos.permission.ACCESS_BLUETOOTH' + 'ohos.permission.READ_PASTEBOARD' ]; export default class EntryAbility extends WebAbility { diff --git a/entry/src/main/module.json5 b/entry/src/main/module.json5 index f2bb6ec..91a2a5a 100644 --- a/entry/src/main/module.json5 +++ b/entry/src/main/module.json5 @@ -43,41 +43,9 @@ "when": "always" } }, - { - "name": "ohos.permission.LOCATION", - "reason": "$string:reason", - "usedScene": { - "abilities": ["EntryAbility"], - "when": "always" - } - }, - { - "name": "ohos.permission.APPROXIMATELY_LOCATION", - "reason": "$string:reason", - "usedScene": { - "abilities": ["EntryAbility"], - "when": "always" - } - }, { "name": "ohos.permission.ACCESS_CERT_MANAGER" }, - { - "name": "ohos.permission.MICROPHONE", - "reason": "$string:microphone", - "usedScene": { - "abilities": ["EntryAbility"], - "when": "inuse" - } - }, - { - "name": "ohos.permission.CAMERA", - "reason": "$string:camera", - "usedScene": { - "abilities": ["EntryAbility"], - "when": "inuse" - } - }, { "name": "ohos.permission.PRINT" }, @@ -89,14 +57,6 @@ "when": "inuse" } }, - { - "name": "ohos.permission.ACCESS_BLUETOOTH", - "reason": "$string:access_bluetooth", - "usedScene": { - "abilities": ["EntryAbility"], - "when": "always" - } - }, { "name": "ohos.permission.GYROSCOPE" }, diff --git a/src/app/lib/create-window.js b/src/app/lib/create-window.js index 9f47359..099fad5 100644 --- a/src/app/lib/create-window.js +++ b/src/app/lib/create-window.js @@ -6,7 +6,6 @@ const { isDev, packInfo, iconPath, isMac, minWindowWidth, minWindowHeight } = require('../common/runtime-constants') -const defaults = require('../common/default-setting') const { getWindowSize, setWindowPos @@ -28,7 +27,6 @@ exports.createWindow = async function (userConfig) { globalState.set('closeAction', 'closeApp') globalState.set('requireAuth', !!userConfig.hashedPassword) const { width, height, x, y } = await getWindowSize() - const { useSystemTitleBar = defaults.useSystemTitleBar } = userConfig // HarmonyOS: `transparent: true` and `titleBarStyle: 'hidden'` are NOT // supported — they cause a double title bar (the OS title bar plus the // app's custom one). We therefore always use the system title bar, @@ -45,7 +43,7 @@ exports.createWindow = async function (userConfig) { minWidth: minWindowWidth, minHeight: minWindowHeight, title: packInfo.name, - frame: useSystemTitleBar, + frame: true, backgroundColor: '#333333', autoHideMenuBar: true, webPreferences: { From dc429bb4401dfa296cdf6fadc0e604abcce761e5 Mon Sep 17 00:00:00 2001 From: ZHAO Xudong Date: Tue, 28 Jul 2026 16:55:01 +0800 Subject: [PATCH 3/3] fix100 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 16d7fe8..52e8f60 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "electerm-harmony", + "name": "electerm", "version": "4.15.176", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "electerm-harmony", + "name": "electerm", "version": "4.15.176", "hasInstallScript": true, "license": "MIT", diff --git a/package.json b/package.json index fdd4584..d719eaa 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "electerm-harmony", + "name": "electerm", "version": "4.15.176", "description": "electerm — a free and open-source ssh/sftp/telnet/RDP/VNC/Spice/ftp client for HarmonyOS, built on the electerm codebase.", "main": "app.js",