react-native-stallion 2.4.3-alpha.1 → 2.4.3-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -4,7 +4,6 @@ import android.content.Context;
|
|
|
4
4
|
import android.content.SharedPreferences;
|
|
5
5
|
import android.content.pm.PackageInfo;
|
|
6
6
|
import android.content.res.Resources;
|
|
7
|
-
import android.provider.Settings;
|
|
8
7
|
|
|
9
8
|
import org.json.JSONException;
|
|
10
9
|
import org.json.JSONObject;
|
|
@@ -53,7 +52,7 @@ public class StallionConfig {
|
|
|
53
52
|
);
|
|
54
53
|
this.publicSigningKey = stallionPublicKeyRes != 0 ? context.getString(stallionPublicKeyRes) : "";
|
|
55
54
|
|
|
56
|
-
// get or generate UID
|
|
55
|
+
// get or generate UID (random install-scoped UUID)
|
|
57
56
|
String cachedUniqueId = sharedPreferences.getString(
|
|
58
57
|
StallionConfigConstants.UNIQUE_ID_IDENTIFIER,
|
|
59
58
|
""
|
|
@@ -61,14 +60,7 @@ public class StallionConfig {
|
|
|
61
60
|
if(!cachedUniqueId.isEmpty()) {
|
|
62
61
|
this.uid = cachedUniqueId;
|
|
63
62
|
} else {
|
|
64
|
-
|
|
65
|
-
this.uid = Settings.Secure.getString(
|
|
66
|
-
context.getContentResolver(),
|
|
67
|
-
Settings.Secure.ANDROID_ID
|
|
68
|
-
);
|
|
69
|
-
} catch (Exception ignored) {
|
|
70
|
-
this.uid = UUID.randomUUID().toString();
|
|
71
|
-
}
|
|
63
|
+
this.uid = UUID.randomUUID().toString();
|
|
72
64
|
SharedPreferences.Editor editor = sharedPreferences.edit();
|
|
73
65
|
editor.putString(StallionConfigConstants.UNIQUE_ID_IDENTIFIER, this.uid);
|
|
74
66
|
editor.apply();
|
|
@@ -23,16 +23,12 @@
|
|
|
23
23
|
_lastUnverifiedHash = [defaults stringForKey:LAST_UNVERIFIED_KEY_IDENTIFIER] ?: @"";
|
|
24
24
|
_baseUrl = [defaults stringForKey:BASE_URL_IDENTIFIER] ?: @"";
|
|
25
25
|
|
|
26
|
+
// get or generate UID (random install-scoped UUID)
|
|
26
27
|
NSString *cachedUid = [defaults stringForKey:UNIQUE_ID_IDENTIFIER];
|
|
27
28
|
if (cachedUid && ![cachedUid isEqualToString:@""]) {
|
|
28
29
|
_uid = cachedUid;
|
|
29
30
|
} else {
|
|
30
|
-
NSString *newUid =
|
|
31
|
-
if ([UIDevice currentDevice].identifierForVendor) {
|
|
32
|
-
newUid = [UIDevice currentDevice].identifierForVendor.UUIDString;
|
|
33
|
-
} else {
|
|
34
|
-
newUid = [[NSUUID UUID] UUIDString];
|
|
35
|
-
}
|
|
31
|
+
NSString *newUid = [[NSUUID UUID] UUIDString];
|
|
36
32
|
[defaults setObject:newUid forKey:UNIQUE_ID_IDENTIFIER];
|
|
37
33
|
[defaults synchronize];
|
|
38
34
|
_uid = newUid;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-stallion",
|
|
3
|
-
"version": "2.4.3-alpha.
|
|
3
|
+
"version": "2.4.3-alpha.2",
|
|
4
4
|
"description": "Official React Native OTA updates SDK — CodePush alternative with patch updates, rollback, and bundle signing.",
|
|
5
5
|
"main": "src/index",
|
|
6
6
|
"types": "types/index.d.ts",
|