Skip to content

Commit 47248ba

Browse files
jamescrosswelljpnurmi
authored andcommitted
fix: Android apps not symbolicating in release mode
Borrowed from #4998
1 parent 799b2bd commit 47248ba

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

src/Sentry.Android.AssemblyReader/V2/StoreReader.cs

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ static StoreReader()
4242
GetArchPath (AndroidTargetArch.Arm),
4343
GetArchPath (AndroidTargetArch.X86_64),
4444
GetArchPath (AndroidTargetArch.X86),
45+
GetArchPath (AndroidTargetArch.Arm64, newBlobName: true),
46+
GetArchPath (AndroidTargetArch.Arm, newBlobName: true),
47+
GetArchPath (AndroidTargetArch.X86_64, newBlobName: true),
48+
GetArchPath (AndroidTargetArch.X86, newBlobName: true),
4549
};
4650
ApkPaths = paths.AsReadOnly();
4751
AabBasePaths = ApkPaths;
@@ -52,10 +56,14 @@ static StoreReader()
5256
GetArchPath (AndroidTargetArch.Arm, AabBaseDir),
5357
GetArchPath (AndroidTargetArch.X86_64, AabBaseDir),
5458
GetArchPath (AndroidTargetArch.X86, AabBaseDir),
59+
GetArchPath (AndroidTargetArch.Arm64, AabBaseDir, true),
60+
GetArchPath (AndroidTargetArch.Arm, AabBaseDir, true),
61+
GetArchPath (AndroidTargetArch.X86_64, AabBaseDir, true),
62+
GetArchPath (AndroidTargetArch.X86, AabBaseDir, true),
5563
};
5664
AabPaths = paths.AsReadOnly();
5765

58-
string GetArchPath(AndroidTargetArch arch, string? root = null)
66+
string GetArchPath(AndroidTargetArch arch, string? root = null, bool newBlobName = false)
5967
{
6068
const string LibDirName = "lib";
6169

@@ -70,7 +78,7 @@ string GetArchPath(AndroidTargetArch arch, string? root = null)
7078
root = LibDirName;
7179
}
7280
parts.Add(abi);
73-
parts.Add(GetBlobName(abi));
81+
parts.Add(newBlobName ? NewBlobName : GetOldBlobName(abi));
7482

7583
return MonoAndroidHelper.MakeZipArchivePath(root, parts);
7684
}
@@ -87,7 +95,16 @@ public StoreReader(Stream store, string path, DebugLogger? logger)
8795
};
8896
}
8997

90-
private static string GetBlobName(string abi) => $"libassemblies.{abi}.blob.so";
98+
/// <summary>
99+
/// This method returns the expected blob name for a given ABI for dotnet/android workload versions 10.0.101.1 and earlier
100+
/// </summary>
101+
private static string GetOldBlobName(string abi) => $"libassemblies.{abi}.blob.so";
102+
103+
/// <summary>
104+
/// More recent versions of the dotnet/android workload (starting with 10.0.102) switched to a single blob name for
105+
/// all ABIs. See: https://github.com/dotnet/android/pull/10638
106+
/// </summary>
107+
private const string NewBlobName = "libassembly-store.so";
91108

92109
protected override ulong GetStoreStartDataOffset() => elfOffset;
93110

0 commit comments

Comments
 (0)