Skip to content

Commit 66beb12

Browse files
committed
Merging dev into master
2 parents 1d7c550 + 702159b commit 66beb12

File tree

43 files changed

+328
-106
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+328
-106
lines changed

.circleci/config.yml

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
aliases:
22
# Docker image tags can be found here: https://circleci.com/developer/images/image/cimg/android
3-
- &cimg cimg/android:2022.09.2-node
3+
- &cimg cimg/android:2023.06.1-node
44
# Most used according to https://gs.statcounter.com/android-version-market-share/mobile-tablet/worldwide
55
- &default-api-level 30
66

@@ -48,7 +48,7 @@ aliases:
4848
command: |
4949
sudo npm i npm@latest -g
5050
sudo npm install -g shelljs@0.8.5
51-
sudo npm install -g cordova@8.1.2
51+
sudo npm install -g cordova@12.0.0
5252
sudo npm install -g typescript
5353
cordova telemetry off
5454
./install.sh
@@ -374,9 +374,11 @@ workflows:
374374
pattern: "^pull/\\d+$"
375375
value: << pipeline.git.branch >>
376376
jobs:
377-
- static-analysis
377+
- static-analysis:
378+
context: Android Unit Tests
378379
- run-tests:
379380
name: << matrix.lib >>
381+
context: Android Unit Tests
380382
matrix:
381383
parameters:
382384
lib: ["SalesforceAnalytics", "SalesforceSDK", "SmartStore", "MobileSync", "SalesforceHybrid", "SalesforceReact"]
@@ -401,12 +403,14 @@ workflows:
401403
jobs:
402404
- run-tests:
403405
name: << matrix.lib >> API << pipeline.parameters.api-level >>
406+
context: Android Unit Tests
404407
matrix:
405408
parameters:
406409
lib: ["SalesforceAnalytics", "SalesforceSDK", "SmartStore", "MobileSync", "SalesforceHybrid", "SalesforceReact"]
407410
api_level: [<< pipeline.parameters.api-level >>]
408411
- test-rest-explorer:
409412
name: RestExplorer API << pipeline.parameters.api-level >>
413+
context: Android Unit Tests
410414
matrix:
411415
parameters:
412416
api_level: [<< pipeline.parameters.api-level >>]

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ This pulls submodule dependencies from github.
2323
Introduction
2424
==
2525

26-
### What's New in 11.0.0
26+
### What's New in 11.1.0
2727
See [release notes](https://github.com/forcedotcom/SalesforceMobileSDK-Android/releases).
2828

2929
### Native Applications

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ buildscript {
1818

1919
allprojects {
2020
group = 'com.salesforce.mobilesdk'
21-
version = '11.0.0'
21+
version = '11.1.0'
2222
repositories {
2323
mavenLocal()
2424
maven {

external/shared

Submodule shared updated 34 files

hybrid/HybridSampleApps/NoteSync/src/com/salesforce/samples/notesync/ContentSoqlSyncDownTarget.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public ContentSoqlSyncDownTarget(JSONObject target) throws JSONException {
9797
@Override
9898
public JSONArray startFetch(SyncManager syncManager, long maxTimeStamp) throws IOException, JSONException {
9999
String queryToRun = maxTimeStamp > 0 ? SoqlSyncDownTarget.addFilterForReSync(getQuery(maxTimeStamp), getModificationDateFieldName(), maxTimeStamp) : getQuery(maxTimeStamp);
100-
syncManager.getRestClient().sendSync(RestRequest.getRequestForUserInfo()); // cheap call to refresh session
100+
syncManager.getRestClient().sendSync(RestRequest.getRequestForLimits(ApiVersionStrings.VERSION_NUMBER)); // cheap call to refresh session
101101
RestRequest request = buildQueryRequest(syncManager.getRestClient().getAuthToken(), queryToRun);
102102
RestResponse response = syncManager.sendSyncWithMobileSyncUserAgent(request);
103103
JSONArray records = parseSoapResponse(response);

libs/MobileSync/AndroidManifest.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22

33
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
4-
android:versionCode="80"
5-
android:versionName="11.0.0">
4+
android:versionCode="81"
5+
android:versionName="11.1.0.dev">
66

77
<application />
88

libs/MobileSync/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ android {
7676

7777
ext {
7878
PUBLISH_GROUP_ID = 'com.salesforce.mobilesdk'
79-
PUBLISH_VERSION = '11.0.0'
79+
PUBLISH_VERSION = '11.1.0'
8080
PUBLISH_ARTIFACT_ID = 'MobileSync'
8181
}
8282

libs/SalesforceAnalytics/AndroidManifest.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22

33
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
4-
android:versionCode="80"
5-
android:versionName="11.0.0">
4+
android:versionCode="81"
5+
android:versionName="11.1.0.dev">
66

77
<uses-permission android:name="android.permission.INTERNET" />
88
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

libs/SalesforceAnalytics/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ android {
6969

7070
ext {
7171
PUBLISH_GROUP_ID = 'com.salesforce.mobilesdk'
72-
PUBLISH_VERSION = '11.0.0'
72+
PUBLISH_VERSION = '11.1.0'
7373
PUBLISH_ARTIFACT_ID = 'SalesforceAnalytics'
7474
}
7575

libs/SalesforceAnalytics/src/com/salesforce/androidsdk/analytics/security/Encryptor.java

+4-5
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
import java.security.GeneralSecurityException;
4242
import java.security.InvalidAlgorithmParameterException;
4343
import java.security.InvalidKeyException;
44-
import java.security.NoSuchAlgorithmException;
4544
import java.security.PrivateKey;
4645
import java.security.PublicKey;
4746
import java.security.SecureRandom;
@@ -60,7 +59,6 @@ public class Encryptor {
6059
private static final String AES_CBC_CIPHER = "AES/CBC/PKCS5Padding";
6160
private static final String AES_GCM_CIPHER = "AES/GCM/NoPadding";
6261
private static final String MAC_TRANSFORMATION = "HmacSHA256";
63-
private static final String SHA1PRNG = "SHA1PRNG";
6462
private static final String RSA_PKCS1 = "RSA/ECB/PKCS1Padding";
6563
private static final String BOUNCY_CASTLE = "BC";
6664
private static final int READ_BUFFER_LENGTH = 1024;
@@ -72,7 +70,7 @@ public class Encryptor {
7270
* @return Initialized cipher.
7371
*/
7472
public static Cipher getEncryptingCipher(String encryptionKey)
75-
throws NoSuchAlgorithmException, InvalidAlgorithmParameterException, InvalidKeyException {
73+
throws InvalidAlgorithmParameterException, InvalidKeyException {
7674
final byte[] keyBytes = Base64.decode(encryptionKey, Base64.DEFAULT);
7775
return getEncryptingCipher(keyBytes, generateInitVector());
7876
}
@@ -534,8 +532,9 @@ private static byte[] decryptWithPrivateKey(PrivateKey privateKey, String data,
534532
return null;
535533
}
536534

537-
private static byte[] generateInitVector() throws NoSuchAlgorithmException {
538-
final SecureRandom random = SecureRandom.getInstance(SHA1PRNG);
535+
private static byte[] generateInitVector() {
536+
// Create the system recommended secure random number generator provider algorithm.
537+
final SecureRandom random = new SecureRandom();
539538
byte[] iv = new byte[12];
540539
random.nextBytes(iv);
541540
return iv;
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22

33
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
4-
android:versionCode="80"
5-
android:versionName="11.0.0">
4+
android:versionCode="81"
5+
android:versionName="11.1.0.dev">
66

77
<application />
88
</manifest>

libs/SalesforceHybrid/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ android {
7373

7474
ext {
7575
PUBLISH_GROUP_ID = 'com.salesforce.mobilesdk'
76-
PUBLISH_VERSION = '11.0.0'
76+
PUBLISH_VERSION = '11.1.0'
7777
PUBLISH_ARTIFACT_ID = 'SalesforceHybrid'
7878
}
7979

libs/SalesforceHybrid/res/xml/config.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<widget xmlns = "http://www.w3.org/ns/widgets"
33
id = "com.salesforce.androidsdk"
4-
version = "11.0.0">
4+
version = "11.1.0">
55

66
<content src="index.html" />
77

libs/SalesforceHybrid/src/com/salesforce/androidsdk/phonegap/ui/SalesforceDroidGapActivity.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import com.salesforce.androidsdk.config.LoginServerManager;
3838
import com.salesforce.androidsdk.phonegap.app.SalesforceHybridSDKManager;
3939
import com.salesforce.androidsdk.phonegap.util.SalesforceHybridLogger;
40+
import com.salesforce.androidsdk.rest.ApiVersionStrings;
4041
import com.salesforce.androidsdk.rest.ClientManager;
4142
import com.salesforce.androidsdk.rest.ClientManager.AccountInfoNotFoundException;
4243
import com.salesforce.androidsdk.rest.ClientManager.RestClientCallback;
@@ -349,7 +350,7 @@ public void authenticatedRestClient(RestClient client) {
349350
* but a stale session ID will cause the WebView to redirect
350351
* to the web login.
351352
*/
352-
SalesforceDroidGapActivity.this.client.sendAsync(RestRequest.getRequestForUserInfo(), new AsyncRequestCallback() {
353+
SalesforceDroidGapActivity.this.client.sendAsync(RestRequest.getRequestForLimits(ApiVersionStrings.VERSION_NUMBER), new AsyncRequestCallback() {
353354

354355
@Override
355356
public void onSuccess(RestRequest request, RestResponse response) {
@@ -422,7 +423,7 @@ public void authenticatedRestClient(RestClient client) {
422423
});
423424
return;
424425
}
425-
client.sendAsync(RestRequest.getRequestForUserInfo(), new AsyncRequestCallback() {
426+
client.sendAsync(RestRequest.getRequestForLimits(ApiVersionStrings.VERSION_NUMBER), new AsyncRequestCallback() {
426427

427428
@Override
428429
public void onSuccess(RestRequest request, RestResponse response) {
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22

33
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
4-
android:versionCode="80"
5-
android:versionName="11.0.0">
4+
android:versionCode="81"
5+
android:versionName="11.1.0.dev">
66

77
<application />
88
</manifest>

libs/SalesforceReact/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ afterEvaluate {
124124

125125
ext {
126126
PUBLISH_GROUP_ID = 'com.salesforce.mobilesdk'
127-
PUBLISH_VERSION = '11.0.0'
127+
PUBLISH_VERSION = '11.1.0'
128128
PUBLISH_ARTIFACT_ID = 'SalesforceReact'
129129
}
130130

libs/SalesforceReact/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "SalesforceReact",
3-
"version": "11.0.0",
3+
"version": "11.1.0",
44
"private": true,
55
"scripts": {
66
"start": "node node_modules/react-native/local-cli/cli.js start"
@@ -9,7 +9,7 @@
99
"create-react-class": "^15.7.0",
1010
"react": "18.1.0",
1111
"react-native": "0.70.6",
12-
"react-native-force": "git+https://github.com/forcedotcom/SalesforceMobileSDK-ReactNative.git#v11.0.0"
12+
"react-native-force": "git+https://github.com/forcedotcom/SalesforceMobileSDK-ReactNative.git#dev"
1313
},
1414
"devDependencies": {
1515
"@babel/core": "^7.12.9",

libs/SalesforceSDK/AndroidManifest.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
44
xmlns:tools="http://schemas.android.com/tools"
5-
android:versionCode="80"
6-
android:versionName="11.0.0">
5+
android:versionCode="81"
6+
android:versionName="11.1.0.dev">
77

88
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
99
<uses-permission android:name="android.permission.GET_ACCOUNTS" />

libs/SalesforceSDK/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ android {
7777

7878
ext {
7979
PUBLISH_GROUP_ID = 'com.salesforce.mobilesdk'
80-
PUBLISH_VERSION = '11.0.0'
80+
PUBLISH_VERSION = '11.1.0'
8181
PUBLISH_ARTIFACT_ID = 'SalesforceSDK'
8282
}
8383

libs/SalesforceSDK/res/values/sf__strings.xml

+6-5
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
<string name="sf__pick_server">Change Server</string>
2525
<string name="sf__clear_cookies">Clear Cookies</string>
2626
<string name="sf__reload">Reload</string>
27-
<string name="sf__launch_idp">Login with IDP App</string>
28-
<string name="sf__login_with_biometric">Login with Biometric</string>
27+
<string name="sf__launch_idp">Log In with IDP App</string>
28+
<string name="sf__login_with_biometric">Log In with Biometric</string>
2929
<string name="sf__setup_biometric_unlock">Setup Biometric Unlock</string>
3030

3131
<!-- Server picker -->
@@ -50,19 +50,20 @@
5050
<string name="sf__account_selector_text">Select an account to use</string>
5151

5252
<!-- SP status updates -->
53+
<string name="sf__failed_to_send_request_to_idp">Failed to send request to IDP app</string>
5354
<string name="sf__login_request_sent_to_idp">Login request sent to IDP app</string>
5455
<string name="sf__auth_code_received_from_idp">IDP app successfully obtained authorization code</string>
5556
<string name="sf__error_received_from_idp">IDP app failed to obtain authorization code</string>
5657
<string name="sf__failed_to_exchange_authorization_code">Failed to exchange authorization code</string>
57-
<string name="sf__login_complete">Login complete</string>
58+
<string name="sf__login_complete">Log in complete</string>
5859

5960
<!-- IDP status updates -->
6061
<string name="sf__login_request_sent_to_sp">Login request sent to SP app</string>
6162
<string name="sf__getting_auth_code_from_server">Getting authorization code for SP app</string>
6263
<string name="sf__failed_to_get_authorization_code">Failed to get authorization code for SP app</string>
6364
<string name="sf__auth_code_sent_to_sp">Authorization code sent to SP app</string>
6465
<string name="sf__error_received_from_sp">SP app failed to exchange authorization code</string>
65-
<string name="sf__sp_login_complete">SP app login complete</string>
66+
<string name="sf__sp_login_complete">SP app log in complete</string>
6667

6768
<!-- Managed app restrictions -->
6869
<string name="sf__app_service_hosts_description">Used to specify login hosts for the application.</string>
@@ -90,7 +91,7 @@
9091

9192
<!-- Biometric Authentication Opt In Dialog -->
9293
<string name="sf__biometric_opt_in_title">Biometric Login</string>
93-
<string name="sf__biometric_opt_in_message">Use your fingerprint to quickly login. Biometric information is never stored.</string>
94+
<string name="sf__biometric_opt_in_message">Use your fingerprint to quickly log in. Biometric information is never stored.</string>
9495
<string name="sf__biometric_opt_in_approve">Enable</string>
9596
<string name="sf__biometric_opt_in_deny">Use Password</string>
9697
<string name="sf__biometric_signout_user">Signing out %s.</string>

libs/SalesforceSDK/src/com/salesforce/androidsdk/app/SalesforceSDKManager.java

+28-1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
import android.webkit.CookieManager;
4949

5050
import androidx.annotation.NonNull;
51+
import androidx.annotation.Nullable;
5152
import androidx.lifecycle.Lifecycle;
5253
import androidx.lifecycle.LifecycleObserver;
5354
import androidx.lifecycle.OnLifecycleEvent;
@@ -100,6 +101,7 @@
100101
import java.util.SortedSet;
101102
import java.util.UUID;
102103
import java.util.concurrent.ConcurrentSkipListSet;
104+
import java.util.regex.Pattern;
103105

104106
/**
105107
* This class serves as an interface to the various
@@ -114,7 +116,7 @@ public class SalesforceSDKManager implements LifecycleObserver {
114116
/**
115117
* Current version of this SDK.
116118
*/
117-
public static final String SDK_VERSION = "11.0.0";
119+
public static final String SDK_VERSION = "11.1.0.dev";
118120

119121
/**
120122
* Intent action meant for instances of SalesforceSDKManager residing in other processes
@@ -181,6 +183,9 @@ public class SalesforceSDKManager implements LifecycleObserver {
181183
private boolean useWebServerAuthentication = true; // web server flow ON by default - but app can opt out by calling setUseWebServerAuthentication(false)
182184

183185
private boolean useHybridAuthentication = true; // hybrid authentication flows ON by default - but app can opt out by calling setUseHybridAuthentication(false)
186+
187+
private Pattern customDomainInferencePattern;
188+
184189
private Theme theme = Theme.SYSTEM_DEFAULT;
185190
private String appName;
186191

@@ -672,6 +677,28 @@ public synchronized void setUseHybridAuthentication(boolean useHybridAuthenticat
672677
this.useHybridAuthentication = useHybridAuthentication;
673678
}
674679

680+
/**
681+
* Returns the pattern used to detect the use of "Use Custom Domain" input from login web view.
682+
*
683+
* @return pattern if set or null
684+
*/
685+
public synchronized Pattern getCustomDomainInferencePattern() {
686+
return customDomainInferencePattern;
687+
}
688+
689+
/**
690+
* Detect use of "Use Custom Domain" input from login web view using the given regex.
691+
* Example for a specific org:
692+
* "^https:\\/\\/mobilesdk\\.my\\.salesforce\\.com\\/\\?startURL=%2Fsetup%2Fsecur%2FRemoteAccessAuthorizationPage\\.apexp"
693+
* For any my domain:
694+
* "^https:\\/\\/[a-zA-Z0-9]+\\.my\\.salesforce\\.com/\\?startURL=%2Fsetup%2Fsecur%2FRemoteAccessAuthorizationPage\\.apexp"
695+
*
696+
* @param pattern regex to use when detecting use of custom domain on login
697+
*/
698+
public synchronized void setCustomDomainInferencePattern(@Nullable Pattern pattern) {
699+
this.customDomainInferencePattern = pattern;
700+
}
701+
675702
/**
676703
* Returns whether the IDP login flow is enabled.
677704
*

libs/SalesforceSDK/src/com/salesforce/androidsdk/auth/idp/IDPAuthCodeHelper.kt

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import com.salesforce.androidsdk.app.SalesforceSDKManager
3939
import com.salesforce.androidsdk.auth.OAuth2.getAuthorizationUrl
4040
import com.salesforce.androidsdk.auth.OAuth2.getFrontdoorUrl
4141
import com.salesforce.androidsdk.config.BootConfig
42+
import com.salesforce.androidsdk.rest.ApiVersionStrings
4243
import com.salesforce.androidsdk.rest.ClientManager
4344
import com.salesforce.androidsdk.rest.RestClient
4445
import com.salesforce.androidsdk.rest.RestRequest
@@ -119,7 +120,7 @@ internal class IDPAuthCodeHelper private constructor(
119120
SalesforceSDKLogger.d(TAG, "Obtaining valid access token")
120121
buildRestClient()?.let {restClient ->
121122
val restResponse = try {
122-
restClient.sendSync(RestRequest.getRequestForUserInfo())
123+
restClient.sendSync(RestRequest.getRequestForLimits(ApiVersionStrings.VERSION_NUMBER))
123124
} catch (e: IOException) {
124125
SalesforceSDKLogger.e(TAG, "Failed to obtain valid access token", e)
125126
null

0 commit comments

Comments
 (0)