Commit graph

386 commits

Author SHA1 Message Date
Darcy Wong
84d2aa6539
Merge pull request #3977 from keymanapp/chore/mac/history-stable-13
chore(mac/resources): Catch up mac history for 13.0 releases
2020-11-27 12:36:30 +07:00
Marc Durdin
ab0ed0c614 chore: address review comments 2020-11-27 15:58:21 +11:00
Darcy Wong
02843d1aaf chore(mac/resources): Catch up mac history for 13.0 releases 2020-11-27 11:29:45 +07:00
Marc Durdin
737ff45952 chore(mac): englishspanish test keyboard 2020-11-27 15:19:32 +11:00
Marc Durdin
5bcbcb260f
Merge pull request #3961 from keymanapp/fix/mac/2488-duplicate-package-filenames
fix(mac): Handle duplicate filenames for packages
2020-11-27 13:13:58 +11:00
Marc Durdin
be544f49a7 fix(mac): Handle duplicate filenames for packages
If multiple copies of a package are saved by a browser, the browser will
typically append a ` (#)` to the filename, where `#` is a number. This
should be stripped off before installation to prevent duplicates of the
package being installed.

Fixes #2488.
2020-11-26 14:44:38 +11:00
Marc Durdin
9757e4330b fix(mac): improve robustness of altool call
Handles temporary failures calling altool where Apple servers return
"Could not find the RequestUUID" for a few minutes post-upload.

Example log we are handling:

```
[04:50:44][Step 5/5] Zipping Keyman.app for notarization to /Users/mcdurdin/buildAgent/work/99b311828f4ee7c/keyman/mac/Keyman4MacIM/build/Release/Keyman.zip
[04:50:44][Step 5/5] Uploading Keyman.zip to Apple for notarization
[04:51:23][Step 5/5] <?xml version="1.0" encoding="UTF-8"?>
[04:51:23][Step 5/5] <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
[04:51:23][Step 5/5] <plist version="1.0">
[04:51:23][Step 5/5] <dict>
[04:51:23][Step 5/5] 	<key>notarization-upload</key>
[04:51:23][Step 5/5] 	<dict>
[04:51:23][Step 5/5] 		<key>RequestUUID</key>
[04:51:23][Step 5/5] 		<string>fd45e30c-5a96-4d02-9196-0923d4e5e90f</string>
[04:51:23][Step 5/5] 	</dict>
[04:51:23][Step 5/5] 	<key>os-version</key>
[04:51:23][Step 5/5] 	<string>10.15.3</string>
[04:51:23][Step 5/5] 	<key>success-message</key>
[04:51:23][Step 5/5] 	<string>No errors uploading '/Users/mcdurdin/buildAgent/work/99b311828f4ee7c/keyman/mac/Keyman4MacIM/build/Release/Keyman.zip'.</string>
[04:51:23][Step 5/5] 	<key>tool-path</key>
[04:51:23][Step 5/5] 	<string>/Applications/Xcode.app/Contents/SharedFrameworks/ContentDeliveryServices.framework/Versions/A/Frameworks/AppStoreService.framework</string>
[04:51:23][Step 5/5] 	<key>tool-version</key>
[04:51:23][Step 5/5] 	<string>4.01.1182</string>
[04:51:23][Step 5/5] </dict>
[04:51:23][Step 5/5] </plist>
[04:51:23][Step 5/5]
[04:51:23][Step 5/5] Waiting 30 seconds for status
[04:51:55][Step 5/5] <?xml version="1.0" encoding="UTF-8"?>
[04:51:55][Step 5/5] <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
[04:51:55][Step 5/5] <plist version="1.0">
[04:51:55][Step 5/5] <dict>
[04:51:55][Step 5/5] 	<key>os-version</key>
[04:51:55][Step 5/5] 	<string>10.15.3</string>
[04:51:55][Step 5/5] 	<key>product-errors</key>
[04:51:55][Step 5/5] 	<array>
[04:51:55][Step 5/5] 		<dict>
[04:51:55][Step 5/5] 			<key>code</key>
[04:51:55][Step 5/5] 			<integer>1519</integer>
[04:51:55][Step 5/5] 			<key>message</key>
[04:51:55][Step 5/5] 			<string>Could not find the RequestUUID.</string>
[04:51:55][Step 5/5] 			<key>userInfo</key>
[04:51:55][Step 5/5] 			<dict>
[04:51:55][Step 5/5] 				<key>NSLocalizedDescription</key>
[04:51:55][Step 5/5] 				<string>Could not find the RequestUUID.</string>
[04:51:55][Step 5/5] 				<key>NSLocalizedFailureReason</key>
[04:51:55][Step 5/5] 				<string>Apple Services operation failed.</string>
[04:51:55][Step 5/5] 				<key>NSLocalizedRecoverySuggestion</key>
[04:51:55][Step 5/5] 				<string>Could not find the RequestUUID.</string>
[04:51:55][Step 5/5] 			</dict>
[04:51:55][Step 5/5] 		</dict>
[04:51:55][Step 5/5] 	</array>
[04:51:55][Step 5/5] 	<key>tool-path</key>
[04:51:55][Step 5/5] 	<string>/Applications/Xcode.app/Contents/SharedFrameworks/ContentDeliveryServices.framework/Versions/A/Frameworks/AppStoreService.framework</string>
[04:51:55][Step 5/5] 	<key>tool-version</key>
[04:51:55][Step 5/5] 	<string>4.01.1182</string>
[04:51:55][Step 5/5] </dict>
[04:51:55][Step 5/5] </plist>
[04:51:55][Step 5/5]
[04:51:55][Step 5/5] altool failed with code 1
```
2020-11-26 11:53:35 +11:00
Marc Durdin
0981473514 chore(mac): fix iso section key code 2020-11-25 18:56:23 +11:00
Marc Durdin
01b192796a feat(mac): user-controllable legacy app list
Fixes #1953.

Makes it possible to specify additional apps that need 'legacy' handling
without requiring an updated build of Keyman for Mac. The list should be
stored in user defaults under the `KMLegacyApps` key. It can be viewed
with the command:

```
defaults read keyman.inputmethod.Keyman KMLegacyApps
```

And updated with

```
defaults write keyman.inputmethod.Keyman KMLegacyApps -array value1 value2 ...
defaults write keyman.inputmethod.Keyman KMLegacyApps -array-add value1 value2 ...
```

Each entry should be a regex that matches the client app id.

For example:

```
defaults write keyman.inputmethod.Keyman KMLegacyApps -array com.microsoft.Word '^com.github.atom$'
```

(Note for purity, the `.` should be escaped in the regex but it'll
actually be fine without...)

This commit also adds the `keymanDataPath` method on
`KMInputMethodAppDelegate`, so we can place additional configuration
data there in the future (as opposed to in the shared config which is
less easy for users to edit.)
2020-11-25 16:56:52 +11:00
Marc Durdin
daff70bebf fix(mac): arrow keys now reset context
Fixes #3939.

Arrow keys, function keys and a handful of other keys should trigger a
context reload (for legacy apps, that means a context flush). This means
that deadkeys are also flushed when any of these keys are pressed, in
the same way as a Command key or a mouse click already did.
2020-11-25 13:15:12 +11:00
Marc Durdin
6a4038497b
Merge pull request #3944 from keymanapp/fix/mac/3935-legacy-mode-for-java
fix(mac): turn on legacy mode for Java apps
2020-11-25 12:50:03 +11:00
Marc Durdin
44399fc594
Merge pull request #3924 from keymanapp/feat/mac/2601-support-102nd-key
feat(mac): Add support for "ISO" keyboard layouts
2020-11-25 12:49:53 +11:00
Marc Durdin
506a2b52f3
Merge pull request #3933 from keymanapp/fix/mac/nsstring-to-nsurl
fix(mac/engine): wrong variable type
2020-11-25 12:49:31 +11:00
Marc Durdin
0f831f7df7
Merge pull request #3932 from keymanapp/fix/mac/build-sign-post-tweaking-plist
fix(mac): re-sign files post plist update
2020-11-25 12:49:19 +11:00
Marc Durdin
044631cd54 fix(mac): turn on legacy mode for Java apps
Relates to #3935.

This switches Java apps into legacy mode. However, Java itself will need
patching to support Keyman, as it makes assumptions about input methods,
including matching specific input methods by name, before enabling its
complex text support.

I am in process of submitting a bug report and may try and submit a
patch (although the process seems a little convoluted). It requires a
change to a single file, AWTView.m, with the following diff (against
JDK 16.0):

diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m b/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m
index 3e80b5a6cf3..2ae1f4f3f12 100644
--- a/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m
+++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m
@@ -263,6 +263,16 @@ - (void) keyDown: (NSEvent *)event {
     fProcessingKeystroke = YES;
     fKeyEventsNeeded = YES;

+    if([(NSString *)kbdLayout containsString:@"keyman"]) {
+        // Keyman handles all key events; none should be
+        // passed through as default before Keyman processes them
+        fKeyEventsNeeded = NO;
+    }
     // Allow TSM to look at the event and potentially send back NSTextInputClient messages.
     [self interpretKeyEvents:[NSArray arrayWithObject:event]];

@@ -960,7 +989,9 @@ - (void) insertText:(id)aString replacementRange:(NSRange)replacementRange

     if ((utf16Length > 2) ||
         ((utf8Length > 1) && [self isCodePointInUnicodeBlockNeedingIMEvent:codePoint]) ||
-        ((codePoint == 0x5c) && ([(NSString *)kbdLayout containsString:@"Kotoeri"]))) {
+        ((codePoint == 0x5c) && ([(NSString *)kbdLayout containsString:@"Kotoeri"])) ||
+        ([(NSString *)kbdLayout containsString:@"keyman"])
+        ) {
         aStringIsComplex = YES;
     }
2020-11-25 09:59:10 +11:00
Marc Durdin
d849c532de chore(mac): address review comments
* Make less WET
* Add comments
* Fix mixed up key labels
2020-11-24 08:27:37 +11:00
Marc Durdin
c8000c2d9c chore: cleanup 2020-11-24 08:24:30 +11:00
Marc Durdin
e32ab796bd feat(mac): Add support for "ISO" keyboard layouts
Fixes #2601.

This PR adds support for the 102nd key as found on European layouts. It
does not however reshape the Enter key and move the BKSLASH key, as that
is a much bigger job; functionally this makes it possible to press the
102nd key, which was the biggest gap.
2020-11-24 08:24:30 +11:00
Marc Durdin
b4f08b3604 chore: fix parameters 2020-11-24 08:10:50 +11:00
Marc Durdin
f692af2545 chore: fix test 2020-11-24 08:08:33 +11:00
Marc Durdin
258fed6511 fix: wrong variable type 2020-11-24 08:04:30 +11:00
Marc Durdin
e41df6f838 fix(mac): re-sign files post plist update
Cleans up a bunch of bits and pieces around the build process and makes
sure that files are re-signed after we update the Info.plist file.
2020-11-24 08:02:16 +11:00
Marc Durdin
960a04d450
Merge pull request #3880 from keymanapp/docs/mac-readme-refresh
Update README.md
2020-11-24 06:39:37 +11:00
Marc Durdin
fe7709b8e0
Update README.md 2020-11-23 18:56:09 +11:00
Marc Durdin
e1627260f3 chore(mac): use new keyboard install page
Fixes #3898.

This reworks the keyboard download window to use the new keyboard
install page and url pattern. Some refactoring of the downloadKeyboard
method was required to handle the new download patterns.
2020-11-20 13:39:12 +11:00
Marc Durdin
c2401514cb fix(mac): support page and copyright
Fixes #3849.

* Uses keyman-staging.com when on alpha or beta
* Updates copyright year at build time
* Fixes link to help documentation (/mac, not /macosx)
2020-11-20 05:55:53 +11:00
Marc Durdin
590f7782cc chore: fix command order 2020-11-19 10:32:07 +11:00
Marc Durdin
da8dbc59fb fix(mac): codesign resilience
This PR tries to make codesign more resilient to failure, by retrying
a build step that falls over with code 65. This code is not limited to
codesign but most frequently happens with it.

A more complete answer would be to do the codesigning step in build.sh
instead of in the project, which would give us more control of the
outcome, and maybe simplify the build process somewhat, but I will
leave that for now, because it is usually better to leave that to XCode.
2020-11-19 10:24:36 +11:00
Marc Durdin
66601f5f91 fix(mac): add icon for Keyman.app
Fixes #2717.
2020-11-19 10:08:35 +11:00
Marc Durdin
be8738e9b4 chore(mac): rewrite plists after build
Instead of updating the source plist files with version information,
do this on the built artifacts so that the source files do not get
continually clobbered.
2020-11-19 09:38:32 +11:00
Marc Durdin
c8070718d9 chore: fixup plists 2020-11-19 09:07:54 +11:00
Marc Durdin
d98f042e4b chore: fix podfile for tests 2020-11-19 08:51:33 +11:00
Marc Durdin
c20cd9e20f chore: add library to tests 2020-11-19 06:03:19 +11:00
Marc Durdin
ea86ce0fbe chore: typo 2020-11-18 20:18:43 +11:00
Marc Durdin
bede3948d2 feat(mac): Sentry support
I wasn't going to do this, but realised that crash reporting was going
to be a problem on mac because it still used crashlytics/fabric. Turned
out to be a good exercise to get me back into macOS world, and fairly
straightforward to get right (helps that the other platforms broke the
ice for me).
2020-11-18 17:13:20 +11:00
Marc Durdin
105ae22a63
Update README.md 2020-11-18 11:35:30 +11:00
Marc Durdin
8db88d72ee
Update README.md 2020-11-18 10:59:19 +11:00
Marc Durdin
cda1978567
Update README.md 2020-11-18 10:14:28 +11:00
jahorton
7e10c56354 docs(common): requested comment tweaks 2020-11-17 09:57:31 +07:00
jahorton
ad6489d9d3 chore(common): adds requested comments re: tentative META flag 2020-11-17 09:42:28 +07:00
Marc Durdin
066e9aa8a8 fix(mac): altool second call report ci errors 2020-06-22 11:32:15 +10:00
Marc Durdin
7c46e02907 fix(mac/resources): altool is failing but we lose the log in CI 2020-06-22 08:30:52 +10:00
Marc Durdin
15231a0bac fix(mac): invalid build script params removed
I accidentally pulled old parameters into mac/build.sh for the
make-km-dmg.sh script when merging from beta. The script no longer
requires `-version`. This fixes that.
2020-02-17 14:58:45 +11:00
Marc Durdin
255e4f4b7a chore: Merge branch 'master' into chore/beta-to-master-p9s2-1 2020-02-17 10:11:15 +11:00
Marc Durdin
4bd777a210
Update .gitignore 2020-02-14 13:27:41 +11:00
Marc Durdin
06063199c0 fix(mac): attempt multiple times to detach dmg in build 2020-02-14 11:50:35 +11:00
Marc Durdin
4281b72b26 chore(mac): Merge branch 'beta' into fix/mac/install-fails-with-quarantine 2020-02-14 11:26:43 +11:00
Marc Durdin
ad99c6c687 fix(mac): build installer from source
The installer did not work on downlevel versions
of macOS as the compile in Script Editor produced
a 10.15-compatible version. Now we build the app
directly from source with osacompile and bundle
that instead.
2020-02-14 10:05:24 +11:00
Marc Durdin
9f9ca35e09
Update history.md 2020-02-14 08:33:33 +11:00
Marc Durdin
348f39d4a2 fix(mac): support older macos in installer 2020-02-14 08:29:54 +11:00