fix(auth): App Link HTTPS pour le retour OIDC (Chrome bloque le schéma custom)
Build APK / build (push) Successful in 2m29s
Build APK / build (push) Successful in 2m29s
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
3471c82c61
commit
1fe4528b0b
+19
-1
@@ -20,15 +20,33 @@ with open("android/key.properties", "w") as f:
|
||||
f"storeFile={KEYSTORE_PATH}\n"
|
||||
)
|
||||
|
||||
# 2) AndroidManifest : permissions
|
||||
# 2) AndroidManifest : permissions + App Link HTTPS (retour OIDC fiable)
|
||||
man = "android/app/src/main/AndroidManifest.xml"
|
||||
s = open(man).read()
|
||||
# namespace tools (pour merger dans l'activity de flutter_appauth)
|
||||
if "xmlns:tools" not in s:
|
||||
s = s.replace("<manifest ", '<manifest xmlns:tools="http://schemas.android.com/tools" ', 1)
|
||||
perms = (
|
||||
'<uses-permission android:name="android.permission.INTERNET"/>\n'
|
||||
' <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES"/>\n'
|
||||
)
|
||||
if "REQUEST_INSTALL_PACKAGES" not in s:
|
||||
s = s.replace("<application", perms + " <application", 1)
|
||||
# App Link https://gamemanager-api.nfteam.ovh/oidc/callback → capté par l'app
|
||||
applink = (
|
||||
' <activity android:name="net.openid.appauth.RedirectUriReceiverActivity" '
|
||||
'android:exported="true" tools:node="merge">\n'
|
||||
' <intent-filter android:autoVerify="true">\n'
|
||||
' <action android:name="android.intent.action.VIEW"/>\n'
|
||||
' <category android:name="android.intent.category.DEFAULT"/>\n'
|
||||
' <category android:name="android.intent.category.BROWSABLE"/>\n'
|
||||
' <data android:scheme="https" android:host="gamemanager-api.nfteam.ovh" '
|
||||
'android:path="/oidc/callback"/>\n'
|
||||
' </intent-filter>\n'
|
||||
' </activity>\n'
|
||||
)
|
||||
if "gamemanager-api.nfteam.ovh" not in s:
|
||||
s = s.replace("</application>", applink + " </application>", 1)
|
||||
open(man, "w").write(s)
|
||||
|
||||
# 3) build.gradle : signature + schéma OIDC
|
||||
|
||||
Reference in New Issue
Block a user