Skip to content

Commit a474f68

Browse files
fix Android XAGMM7009 by removing OsuApplication subclass
Agent-Logs-Url: https://github.com/winnerspiros/osu/sessions/c1769bd6-c639-44bc-b1e9-1eba8acf7081 Co-authored-by: winnerspiros <1675249+winnerspiros@users.noreply.github.com>
1 parent 10909fd commit a474f68

4 files changed

Lines changed: 10 additions & 54 deletions

File tree

osu.Android/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version='1.0' encoding='utf-8'?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="sh.ppy.osulazer" android:installLocation="auto">
33
<uses-sdk android:minSdkVersion="33" android:targetSdkVersion="36" />
4-
<application>
4+
<application android:allowBackup="true" android:supportsRtl="true" android:label="osu!" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher" android:largeHeap="true" android:hardwareAccelerated="true" android:extractNativeLibs="false">
55
<provider android:name="androidx.core.content.FileProvider" android:authorities="sh.ppy.osulazer.fileprovider" android:grantUriPermissions="true" android:exported="false">
66
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/filepaths" />
77
</provider>

osu.Android/CrashDiagnostics.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ internal static class CrashDiagnostics
4040

4141
/// <summary>
4242
/// Installs the native crash handler against the internal-storage log path, drops the
43-
/// sentinel, and writes the first "I am alive" marker. Idempotent — safe to call from
44-
/// both <see cref="Application.OnCreate"/> and <see cref="Activity.OnCreate(Bundle)"/>;
45-
/// the underlying handler dedupes via its own <c>g_installed</c> flag.
43+
/// sentinel, and writes the first "I am alive" marker. Idempotent — safe to call
44+
/// repeatedly from <c>Activity.OnCreate</c>; the underlying handler dedupes
45+
/// via its own <c>g_installed</c> flag.
4646
/// </summary>
47-
/// <param name="context">Any <see cref="Context"/> — typically the Application or Activity.</param>
47+
/// <param name="context">Any <see cref="Context"/> — typically the host Activity.</param>
4848
public static void InstallNativeHandler(Context context)
4949
{
5050
try

osu.Android/OsuApplication.cs

Lines changed: 0 additions & 45 deletions
This file was deleted.

osu.Android/OsuGameActivity.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,11 @@ protected override void OnCreate(Bundle? savedInstanceState)
8686
// Crash diagnostics first. The native handler write target is internal storage
8787
// (FilesDir/native_crash.log); a one-shot mirror copies it to external storage
8888
// here on the *next* normal startup so the user can pull it without root.
89-
// OsuApplication.OnCreate already installed both the native handler and the
90-
// managed exception hooks — these calls are idempotent safety nets that cover
91-
// the (vanishingly unlikely) case where the activity is created without our
92-
// Application subclass having run first.
89+
// We do NOT have a custom Android.App.Application subclass — ppy.osu.Framework.Android
90+
// already declares `[assembly: Application]`, so adding our own `[Application]`
91+
// class would trigger XAGMM7009 at manifest-merge time. The activity is the
92+
// earliest managed entry point we own; install both hooks at the very top of
93+
// OnCreate so any crash from this point onward lands in `native_crash.log`.
9394
CrashDiagnostics.InstallNativeHandler(this);
9495
CrashDiagnostics.InstallManagedExceptionHooks();
9596
CrashDiagnostics.WriteAliveMarker("Activity.OnCreate entry");

0 commit comments

Comments
 (0)