Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
a44a06b
Bump github.com/ensan-hcl/azookeykanakanjiconverter in /AzooKeyCore
dependabot[bot] Feb 21, 2024
15c9f5a
Merge pull request #434 from ensan-hcl/dependabot/swift/AzooKeyCore/g…
ensan-hcl Feb 22, 2024
8030d6e
句点を追加
k-taro56 Feb 29, 2024
d6cffae
Merge pull request #435 from k-taro56/fix/core-doc-typo
ensan-hcl Feb 29, 2024
a59b071
fix: build error in Swift 5.10
ensan-hcl Mar 6, 2024
91cbd8f
fix var to let
ensan-hcl Mar 6, 2024
7a578a0
Make init workable in non-@MainActor-context
ensan-hcl Mar 6, 2024
8913c75
Merge pull request #436 from ensan-hcl/fix/swift_5.10
ensan-hcl Mar 6, 2024
a771071
[Docs] Update advice_for_azooKey_based_development.md
ensan-hcl Mar 7, 2024
bc63de8
Merge pull request #439 from ensan-hcl/ensan-hcl-patch-1
ensan-hcl Mar 7, 2024
3b8fdea
Bump swift-actions/setup-swift from 1.26.0 to 2.0.0
dependabot[bot] Mar 13, 2024
5df50b9
Merge pull request #442 from ensan-hcl/dependabot/github_actions/swif…
ensan-hcl Mar 13, 2024
bef5b1b
Update README.md
ensan-hcl Mar 20, 2024
10fc46a
Merge pull request #444 from ensan-hcl/ensan-hcl-patch-1
ensan-hcl Mar 20, 2024
91e976d
remove: laucnhscreen storyboard
ensan-hcl Apr 7, 2024
81ff0b9
feat: 設定画面で項目検索ができるようにした
ensan-hcl Apr 7, 2024
44d5a79
cleanup
ensan-hcl Apr 7, 2024
95e16d1
Merge pull request #448 from ensan-hcl/refactor/remove_storyboard
ensan-hcl Apr 7, 2024
ac99c05
minor fixes
ensan-hcl Apr 7, 2024
0b14903
fix: asset validation errro
ensan-hcl Apr 7, 2024
b80e22c
Merge pull request #450 from ensan-hcl/fix/launch_screen
ensan-hcl Apr 7, 2024
9e6a3df
Merge pull request #449 from ensan-hcl/feature/setting_search
ensan-hcl Apr 7, 2024
67e3c0f
fix: 握手絵文字のバリエーションが誤って右パンチ絵文字のバリエーションとして扱われていた問題を修正
ensan-hcl Apr 7, 2024
95cf32f
Merge pull request #451 from ensan-hcl/fix/handshake
ensan-hcl Apr 7, 2024
8e1288c
fix: キーボードバーの判定が広すぎる問題を修正
ensan-hcl Apr 16, 2024
bfd5220
Merge pull request #452 from ensan-hcl/fix/touch_detection
ensan-hcl Apr 16, 2024
324211c
fix privacy manifest description
ensan-hcl Apr 16, 2024
fd61a49
Merge pull request #453 from ensan-hcl/fix/privacy_manifest
ensan-hcl Apr 17, 2024
f7f3940
fix bundle id
ensan-hcl Apr 17, 2024
700d18d
Merge pull request #454 from ensan-hcl/fix/product_bundle_id
ensan-hcl Apr 17, 2024
444131a
add xcprivacy as resource of Keyboard
ensan-hcl Apr 21, 2024
ce2ecd9
Merge pull request #456 from ensan-hcl/fix/add_xcprivacy_to_keyboard
ensan-hcl Apr 21, 2024
5744c53
[Debug] upload-build.ymlを手動実行可能にする (#457)
ensan-hcl Apr 21, 2024
4f3108d
update: use AzooKeyKanaKanjiConverter 0.7.0
ensan-hcl Apr 21, 2024
95ea6c0
Merge pull request #459 from ensan-hcl/update/AzooKeyKanaKanjiConverter
ensan-hcl Apr 21, 2024
96d45d7
Add CodeQL workflow for automated code scanning
k-taro56 Apr 30, 2024
272295c
Update build mode for Swift language
k-taro56 May 1, 2024
d5dfc08
Add submodule support to the repository checkout step
k-taro56 May 1, 2024
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
95 changes: 95 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]
schedule:
- cron: '32 19 * * 4'

jobs:
analyze:
name: Analyze (${{ matrix.language }})
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners (GitHub.com only)
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
# required for all workflows
security-events: write

# required to fetch internal or private CodeQL packs
packages: read

# only required for workflows in private repositories
actions: read
contents: read

strategy:
fail-fast: false
matrix:
include:
- language: python
build-mode: none
- language: swift
build-mode: manual
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

# If the analyze step fails for one of the languages you are analyzing with
# "We were unable to automatically build your code", modify the matrix above
# to set the build mode to "manual" for that language. Then modify this step
# to build your code.
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- if: matrix.build-mode == 'manual'
run: |
xcodebuild build -project azooKey.xcodeproj \
-scheme MainApp \
-sdk iphoneos \
-configuration Release \
CODE_SIGNING_ALLOWED=NO

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
2 changes: 1 addition & 1 deletion .github/workflows/swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: macos-latest

steps:
- uses: swift-actions/setup-swift@cdbe0f7f4c77929b6580e71983e8606e55ffe7e4
- uses: swift-actions/setup-swift@e1dca7c4a36344146bbc2803f0d538462477bb37
with:
swift-version: "5.9"

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/upload-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
name: Upload build to App Store Connect

on:
workflow_dispatch:
push:
branches:
- develop
Expand Down
2 changes: 1 addition & 1 deletion AzooKeyCore/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ let package = Package(
// MARK: `_: .upToNextMinor(Version)` or `exact: Version` or `revision: Version`.
// MARK: For develop branch, you can use `revision:` specification.
// MARK: For main branch, you must use `upToNextMinor` specification.
.package(url: "https://github.com/ensan-hcl/AzooKeyKanaKanjiConverter", .upToNextMinor(from: "0.5.0"))
.package(url: "https://github.com/ensan-hcl/AzooKeyKanaKanjiConverter", .upToNextMinor(from: "0.7.0"))
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
Expand Down
2 changes: 1 addition & 1 deletion AzooKeyCore/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Keyboardの着せ替えデータ(`ThemeData`)に関するモジュールです

## KeyboardViews

KeyboardのViewを実装したモジュールです最小で以下のように利用できます
KeyboardのViewを実装したモジュールです。最小で以下のように利用できます

```swift
var body: some View {
Expand Down
79 changes: 79 additions & 0 deletions AzooKeyCore/Sources/AzooKeyUtils/AppVersion.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
//
// AppVersion.swift
// azooKey
//
// Created by ensan on 2022/07/02.
// Copyright © 2022 ensan. All rights reserved.
//

import Foundation

/// AppVersion is a struct that represents a version of an app.
/// It is a wrapper of String that conforms to Codable, Equatable, Comparable, Hashable, LosslessStringConvertible, CustomStringConvertible.
/// It is initialized with a string that represents a version of an app.
/// The string must be in the format of "major.minor.patch".
/// The string must not contain any other characters than numbers and dots.
public struct AppVersion: Codable, Equatable, Comparable, Hashable, LosslessStringConvertible, CustomStringConvertible, Sendable {

/// ParseError is an enum that represents an error that occurs when parsing a string to an AppVersion.
private enum ParseError: Error {
case nonIntegerValue
}

/// Initializes an AppVersion with a string that represents a version of an app.
public init?(_ description: String) {
if let versionSequence = try? description.split(separator: ".").map({ (value: Substring) throws -> Int in
guard let value = Int(value) else { throw ParseError.nonIntegerValue }
return value
}) {
if versionSequence.count < 1 {
self.majorVersion = 0
} else {
self.majorVersion = versionSequence[0]
}

if versionSequence.count < 2 {
self.minorVersion = 0
} else {
self.minorVersion = versionSequence[1]
}

if versionSequence.count < 3 {
self.patchVersion = 0
} else {
self.patchVersion = versionSequence[2]
}
} else {
return nil
}
}

/// Compares two AppVersions.
public static func < (lhs: AppVersion, rhs: AppVersion) -> Bool {
for (l, r) in zip([lhs.majorVersion, lhs.minorVersion, lhs.patchVersion], [rhs.majorVersion, rhs.minorVersion, rhs.patchVersion]) {
if l == r {
continue
}
return l < r
}
return false
}

public var majorVersion: Int
public var minorVersion: Int
public var patchVersion: Int

public var description: String {
"\(majorVersion).\(minorVersion).\(patchVersion)"
}
}
public extension AppVersion {
static let azooKey_v2_2_3 = AppVersion("2.2.3")!
static let azooKey_v2_2_2 = AppVersion("2.2.2")!
static let azooKey_v2_0_2 = AppVersion("2.0.2")!
static let azooKey_v1_9 = AppVersion("1.9")!
static let azooKey_v1_8_1 = AppVersion("1.8.1")!
static let azooKey_v1_8 = AppVersion("1.8")!
static let azooKey_v1_7_2 = AppVersion("1.7.2")!
static let azooKey_v1_7_1 = AppVersion("1.7.1")!
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ protocol Savable {
}

@propertyWrapper
@MainActor
public struct KeyboardSetting<T: KeyboardSettingKey> {
public init(_ key: T) {}
public var wrappedValue: T.Value {
@MainActor public var wrappedValue: T.Value {
get {
T.value
}
Expand Down
11 changes: 0 additions & 11 deletions AzooKeyCore/Sources/AzooKeyUtils/SharedStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,3 @@ public enum SharedStore {
}
}
}

public extension AppVersion {
static let azooKey_v2_2_3 = AppVersion("2.2.3")!
static let azooKey_v2_2_2 = AppVersion("2.2.2")!
static let azooKey_v2_0_2 = AppVersion("2.0.2")!
static let azooKey_v1_9 = AppVersion("1.9")!
static let azooKey_v1_8_1 = AppVersion("1.8.1")!
static let azooKey_v1_8 = AppVersion("1.8")!
static let azooKey_v1_7_2 = AppVersion("1.7.2")!
static let azooKey_v1_7_1 = AppVersion("1.7.1")!
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import SwiftUtils
import UIKit

/// UI側の入力中のテキストの更新を受け持つクラス
@MainActor final public class DisplayedTextManager {
final public class DisplayedTextManager {
public init(isLiveConversionEnabled: Bool, isMarkedTextEnabled: Bool) {
self.isLiveConversionEnabled = isLiveConversionEnabled
self.isMarkedTextEnabled = isMarkedTextEnabled
Expand Down Expand Up @@ -61,15 +61,15 @@ import UIKit
}
}

public var documentContextAfterInput: String? {
@MainActor public var documentContextAfterInput: String? {
self.proxy?.documentContextAfterInput
}

public var selectedText: String? {
@MainActor public var selectedText: String? {
self.proxy?.selectedText
}

public var documentContextBeforeInput: String? {
@MainActor public var documentContextBeforeInput: String? {
self.proxy?.documentContextBeforeInput
}

Expand Down Expand Up @@ -101,7 +101,7 @@ import UIKit
}

/// カーソルを何カウント分動かせばいいか計算する
private func getActualOffset(count: Int) -> Int {
@MainActor private func getActualOffset(count: Int) -> Int {
if count == 0 {
return 0
} else if count > 0 {
Expand All @@ -127,13 +127,13 @@ import UIKit

/// MarkedTextを更新する関数
/// この関数自体はisMarkedTextEnabledのチェックを行わない。
private func updateMarkedText() {
@MainActor private func updateMarkedText() {
let text = self.displayedLiveConversionText ?? self.composingText.convertTarget
let cursorPosition = self.displayedLiveConversionText.map(NSString.init(string:))?.length ?? NSString(string: String(self.composingText.convertTarget.prefix(self.composingText.convertTargetCursorPosition))).length
self.proxy?.setMarkedText(text, selectedRange: NSRange(location: cursorPosition, length: 0))
}

public func insertText(_ text: String) {
@MainActor public func insertText(_ text: String) {
guard !text.isEmpty else {
return
}
Expand All @@ -142,15 +142,15 @@ import UIKit
}

/// In-Keyboard TextFiledが用いられていても、そちらではない方に強制的に入力を行う関数
public func insertMainDisplayText(_ text: String) {
@MainActor public func insertMainDisplayText(_ text: String) {
guard !text.isEmpty else {
return
}
self.displayedTextProxy?.insertText(text)
self.textChangedCount += 1
}

public func moveCursor(count: Int) {
@MainActor public func moveCursor(count: Int) {
guard count != 0 else {
return
}
Expand All @@ -160,7 +160,7 @@ import UIKit
}

// ただ与えられた回数の削除を実行する関数
private func rawDeleteBackward(count: Int = 1) {
@MainActor private func rawDeleteBackward(count: Int = 1) {
guard count != 0 else {
return
}
Expand All @@ -172,7 +172,7 @@ import UIKit

// isComposingの場合、countはadjust済みであることを期待する
// されていなかった場合は例外を投げる
public func deleteBackward(count: Int) {
@MainActor public func deleteBackward(count: Int) {
if count == 0 {
return
}
Expand All @@ -186,7 +186,7 @@ import UIKit
// ただ与えられた回数の削除を入力方向に実行する関数
// カーソルが動かせない場合を検知するために工夫を入れている
// TODO: iOS16以降のテキストフィールドの仕様変更で動かなくなっている。直す必要があるが、どうしようもない気がしている。
private func rawDeleteForward(count: Int) {
@MainActor private func rawDeleteForward(count: Int) {
guard count != 0 else {
return
}
Expand All @@ -205,7 +205,7 @@ import UIKit

// isComposingの場合、countはadjust済みであることを期待する
// されていなかった場合は例外を投げる
public func deleteForward(count: Int = 1) {
@MainActor public func deleteForward(count: Int = 1) {
if count == 0 {
return
}
Expand All @@ -217,7 +217,7 @@ import UIKit
}

/// `composingText`を更新する
public func updateComposingText(composingText: ComposingText, newLiveConversionText: String?) {
@MainActor public func updateComposingText(composingText: ComposingText, newLiveConversionText: String?) {
if isMarkedTextEnabled {
self.composingText = composingText
self.displayedLiveConversionText = newLiveConversionText
Expand All @@ -244,7 +244,7 @@ import UIKit
}
}

public func updateComposingText(composingText: ComposingText, userMovedCount: Int, adjustedMovedCount: Int) -> Bool {
@MainActor public func updateComposingText(composingText: ComposingText, userMovedCount: Int, adjustedMovedCount: Int) -> Bool {
let delta = adjustedMovedCount - userMovedCount
self.composingText = composingText
if delta != 0 {
Expand All @@ -255,7 +255,7 @@ import UIKit
return false
}

public func updateComposingText(composingText: ComposingText, completedPrefix: String, isSelected: Bool) {
@MainActor public func updateComposingText(composingText: ComposingText, completedPrefix: String, isSelected: Bool) {
if isMarkedTextEnabled {
self.insertText(completedPrefix)
self.composingText = composingText
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import Foundation
import SwiftUtils
import SwiftUIUtils

/// 絵文字等のタブで、表示する文字に関する設定を記述する
public struct EmojiTabExpandModePreference: Codable, StaticInitialValueAvailable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//

import Foundation
import SwiftUtils
import SwiftUIUtils

public struct KeyboardInternalSettingManager: UserDefaultsManager {
public var userDefaults: UserDefaults
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import Foundation
import SwiftUI
import SwiftUtils
import SwiftUIUtils

public struct OneHandedModeSetting: Codable, StaticInitialValueAvailable {
public static let initialValue = Self()
Expand Down
Loading