Skip to content

WIP: Next Prof Release Candidate#779

Draft
prathieshna wants to merge 278 commits intonextfrom
NEXT-WITHOUT-STORACHA
Draft

WIP: Next Prof Release Candidate#779
prathieshna wants to merge 278 commits intonextfrom
NEXT-WITHOUT-STORACHA

Conversation

@prathieshna
Copy link
Copy Markdown

•⁠ ⁠Bug Fixes Reported by QA
•⁠ ⁠⁠Security Fixes based on the document
•⁠ ⁠⁠Storacha Removed
•⁠ ⁠⁠C2PA chnages with additional data similar to Proofmode Legacy
•⁠ ⁠⁠TOR - cTOR based

Prathieshna Vekneswaran and others added 30 commits September 10, 2025 23:44
# Conflicts:
#	gradle/libs.versions.toml
corrected version name for core-ktx in libs.versions.toml
- Refactored `StorachaAccountDetailsFragment` to display detailed plan information (name, storage limit, cost) and a sortable list of spaces with their usage.
- Added loading indicators with appropriate messages to `StorachaAccountDetailsFragment` and `StorachaViewAccountsFragment`.
- Implemented retry logic with token regeneration in `BridgeUploader` for `store/add`, `upload/add`, and S3 uploads to handle token expirations and temporary network issues.
- Improved error handling in `StorachaMediaFragment` to show user-friendly dialogs for upload failures, with an option to retry the last failed upload.
- Added `PlanInfo.kt` model to manage and format storage plan details.
- Introduced `SpacesUsageAdapter.kt` to display and sort space usage in `StorachaAccountDetailsFragment`.
- Updated layouts and string resources to support these changes.
storacha: adjust grid item layout
Added `SwipeRefreshLayout` to `StorachaMediaFragment` and `StorachaBrowseSpacesFragment`.
Updated `StorachaMediaViewModel` to support refreshing media list from the start.
Modified loading indicators to avoid dual display during pull-to-refresh.
… fix

- Integrated `isAdmin` flag throughout Storacha upload process in BridgeUploader and related ViewModels/Fragments.
- Updated Storacha service base URL.
- Corrected pagination logic in `StorachaMediaViewModel` to properly handle refresh, first load, and prevent duplicate entries.
- Adjusted scroll listener threshold in `StorachaMediaFragment` for earlier pagination trigger.
- Minor UI tweaks in Storacha account details screen.
App version bump to 4.0.4
- Improved Storacha disclaimer with a link to learn more.
- Refined various UI text and labels for clarity and consistency.
- Added user-friendly error messages for upload failures.
- Renamed "Manage DIDs" to "Manage Accounts" for better user understanding.
Prathieshna Vekneswaran and others added 13 commits March 24, 2026 22:50
- Hide `didKey` field in `StorachaBrowseSpacesAdapter` to simplify the UI.
- Update `SpaceSetupScreen` to use Filecoin branding, including a new icon and updated titles/subtitles.
- Adjust header height in `fragment_storacha_client_qr.xml` to `wrap_content`.
- Update strings to reflect Filecoin branding and clarify storage options in onboarding hints.
- Refine disclaimer and warning messages regarding decentralized storage/CID accessibility.
In app/build.gradle.kts:
- Increment versionCode to 30029
- Update versionName to 4.0.6
…, and improve file cleanup

- Upgrade Room dependencies to androidx.room3 across the project.
- Add thumbnail support to Evidence and improve media representation in UI.
- Enhance file cleanup logic by separating uploaded media artifact deletion.
- Update database schema version and related migration scripts.
refactor(database): migrate to androidx.room3, add thumbnail handling…
…tercept camera results in PreviewMedia

- **SetupLicenseScreen.kt**: Add `BackHandler` to disable the back button when `spaceType` is `INTERNET_ARCHIVE`.
- **PreviewMediaViewModel.kt**: Expose the internal `navigator` to support content picker launchers.
- **PreviewMediaScreen.kt**:
    - Implement `ResultEffect` to intercept `CAMERA_CAPTURE_RESULT`, preventing parent screens from re-navigating.
    - Handle camera capture imports (archive lookup and evidence creation) within a coroutine scope using `ProjectRepository` and `MediaRepository`.
- **build.gradle.kts**: Remove the Koin compiler plugin and annotations dependency, as the project uses DSL-based modules and the plugin caused incremental build errors.
- Replace the separate add icon and spacer with a text-based "+" prefix.
- Update button colors to use MaterialTheme tertiary scheme.
- Apply titleMedium typography with SemiBold weight and 18sp font size.
- Refine padding and remove hardcoded text color in favor of theme content color.
- Add `BackHandler` to close the navigation drawer if it is open.
- Add `BackHandler` to navigate from the settings tab back to the media tab.
*   **UI/UX**: Refactor `MainMediaViewModel` to handle evidence status transitions more robustly, ensuring `UPLOADED` status takes precedence over transient progress updates.
*   **Architecture**: Hoist `UploadManagerViewModel` in `HomeScreen` to prevent its lifecycle from being tied to the visibility of the upload manager bottom sheet, preventing unnecessary re-initialization and flow cancellations.
*   **Reactivity**: Implement `InvalidationBus` in `EvidenceRepositoryImpl` to trigger reactive UI updates across the app whenever media or collections are modified.
*   **Upload Manager**: Update `UploadManagerViewModel` to reactively observe the upload queue via `InvalidationBus` instead of relying solely on manual refreshes or event-based removals.
*   **Upload Service**: Add logic to `UploadService` to skip items in an `ERROR` state during processing to prevent infinite retry loops.
*   **Stability**: Add null safety checks and explicit error handling for input streams in `RequestBodyUtil`.
- Enhanced `MetadataCollector` to capture comprehensive device, location, and network metadata, mirroring the ProofMode v1.0.25 schema.
- Added collection of altitude, accuracy, bearing, speed, provider, and timestamp to location data.
- Implemented network status and IP address detection (IPv4/IPv6).
- Added cellular tower information collection (supporting GSM, LTE, WCDMA, and NR/5G) via `READ_PHONE_STATE` permission.
- Updated `MediaPicker` to write extended EXIF tags (GPS metadata, device info, software version) to image files before hashing.
- Improved C2PA manifest generation to include the full proof metadata map for interoperability.
- Updated settings to request both `ACCESS_FINE_LOCATION` and `READ_PHONE_STATE` permissions when enabling provenance features.
- Refined MIME type detection fallback logic for imported media.
- Completely remove all Storacha (Filecoin) service code, including fragments, view models, network services, and data models.
- Delete associated UI resources, such as layouts, drawables, and navigation graphs.
- Remove Storacha-related strings and configuration entries.
- Update repository interfaces, database mappers, and domain models to remove Storacha support.
- Clean up the space setup flow and main navigation drawer to exclude Storacha options.
- Remove Storacha dependency injection module and network security configurations.
Cherry-picked from NEXT-FDROID-C2PA-TOR-STORACHA-DWEB-COMPOSE-SECURITY-FIXES:

- Security Hardening: C2paKeyStore + VaultCredentialStore for AES-GCM
  encrypted credential storage via Android Keystore; lazy migration of
  legacy plaintext passwords in SugarSpaceRepository; disabled
  android:allowBackup; restricted ACTION_SEND MIME types.
- Passcode & Navigation: PasscodeGate integrated into HomeActivity to
  hold shared URIs until authenticated; PasscodeEntryRoute added as
  global lock screen; verification-only mode in PasscodeEntryActivity.
- Storage & Maintenance: CacheCleanupWorker (7-day / 100MB prune);
  temp media storage moved to filesDir/media_temp; ShareUtils updated
  to filesDir/share_images.
- Storacha-specific changes excluded (StorachaMediaFragment, named
  storacha_okhttp client).
@prathieshna prathieshna changed the title Next Prof Release Candidate WIP: Next Prof Release Candidate Apr 2, 2026
@prathieshna prathieshna marked this pull request as draft April 2, 2026 11:06
Copy link
Copy Markdown

@github-advanced-security github-advanced-security AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

detekt found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@prathieshna prathieshna requested a review from Elelan April 2, 2026 11:11
@prathieshna prathieshna self-assigned this Apr 2, 2026
@prathieshna prathieshna added the Needs QA Should be done now, please test! label Apr 2, 2026
Prathieshna Vekneswaran and others added 11 commits April 3, 2026 11:42
- Change `PasscodeGate` registration from Activity lifecycle to `ProcessLifecycleOwner` to prevent accidental locking during Activity transitions.
- Update `to_get_started_more_hint` string to remove Filecoin reference and simplify wording.
- Customize `Switch` colors in `C2paScreen` to use white thumbs and tertiary track colors when enabled.
…service handling

- Handle `ForegroundServiceStartNotAllowedException` on Android 12+ by deferring Tor service startup until the app enters the foreground.
- Implement a workaround for a bug in `tor-android` 0.4.9.5.1 where the library fails to subscribe to `NOTICE` events, preventing "Bootstrapped 100%" status broadcasts.
- Update `TorForegroundService` to manually subscribe to `NOTICE` events and verify bootstrap status via the control port.
- Modify `SnowbirdService` to wait for Tor to reach a ready state before initializing the Rust bridge to prevent resource contention and connection failures.
- Adjust `HomeActivity` startup sequence to ensure `SnowbirdService` starts after intent handling.
- Add `strings.xml` for Central Kurdish (ckb) localization.
- Fix logic in `SettingsScreen.kt` to prevent premature passcode state updates before setup completion.
- Implement a two-step project picker bottom sheet for media imported via the Android share-sheet, allowing users to select a specific server and folder for the upload.
- Introduce `SharedImportState` to manage pending URIs across the import lifecycle.
- Refactor `HomeActivity` to handle intent-based imports using an explicit list of supported MIME types instead of wildcards.
- Update `HomeViewModel` and `HomeState` to support the new shared import workflow and UI states.
- Set `HomeActivity` to `singleTask` launch mode for better intent handling.
- Ensure `ResultEventBus` creates channels eagerly to prevent missed events.
- Add debug logging for the share-sheet import process.
**Core & Repository**
- Added `updatePriorities` to `MediaRepository` and implementations to allow batch updating of media queue priorities.
- Fixed a bug in `HomeActivity` where shared media was re-imported on configuration changes by checking `savedInstanceState`.
- Improved file name resolution in `MediaPicker` to handle URIs without display names.

**Feature Improvements**
- **Home:** Added a snackbar warning if a user attempts to add media without an active folder. Enabled auto-scrolling to the top when refreshing media.
- **Media Review:** Added a "Done" action button to the top bar for saving and finishing. Improved layout handling by adding `imePadding` and using fixed height ratios for previews to prevent keyboard overlap.
- **UI/UX:** Added title overlays to media thumbnails in the main grid. Refined typography and spacing across `FoldersScreen`, `FolderDetailScreen`, and `MainMediaScreen`.
- **Upload Manager:** Optimized reordering performance using batch priority updates and improved drag-handle touch targets.

**Services & Integration**
- **Internet Archive:** Modified `IaConduit` to handle `file://` URIs directly, bypassing `ContentResolver` for local files. Made metadata and C2PA manifest uploads non-fatal.
- **WebDAV:** Wrapped the upload process in a try-catch block for better error reporting and updated `WebDavDetailScreen` to mask passwords.
- **C2PA:** Refactored `C2paScreen` to use `HtmlText` for "Learn More" links and updated the linked URL.

**Bug Fixes & Localization**
- Fixed `HtmlText` styling where the default text color was overriding link styles.
- Added "Folder renamed" string and confirmation message.
- Adjusted UI spacing in license setup and secure field components.
…ES-256-GCM

- Refactor `TinkVaultCredentialStore` and `PasscodeRepository` to use native `AndroidKeyStore` and `Cipher` (AES/GCM/NoPadding) for encryption, removing the Google Tink dependency.
- Remove `ScryptHashingStrategy` and associated Bouncy Castle dependencies.
- Replace ML Kit barcode scanning with ZXing in `QRImageAnalyzer` to reduce binary size (~20MB saving).
- Update `app/proguard-rules.pro` with comprehensive rules for Room, Koin, Retrofit, Serialization, and native JNI bridges.
- Update `app/build.gradle.kts`:
    - Enable ProGuard minification and resource shrinking for release builds.
    - Restrict NDK ABIs to `arm64-v8a` and `armeabi-v7a`.
    - Apply locale filters to strip unused resources.
    - Remove several unused dependencies (Guava, Picasso, ML Kit, Bouncy Castle, etc.).
- Modify `IaConduit` to stop uploading C2PA manifests to Internet Archive and update `MediaPicker` to only generate C2PA manifests for in-app camera captures.
- Improve `FolderBar` UI with updated typography and error colors for destructive actions.
- Bump `versionCode` to 30031 and `versionName` to 4.0.10.
[SECURITY] Replace Tink and Scrypt with native Android Keystore and A…
…tivity checks before starting uploads.

### Core Changes
- **New `UploadGate` Utility**: Introduced a central component to validate network conditions (Wi-Fi requirement) and Tor status before proceeding with uploads. It includes specific logic to skip Tor checks for DWeb (Snowbird) storage.
- **Improved Background Resumption**: Added `checkIfQueued` to `UploadGate` to prevent spurious connectivity dialogs when the app resumes if the upload queue is empty.
- **Enhanced Error Handling in `WebDavConduit`**: Added explicit checks for file existence (ENOENT) before upload. If a file is missing, the evidence record is now deleted to prevent the queue from getting stuck in a permanent error state.
- **Upload Cancellation Fix**: Updated `Conduit` to reset cancelled uploads to a `QUEUED` status and clear transient UI progress, ensuring they can be retried in the next session.
- **ProGuard Optimization**: Added `-optimizations !class/merging/*` to prevent R8 from merging `CleanInsights` configuration classes, which previously caused Moshi serialization failures.

### UI and Integration
- Integrated `UploadGate` into `HomeActivity`, `HomeViewModel`, `UploadManagerViewModel`, and `PreviewMediaViewModel` to wrap upload triggers.
- Added `NetworkUtils.isOnWifi` helper.
- Added localized strings for Wi-Fi and Tor connectivity warnings.
- Registered `UploadGate` in `TorModule` for dependency injection.
- Add `REVIEW_MEDIA_SAVED` constant to `NavigationResultKeys`.
- Trigger `REVIEW_MEDIA_SAVED` event in `ReviewMediaViewModel` after successfully saving media.
- Observe `REVIEW_MEDIA_SAVED` in `PreviewMediaViewModel` to reset selection state (clear `selectedIds` and `selectionCount`) when media is saved.
Updated and synchronized `strings.xml` for multiple languages:
- Added new translations and corrected existing strings for Arabic, Spanish, Farsi, French, Russian, Turkish, and Ukrainian.
- Added comprehensive new localization support for Belarusian, Kurdish, Polish, Portuguese (Brazil), Chinese (Simplified), Chinese (Traditional), and Chinese (Hong Kong).
- Synchronized Transifex metadata and formatting across resource files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs QA Should be done now, please test!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants