-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathintent-test.html
More file actions
125 lines (112 loc) · 5.82 KB
/
Copy pathintent-test.html
File metadata and controls
125 lines (112 loc) · 5.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<!DOCTYPE html>
<html lang="sk">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>gameflix intent:// diagnostika</title>
<style>
body { font-family: sans-serif; margin: 16px; line-height: 1.5; }
button { display: block; width: 100%; margin: 8px 0; padding: 14px; font-size: 15px; }
pre { background: #eee; padding: 8px; white-space: pre-wrap; word-break: break-all; font-size: 12px; }
h3 { margin: 18px 0 4px; }
.ua { background: #ffd; padding: 8px; font-size: 13px; }
.ok { background: #cfc; padding: 8px; }
.bad { background: #fcc; padding: 8px; }
small { color: #555; }
</style>
</head>
<body>
<h2>gameflix — intent:// diagnostika</h2>
<div class="ua" id="ua"></div>
<div id="verdict"></div>
<p><small>Každé tlačidlo má <b>fallback URL</b> späť sem s <code>?failed=…</code>.
Ak sa stránka reloadne s červeným hlásením → intent sa <b>nezrezolvoval</b>
(zlý balík/aktivita). Ak sa otvorí RetroArch → intent <b>prešiel</b>.</small></p>
<h3>0. REÁLNE ODKAZY (ťukni priamo, žiadny JavaScript)</h3>
<p><small>Firefox môže otvárať intent len cez skutočné ťuknutie na odkaz, nie cez
JS navigáciu. Ak fungujú tieto a tlačidlá nižšie nie → to je príčina.</small></p>
<p><a href="intent://gameflix#Intent;action=android.intent.action.MAIN;category=android.intent.category.LAUNCHER;package=com.retroarch;end">L1 — odkaz: com.retroarch (launcher)</a></p>
<p><a href="intent://gameflix#Intent;action=android.intent.action.MAIN;category=android.intent.category.LAUNCHER;package=com.retroarch.aarch64;end">L2 — odkaz: com.retroarch.aarch64 (launcher)</a></p>
<p><a href="intent:#Intent;action=android.intent.action.MAIN;category=android.intent.category.LAUNCHER;package=com.retroarch;end">L3 — odkaz: intent: (bez //) com.retroarch</a></p>
<h3>1. Otvorí sa appka vôbec? (MAIN + LAUNCHER, bez ROM)</h3>
<button onclick="launcher('com.retroarch')">A — com.retroarch (stable)</button>
<button onclick="launcher('com.retroarch.aarch64')">B — com.retroarch.aarch64 (Plus 64-bit)</button>
<button onclick="launcher('com.retroarch.ra32')">C — com.retroarch.ra32 (Plus 32-bit)</button>
<h3>2. Explicitná komponenta (RetroActivityFuture, bez ROM)</h3>
<button onclick="component('com.retroarch')">D — com.retroarch / RetroActivityFuture</button>
<button onclick="component('com.retroarch.aarch64')">E — com.retroarch.aarch64 / RetroActivityFuture</button>
<h3>3. Plný launch (neexistujúci ROM + Stella core)</h3>
<button onclick="full('com.retroarch')">F — com.retroarch + ROM + core</button>
<button onclick="full('com.retroarch.aarch64')">G — com.retroarch.aarch64 + ROM + core</button>
<h3>Posledný odpálený intent:</h3>
<pre id="out">—</pre>
<script>
var ACT = 'com.retroarch.browser.retroactivity.RetroActivityFuture';
// Firefox/Fenix jumps straight to S.browser_fallback_url and never tries the app
// (fenix#23397). So on Firefox we MUST omit the fallback, and we can't use the
// "did we bounce back?" trick — the only signal is whether RetroArch opens.
var FIREFOX = /Firefox|FxiOS|Fennec/i.test(navigator.userAgent);
document.getElementById('ua').textContent =
'userAgent: ' + navigator.userAgent + (FIREFOX ? '\n→ Firefox: fallback URL vypnutý' : '');
(function () {
var m = /[?&]failed=([^&]+)/.exec(location.search);
var v = document.getElementById('verdict');
if (FIREFOX) {
v.className = 'bad';
v.innerHTML = '🦊 <b>Firefox</b>: zapni <b>Nastavenia → Otvárať odkazy v aplikáciách</b> ' +
'(„Open links in apps"), inak sa appka neotvorí. Fallback URL je vypnutý, ' +
'takže detekcia zlyhania cez <code>?failed</code> tu nefunguje — ' +
'jediný signál je, či sa RetroArch otvorí.';
} else if (m) {
v.className = 'bad';
v.innerHTML = '❌ Intent <b>' + decodeURIComponent(m[1]) +
'</b> sa NEzrezolvoval — Android nenašiel takú aktivitu/balík ' +
'(appka nie je nainštalovaná pod týmto názvom, alebo je iná komponenta).';
} else {
v.className = 'ok';
v.innerHTML = '✅ Ak sa po ťuknutí otvorí RetroArch, daný intent funguje. ' +
'Ak sa vrátiš sem s červeným hlásením, nefunguje.';
}
})();
function show(u){ document.getElementById('out').textContent = u; }
function fire(u){ show(u); window.location.href = u; }
function fb(tag){
// Chrome: fallback back to this page so we can detect non-resolution.
// Firefox: must be omitted (it short-circuits to the fallback).
if (FIREFOX) return '';
var base = location.origin + location.pathname + '?failed=' + encodeURIComponent(tag);
return 'S.browser_fallback_url=' + encodeURIComponent(base) + ';';
}
// Just open the app's launcher activity.
function launcher(pkg){
fire('intent://gameflix#Intent;' +
'action=android.intent.action.MAIN;' +
'category=android.intent.category.LAUNCHER;' +
'package=' + pkg + ';' + fb(pkg + ' (launcher)') + 'end');
}
// Explicit RetroActivityFuture component, no ROM.
function component(pkg){
fire('intent://gameflix#Intent;' +
'action=android.intent.action.MAIN;' +
'package=' + pkg + ';' +
'component=' + pkg + '/' + ACT + ';' +
fb(pkg + ' (component)') + 'end');
}
// Full launch with a (non-existent) ROM + Stella core.
function full(pkg){
var rom = '/storage/emulated/0/Download/__gameflix_test_neexistuje__.bin';
var core = '/data/data/' + pkg + '/cores/stella_libretro_android.so';
var cfg = '/storage/emulated/0/Android/data/' + pkg + '/files/retroarch.cfg';
var e = encodeURIComponent;
fire('intent://gameflix/launch#Intent;' +
'action=android.intent.action.MAIN;' +
'package=' + pkg + ';' +
'component=' + pkg + '/' + ACT + ';' +
'S.ROM=' + e(rom) + ';' +
'S.LIBRETRO=' + e(core) + ';' +
'S.CONFIGFILE=' + e(cfg) + ';' +
fb(pkg + ' (full)') + 'end');
}
</script>
</body>
</html>