Fix multiple code quality and security issues#11
Open
oyvindbso wants to merge 3 commits into
Open
Conversation
This commit addresses several critical and high-severity issues identified during code review: Security Fixes: - Disable cleartext HTTP traffic globally in network_security_config.xml - Remove API key logging (even partial) from ZoteroApiClient - Add null safety checks for API response fields to prevent NPEs Resource Management: - Fix resource leak in writeResponseBodyToDisk() using try-with-resources - Properly close streams even if exceptions occur during file operations Fragment Lifecycle: - Fix race conditions in CollectionFragment where getActivity() could become null between check and use - Store activity reference in local variable before checking and using it - Prevents crashes when fragments are detached during async operations Build Configuration: - Enable lint checks (abortOnError and checkReleaseBuilds) - Remove duplicate testOptions blocks - Allow lint to catch issues before they reach production
This commit adds a copy button to each book cover that copies either a web library link or internal Zotero link to the clipboard, based on user preference. Features: - Added small copy button (icon) in the top-right corner of each book cover - New setting in Settings to choose between web library links and internal Zotero links - Web link format: https://www.zotero.org/{username}/items/{itemId} - Internal link format: zotero://select/library/items/{itemId} - Toast notification confirms which link type was copied Implementation: - Added LINK_TYPE_WEB and LINK_TYPE_INTERNAL constants to UserPreferences - Added getLinkType() and setLinkType() methods to UserPreferences - Added link type radio group to Settings layout - Created ic_copy.xml vector drawable (white copy icon) - Modified grid_item_cover.xml to add ImageButton overlaying the cover image - Updated CoverGridAdapter to handle copy button clicks and clipboard operations - Updated SettingsActivity to load/save link type preference User Experience: - Small, unobtrusive button in corner of each cover - Copies link instantly with visual feedback via toast - User can configure link type once in settings
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit addresses several critical and high-severity issues identified during code review:
Security Fixes:
Resource Management:
Fragment Lifecycle:
Build Configuration: