sudo-soldier commited on
Commit
1076925
·
verified ·
1 Parent(s): 9ec3dc9

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +99 -18
index.html CHANGED
@@ -1,19 +1,100 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  </html>
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Browser APK Analyzer</title>
7
+ <style>
8
+ body {
9
+ font-family: Arial, sans-serif;
10
+ max-width: 800px;
11
+ margin: 0 auto;
12
+ padding: 20px;
13
+ line-height: 1.6;
14
+ }
15
+ .container {
16
+ border: 1px solid #ddd;
17
+ padding: 20px;
18
+ border-radius: 8px;
19
+ margin-top: 20px;
20
+ }
21
+ #results {
22
+ margin-top: 20px;
23
+ white-space: pre-wrap;
24
+ background: #f5f5f5;
25
+ padding: 15px;
26
+ border-radius: 5px;
27
+ }
28
+ button {
29
+ background: #4CAF50;
30
+ color: white;
31
+ border: none;
32
+ padding: 10px 15px;
33
+ border-radius: 4px;
34
+ cursor: pointer;
35
+ }
36
+ button:disabled {
37
+ background: #cccccc;
38
+ }
39
+ </style>
40
+ </head>
41
+ <body>
42
+ <h1>Browser APK Analyzer</h1>
43
+ <div class="container">
44
+ <input type="file" id="apkFile" accept=".apk">
45
+ <button id="analyzeBtn" disabled>Analyze APK</button>
46
+
47
+ <div id="results"></div>
48
+ </div>
49
+
50
+ <script>
51
+ const apkInput = document.getElementById('apkFile');
52
+ const analyzeBtn = document.getElementById('analyzeBtn');
53
+ const resultsDiv = document.getElementById('results');
54
+
55
+ apkInput.addEventListener('change', (e) => {
56
+ analyzeBtn.disabled = !e.target.files.length;
57
+ });
58
+
59
+ analyzeBtn.addEventListener('click', async () => {
60
+ const file = apkInput.files[0];
61
+ if (!file) return;
62
+
63
+ analyzeBtn.disabled = true;
64
+ resultsDiv.textContent = "Analyzing...";
65
+
66
+ try {
67
+ // Read basic file info
68
+ const fileInfo = {
69
+ name: file.name,
70
+ size: file.size,
71
+ type: file.type,
72
+ lastModified: new Date(file.lastModified).toLocaleString()
73
+ };
74
+
75
+ // Read as ArrayBuffer for more advanced analysis
76
+ const arrayBuffer = await file.arrayBuffer();
77
+ const uint8Array = new Uint8Array(arrayBuffer);
78
+
79
+ // Simple APK header check (PK zip signature)
80
+ const isApk = uint8Array[0] === 0x50 && uint8Array[1] === 0x4B;
81
+
82
+ // Display results
83
+ resultsDiv.innerHTML = `
84
+ <h3>Basic File Info:</h3>
85
+ <pre>${JSON.stringify(fileInfo, null, 2)}</pre>
86
+
87
+ <h3>APK Analysis:</h3>
88
+ <p>Valid APK/ZIP: ${isApk ? "✅ Yes" : "❌ No"}</p>
89
+ <p>Note: This browser-only version shows limited info. For full analysis, use the Docker version.</p>
90
+ `;
91
+
92
+ } catch (error) {
93
+ resultsDiv.textContent = `Error: ${error.message}`;
94
+ } finally {
95
+ analyzeBtn.disabled = false;
96
+ }
97
+ });
98
+ </script>
99
+ </body>
100
  </html>