Keep HttpBodyType constants before adopting sentry-java 9

オープン 初心者向け
#6,020 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
75/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
android, csharp, java

調査の方向性

src/Sentry.Bindings.Android/sentry-proguard.cfgと、src/Sentry/Platforms/Android/Extensions/EnumExtensions.csおよびDataCollectionExtensions.cs内のenum参照を読んでください。説明に従って、enum定数SentryLevelとHttpBodyTypeのkeepルールを追加し、sentry-java 9.0.0の難読化動作に照らしてファイルを確認してください。アプリでR8の難読化を有効にしたとき、両方の定数セットが名前を保持すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

.NET Platform: Android Task

sentry-java 9.0.0 stops keeping the members of io.sentry enums (getsentry/sentry-java#6787). Before bumping to 9.0.0, the .NET SDK needs its own keeps for the enum constants the bindings read by field name.

  • JavaSdk.SentryLevel.Debug … .Fatal (src/Sentry/Platforms/Android/Extensions/EnumExtensions.cs)
  • JavaSdk.HttpBodyType.IncomingRequest … .OutgoingResponse (src/Sentry/Platforms/Android/Extensions/DataCollectionExtensions.cs:33-36)

In the minified sentry-java sample built with the 9.0.0 change, SentryLevel.ERROR is renamed to M. SpanStatus, TransactionNameSource, and DeviceOrientation go through Name(), so they're not affected.

Add to src/Sentry.Bindings.Android/sentry-proguard.cfg:

-keepclassmembers enum io.sentry.SentryLevel { public static <fields>; }
-keepclassmembers enum io.sentry.HttpBodyType { public static <fields>; }

This only helps once #6017 is fixed: the package's .targets points at proguard.cfg, but the file ships as sentry-proguard.cfg, so apps don't get these rules today. That also matters for 9.0.0 because sentry-java stops keeping every SentryAndroidOptions member, and this file's SentryAndroidOptions { *; } is what would replace it.

.NET Android's default -dontobfuscate prevents the rename, so this mainly affects apps that opt into AndroidR8ObfuscationMode.

Related: getsentry/sentry-java#6771

主要言語
C#
スター
775
フォーク
262
平均マージ
1日 16時間
マージ済み PR(30日)
118

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

getsentry/sentry-dotnet のほかの issue

getsentry/sentry-dotnet の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。