Skip to content

Commit bfa48f9

Browse files
build(deps): bump io.sentry:sentry-android from 7.16.0 to 8.11.1 in /android (#889)
* build(deps): bump io.sentry:sentry-android in /android Bumps [io.sentry:sentry-android](https://github.com/getsentry/sentry-java) from 7.16.0 to 8.11.1. - [Release notes](https://github.com/getsentry/sentry-java/releases) - [Changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md) - [Commits](getsentry/sentry-java@7.16.0...8.11.1) --- updated-dependencies: - dependency-name: io.sentry:sentry-android dependency-version: 8.11.1 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * update java import * update changelog and merge main * update changelog number --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: lucas <lucas-zimerman1@hotmail.com>
1 parent c797ca8 commit bfa48f9

File tree

3 files changed

+22
-28
lines changed

3 files changed

+22
-28
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@
1111
### Dependencies
1212

1313
- Bump JavaScript SDKs from v9.0.0 to v9.11.0 ([#872](https://github.com/getsentry/sentry-capacitor/pull/872))
14-
1514
- [changelog](https://github.com/getsentry/sentry-javascript/blob/9.11.0/CHANGELOG.md)
1615
- [diff](https://github.com/getsentry/sentry-javascript/compare/9.0.0...9.11.0)
16+
- Bump Android SDK from v7.16.0 to v8.11.1 ([#889](https://github.com/getsentry/sentry-capacitor/pull/889))
17+
- [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#8111)
18+
- [diff](https://github.com/getsentry/sentry-java/compare/7.16.0...8.11.1)
1719

1820
## 2.0.0-beta.1
1921

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,5 +93,5 @@ repositories {
9393

9494
dependencies {
9595
implementation project(':capacitor-android')
96-
implementation 'io.sentry:sentry-android:7.16.0'
96+
implementation 'io.sentry:sentry-android:8.11.1'
9797
}

android/src/main/java/io/sentry/capacitor/SentryCapacitor.java

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@
1010
import com.getcapacitor.annotation.CapacitorPlugin;
1111

1212
import io.sentry.Breadcrumb;
13-
import io.sentry.HubAdapter;
13+
import io.sentry.IScope;
1414
import io.sentry.Integration;
15+
import io.sentry.ScopesAdapter;
1516
import io.sentry.Sentry;
1617
import io.sentry.SentryEvent;
1718
import io.sentry.SentryLevel;
@@ -25,7 +26,7 @@
2526
import io.sentry.protocol.User;
2627
import java.io.File;
2728
import java.io.FileOutputStream;
28-
import java.io.UnsupportedEncodingException;
29+
import java.nio.charset.StandardCharsets;
2930
import java.util.HashMap;
3031
import java.util.Iterator;
3132
import java.util.List;
@@ -62,9 +63,9 @@ public void load() {
6263

6364
@PluginMethod
6465
public void initNativeSdk(final PluginCall call) {
65-
JSObject capOptions = call.getObject("options");
66+
JSObject capOptions = call.getObject("options");
6667

67-
SentryAndroid.init(
68+
SentryAndroid.init(
6869
this.getContext(),
6970
options -> {
7071
SdkVersion sdkVersion = options.getSdkVersion();
@@ -74,7 +75,7 @@ public void initNativeSdk(final PluginCall call) {
7475
sdkVersion.setName(ANDROID_SDK_NAME);
7576
}
7677

77-
if (capOptions.has("debug") && capOptions.getBool("debug")) {
78+
if (capOptions.has("debug") && capOptions.getBool("debug")) {
7879
options.setDebug(true);
7980
logger.setLevel(Level.INFO);
8081
}
@@ -83,7 +84,7 @@ public void initNativeSdk(final PluginCall call) {
8384
options.setNativeSdkName(NATIVE_SDK_NAME);
8485
options.setSdkVersion(sdkVersion);
8586

86-
String dsn = capOptions.getString("dsn") != null ? capOptions.getString("dsn") : "";
87+
String dsn = capOptions.getString("dsn") != null ? capOptions.getString("dsn") : "";
8788
logger.info(String.format("Starting with DSN: '%s'", dsn));
8889
options.setDsn(dsn);
8990

@@ -212,9 +213,9 @@ public void crash(PluginCall call) {
212213
@PluginMethod
213214
public void fetchNativeRelease(PluginCall call) {
214215
JSObject release = new JSObject();
215-
release.put("id", this.packageInfo.packageName);
216-
release.put("version", this.packageInfo.versionName);
217-
release.put("build", String.valueOf(this.packageInfo.versionCode)); // Requires API 28
216+
release.put("id", packageInfo.packageName);
217+
release.put("version", packageInfo.versionName);
218+
release.put("build", String.valueOf(packageInfo.versionCode)); // Requires API 28
218219
call.resolve(release);
219220
}
220221

@@ -227,7 +228,7 @@ public void captureEnvelope(PluginCall call) {
227228
bytes[i] = (byte) rawIntegers.getInt(i);
228229
}
229230

230-
final String outboxPath = HubAdapter.getInstance().getOptions().getOutboxPath();
231+
final String outboxPath = ScopesAdapter.getInstance().getOptions().getOutboxPath();
231232

232233
if (outboxPath == null || outboxPath.isEmpty()) {
233234
logger.info("Error when writing envelope, no outbox path is present.");
@@ -259,9 +260,9 @@ public void getStringBytesLength(PluginCall call) {
259260
String payload = call.getString("string");
260261
try {
261262
JSObject resp = new JSObject();
262-
resp.put("value", payload.getBytes("UTF-8").length);
263+
resp.put("value", payload.getBytes(StandardCharsets.UTF_8).length);
263264
call.resolve(resp);
264-
} catch (UnsupportedEncodingException e) {
265+
} catch (Exception e) {
265266
call.reject(String.valueOf(e));
266267
}
267268
} else {
@@ -300,9 +301,6 @@ public void addBreadcrumb(final PluginCall breadcrumb) {
300301
case "debug":
301302
breadcrumbInstance.setLevel(SentryLevel.DEBUG);
302303
break;
303-
case "error":
304-
breadcrumbInstance.setLevel(SentryLevel.ERROR);
305-
break;
306304
default:
307305
breadcrumbInstance.setLevel(SentryLevel.ERROR);
308306
break;
@@ -328,9 +326,7 @@ public void addBreadcrumb(final PluginCall breadcrumb) {
328326

329327
@PluginMethod
330328
public void clearBreadcrumbs(PluginCall call) {
331-
Sentry.configureScope(scope -> {
332-
scope.clearBreadcrumbs();
333-
});
329+
Sentry.configureScope(IScope::clearBreadcrumbs);
334330
}
335331

336332
@PluginMethod
@@ -399,17 +395,13 @@ public void addPackages(SentryEvent event, SdkVersion sdk) {
399395
SdkVersion eventSdk = event.getSdk();
400396
if (eventSdk != null && eventSdk.getName().equals("sentry.javascript.capacitor") && sdk != null) {
401397
Set<SentryPackage> sentryPackages = sdk.getPackageSet();
402-
if (sentryPackages != null) {
403-
for (SentryPackage sentryPackage : sentryPackages) {
404-
eventSdk.addPackage(sentryPackage.getName(), sentryPackage.getVersion());
405-
}
398+
for (SentryPackage sentryPackage : sentryPackages) {
399+
eventSdk.addPackage(sentryPackage.getName(), sentryPackage.getVersion());
406400
}
407401

408402
Set<String> integrations = sdk.getIntegrationSet();
409-
if (integrations != null) {
410-
for (String integration : integrations) {
411-
eventSdk.addIntegration(integration);
412-
}
403+
for (String integration : integrations) {
404+
eventSdk.addIntegration(integration);
413405
}
414406

415407
event.setSdk(eventSdk);

0 commit comments

Comments
 (0)