Skip to content

Master - #2

Merged
theGoodB0rg merged 8 commits into
mainfrom
master
Jan 3, 2026
Merged

Master#2
theGoodB0rg merged 8 commits into
mainfrom
master

Conversation

@theGoodB0rg

Copy link
Copy Markdown
Owner

No description provided.

Antigravity added 8 commits December 31, 2025 19:28
- Added FileOutputHook to intercept Bitmap.compress and FileOutputStream writes
- Fixed XSharedPreferences issue by using external storage path (/sdcard/.camerainterceptor/)
- Added fallback path detection in HookDispatcher.findInjectableImagePath()
- Fixed infinite recursion by reading raw file bytes instead of using Bitmap.compress
- Added isLoadingInternalImage flag to prevent hook re-entry
- Updated ImagePickerActivity to save to world-readable external storage
- Camera.takePicture() hook now successfully delivers injected image
- Add isProfilingEnabled() to HookDispatcher
- Create missing list_item_app_mode.xml layout
- Add FileOutputStream.write(byte[], int, int) hook for Pattern 2 apps
- Improve JPEG detection with isJpegDataAtOffset and isValidJpegStructure
- Enhance Logger with debug mode toggle and statistics tracking
- Add hook-specific logging methods (logHookTriggered, logInjectionSuccess, logInjectionFailure)
- Implement rate limiting for rapid captures (100ms minimum interval)
- Add image caching with SoftReference (GC-friendly under memory pressure)
- Add max file size check (10MB limit)
- Add OOM error handling with cache clearing
- Create MediaStoreHook.java for modern Android 10+ save paths
- Hook MediaStore.Images.Media.insertImage(Bitmap) - replaces bitmap parameter
- Hook MediaStore.Images.Media.insertImage(Path) - replaces file path parameter
- Hook ContentResolver.openFileDescriptor() for scoped storage writes
- Hook ContentResolver.openFileDescriptor() with CancellationSignal overload
- Register MediaStoreHook in MainHook

Estimated coverage improvement: 70% -> 80%
- Add PNG format support to Bitmap.compress hook (JPEG + PNG now intercepted)
- Add PNG header detection (89 50 4E 47 magic bytes)
- Add isImageData() helper for unified JPEG/PNG detection
- Extend isImageFile() to detect .webp, screenshot, capture filenames
- Update InterceptingOutputStream for PNG interception
- Improve logging to show detected format type

Estimated coverage improvement: 80% -> 85%
- CameraHook: Add 2s timeout, only block original capture after confirming valid image data
- Camera2Hook: Add comprehensive try-catch, never break app's camera flow
- FileOutputHook: Add null checks and graceful fallback for Bitmap.compress
- Add GitHub Actions workflow for automatic APK builds on source changes
- Update .gitignore for Android projects

This prevents app crashes/hangs when injection fails for any reason.
@theGoodB0rg
theGoodB0rg merged commit 8c40dd5 into main Jan 3, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant