Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix external links not working on Android #22790

Merged
merged 3 commits into from
Mar 5, 2023

Conversation

Joehuu
Copy link
Member

@Joehuu Joehuu commented Mar 4, 2023

Will also make a PR framework-side but is not necessary for fixing osu!-side.

osu.Android/AndroidManifest.xml Outdated Show resolved Hide resolved
@bdach
Copy link
Collaborator

bdach commented Mar 4, 2023

Would like to get this into the upcoming hotfix release if possible, so expediting application of the review would be appreciated.

@Susko3
Copy link
Member

Susko3 commented Mar 5, 2023

This could use AndroidManifestMerger in combination with AndroidManifestOverlay to reduce code duplication.

Unfortunately, there isn't a way to have this overlay framework-side and have it implicitly included when referencing the nuget/local package.

diff --git a/osu.Android.props b/osu.Android.props
index abd8406cf7..cb41c60f24 100644
--- a/osu.Android.props
+++ b/osu.Android.props
@@ -8,9 +8,11 @@
     <!-- NullabilityInfoContextSupport is disabled by default for Android -->
     <NullabilityInfoContextSupport>true</NullabilityInfoContextSupport>
     <EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
+    <AndroidManifestMerger>manifestmerger.jar</AndroidManifestMerger>
   </PropertyGroup>
   <ItemGroup>
     <PackageReference Include="ppy.osu.Framework.Android" Version="2023.228.0" />
+    <AndroidManifestOverlay Include="$(MSBuildThisFileDirectory)osu.Android\Properties\AndroidManifestOverlay.xml" />
   </ItemGroup>
   <PropertyGroup>
     <!-- Fody does not handle Android build well, and warns when unchanged.
diff --git a/osu.Android/Properties/AndroidManifestOverlay.xml b/osu.Android/Properties/AndroidManifestOverlay.xml
new file mode 100644
index 0000000000..815f935383
--- /dev/null
+++ b/osu.Android/Properties/AndroidManifestOverlay.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="https://schemas.android.com/apk/res/android">
+    <queries>
+        <intent>
+            <action android:name="android.intent.action.VIEW" />
+            <category android:name="android.intent.category.BROWSABLE" />
+            <data android:scheme="https" />
+        </intent>
+        <intent>
+            <action android:name="android.intent.action.VIEW" />
+            <category android:name="android.intent.category.BROWSABLE" />
+            <data android:scheme="mailto" />
+        </intent>
+    </queries>

@Joehuu
Copy link
Member Author

Joehuu commented Mar 5, 2023

I'll wait for another opinion. I might not be around for the hotfix release so feel free to apply the changes.

@pull-request-size pull-request-size bot added size/S and removed size/M labels Mar 5, 2023
@bdach
Copy link
Collaborator

bdach commented Mar 5, 2023

The manifest merger thing seems pretty nice and looks to work, so I've applied (with minor stylistic adjustments), thanks 👍

@bdach bdach enabled auto-merge March 5, 2023 12:38
@peppy peppy disabled auto-merge March 5, 2023 13:12
@peppy peppy merged commit 778cde8 into ppy:master Mar 5, 2023
@Joehuu Joehuu deleted the fix-android-external-links branch March 5, 2023 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

osu! does not update on Android.
4 participants