Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions osu.Android/Linker.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
<type fullname="System.Collections.Generic.PriorityQueue`2" preserve="all" />
<type fullname="System.Collections.Generic.IEnumerable`1" preserve="all" />
<type fullname="System.Collections.IEnumerable" preserve="all" />
<type fullname="System.Runtime.CompilerServices.Unsafe" preserve="all" />
</assembly>
<assembly fullname="System.Memory" preserve="all" />
<assembly fullname="System.Formats.Asn1" preserve="all" />
<assembly fullname="MessagePack">
<type fullname="MessagePack.Internal.PriorityQueue`1" preserve="all" />
<type fullname="MessagePack.Resolvers.DynamicUnionResolver" preserve="all" />
Expand All @@ -17,6 +20,8 @@
</assembly>
<assembly fullname="osu.Framework">
<namespace fullname="osu.Framework.Audio" preserve="all" />
<namespace fullname="osu.Framework.Bindables" preserve="all" />
<namespace fullname="osu.Framework.Platform.Android" preserve="all" />
<type fullname="osu.Framework.Audio.AudioManager">
<property name="ActiveMixers" />
<field name="TrackMixer" />
Expand All @@ -31,9 +36,8 @@
<method name="UnbindCollectionChanged" />
</type>
<type fullname="osu.Framework.Audio.Mixing.AudioMixer" preserve="all" />
<type fullname="osu.Framework.Platform.Android.AndroidGameActivity" preserve="all" />
<type fullname="osu.Framework.Android.AndroidGameActivity" preserve="all" />
</assembly>
<assembly fullname="osu.Framework.Android" preserve="all" />
<assembly fullname="osu.Game">
<type fullname="osu.Game.OsuGameBase" preserve="all" />
<type fullname="osu.Game.Beatmaps.Beatmap" preserve="all" />
Expand All @@ -48,14 +52,26 @@
<type fullname="osu.Game.Online.API.Requests.Responses.APIUser" preserve="all" />
<type fullname="osu.Game.Scoring.ScoreInfo" preserve="all" />
</assembly>
<assembly fullname="osu.Game.Resources">
<type fullname="osu.Game.Resources.OsuResources" preserve="all" />
</assembly>
<assembly fullname="osu.Game.Rulesets.Osu" preserve="all" />
<assembly fullname="osu.Game.Rulesets.Taiko" preserve="all" />
<assembly fullname="osu.Game.Rulesets.Catch" preserve="all" />
<assembly fullname="osu.Game.Rulesets.Mania" preserve="all" />
<assembly fullname="osu.Android">
<type fullname="*" preserve="all" />
</assembly>
<assembly fullname="Veldrid" preserve="all" />
<assembly fullname="Veldrid.SPIRV" preserve="all" />
<assembly fullname="ppy.Veldrid.SPIRV" preserve="all" />
<assembly fullname="Veldrid.Vk">
<type fullname="Veldrid.Vk.VkGraphicsDevice" preserve="all" />
<type fullname="Veldrid.Vk.VkCommandList" preserve="all" />
</assembly>
<assembly fullname="AutoMapper" preserve="all" />
<assembly fullname="Newtonsoft.Json" preserve="all" />
<assembly fullname="Realm" preserve="all" />
<assembly fullname="SharpCompress" preserve="all" />
<assembly fullname="Microsoft.Maui.Essentials" preserve="all" />
</linker>
4 changes: 2 additions & 2 deletions osu.Android/OboeAudioRedirector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public void RefreshMixers(int hardwareSampleRate)
}

// Trimming warnings suppressed because AudioManager.ActiveMixers and related types are manually preserved in Linker.xml.
[UnconditionalSuppressMessage("Trimming", "IL2067, IL2070, IL2072, IL2075, IL2080, IL2106", Justification = "Preserved in Linker.xml")]
[UnconditionalSuppressMessage("Trimming", "IL2026, IL2067, IL2070, IL2072, IL2075, IL2080, IL2106", Justification = "Preserved in Linker.xml")]
private IEnumerable<AudioMixer> getActiveMixers()
{
Type type = typeof(AudioManager);
Expand Down Expand Up @@ -299,7 +299,7 @@ private void addMixer(AudioMixer? mixer)
}

// Trimming warnings suppressed because source handles (BASS mixer/stream/channel) are identified via reflection over types preserved in Linker.xml.
[UnconditionalSuppressMessage("Trimming", "IL2067, IL2070, IL2072, IL2075, IL2080, IL2106", Justification = "Preserved in Linker.xml")]
[UnconditionalSuppressMessage("Trimming", "IL2026, IL2067, IL2070, IL2072, IL2075, IL2080, IL2106", Justification = "Preserved in Linker.xml")]
private int findHandle(object obj)
{
Type? type = obj.GetType();
Expand Down
8 changes: 7 additions & 1 deletion osu.Android/OsuGameActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ namespace osu.Android
"application/x-osu-replay",
})]
[IntentFilter(new[] { Intent.ActionView }, Categories = new[] { Intent.CategoryBrowsable, Intent.CategoryDefault }, DataSchemes = new[] { "osu", "osump" })]
[UnconditionalSuppressMessage("Trimming", "IL2067, IL2070, IL2072, IL2075, IL2080, IL2106", Justification = "Preserved in Linker.xml")]
[UnconditionalSuppressMessage("Trimming", "IL2026, IL2067, IL2070, IL2072, IL2075, IL2080, IL2106", Justification = "Preserved in Linker.xml")]
public class OsuGameActivity : AndroidGameActivity, ISurfaceHolderCallback
{
private static readonly string[] osu_url_schemes = { "osu", "osump" };
Expand Down Expand Up @@ -77,6 +77,12 @@ protected override osu.Framework.Game CreateGame()


public OsuGameActivity()
{
initialise();
}

[UnconditionalSuppressMessage("Trimming", "IL2026, IL2067, IL2070, IL2072, IL2075, IL2080, IL2106", Justification = "Preserved in Linker.xml")]
private void initialise()
{
game = new OsuGameAndroid(this);

Expand Down
5 changes: 3 additions & 2 deletions osu.Android/OsuGameAndroid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,15 @@ public partial class OsuGameAndroid : OsuGame

private int hardwareSampleRateCached;

[UnconditionalSuppressMessage("Trimming", "IL2026, IL2067, IL2070, IL2072, IL2075, IL2080, IL2106", Justification = "Preserved in Linker.xml")]
public OsuGameAndroid(OsuGameActivity activity)
: base(null)
{
gameActivity = activity;
}

// Trimming warnings suppressed because reflection is used to bind to AudioManager.ActiveMixers, which is manually preserved in Linker.xml.
[UnconditionalSuppressMessage("Trimming", "IL2067, IL2070, IL2072, IL2075, IL2080, IL2106", Justification = "Preserved in Linker.xml")]
[UnconditionalSuppressMessage("Trimming", "IL2026, IL2067, IL2070, IL2072, IL2075, IL2080, IL2106", Justification = "Preserved in Linker.xml")]
protected override void LoadComplete()
{
base.LoadComplete();
Expand Down Expand Up @@ -393,7 +394,7 @@ public override void SetHost(GameHost host)
protected override BatteryInfo CreateBatteryInfo() => new AndroidBatteryInfo();

// Trimming warnings suppressed because reflection is used to unbind from AudioManager.ActiveMixers, which is manually preserved in Linker.xml.
[UnconditionalSuppressMessage("Trimming", "IL2067, IL2070, IL2072, IL2075, IL2080, IL2106", Justification = "Preserved in Linker.xml")]
[UnconditionalSuppressMessage("Trimming", "IL2026, IL2067, IL2070, IL2072, IL2075, IL2080, IL2106", Justification = "Preserved in Linker.xml")]
protected override void Dispose(bool isDisposing)
{
try
Expand Down
Loading