securiti-consent-sdk 1.132.0
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.
- package/NitroSecuritiConsentSdk.podspec +37 -0
- package/README.md +45 -0
- package/android/CMakeLists.txt +29 -0
- package/android/build.gradle +146 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/cpp/cpp-adapter.cpp +6 -0
- package/android/src/main/java/com/margelo/nitro/securiticonsentsdk/HybridConsentSDK.kt +669 -0
- package/android/src/main/java/com/margelo/nitro/securiticonsentsdk/NitroSecuritiConsentSdkPackage.java +33 -0
- package/ios/Bridge.h +10 -0
- package/ios/HybridConsentSDK.swift +640 -0
- package/nitrogen/generated/.gitattributes +1 -0
- package/nitrogen/generated/android/NitroSecuritiConsentSdk+autolinking.cmake +78 -0
- package/nitrogen/generated/android/NitroSecuritiConsentSdk+autolinking.gradle +27 -0
- package/nitrogen/generated/android/NitroSecuritiConsentSdkOnLoad.cpp +48 -0
- package/nitrogen/generated/android/NitroSecuritiConsentSdkOnLoad.hpp +25 -0
- package/nitrogen/generated/android/c++/JAppPermission.hpp +86 -0
- package/nitrogen/generated/android/c++/JBannerConfig.hpp +194 -0
- package/nitrogen/generated/android/c++/JCmpSDKOptions.hpp +94 -0
- package/nitrogen/generated/android/c++/JCustomColors.hpp +82 -0
- package/nitrogen/generated/android/c++/JFunc_void_bool.hpp +74 -0
- package/nitrogen/generated/android/c++/JHybridConsentSDKSpec.cpp +277 -0
- package/nitrogen/generated/android/c++/JHybridConsentSDKSpec.hpp +78 -0
- package/nitrogen/generated/android/c++/JPermissionConsent.hpp +61 -0
- package/nitrogen/generated/android/c++/JPostConsentsRequest.hpp +137 -0
- package/nitrogen/generated/android/c++/JPurpose.hpp +118 -0
- package/nitrogen/generated/android/c++/JPurposeConsent.hpp +65 -0
- package/nitrogen/generated/android/c++/JSDK.hpp +104 -0
- package/nitrogen/generated/android/c++/JSettingsPrompt.hpp +88 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/AppPermission.kt +34 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/BannerConfig.kt +57 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/CmpSDKOptions.kt +36 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/CustomColors.kt +33 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/Func_void_bool.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/HybridConsentSDKSpec.kt +121 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/NitroSecuritiConsentSdkOnLoad.kt +35 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/PermissionConsent.kt +28 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/PostConsentsRequest.kt +37 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/Purpose.kt +37 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/PurposeConsent.kt +29 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/SDK.kt +34 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/SettingsPrompt.kt +30 -0
- package/nitrogen/generated/ios/NitroSecuritiConsentSdk+autolinking.rb +60 -0
- package/nitrogen/generated/ios/NitroSecuritiConsentSdk-Swift-Cxx-Bridge.cpp +96 -0
- package/nitrogen/generated/ios/NitroSecuritiConsentSdk-Swift-Cxx-Bridge.hpp +604 -0
- package/nitrogen/generated/ios/NitroSecuritiConsentSdk-Swift-Cxx-Umbrella.hpp +78 -0
- package/nitrogen/generated/ios/NitroSecuritiConsentSdkAutolinking.mm +33 -0
- package/nitrogen/generated/ios/NitroSecuritiConsentSdkAutolinking.swift +25 -0
- package/nitrogen/generated/ios/c++/HybridConsentSDKSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridConsentSDKSpecSwift.hpp +223 -0
- package/nitrogen/generated/ios/swift/AppPermission.swift +267 -0
- package/nitrogen/generated/ios/swift/BannerConfig.swift +918 -0
- package/nitrogen/generated/ios/swift/CmpSDKOptions.swift +217 -0
- package/nitrogen/generated/ios/swift/CustomColors.swift +256 -0
- package/nitrogen/generated/ios/swift/Func_void_bool.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__optional_BannerConfig_.swift +52 -0
- package/nitrogen/generated/ios/swift/Func_void_std__optional_SettingsPrompt_.swift +52 -0
- package/nitrogen/generated/ios/swift/Func_void_std__string.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_AppPermission_.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_Purpose_.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_SDK_.swift +46 -0
- package/nitrogen/generated/ios/swift/HybridConsentSDKSpec.swift +64 -0
- package/nitrogen/generated/ios/swift/HybridConsentSDKSpec_cxx.swift +398 -0
- package/nitrogen/generated/ios/swift/PermissionConsent.swift +57 -0
- package/nitrogen/generated/ios/swift/PostConsentsRequest.swift +216 -0
- package/nitrogen/generated/ios/swift/Purpose.swift +354 -0
- package/nitrogen/generated/ios/swift/PurposeConsent.swift +68 -0
- package/nitrogen/generated/ios/swift/SDK.swift +285 -0
- package/nitrogen/generated/ios/swift/SettingsPrompt.swift +181 -0
- package/nitrogen/generated/shared/c++/AppPermission.hpp +102 -0
- package/nitrogen/generated/shared/c++/BannerConfig.hpp +197 -0
- package/nitrogen/generated/shared/c++/CmpSDKOptions.hpp +110 -0
- package/nitrogen/generated/shared/c++/CustomColors.hpp +98 -0
- package/nitrogen/generated/shared/c++/HybridConsentSDKSpec.cpp +37 -0
- package/nitrogen/generated/shared/c++/HybridConsentSDKSpec.hpp +102 -0
- package/nitrogen/generated/shared/c++/PermissionConsent.hpp +77 -0
- package/nitrogen/generated/shared/c++/PostConsentsRequest.hpp +120 -0
- package/nitrogen/generated/shared/c++/Purpose.hpp +117 -0
- package/nitrogen/generated/shared/c++/PurposeConsent.hpp +81 -0
- package/nitrogen/generated/shared/c++/SDK.hpp +103 -0
- package/nitrogen/generated/shared/c++/SettingsPrompt.hpp +87 -0
- package/package.json +107 -0
- package/react-native.config.js +16 -0
- package/src/ConsentSDK.nitro.ts +232 -0
- package/src/index.ts +133 -0
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JPurpose.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "Purpose.hpp"
|
|
12
|
+
|
|
13
|
+
#include "JSDK.hpp"
|
|
14
|
+
#include "SDK.hpp"
|
|
15
|
+
#include <optional>
|
|
16
|
+
#include <string>
|
|
17
|
+
#include <vector>
|
|
18
|
+
|
|
19
|
+
namespace margelo::nitro::securiticonsentsdk {
|
|
20
|
+
|
|
21
|
+
using namespace facebook;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* The C++ JNI bridge between the C++ struct "Purpose" and the the Kotlin data class "Purpose".
|
|
25
|
+
*/
|
|
26
|
+
struct JPurpose final: public jni::JavaClass<JPurpose> {
|
|
27
|
+
public:
|
|
28
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/securiticonsentsdk/Purpose;";
|
|
29
|
+
|
|
30
|
+
public:
|
|
31
|
+
/**
|
|
32
|
+
* Convert this Java/Kotlin-based struct to the C++ struct Purpose by copying all values to C++.
|
|
33
|
+
*/
|
|
34
|
+
[[maybe_unused]]
|
|
35
|
+
[[nodiscard]]
|
|
36
|
+
Purpose toCpp() const {
|
|
37
|
+
static const auto clazz = javaClassStatic();
|
|
38
|
+
static const auto fieldPurposeId = clazz->getField<jni::JDouble>("purposeId");
|
|
39
|
+
jni::local_ref<jni::JDouble> purposeId = this->getFieldValue(fieldPurposeId);
|
|
40
|
+
static const auto fieldPurposeName = clazz->getField<jni::JString>("purposeName");
|
|
41
|
+
jni::local_ref<jni::JString> purposeName = this->getFieldValue(fieldPurposeName);
|
|
42
|
+
static const auto fieldPurposeDescription = clazz->getField<jni::JString>("purposeDescription");
|
|
43
|
+
jni::local_ref<jni::JString> purposeDescription = this->getFieldValue(fieldPurposeDescription);
|
|
44
|
+
static const auto fieldSdks = clazz->getField<jni::JArrayClass<JSDK>>("sdks");
|
|
45
|
+
jni::local_ref<jni::JArrayClass<JSDK>> sdks = this->getFieldValue(fieldSdks);
|
|
46
|
+
static const auto fieldConsentStatus = clazz->getField<jni::JString>("consentStatus");
|
|
47
|
+
jni::local_ref<jni::JString> consentStatus = this->getFieldValue(fieldConsentStatus);
|
|
48
|
+
static const auto fieldDisableOptOut = clazz->getField<jni::JBoolean>("disableOptOut");
|
|
49
|
+
jni::local_ref<jni::JBoolean> disableOptOut = this->getFieldValue(fieldDisableOptOut);
|
|
50
|
+
static const auto fieldOptOutText = clazz->getField<jni::JString>("optOutText");
|
|
51
|
+
jni::local_ref<jni::JString> optOutText = this->getFieldValue(fieldOptOutText);
|
|
52
|
+
static const auto fieldHideDetails = clazz->getField<jni::JBoolean>("hideDetails");
|
|
53
|
+
jni::local_ref<jni::JBoolean> hideDetails = this->getFieldValue(fieldHideDetails);
|
|
54
|
+
static const auto fieldIsGADMapped = clazz->getField<jni::JBoolean>("isGADMapped");
|
|
55
|
+
jni::local_ref<jni::JBoolean> isGADMapped = this->getFieldValue(fieldIsGADMapped);
|
|
56
|
+
static const auto fieldGadDescription = clazz->getField<jni::JString>("gadDescription");
|
|
57
|
+
jni::local_ref<jni::JString> gadDescription = this->getFieldValue(fieldGadDescription);
|
|
58
|
+
static const auto fieldIsATTMapped = clazz->getField<jni::JBoolean>("isATTMapped");
|
|
59
|
+
jni::local_ref<jni::JBoolean> isATTMapped = this->getFieldValue(fieldIsATTMapped);
|
|
60
|
+
static const auto fieldAttDescription = clazz->getField<jni::JString>("attDescription");
|
|
61
|
+
jni::local_ref<jni::JString> attDescription = this->getFieldValue(fieldAttDescription);
|
|
62
|
+
return Purpose(
|
|
63
|
+
purposeId != nullptr ? std::make_optional(purposeId->value()) : std::nullopt,
|
|
64
|
+
purposeName != nullptr ? std::make_optional(purposeName->toStdString()) : std::nullopt,
|
|
65
|
+
purposeDescription != nullptr ? std::make_optional(purposeDescription->toStdString()) : std::nullopt,
|
|
66
|
+
sdks != nullptr ? std::make_optional([&]() {
|
|
67
|
+
size_t __size = sdks->size();
|
|
68
|
+
std::vector<SDK> __vector;
|
|
69
|
+
__vector.reserve(__size);
|
|
70
|
+
for (size_t __i = 0; __i < __size; __i++) {
|
|
71
|
+
auto __element = sdks->getElement(__i);
|
|
72
|
+
__vector.push_back(__element->toCpp());
|
|
73
|
+
}
|
|
74
|
+
return __vector;
|
|
75
|
+
}()) : std::nullopt,
|
|
76
|
+
consentStatus != nullptr ? std::make_optional(consentStatus->toStdString()) : std::nullopt,
|
|
77
|
+
disableOptOut != nullptr ? std::make_optional(static_cast<bool>(disableOptOut->value())) : std::nullopt,
|
|
78
|
+
optOutText != nullptr ? std::make_optional(optOutText->toStdString()) : std::nullopt,
|
|
79
|
+
hideDetails != nullptr ? std::make_optional(static_cast<bool>(hideDetails->value())) : std::nullopt,
|
|
80
|
+
isGADMapped != nullptr ? std::make_optional(static_cast<bool>(isGADMapped->value())) : std::nullopt,
|
|
81
|
+
gadDescription != nullptr ? std::make_optional(gadDescription->toStdString()) : std::nullopt,
|
|
82
|
+
isATTMapped != nullptr ? std::make_optional(static_cast<bool>(isATTMapped->value())) : std::nullopt,
|
|
83
|
+
attDescription != nullptr ? std::make_optional(attDescription->toStdString()) : std::nullopt
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
public:
|
|
88
|
+
/**
|
|
89
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
90
|
+
*/
|
|
91
|
+
[[maybe_unused]]
|
|
92
|
+
static jni::local_ref<JPurpose::javaobject> fromCpp(const Purpose& value) {
|
|
93
|
+
return newInstance(
|
|
94
|
+
value.purposeId.has_value() ? jni::JDouble::valueOf(value.purposeId.value()) : nullptr,
|
|
95
|
+
value.purposeName.has_value() ? jni::make_jstring(value.purposeName.value()) : nullptr,
|
|
96
|
+
value.purposeDescription.has_value() ? jni::make_jstring(value.purposeDescription.value()) : nullptr,
|
|
97
|
+
value.sdks.has_value() ? [&]() {
|
|
98
|
+
size_t __size = value.sdks.value().size();
|
|
99
|
+
jni::local_ref<jni::JArrayClass<JSDK>> __array = jni::JArrayClass<JSDK>::newArray(__size);
|
|
100
|
+
for (size_t __i = 0; __i < __size; __i++) {
|
|
101
|
+
const auto& __element = value.sdks.value()[__i];
|
|
102
|
+
__array->setElement(__i, *JSDK::fromCpp(__element));
|
|
103
|
+
}
|
|
104
|
+
return __array;
|
|
105
|
+
}() : nullptr,
|
|
106
|
+
value.consentStatus.has_value() ? jni::make_jstring(value.consentStatus.value()) : nullptr,
|
|
107
|
+
value.disableOptOut.has_value() ? jni::JBoolean::valueOf(value.disableOptOut.value()) : nullptr,
|
|
108
|
+
value.optOutText.has_value() ? jni::make_jstring(value.optOutText.value()) : nullptr,
|
|
109
|
+
value.hideDetails.has_value() ? jni::JBoolean::valueOf(value.hideDetails.value()) : nullptr,
|
|
110
|
+
value.isGADMapped.has_value() ? jni::JBoolean::valueOf(value.isGADMapped.value()) : nullptr,
|
|
111
|
+
value.gadDescription.has_value() ? jni::make_jstring(value.gadDescription.value()) : nullptr,
|
|
112
|
+
value.isATTMapped.has_value() ? jni::JBoolean::valueOf(value.isATTMapped.value()) : nullptr,
|
|
113
|
+
value.attDescription.has_value() ? jni::make_jstring(value.attDescription.value()) : nullptr
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
} // namespace margelo::nitro::securiticonsentsdk
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JPurposeConsent.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "PurposeConsent.hpp"
|
|
12
|
+
|
|
13
|
+
#include <string>
|
|
14
|
+
|
|
15
|
+
namespace margelo::nitro::securiticonsentsdk {
|
|
16
|
+
|
|
17
|
+
using namespace facebook;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The C++ JNI bridge between the C++ struct "PurposeConsent" and the the Kotlin data class "PurposeConsent".
|
|
21
|
+
*/
|
|
22
|
+
struct JPurposeConsent final: public jni::JavaClass<JPurposeConsent> {
|
|
23
|
+
public:
|
|
24
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/securiticonsentsdk/PurposeConsent;";
|
|
25
|
+
|
|
26
|
+
public:
|
|
27
|
+
/**
|
|
28
|
+
* Convert this Java/Kotlin-based struct to the C++ struct PurposeConsent by copying all values to C++.
|
|
29
|
+
*/
|
|
30
|
+
[[maybe_unused]]
|
|
31
|
+
[[nodiscard]]
|
|
32
|
+
PurposeConsent toCpp() const {
|
|
33
|
+
static const auto clazz = javaClassStatic();
|
|
34
|
+
static const auto fieldPurposeID = clazz->getField<double>("purposeID");
|
|
35
|
+
double purposeID = this->getFieldValue(fieldPurposeID);
|
|
36
|
+
static const auto fieldConsentStatus = clazz->getField<jni::JString>("consentStatus");
|
|
37
|
+
jni::local_ref<jni::JString> consentStatus = this->getFieldValue(fieldConsentStatus);
|
|
38
|
+
static const auto fieldTimestamp = clazz->getField<double>("timestamp");
|
|
39
|
+
double timestamp = this->getFieldValue(fieldTimestamp);
|
|
40
|
+
static const auto fieldIsEssential = clazz->getField<jboolean>("isEssential");
|
|
41
|
+
jboolean isEssential = this->getFieldValue(fieldIsEssential);
|
|
42
|
+
return PurposeConsent(
|
|
43
|
+
purposeID,
|
|
44
|
+
consentStatus->toStdString(),
|
|
45
|
+
timestamp,
|
|
46
|
+
static_cast<bool>(isEssential)
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
public:
|
|
51
|
+
/**
|
|
52
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
53
|
+
*/
|
|
54
|
+
[[maybe_unused]]
|
|
55
|
+
static jni::local_ref<JPurposeConsent::javaobject> fromCpp(const PurposeConsent& value) {
|
|
56
|
+
return newInstance(
|
|
57
|
+
value.purposeID,
|
|
58
|
+
jni::make_jstring(value.consentStatus),
|
|
59
|
+
value.timestamp,
|
|
60
|
+
value.isEssential
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
} // namespace margelo::nitro::securiticonsentsdk
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JSDK.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "SDK.hpp"
|
|
12
|
+
|
|
13
|
+
#include <optional>
|
|
14
|
+
#include <string>
|
|
15
|
+
#include <vector>
|
|
16
|
+
|
|
17
|
+
namespace margelo::nitro::securiticonsentsdk {
|
|
18
|
+
|
|
19
|
+
using namespace facebook;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The C++ JNI bridge between the C++ struct "SDK" and the the Kotlin data class "SDK".
|
|
23
|
+
*/
|
|
24
|
+
struct JSDK final: public jni::JavaClass<JSDK> {
|
|
25
|
+
public:
|
|
26
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/securiticonsentsdk/SDK;";
|
|
27
|
+
|
|
28
|
+
public:
|
|
29
|
+
/**
|
|
30
|
+
* Convert this Java/Kotlin-based struct to the C++ struct SDK by copying all values to C++.
|
|
31
|
+
*/
|
|
32
|
+
[[maybe_unused]]
|
|
33
|
+
[[nodiscard]]
|
|
34
|
+
SDK toCpp() const {
|
|
35
|
+
static const auto clazz = javaClassStatic();
|
|
36
|
+
static const auto fieldSdkId = clazz->getField<jni::JDouble>("sdkId");
|
|
37
|
+
jni::local_ref<jni::JDouble> sdkId = this->getFieldValue(fieldSdkId);
|
|
38
|
+
static const auto fieldNamespaceId = clazz->getField<jni::JString>("namespaceId");
|
|
39
|
+
jni::local_ref<jni::JString> namespaceId = this->getFieldValue(fieldNamespaceId);
|
|
40
|
+
static const auto fieldSdkName = clazz->getField<jni::JString>("sdkName");
|
|
41
|
+
jni::local_ref<jni::JString> sdkName = this->getFieldValue(fieldSdkName);
|
|
42
|
+
static const auto fieldSdkDescription = clazz->getField<jni::JString>("sdkDescription");
|
|
43
|
+
jni::local_ref<jni::JString> sdkDescription = this->getFieldValue(fieldSdkDescription);
|
|
44
|
+
static const auto fieldVendor = clazz->getField<jni::JString>("vendor");
|
|
45
|
+
jni::local_ref<jni::JString> vendor = this->getFieldValue(fieldVendor);
|
|
46
|
+
static const auto fieldLogoBase64 = clazz->getField<jni::JString>("logoBase64");
|
|
47
|
+
jni::local_ref<jni::JString> logoBase64 = this->getFieldValue(fieldLogoBase64);
|
|
48
|
+
static const auto fieldWebsite = clazz->getField<jni::JString>("website");
|
|
49
|
+
jni::local_ref<jni::JString> website = this->getFieldValue(fieldWebsite);
|
|
50
|
+
static const auto fieldMatchedBy = clazz->getField<jni::JArrayClass<jni::JString>>("matchedBy");
|
|
51
|
+
jni::local_ref<jni::JArrayClass<jni::JString>> matchedBy = this->getFieldValue(fieldMatchedBy);
|
|
52
|
+
static const auto fieldCollectingData = clazz->getField<jni::JBoolean>("collectingData");
|
|
53
|
+
jni::local_ref<jni::JBoolean> collectingData = this->getFieldValue(fieldCollectingData);
|
|
54
|
+
return SDK(
|
|
55
|
+
sdkId != nullptr ? std::make_optional(sdkId->value()) : std::nullopt,
|
|
56
|
+
namespaceId != nullptr ? std::make_optional(namespaceId->toStdString()) : std::nullopt,
|
|
57
|
+
sdkName != nullptr ? std::make_optional(sdkName->toStdString()) : std::nullopt,
|
|
58
|
+
sdkDescription != nullptr ? std::make_optional(sdkDescription->toStdString()) : std::nullopt,
|
|
59
|
+
vendor != nullptr ? std::make_optional(vendor->toStdString()) : std::nullopt,
|
|
60
|
+
logoBase64 != nullptr ? std::make_optional(logoBase64->toStdString()) : std::nullopt,
|
|
61
|
+
website != nullptr ? std::make_optional(website->toStdString()) : std::nullopt,
|
|
62
|
+
matchedBy != nullptr ? std::make_optional([&]() {
|
|
63
|
+
size_t __size = matchedBy->size();
|
|
64
|
+
std::vector<std::string> __vector;
|
|
65
|
+
__vector.reserve(__size);
|
|
66
|
+
for (size_t __i = 0; __i < __size; __i++) {
|
|
67
|
+
auto __element = matchedBy->getElement(__i);
|
|
68
|
+
__vector.push_back(__element->toStdString());
|
|
69
|
+
}
|
|
70
|
+
return __vector;
|
|
71
|
+
}()) : std::nullopt,
|
|
72
|
+
collectingData != nullptr ? std::make_optional(static_cast<bool>(collectingData->value())) : std::nullopt
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
public:
|
|
77
|
+
/**
|
|
78
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
79
|
+
*/
|
|
80
|
+
[[maybe_unused]]
|
|
81
|
+
static jni::local_ref<JSDK::javaobject> fromCpp(const SDK& value) {
|
|
82
|
+
return newInstance(
|
|
83
|
+
value.sdkId.has_value() ? jni::JDouble::valueOf(value.sdkId.value()) : nullptr,
|
|
84
|
+
value.namespaceId.has_value() ? jni::make_jstring(value.namespaceId.value()) : nullptr,
|
|
85
|
+
value.sdkName.has_value() ? jni::make_jstring(value.sdkName.value()) : nullptr,
|
|
86
|
+
value.sdkDescription.has_value() ? jni::make_jstring(value.sdkDescription.value()) : nullptr,
|
|
87
|
+
value.vendor.has_value() ? jni::make_jstring(value.vendor.value()) : nullptr,
|
|
88
|
+
value.logoBase64.has_value() ? jni::make_jstring(value.logoBase64.value()) : nullptr,
|
|
89
|
+
value.website.has_value() ? jni::make_jstring(value.website.value()) : nullptr,
|
|
90
|
+
value.matchedBy.has_value() ? [&]() {
|
|
91
|
+
size_t __size = value.matchedBy.value().size();
|
|
92
|
+
jni::local_ref<jni::JArrayClass<jni::JString>> __array = jni::JArrayClass<jni::JString>::newArray(__size);
|
|
93
|
+
for (size_t __i = 0; __i < __size; __i++) {
|
|
94
|
+
const auto& __element = value.matchedBy.value()[__i];
|
|
95
|
+
__array->setElement(__i, *jni::make_jstring(__element));
|
|
96
|
+
}
|
|
97
|
+
return __array;
|
|
98
|
+
}() : nullptr,
|
|
99
|
+
value.collectingData.has_value() ? jni::JBoolean::valueOf(value.collectingData.value()) : nullptr
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
} // namespace margelo::nitro::securiticonsentsdk
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JSettingsPrompt.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "SettingsPrompt.hpp"
|
|
12
|
+
|
|
13
|
+
#include <optional>
|
|
14
|
+
#include <string>
|
|
15
|
+
#include <vector>
|
|
16
|
+
|
|
17
|
+
namespace margelo::nitro::securiticonsentsdk {
|
|
18
|
+
|
|
19
|
+
using namespace facebook;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The C++ JNI bridge between the C++ struct "SettingsPrompt" and the the Kotlin data class "SettingsPrompt".
|
|
23
|
+
*/
|
|
24
|
+
struct JSettingsPrompt final: public jni::JavaClass<JSettingsPrompt> {
|
|
25
|
+
public:
|
|
26
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/securiticonsentsdk/SettingsPrompt;";
|
|
27
|
+
|
|
28
|
+
public:
|
|
29
|
+
/**
|
|
30
|
+
* Convert this Java/Kotlin-based struct to the C++ struct SettingsPrompt by copying all values to C++.
|
|
31
|
+
*/
|
|
32
|
+
[[maybe_unused]]
|
|
33
|
+
[[nodiscard]]
|
|
34
|
+
SettingsPrompt toCpp() const {
|
|
35
|
+
static const auto clazz = javaClassStatic();
|
|
36
|
+
static const auto fieldPromptHeading = clazz->getField<jni::JString>("promptHeading");
|
|
37
|
+
jni::local_ref<jni::JString> promptHeading = this->getFieldValue(fieldPromptHeading);
|
|
38
|
+
static const auto fieldPromptMessage = clazz->getField<jni::JString>("promptMessage");
|
|
39
|
+
jni::local_ref<jni::JString> promptMessage = this->getFieldValue(fieldPromptMessage);
|
|
40
|
+
static const auto fieldSettingsButtonText = clazz->getField<jni::JString>("settingsButtonText");
|
|
41
|
+
jni::local_ref<jni::JString> settingsButtonText = this->getFieldValue(fieldSettingsButtonText);
|
|
42
|
+
static const auto fieldNotNowButtonText = clazz->getField<jni::JString>("notNowButtonText");
|
|
43
|
+
jni::local_ref<jni::JString> notNowButtonText = this->getFieldValue(fieldNotNowButtonText);
|
|
44
|
+
static const auto fieldPermissions = clazz->getField<jni::JArrayClass<jni::JString>>("permissions");
|
|
45
|
+
jni::local_ref<jni::JArrayClass<jni::JString>> permissions = this->getFieldValue(fieldPermissions);
|
|
46
|
+
return SettingsPrompt(
|
|
47
|
+
promptHeading != nullptr ? std::make_optional(promptHeading->toStdString()) : std::nullopt,
|
|
48
|
+
promptMessage != nullptr ? std::make_optional(promptMessage->toStdString()) : std::nullopt,
|
|
49
|
+
settingsButtonText != nullptr ? std::make_optional(settingsButtonText->toStdString()) : std::nullopt,
|
|
50
|
+
notNowButtonText != nullptr ? std::make_optional(notNowButtonText->toStdString()) : std::nullopt,
|
|
51
|
+
permissions != nullptr ? std::make_optional([&]() {
|
|
52
|
+
size_t __size = permissions->size();
|
|
53
|
+
std::vector<std::string> __vector;
|
|
54
|
+
__vector.reserve(__size);
|
|
55
|
+
for (size_t __i = 0; __i < __size; __i++) {
|
|
56
|
+
auto __element = permissions->getElement(__i);
|
|
57
|
+
__vector.push_back(__element->toStdString());
|
|
58
|
+
}
|
|
59
|
+
return __vector;
|
|
60
|
+
}()) : std::nullopt
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
public:
|
|
65
|
+
/**
|
|
66
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
67
|
+
*/
|
|
68
|
+
[[maybe_unused]]
|
|
69
|
+
static jni::local_ref<JSettingsPrompt::javaobject> fromCpp(const SettingsPrompt& value) {
|
|
70
|
+
return newInstance(
|
|
71
|
+
value.promptHeading.has_value() ? jni::make_jstring(value.promptHeading.value()) : nullptr,
|
|
72
|
+
value.promptMessage.has_value() ? jni::make_jstring(value.promptMessage.value()) : nullptr,
|
|
73
|
+
value.settingsButtonText.has_value() ? jni::make_jstring(value.settingsButtonText.value()) : nullptr,
|
|
74
|
+
value.notNowButtonText.has_value() ? jni::make_jstring(value.notNowButtonText.value()) : nullptr,
|
|
75
|
+
value.permissions.has_value() ? [&]() {
|
|
76
|
+
size_t __size = value.permissions.value().size();
|
|
77
|
+
jni::local_ref<jni::JArrayClass<jni::JString>> __array = jni::JArrayClass<jni::JString>::newArray(__size);
|
|
78
|
+
for (size_t __i = 0; __i < __size; __i++) {
|
|
79
|
+
const auto& __element = value.permissions.value()[__i];
|
|
80
|
+
__array->setElement(__i, *jni::make_jstring(__element));
|
|
81
|
+
}
|
|
82
|
+
return __array;
|
|
83
|
+
}() : nullptr
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
} // namespace margelo::nitro::securiticonsentsdk
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/AppPermission.kt
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// AppPermission.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.securiticonsentsdk
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
import com.margelo.nitro.core.*
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Represents the JavaScript object/struct "AppPermission".
|
|
16
|
+
*/
|
|
17
|
+
@DoNotStrip
|
|
18
|
+
@Keep
|
|
19
|
+
data class AppPermission
|
|
20
|
+
@DoNotStrip
|
|
21
|
+
@Keep
|
|
22
|
+
constructor(
|
|
23
|
+
val id: Double?,
|
|
24
|
+
val name: String?,
|
|
25
|
+
val permissionId: String?,
|
|
26
|
+
val description: String?,
|
|
27
|
+
val group: String?,
|
|
28
|
+
val groupId: Double?,
|
|
29
|
+
val consentStatus: String?,
|
|
30
|
+
val nameMap: String?,
|
|
31
|
+
val isSettingsPromptEnabled: Boolean?
|
|
32
|
+
) {
|
|
33
|
+
/* main constructor */
|
|
34
|
+
}
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/BannerConfig.kt
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// BannerConfig.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.securiticonsentsdk
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
import com.margelo.nitro.core.*
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Represents the JavaScript object/struct "BannerConfig".
|
|
16
|
+
*/
|
|
17
|
+
@DoNotStrip
|
|
18
|
+
@Keep
|
|
19
|
+
data class BannerConfig
|
|
20
|
+
@DoNotStrip
|
|
21
|
+
@Keep
|
|
22
|
+
constructor(
|
|
23
|
+
val hideCloseButton: Boolean?,
|
|
24
|
+
val hideAcceptButton: Boolean?,
|
|
25
|
+
val embedDSRPortalLink: Boolean?,
|
|
26
|
+
val recordConsentUponAppStart: Boolean?,
|
|
27
|
+
val hideToggleForEssentialCategories: Boolean?,
|
|
28
|
+
val name: String?,
|
|
29
|
+
val dsrPortalLink: String?,
|
|
30
|
+
val complianceType: String?,
|
|
31
|
+
val bannerReappearanceTime: String?,
|
|
32
|
+
val privacyNoticeLink: String?,
|
|
33
|
+
val accept: String?,
|
|
34
|
+
val reject: String?,
|
|
35
|
+
val bannerText: String?,
|
|
36
|
+
val bannerHeading: String?,
|
|
37
|
+
val sdkTabHeading: String?,
|
|
38
|
+
val privacyNoticeText: String?,
|
|
39
|
+
val preferenceCenterLink: String?,
|
|
40
|
+
val permissionsTabHeading: String?,
|
|
41
|
+
val permissionsTabGuidance: String?,
|
|
42
|
+
val preferenceCenterHeading: String?,
|
|
43
|
+
val preferenceCenterGuidance: String?,
|
|
44
|
+
val permissionsTabDescription: String?,
|
|
45
|
+
val preferenceCenterDescription: String?,
|
|
46
|
+
val showPoweredBySecuritiLogo: Boolean?,
|
|
47
|
+
val showDescriptionTextWithPrefCenterToggle: Boolean?,
|
|
48
|
+
val paletteTheme: Double?,
|
|
49
|
+
val bannerPosition: String?,
|
|
50
|
+
val buttonShape: String?,
|
|
51
|
+
val companyLogo: String?,
|
|
52
|
+
val customPaletteTheme: CustomColors?,
|
|
53
|
+
val shouldShowSettingsPrompt: Boolean?,
|
|
54
|
+
val translations: Map<String, String>?
|
|
55
|
+
) {
|
|
56
|
+
/* main constructor */
|
|
57
|
+
}
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/CmpSDKOptions.kt
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// CmpSDKOptions.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.securiticonsentsdk
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
import com.margelo.nitro.core.*
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Represents the JavaScript object/struct "CmpSDKOptions".
|
|
16
|
+
*/
|
|
17
|
+
@DoNotStrip
|
|
18
|
+
@Keep
|
|
19
|
+
data class CmpSDKOptions
|
|
20
|
+
@DoNotStrip
|
|
21
|
+
@Keep
|
|
22
|
+
constructor(
|
|
23
|
+
val appURL: String,
|
|
24
|
+
val cdnURL: String,
|
|
25
|
+
val tenantID: String,
|
|
26
|
+
val appID: String,
|
|
27
|
+
val testingMode: Boolean,
|
|
28
|
+
val loggerLevel: String,
|
|
29
|
+
val consentsCheckInterval: Double,
|
|
30
|
+
val subjectId: String?,
|
|
31
|
+
val languageCode: String?,
|
|
32
|
+
val locationCode: String?,
|
|
33
|
+
val mode: String?
|
|
34
|
+
) {
|
|
35
|
+
/* main constructor */
|
|
36
|
+
}
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/CustomColors.kt
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// CustomColors.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.securiticonsentsdk
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
import com.margelo.nitro.core.*
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Represents the JavaScript object/struct "CustomColors".
|
|
16
|
+
*/
|
|
17
|
+
@DoNotStrip
|
|
18
|
+
@Keep
|
|
19
|
+
data class CustomColors
|
|
20
|
+
@DoNotStrip
|
|
21
|
+
@Keep
|
|
22
|
+
constructor(
|
|
23
|
+
val buttonBackground: String?,
|
|
24
|
+
val buttonText: String?,
|
|
25
|
+
val buttonBorder: String?,
|
|
26
|
+
val bannerBackground: String?,
|
|
27
|
+
val bannerText: String?,
|
|
28
|
+
val bannerLinks: String?,
|
|
29
|
+
val preferenceCenterFooterBackground: String?,
|
|
30
|
+
val preferenceCenterFooterSelector: String?
|
|
31
|
+
) {
|
|
32
|
+
/* main constructor */
|
|
33
|
+
}
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/Func_void_bool.kt
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Func_void_bool.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.securiticonsentsdk
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.jni.HybridData
|
|
12
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
13
|
+
import com.margelo.nitro.core.*
|
|
14
|
+
import dalvik.annotation.optimization.FastNative
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Represents the JavaScript callback `(isReady: boolean) => void`.
|
|
18
|
+
* This can be either implemented in C++ (in which case it might be a callback coming from JS),
|
|
19
|
+
* or in Kotlin/Java (in which case it is a native callback).
|
|
20
|
+
*/
|
|
21
|
+
@DoNotStrip
|
|
22
|
+
@Keep
|
|
23
|
+
@Suppress("ClassName", "RedundantUnitReturnType")
|
|
24
|
+
fun interface Func_void_bool: (Boolean) -> Unit {
|
|
25
|
+
/**
|
|
26
|
+
* Call the given JS callback.
|
|
27
|
+
* @throws Throwable if the JS function itself throws an error, or if the JS function/runtime has already been deleted.
|
|
28
|
+
*/
|
|
29
|
+
@DoNotStrip
|
|
30
|
+
@Keep
|
|
31
|
+
override fun invoke(isReady: Boolean): Unit
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Represents the JavaScript callback `(isReady: boolean) => void`.
|
|
36
|
+
* This is implemented in C++, via a `std::function<...>`.
|
|
37
|
+
* The callback might be coming from JS.
|
|
38
|
+
*/
|
|
39
|
+
@DoNotStrip
|
|
40
|
+
@Keep
|
|
41
|
+
@Suppress(
|
|
42
|
+
"KotlinJniMissingFunction", "unused",
|
|
43
|
+
"RedundantSuppression", "RedundantUnitReturnType", "FunctionName",
|
|
44
|
+
"ConvertSecondaryConstructorToPrimary", "ClassName", "LocalVariableName",
|
|
45
|
+
)
|
|
46
|
+
class Func_void_bool_cxx: Func_void_bool {
|
|
47
|
+
@DoNotStrip
|
|
48
|
+
@Keep
|
|
49
|
+
private val mHybridData: HybridData
|
|
50
|
+
|
|
51
|
+
@DoNotStrip
|
|
52
|
+
@Keep
|
|
53
|
+
private constructor(hybridData: HybridData) {
|
|
54
|
+
mHybridData = hybridData
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
@DoNotStrip
|
|
58
|
+
@Keep
|
|
59
|
+
override fun invoke(isReady: Boolean): Unit
|
|
60
|
+
= invoke_cxx(isReady)
|
|
61
|
+
|
|
62
|
+
@FastNative
|
|
63
|
+
private external fun invoke_cxx(isReady: Boolean): Unit
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Represents the JavaScript callback `(isReady: boolean) => void`.
|
|
68
|
+
* This is implemented in Java/Kotlin, via a `(Boolean) -> Unit`.
|
|
69
|
+
* The callback is always coming from native.
|
|
70
|
+
*/
|
|
71
|
+
@DoNotStrip
|
|
72
|
+
@Keep
|
|
73
|
+
@Suppress("ClassName", "RedundantUnitReturnType", "unused")
|
|
74
|
+
class Func_void_bool_java(private val function: (Boolean) -> Unit): Func_void_bool {
|
|
75
|
+
@DoNotStrip
|
|
76
|
+
@Keep
|
|
77
|
+
override fun invoke(isReady: Boolean): Unit {
|
|
78
|
+
return this.function(isReady)
|
|
79
|
+
}
|
|
80
|
+
}
|