B4J Question Mac Store says app capturing key strokes

Markos

Active Member
Licensed User
Longtime User
Hi All,

Have you encountered and resolved these 2 issues when submitting to Mac Store..
1.

Guideline 2.3.8 - Performance


We noticed that your app name to be displayed on the App Store does not sufficiently match the name of the app displayed when installed on macOS.

App Store Connect Name: ProgwhizNotarizer
App Name when Installed: ProgwhizNotarizer
App Name when Launched: ProgwhizNotarizer
App Name in About/Quit Menu: com.progwhiz.notarizer.main

2.
Guideline 2.4.5(v) - Performance


Your app requests keystrokes access from the user during operation of launch of the app.

Next Steps

To resolve this issue, please confirm that you are using:

- NSEvent.addLocalMonitor

rather than

- CGEvent.TapCreate.

Additionally, you may want to confirm the app does not access the user’s keystrokes under Privacy.

Resources

An informational video concerning requesting access from users is available from our WWDC 2019 conference. See the Advances in macOS Security video.

The 2nd issue apparently is a new requirement for Catalina OSX
 
Last edited:

Markos

Active Member
Licensed User
Longtime User
Hi Erel,

That's great to hear for issue with Key strokes. I look forward to that revision of B4JPacker11 and other prerequisites like jdk14 on both the windows and Mac side.

On issue with class name and Doc Name I'm attaching the images to hopefully better state the anomally. This issue is one in which the Doc Name is showing Java, I can fix this by changing the Java executable to ProgramName, however the Class Name showing in the menu box supposed to show programname only. I tried and cannot be fixed with Java -Xdock:name=programname, however plz note the -Xdock:icon=iconname works still to change the icon (I didnt insert an image to reflect the icon compliance)

s1.jpg

s2.jpg
 
Last edited:
Upvote 0

Markos

Active Member
Licensed User
Longtime User
I found two suggestions to programatically achieve changing the Name in the submenu from class name to just program name via java code.

B4X:
System.setProperty("com.apple.mrj.application.apple.menu.about.name", "Alfabet"); Application.getApplication().setDockIconImage(icon); EventQueue.invokeLater(new Runnable() { @Override public void run()

The other is..

B4X:
private static final String APPLICATION_NAME = "Menu bar & dock demo";
private static final String APPLICATION_ICON = "/resources/app-icon.png";

/**
 * Launch the application.
 */
public static void main(String[] args) {
     if(OSXHelper.IS_MAC){
          // These calls must come before any AWT or Swing code is called,
          // otherwise the Mac menu bar will use the class name as the application name.
          System.setProperty("apple.laf.useScreenMenuBar", "true");
          OSXHelper.setMacMenuAboutNameAndDockIcon(args, APPLICATION_NAME, APPLICATION_ICON);
     }
    
     // Ok proceed with launch
     System.setProperty("java.net.preferIPv4Stack", "true");
    
     EventQueue.invokeLater(new Runnable() {
     public void run() {
               try {
                    Demo window = new Demo();
                    window.frame.setVisible(true);
               } catch (Exception e) {
                    e.printStackTrace()
               }
          }
     });
}
 
Upvote 0

Markos

Active Member
Licensed User
Longtime User
Yep set Bundle Name in info.plist. unfortunately that works for the App executable but then that launches Java in a shell which creates the separate Java dock and menu item. For which -Xdock:name supposed to do the trick but that no longer works. What I found online posted prior is the work around but via java code in the main class only.
 
Upvote 0

Markos

Active Member
Licensed User
Longtime User
Im sorry to confess I tried to do it the raw java code route but I lack the experience to produce the resultant jar file using the main.java produced by B4J I achieved producing the class files. Only someone of your experience can test this theory and know how to do it right.
I know in time it will be discovered by you and the team and we can then post many Apps priduced by b4j to Mac Store.
 
Upvote 0

Markos

Active Member
Licensed User
Longtime User
Dear Erel,

Where will we be notified of the update to B4J to support Java14/Javafx14

I tried using B4J with Jdk14/Javafx14 using the directory structure for your Jdk11 package and I got the following error when compiling

B4X:
B4J Version: 8.10
Java Version: 8
Parsing code.    (0.04s)
Building folders structure.    (0.01s)
Compiling code.    (0.04s)
    
ObfuscatorMap.txt file created in Objects folder.
Compiling layouts code.    (0.00s)
Organizing libraries.    (0.00s)
Compiling generated Java code.    Error
src\com\progwhiz\pdfmacviewer\main.java:17: error: package javafx.application does not exist
public class main extends javafx.application.Application{
                                            ^
1 error
only showing the first 1 errors, of 16 total; use -Xmaxerrs if you would like to see more

javac 14.0.1
 
Last edited:
Upvote 0
Top