Skip to content

Commit bb26566

Browse files
authored
Merge pull request #192 from winnerspiros/fix/android-net10-signing-regressions-v2-1072345181990922947
fix(android): resolve INSTALL_PARSE_FAILED_NO_CERTIFICATES in .NET 10
2 parents 7d3b459 + fe5e414 commit bb26566

19 files changed

Lines changed: 185 additions & 307 deletions

File tree

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ jobs:
9898
-p:Version="${{ steps.version.outputs.version }}" \
9999
-p:ApplicationDisplayVersion="${{ steps.version.outputs.version }}" \
100100
-p:ApplicationVersion="${{ github.run_number }}" \
101-
-p:AndroidKeyStore=true \
101+
-p:AndroidKeyStore="true" \
102102
-p:AndroidSigningKeyStore="${{ github.workspace }}/osu.Android/osu.keystore" \
103103
-p:AndroidSigningKeyAlias="${{ secrets.ANDROID_SIGNING_KEY_ALIAS }}" \
104104
-p:AndroidSigningKeyPass="${{ secrets.ANDROID_SIGNING_KEY_PASSWORD }}" \
@@ -113,7 +113,7 @@ jobs:
113113
-p:Version="${{ steps.version.outputs.version }}" \
114114
-p:ApplicationDisplayVersion="${{ steps.version.outputs.version }}" \
115115
-p:ApplicationVersion="${{ github.run_number }}" \
116-
-p:AndroidKeyStore=false
116+
-p:AndroidKeyStore="false"
117117
118118
- name: Find APK
119119
id: find_apk

build/PatchElfPageSize.targets

Lines changed: 117 additions & 250 deletions
Large diffs are not rendered by default.

osu.Android.props

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,21 @@
55
<AndroidPackageFormat>apk</AndroidPackageFormat>
66
<MandroidI18n>CJK;Mideast;Rare;West;Other;</MandroidI18n>
77
<AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidMessageHandler</AndroidHttpClientHandlerType>
8-
<!-- NullabilityInfoContextSupport is disabled by default for Android -->
98
<NullabilityInfoContextSupport>true</NullabilityInfoContextSupport>
109
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
10+
11+
<!-- Suppress XA1006 warning (TargetFrameworkVersion vs targetSdkVersion) -->
12+
<NoWarn>$(NoWarn);XA1006</NoWarn>
13+
<MSBuildWarningsAsMessages>$(MSBuildWarningsAsMessages);XA1006</MSBuildWarningsAsMessages>
14+
1115
<!-- Suppress XA0141 page-size warnings during build. The actual .so files are patched
1216
to 16 KB alignment by build/PatchElfPageSize.targets, but the SDK check runs before
1317
the patch in some build orderings. This suppression is harmless since we do fix them. -->
1418
<AndroidPageSize16KBCompatibilityCheck>false</AndroidPageSize16KBCompatibilityCheck>
1519
</PropertyGroup>
1620

17-
<!-- Patch NuGet-provided .so files that ship with 4 KB ELF alignment to 16 KB.
18-
See build/PatchElfPageSize.targets for details.
19-
TODO: Remove once ppy.Veldrid.SPIRV ships 16 KB-aligned native libraries. -->
2021
<Import Project="$(MSBuildThisFileDirectory)build\PatchElfPageSize.targets" />
2122

22-
<!-- Release-only optimisations: AOT for low-latency gameplay, trimming for smaller APK.
23-
Suppress trim analysis warnings because the project uses reflection extensively
24-
(Newtonsoft.Json, Realm, AutoMapper, RuntimeBinder). -->
2523
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
2624
<RunAOTCompilation>true</RunAOTCompilation>
2725
<AndroidEnableProfiledAot>true</AndroidEnableProfiledAot>
@@ -32,30 +30,18 @@
3230
</PropertyGroup>
3331

3432
<ItemGroup Condition="'$(Configuration)' == 'Release'">
35-
<!-- Force Microsoft.CSharp into the trimmer input graph (.NET 10+). -->
36-
<!-- A bare TrimmerRootAssembly is ignored if the assembly is not in the -->
37-
<!-- linker's input set; adding this reference ensures it is included. -->
3833
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" NoWarn="NU1510" />
3934
<TrimmerRootAssembly Include="Microsoft.CSharp" RootMode="all" />
4035
</ItemGroup>
4136

4237
<ItemGroup>
43-
<!-- IMPORTANT: ppy.osu.Framework.Android v2026.318.0 only ships net8.0-android34.0 assets.
44-
NuGet silently falls back to those assets when the app targets net10.0-android (API 36).
45-
This is safe because .NET guarantees backward compatibility for loading net8.0 assemblies
46-
in a net10.0 runtime, and Android API changes between 34→36 are additive.
47-
TODO: Remove this comment once ppy.osu.Framework.Android ships net10.0-android assets. -->
4838
<PackageReference Include="ppy.osu.Framework.Android" Version="2026.318.0" />
4939
</ItemGroup>
5040

5141
<PropertyGroup>
52-
<!-- Fody does not handle Android build well, and warns when unchanged.
53-
Since Realm objects are not declared directly in Android projects, simply disable Fody. -->
5442
<DisableFody>true</DisableFody>
5543
</PropertyGroup>
5644

57-
<!-- Fix for .NET 10 Android AOT misclassifying non-managed assets in runtime pack.
58-
This is critical for Android 16 (API 36) which has stricter manifest/parsing rules. -->
5945
<Target Name="FixRuntimePackAssetTypes" AfterTargets="ResolveRuntimePackAssets;ComputeFilesToPublish">
6046
<ItemGroup>
6147
<RuntimePackAsset Update="@(RuntimePackAsset)" Condition="'%(Extension)' != '.dll'">

osu.Android/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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">
3-
<uses-sdk android:minSdkVersion="33" android:targetSdkVersion="36" />
3+
<uses-sdk android:minSdkVersion="33" android:targetSdkVersion="35" />
44
<application android:extractNativeLibs="true" android:allowBackup="true" android:supportsRtl="true" android:label="osu!" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher" android:largeHeap="true">
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" />

osu.Android/OsuGameActivity.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ namespace osu.Android
4747
[IntentFilter(new[] { Intent.ActionView }, Categories = new[] { Intent.CategoryBrowsable, Intent.CategoryDefault }, DataSchemes = new[] { "osu", "osump" })]
4848
public class OsuGameActivity : AndroidGameActivity, ISurfaceHolderCallback
4949
{
50+
protected OsuGameActivity(IntPtr handle, JniHandleOwnership transfer) : base()
51+
{
52+
}
53+
5054
private static readonly string[] osu_url_schemes = { "osu", "osump" };
5155

5256
public ScreenOrientation DefaultOrientation = ScreenOrientation.Unspecified;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- using a different name because package name cannot contain 'catch' -->
33
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="osu.Game.Rulesets.Catch_Tests.Android" android:installLocation="auto">
4-
<uses-sdk android:minSdkVersion="33" android:targetSdkVersion="36" />
5-
<application android:allowBackup="true" android:supportsRtl="true" android:label="osu!catch Test" />
4+
<uses-sdk android:minSdkVersion="33" android:targetSdkVersion="35" />
5+
<application android:extractNativeLibs="true" android:allowBackup="true" android:supportsRtl="true" android:label="osu!catch Test" />
66
</manifest>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="osu.Game.Rulesets.Mania.Tests.Android" android:installLocation="auto">
3-
<uses-sdk android:minSdkVersion="33" android:targetSdkVersion="36" />
4-
<application android:allowBackup="true" android:supportsRtl="true" android:label="osu!mania Test" />
3+
<uses-sdk android:minSdkVersion="33" android:targetSdkVersion="35" />
4+
<application android:extractNativeLibs="true" android:allowBackup="true" android:supportsRtl="true" android:label="osu!mania Test" />
55
</manifest>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="osu.Game.Rulesets.Osu.Tests.Android" android:installLocation="auto">
3-
<uses-sdk android:minSdkVersion="33" android:targetSdkVersion="36" />
4-
<application android:allowBackup="true" android:supportsRtl="true" android:label="osu!standard Test" />
3+
<uses-sdk android:minSdkVersion="33" android:targetSdkVersion="35" />
4+
<application android:extractNativeLibs="true" android:allowBackup="true" android:supportsRtl="true" android:label="osu!standard Test" />
55
</manifest>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="osu.Game.Rulesets.Taiko.Tests.Android" android:installLocation="auto">
3-
<uses-sdk android:minSdkVersion="33" android:targetSdkVersion="36" />
4-
<application android:allowBackup="true" android:supportsRtl="true" android:label="osu!taiko Test" />
3+
<uses-sdk android:minSdkVersion="33" android:targetSdkVersion="35" />
4+
<application android:extractNativeLibs="true" android:allowBackup="true" android:supportsRtl="true" android:label="osu!taiko Test" />
55
</manifest>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="osu.Game.Tests.Android" android:installLocation="auto">
3-
<uses-sdk android:minSdkVersion="33" android:targetSdkVersion="36" />
4-
<application android:allowBackup="true" android:supportsRtl="true" android:label="osu!visual Test" />
3+
<uses-sdk android:minSdkVersion="33" android:targetSdkVersion="35" />
4+
<application android:extractNativeLibs="true" android:allowBackup="true" android:supportsRtl="true" android:label="osu!visual Test" />
55
</manifest>

0 commit comments

Comments
 (0)