Split monolithic jailbreak.c into reusable shared modules#2
Draft
Split monolithic jailbreak.c into reusable shared modules#2
Conversation
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…evice_compat Agent-Logs-Url: https://github.com/OpenJailbreak/absinthe/sessions/b015be3d-d0c6-458b-a2b2-49f98cd8da3f Co-authored-by: posixninja <50025+posixninja@users.noreply.github.com>
Agent-Logs-Url: https://github.com/OpenJailbreak/absinthe/sessions/b015be3d-d0c6-458b-a2b2-49f98cd8da3f Co-authored-by: posixninja <50025+posixninja@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Refactor code to split into reusable components
Split monolithic jailbreak.c into reusable shared modules
Apr 4, 2026
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.
jailbreak.cwas a 3000+ line monolith with several helper functions copy-pasted verbatim acrosstools/mb2insert.c,tools/injectconf.c,src/idevicebackup2.c, andsrc/afc.c. This extracts those duplicates into proper shared modules.New modules
src/afc_utils.c/h— AFC helpersConsolidates 5+ independent copies of the same functions:
afc_dictionary_free()— replacesfree_dictionary/afc_free_dictionaryafc_rmdir_recursive()— replacesrmdir_recursive_afcafc_upload_file()/afc_upload_file_as()— extracted fromjailbreak.conlysrc/vpn_config.c/h— VPN on-demand configurationConsolidates 4+ independent copies:
vpn_prefs_remove_entry()— replacesprefs_remove_entry_if_presentvpn_prefs_add_entry()— replacesprefs_add_entryVPN_CONNECTION_NAMEandVPN_TRIGGER_ADDRESSdefinessrc/device_compat.c/h— Device compatibility tabledevices_vmaddr_libcopyfile[]out ofjailbreak.h(was incorrectly astaticarray in a header — each translation unit got its own copy)compatible_devices[],get_libcopyfile_vmaddr(),jb_device_is_supported(),jb_check_consistency(),verify_product(),check_consistency()out ofjailbreak.cUpdated callers
src/jailbreak.c,src/jailbreak.h,src/afc.c,src/idevicebackup2.c,tools/mb2insert.c,tools/injectconf.c,src/Makefile.am,tools/Makefile.am.jailbreak.hkeeps aCONNECTION_NAMEalias pointing toVPN_CONNECTION_NAMEfor backward compatibility with any out-of-tree consumers.Original prompt