Skip to content

Instantly share code, notes, and snippets.

@jspargo
Created April 25, 2020 17:03
Show Gist options
  • Save jspargo/4eaaf66f55d45bf378e696e982bcfb50 to your computer and use it in GitHub Desktop.
Save jspargo/4eaaf66f55d45bf378e696e982bcfb50 to your computer and use it in GitHub Desktop.
UIWebView Framework Hunter - Search a directory or repository for frameworks that use UIWebViews, which are deprecated
#!/usr/bin/env bash
set -o pipefail
export LANG=en_US.UTF-8
export location=${PWD}
GREEN='\033[0;32m'
RED='\033[0;31m'
NC='\033[0m' # No Color
echo "Searching for all frameworks in ${location}":
frameworks=$(find . -name "*.framework*")
for frameworkPath in $frameworks; do
echo "Searching for UIWebView in ${frameworkPath}"
framework=$(echo $frameworkPath | perl -lne '/([a-zA-Z0-9_-]*)(?=\.framework+)/ && print $1')
fullPath="${frameworkPath}/${framework}"
nm $fullPath | grep "UIWebView"
if [ $? != 0 ]; then
echo -e "${GREEN}PASS: No UIWebView Symbols found in ${framework}${NC}"
else
echo -e "${RED}FAIL: UIWebView Symbols found in ${framework}${NC}"
fi
done
@jspargo
Copy link
Author

jspargo commented Apr 26, 2020

Run this script to see which frameworks in your iOS or macOS app are still using UIWebView, which has been deprecated by Apple. To run this script, download it as a zip file by pressing 'Download ZIP' above, and decompress the zip file to get the bash script. Move this script to the top level of your apps directory structure, and run it!
You may need to change the permission first:

  1. chmod +x UIWebViewFrameworkHunter.sh
  2. ./UIWebViewFrameworkHunter.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment