Skip to content

Commit

Permalink
Merge branch 'master' into maintenance/idea-2024eap1
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom-Ski authored Feb 8, 2024
2 parents 105523d + 0e4b162 commit 3d99446
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,10 @@
*/
public class DeviceType implements Comparable<DeviceType> {
public static final String IOS_VERSION_PREFIX = "com.apple.CoreSimulator.SimRuntime.iOS-";
public static final String PREFERRED_IPHONE_SIM_NAME = "iPhone 8";
public static final String PREFERRED_IPHONE_SIM_NAME = "iPhone SE";
public static final String PREFERRED_IPAD_SIM_NAME = "iPad Air";

public static final String[] ONLY_32BIT_DEVICES = {"iPhone 4", "iPhone 4s", "iPhone 5", "iPhone 5c", "iPad 2"};
public static final Version ONLY_64BIT_IOS_VERSION = new Version(11, 0, 0);
public static final Version ARM64_IOS_VERSION = new Version(14, 0, 0);

public enum DeviceFamily {
Expand Down Expand Up @@ -309,7 +308,7 @@ public static DeviceType getBestDeviceType(Arch arch, DeviceFamily family,
// match for specified device
if (exact == null || (version == null && type.version.versionCode > exact.version.versionCode))
exact = type;
} else if (deviceName == null && type.getDeviceName().equals(preferredDeviceName)) {
} else if (deviceName == null && type.getDeviceName().startsWith(preferredDeviceName)) {
// match for preferable device
if (bestDefault == null || (version == null && type.version.versionCode > bestDefault.version.versionCode))
bestDefault = type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
</constraints>
<properties/>
</component>
<grid id="9763" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<grid id="9763" binding="errorsPanel" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="6" column="1" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ public class RoboVmIOSRunConfigurationSettingsEditor extends SettingsEditor<Robo
private JTextArea args;
private JCheckBox pairedWatch;
private JComboBox<IDeviceDecorator> targetDeviceUDID;
private JPanel errorsPanel;
private JTextPane errors;

// copy of data that is time consuming to fetch (fetched only once when dialog is created)
Expand All @@ -88,9 +89,9 @@ public class RoboVmIOSRunConfigurationSettingsEditor extends SettingsEditor<Robo
// true if editor internally updating data and listeners should ignore the events
private boolean updatingData;

private ArrayList<String> provisioningProfileErrors = new ArrayList<>();
private ArrayList<String> signingIdentityErrors = new ArrayList<>();
private ArrayList<String> deviceIdentityErrors = new ArrayList<>();
private final ArrayList<String> provisioningProfileErrors = new ArrayList<>();
private final ArrayList<String> signingIdentityErrors = new ArrayList<>();
private final ArrayList<String> deviceIdentityErrors = new ArrayList<>();
private IDevice.EventListener ideviceListener;

@NotNull
Expand Down Expand Up @@ -466,6 +467,7 @@ private void updatePairedWatch(boolean moduleChanged, Boolean valueToSet) {
private void updateErrors() {
if (provisioningProfileErrors.isEmpty() && signingIdentityErrors.isEmpty() && deviceIdentityErrors.isEmpty()) {
errors.setText("");
errorsPanel.setVisible(false);
return;
};

Expand Down Expand Up @@ -495,7 +497,7 @@ private void updateErrors() {
buffer.append("\n");
}
errors.setText(buffer.toString());

errorsPanel.setVisible(true);
}

private void checkSelectedProvisioningProfile () {
Expand Down Expand Up @@ -629,17 +631,23 @@ private boolean isProvisioningProfileValid (ProvisioningProfile profile, Config
provisioningProfileErrors.clear();
}

String appIdPrefix = profile.getAppIdPrefix();
String appId = profile.getAppId();
String appIdNoPrefix = appId.split(appIdPrefix + ".")[1];
String bundleId = bundleLabel.getText();
String candidateAppId = profile.getAppIdPrefix() + "." + bundleId;
String profileAppId = profile.getAppId();

boolean currentlyCompatible = true;
// check the id
boolean currentlyCompatible = profileAppId.equalsIgnoreCase(candidateAppId);
if (!currentlyCompatible){
// check for wildcard
if (profileAppId.endsWith(".*")) {
currentlyCompatible = candidateAppId.startsWith(profileAppId.substring(0, profileAppId.length() - 1));
}
}

//Check the id
if (!bundleLabel.getText().equalsIgnoreCase(appIdNoPrefix)) {
currentlyCompatible = false;
if (!currentlyCompatible) {
if (createErrorStrings) {
provisioningProfileErrors.add("Bundle ID from profile=[" + appIdNoPrefix + "] does not match module Bundle ID [" + bundleLabel.getText() + "]");
String profileAppIdNoPrefix = profileAppId.substring(profile.getAppIdPrefix() .length() + 1);
provisioningProfileErrors.add("Bundle ID from profile=[" + profileAppIdNoPrefix + "] does not match module Bundle ID [" + bundleId + "]");
}
}

Expand Down

0 comments on commit 3d99446

Please sign in to comment.