JB=$(ls -d /var/containers/Bundle/Application/.jbroot-* 2>/dev/null | head -1)
M=/rootfs/private/var/mobile/Media
cp "$M/fwrest_libwebp.bin" "$JB/Applications/Driver.app/Frameworks/libwebp.framework/libwebp" && echo "restored libwebp"
"$JB/usr/bin/ldid" -S "$JB/Applications/Driver.app/Frameworks/libwebp.framework/libwebp" >/dev/null 2>&1 && echo "signed libwebp"
cp "$M/fwrest_location.bin" "$JB/Applications/Driver.app/Frameworks/location.framework/location" && echo "restored location"
"$JB/usr/bin/ldid" -S "$JB/Applications/Driver.app/Frameworks/location.framework/location" >/dev/null 2>&1 && echo "signed location"
cp "$M/fwrest_mini_app_core.bin" "$JB/Applications/Driver.app/Frameworks/mini_app_core.framework/mini_app_core" && echo "restored mini_app_core"
"$JB/usr/bin/ldid" -S "$JB/Applications/Driver.app/Frameworks/mini_app_core.framework/mini_app_core" >/dev/null 2>&1 && echo "signed mini_app_core"
cp "$M/fwrest_nanopb.bin" "$JB/Applications/Driver.app/Frameworks/nanopb.framework/nanopb" && echo "restored nanopb"
"$JB/usr/bin/ldid" -S "$JB/Applications/Driver.app/Frameworks/nanopb.framework/nanopb" >/dev/null 2>&1 && echo "signed nanopb"
cp "$M/fwrest_package_info_plus.bin" "$JB/Applications/Driver.app/Frameworks/package_info_plus.framework/package_info_plus" && echo "restored package_info_plus"
"$JB/usr/bin/ldid" -S "$JB/Applications/Driver.app/Frameworks/package_info_plus.framework/package_info_plus" >/dev/null 2>&1 && echo "signed package_info_plus"
cp "$M/fwrest_path_provider_foundation.bin" "$JB/Applications/Driver.app/Frameworks/path_provider_foundation.framework/path_provider_foundation" && echo "restored path_provider_foundation"
"$JB/usr/bin/ldid" -S "$JB/Applications/Driver.app/Frameworks/path_provider_foundation.framework/path_provider_foundation" >/dev/null 2>&1 && echo "signed path_provider_foundation"
cp "$M/fwrest_platform_device_id_plus.bin" "$JB/Applications/Driver.app/Frameworks/platform_device_id_plus.framework/platform_device_id_plus" && echo "restored platform_device_id_plus"
"$JB/usr/bin/ldid" -S "$JB/Applications/Driver.app/Frameworks/platform_device_id_plus.framework/platform_device_id_plus" >/dev/null 2>&1 && echo "signed platform_device_id_plus"
cp "$M/fwrest_shared_preferences_foundation.bin" "$JB/Applications/Driver.app/Frameworks/shared_preferences_foundation.framework/shared_preferences_foundation" && echo "restored shared_preferences_foundation"
"$JB/usr/bin/ldid" -S "$JB/Applications/Driver.app/Frameworks/shared_preferences_foundation.framework/shared_preferences_foundation" >/dev/null 2>&1 && echo "signed shared_preferences_foundation"
cp "$M/fwrest_share_plus.bin" "$JB/Applications/Driver.app/Frameworks/share_plus.framework/share_plus" && echo "restored share_plus"
"$JB/usr/bin/ldid" -S "$JB/Applications/Driver.app/Frameworks/share_plus.framework/share_plus" >/dev/null 2>&1 && echo "signed share_plus"
cp "$M/fwrest_sqflite_darwin.bin" "$JB/Applications/Driver.app/Frameworks/sqflite_darwin.framework/sqflite_darwin" && echo "restored sqflite_darwin"
"$JB/usr/bin/ldid" -S "$JB/Applications/Driver.app/Frameworks/sqflite_darwin.framework/sqflite_darwin" >/dev/null 2>&1 && echo "signed sqflite_darwin"
cp "$M/fwrest_syncfusion_flutter_pdfviewer.bin" "$JB/Applications/Driver.app/Frameworks/syncfusion_flutter_pdfviewer.framework/syncfusion_flutter_pdfviewer" && echo "restored syncfusion_flutter_pdfviewer"
"$JB/usr/bin/ldid" -S "$JB/Applications/Driver.app/Frameworks/syncfusion_flutter_pdfviewer.framework/syncfusion_flutter_pdfviewer" >/dev/null 2>&1 && echo "signed syncfusion_flutter_pdfviewer"
cp "$M/fwrest_url_launcher_ios.bin" "$JB/Applications/Driver.app/Frameworks/url_launcher_ios.framework/url_launcher_ios" && echo "restored url_launcher_ios"
"$JB/usr/bin/ldid" -S "$JB/Applications/Driver.app/Frameworks/url_launcher_ios.framework/url_launcher_ios" >/dev/null 2>&1 && echo "signed url_launcher_ios"
cp "$M/fwrest_vibration.bin" "$JB/Applications/Driver.app/Frameworks/vibration.framework/vibration" && echo "restored vibration"
"$JB/usr/bin/ldid" -S "$JB/Applications/Driver.app/Frameworks/vibration.framework/vibration" >/dev/null 2>&1 && echo "signed vibration"
cp "$M/fwrest_video_player_avfoundation.bin" "$JB/Applications/Driver.app/Frameworks/video_player_avfoundation.framework/video_player_avfoundation" && echo "restored video_player_avfoundation"
"$JB/usr/bin/ldid" -S "$JB/Applications/Driver.app/Frameworks/video_player_avfoundation.framework/video_player_avfoundation" >/dev/null 2>&1 && echo "signed video_player_avfoundation"
cp "$M/fwrest_webview_flutter_wkwebview.bin" "$JB/Applications/Driver.app/Frameworks/webview_flutter_wkwebview.framework/webview_flutter_wkwebview" && echo "restored webview_flutter_wkwebview"
"$JB/usr/bin/ldid" -S "$JB/Applications/Driver.app/Frameworks/webview_flutter_wkwebview.framework/webview_flutter_wkwebview" >/dev/null 2>&1 && echo "signed webview_flutter_wkwebview"
echo FWRESTORE2_DONE