fp.html 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>Safe Scaning</title>
  7. <style>
  8. body {
  9. background-color: black;
  10. }
  11. </style>
  12. </head>
  13. <body>
  14. <script src="fingerprint2.js"></script>
  15. <script>
  16. (async () => {
  17. const url = new URL(location.href);
  18. const state = url.searchParams.get('state');
  19. const fp = await new Promise((resolve) => {
  20. Fingerprint2.get((components) => {
  21. const values = components.map(x => x.value).join('');
  22. const hash = Fingerprint2.x64hash128(values, 31);
  23. resolve(hash);
  24. });
  25. });
  26. // 方式A:App Links(推荐):https://your-domain.com/app-callback?...
  27. // 方式B:自定义 scheme:myapp://fp?...
  28. // 这里用 App Links(更稳,不会 unknown scheme)
  29. const httpsUrl = `https://www.usslot777.com/app-callback?state=${encodeURIComponent(state)}&fp=${encodeURIComponent(fp)}&ua=${encodeURIComponent(navigator.userAgent)}`;
  30. const schemeUrl = `usslot777://callback?state=${encodeURIComponent(state)}&fp=${encodeURIComponent(fp)}&ua=${encodeURIComponent(navigator.userAgent)}`;
  31. // 先走 App Links
  32. location.href = schemeUrl;
  33. // 600~1200ms 后再尝试 scheme(如果 https 没拉起 App,用户还在浏览器里)
  34. setTimeout(() => {
  35. location.href = httpsUrl;
  36. }, 900);
  37. })();
  38. </script>
  39. </body>
  40. </html>