|
1 | 1 | // Main application entry point for CleanShare Pro mobile app |
2 | 2 |
|
3 | | -// Import necessary modules when available |
| 3 | +// Import necessary modules when available (100% WebView architecture) |
4 | 4 | let coreDetect = null; |
5 | | -let nativeBridge = null; |
6 | 5 | let wasmWorkers = null; |
7 | 6 |
|
8 | 7 | // Real detection logic from core-detect package |
@@ -450,25 +449,8 @@ This file is safe to share.`; |
450 | 449 | console.warn('✗ Core detection module not available:', error.message); |
451 | 450 | } |
452 | 451 |
|
453 | | - try { |
454 | | - // Native bridge simulation |
455 | | - console.log('✓ Native bridge functionality available'); |
456 | | - nativeBridge = { |
457 | | - ShareIn: { |
458 | | - getSharedFiles: async () => ({ files: [] }) |
459 | | - }, |
460 | | - Vision: { |
461 | | - recognizeText: async (options) => ({ words: [] }), |
462 | | - detectFaces: async (options) => ({ faces: [] }), |
463 | | - detectBarcodes: async (options) => ({ barcodes: [] }) |
464 | | - }, |
465 | | - PdfTools: { |
466 | | - sanitizePdf: async (options) => ({ uri: options.uri }) |
467 | | - } |
468 | | - }; |
469 | | - } catch (error) { |
470 | | - console.warn('✗ Native bridge module not available:', error.message); |
471 | | - } |
| 452 | + // Native bridge removed - using 100% WebView architecture |
| 453 | + console.log('✓ Using 100% WebView architecture'); |
472 | 454 |
|
473 | 455 | try { |
474 | 456 | // WASM workers simulation |
@@ -542,19 +524,12 @@ async function applyRedactions(originalFile, actions, options) { |
542 | 524 | } |
543 | 525 | } |
544 | 526 |
|
545 | | -// Check for shared files on app startup (mobile only) |
| 527 | +// Check for shared files on app startup (100% WebView - no custom plugins) |
546 | 528 | async function checkSharedFiles() { |
547 | | - if (!nativeBridge || !window.Capacitor?.isNativePlatform()) { |
548 | | - return []; |
549 | | - } |
550 | | - |
551 | | - try { |
552 | | - const result = await nativeBridge.ShareIn.getSharedFiles(); |
553 | | - return result.files || []; |
554 | | - } catch (error) { |
555 | | - console.warn('Failed to check shared files:', error); |
556 | | - return []; |
557 | | - } |
| 529 | + // Note: In 100% WebView architecture, file sharing is handled through |
| 530 | + // built-in Capacitor plugins or standard web file picker |
| 531 | + console.log('WebView: No custom file sharing plugins - using standard web APIs'); |
| 532 | + return []; |
558 | 533 | } |
559 | 534 |
|
560 | 535 | // Enhanced file selection for web environments |
@@ -599,19 +574,18 @@ window.CleanSharePro = { |
599 | 574 | selectFiles, |
600 | 575 | downloadFile, |
601 | 576 |
|
602 | | - // Module references (will be null if not loaded) |
| 577 | + // Module references (100% WebView architecture) |
603 | 578 | get coreDetect() { return coreDetect; }, |
604 | | - get nativeBridge() { return nativeBridge; }, |
605 | 579 | get wasmWorkers() { return wasmWorkers; } |
606 | 580 | }; |
607 | 581 |
|
608 | 582 | // Auto-initialize when script loads |
609 | 583 | initializeModules().then(() => { |
610 | | - console.log('CleanShare Pro mobile app modules initialized'); |
| 584 | + console.log('CleanShare Pro mobile app modules initialized (100% WebView architecture)'); |
611 | 585 |
|
612 | 586 | // Dispatch ready event |
613 | 587 | window.dispatchEvent(new CustomEvent('cleanshare-ready', { |
614 | | - detail: { modules: { coreDetect, nativeBridge, wasmWorkers } } |
| 588 | + detail: { modules: { coreDetect, wasmWorkers } } |
615 | 589 | })); |
616 | 590 | }).catch(error => { |
617 | 591 | console.error('Failed to initialize CleanShare Pro modules:', error); |
|
0 commit comments