Skip to content

Commit 755b820

Browse files
authored
Merge branch 'main' into lucianopa/build-win-fix
2 parents 0c41a33 + 3f160f9 commit 755b820

File tree

9 files changed

+68
-13
lines changed

9 files changed

+68
-13
lines changed

lib/android_build/maesdk/src/main/java/com/microsoft/applications/events/Sanitizer.java

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,18 @@ public class Sanitizer {
1818
* 1 = SitePathStrict (enables strict site path analysis)
1919
* 2 = SitePathLoose (enables loose site path analysis)
2020
* Multiple flags can be combined with bitwise OR (e.g., 1 | 2 = 3)
21+
* @param sendConcernLimit Maximum number of concerns to send.
22+
* @param insertWarningAtProblemLocation Insert warnings at problem location (true) or prepend (false).
2123
* @return true if initialization was successful, false otherwise.
2224
*/
23-
private static native boolean nativeInitialize(long loggerNativePtr,
25+
private static native boolean nativeInitialize(long loggerNativePtr,
2426
String notificationEventName,
25-
boolean enforceSanitization,
26-
String[] urlDomains,
27-
String[] emailDomains,
27+
boolean enforceSanitization,
28+
String[] urlDomains,
29+
String[] emailDomains,
2830
int analyzerOptions,
29-
int sendConcernLimit);
31+
int sendConcernLimit,
32+
boolean insertWarningAtProblemLocation);
3033
/**
3134
* Initializes the sanitizer with the provided configuration.
3235
*
@@ -60,13 +63,14 @@ public static boolean initialize(SanitizerConfiguration config, String[] urlDoma
6063
}
6164

6265
return nativeInitialize(
63-
config.getLogger().getNativeILoggerPtr(),
66+
config.getLogger().getNativeILoggerPtr(),
6467
config.getNotificationEventName(),
6568
config.isEnforceSanitization(),
6669
urlDomains,
6770
emailDomains,
6871
analyzerOptions,
69-
sendConcernLimit);
72+
sendConcernLimit,
73+
config.isInsertWarningAtProblemLocation());
7074
}
7175

7276
/**

lib/android_build/maesdk/src/main/java/com/microsoft/applications/events/SanitizerConfiguration.java

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ public class SanitizerConfiguration {
2828
*/
2929
private boolean enforceSanitization = true;
3030

31+
/**
32+
* Flag to control where warning messages are inserted.
33+
* When true, warnings are inserted at the problem location.
34+
* When false (default), warnings are prepended to the beginning.
35+
* Optional. Defaults to false.
36+
*/
37+
private boolean insertWarningAtProblemLocation = false;
38+
3139
/**
3240
* Constructs a new SanitizerConfiguration with the specified logger.
3341
*
@@ -71,4 +79,22 @@ public boolean isEnforceSanitization() {
7179
public void setEnforceSanitization(boolean enforceSanitization) {
7280
this.enforceSanitization = enforceSanitization;
7381
}
82+
83+
/**
84+
* Returns whether warnings are inserted at the problem location.
85+
*
86+
* @return true if warnings are inserted at problem location, false if prepended
87+
*/
88+
public boolean isInsertWarningAtProblemLocation() {
89+
return insertWarningAtProblemLocation;
90+
}
91+
92+
/**
93+
* Sets whether warnings should be inserted at the problem location.
94+
*
95+
* @param insertAtLocation true to insert at problem location, false to prepend
96+
*/
97+
public void setInsertWarningAtProblemLocation(boolean insertAtLocation) {
98+
this.insertWarningAtProblemLocation = insertAtLocation;
99+
}
74100
}

lib/include/public/Version.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
#define MAT_VERSION_HPP
77
// WARNING: DO NOT MODIFY THIS FILE!
88
// This file has been automatically generated, manual changes will be lost.
9-
#define BUILD_VERSION_STR "3.10.20.1"
10-
#define BUILD_VERSION 3,10,20,1
9+
#define BUILD_VERSION_STR "3.10.23.1"
10+
#define BUILD_VERSION 3,10,23,1
1111

1212
#ifndef RESOURCE_COMPILER_INVOKED
1313
#include "ctmacros.hpp"
@@ -18,7 +18,7 @@ namespace MAT_NS_BEGIN {
1818
uint64_t const Version =
1919
((uint64_t)3 << 48) |
2020
((uint64_t)10 << 32) |
21-
((uint64_t)20 << 16) |
21+
((uint64_t)23 << 16) |
2222
((uint64_t)1);
2323

2424
} MAT_NS_END

lib/jni/Sanitizer_jni.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Java_com_microsoft_applications_events_Sanitizer_isInitialized(const JNIEnv *env
3737
* 2 = SitePathLoose (enables loose site path analysis)
3838
* Multiple flags can be combined with bitwise OR (e.g., 1 | 2 = 3)
3939
* @param sendConcernLimit Maximum number of concerns to send. 0 = no concerns sent, 65536+ = all concerns sent.
40+
* @param insertWarningAtProblemLocation Insert warnings at problem location (true) or prepend (false).
4041
* **/
4142
extern "C"
4243
JNIEXPORT jboolean JNICALL
@@ -48,7 +49,8 @@ Java_com_microsoft_applications_events_Sanitizer_isInitialized(const JNIEnv *env
4849
jobjectArray urlDomains,
4950
jobjectArray emailDomains,
5051
jint analyzerOptions,
51-
jint sendConcernLimit // number of concerns to upload. Set to 0 to upload none, greater than 65536 uploads everything.
52+
jint sendConcernLimit, // number of concerns to upload. Set to 0 to upload none, greater than 65536 uploads everything.
53+
jboolean insertWarningAtProblemLocation
5254
) {
5355

5456
if (spSanitizer != nullptr) {
@@ -89,6 +91,7 @@ Java_com_microsoft_applications_events_Sanitizer_isInitialized(const JNIEnv *env
8991
}
9092

9193
sanitizerConfig.SetAllWarningsToSanitizations = static_cast<bool>(warningsToSanitization);
94+
sanitizerConfig.InsertWarningAtProblemLocation = static_cast<bool>(insertWarningAtProblemLocation);
9295

9396
spSanitizer = std::make_shared<Sanitizer>(sanitizerConfig);
9497
return true;

lib/modules

wrappers/obj-c/ODWSanitizer.mm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ +(void)initializeSanitizer:(ILogger *)logger withODWSanitizerInitConfig:(ODWSani
3535
}
3636
config.SetAllWarningsToSanitizations = initConfigObject.setWarningsToSanitization;
3737
config.SendConcernLimit = static_cast<size_t>(initConfigObject.sendConcernLimit);
38+
config.InsertWarningAtProblemLocation = initConfigObject.insertWarningAtProblemLocation;
3839

3940
_sanitizerPtr = std::make_shared<Sanitizer>(config);
4041
LogManager::GetInstance()->SetDataInspector(_sanitizerPtr);
@@ -73,6 +74,7 @@ +(void)initializeSanitizer:(ILogger *)logger withODWSanitizerInitConfig:(ODWSani
7374
}
7475
config.SetAllWarningsToSanitizations = initConfigObject.setWarningsToSanitization;
7576
config.SendConcernLimit = static_cast<size_t>(initConfigObject.sendConcernLimit);
77+
config.InsertWarningAtProblemLocation = initConfigObject.insertWarningAtProblemLocation;
7678

7779
_sanitizerPtr = std::make_shared<Sanitizer>(config);
7880
LogManager::GetInstance()->SetDataInspector(_sanitizerPtr);

wrappers/obj-c/ODWSanitizerInitConfig.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ NS_ASSUME_NONNULL_BEGIN
2626
*/
2727
@property(readwrite, nonatomic) NSUInteger sendConcernLimit;
2828

29+
/*!
30+
@brief (OPTIONAL) When YES, warning messages are inserted at the problem location.
31+
When NO (default), warnings are prepended to the beginning of the string.
32+
Default value is `NO`.
33+
*/
34+
@property(readwrite, nonatomic) BOOL insertWarningAtProblemLocation;
35+
2936
// Initializer
3037
- (instancetype)init;
3138

wrappers/obj-c/ODWSanitizerInitConfig.mm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ - (instancetype)init {
1616
_notificationEventName = @"SanitizerConcerns"; // Default event name
1717
_setWarningsToSanitization = YES; // Default to true
1818
_sendConcernLimit = 65536; // Default to 65536 (upload all concerns)
19+
_insertWarningAtProblemLocation = NO; // Default to NO (prepend warnings)
1920
}
2021
return self;
2122
}

wrappers/swift/Sources/OneDSSwift/SanitizerInitConfig.swift

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,19 @@ public final class SanitizerInitConfig {
3232
odwSanitizerInitConfig.setWarningsToSanitization = newValue
3333
}
3434
}
35-
35+
36+
/// (OPTIONAL) When true, warnings are inserted at the problem location.
37+
/// When false (default), warnings are prepended to the beginning of the string.
38+
/// Default value is `false`.
39+
public var insertWarningAtProblemLocation: Bool {
40+
get {
41+
odwSanitizerInitConfig.insertWarningAtProblemLocation
42+
}
43+
set {
44+
odwSanitizerInitConfig.insertWarningAtProblemLocation = newValue
45+
}
46+
}
47+
3648
/**
3749
Returns the Obj-C object of the wrapper.
3850

0 commit comments

Comments
 (0)