Created
April 25, 2020 17:03
-
-
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
This file contains 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
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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:
chmod +x UIWebViewFrameworkHunter.sh
./UIWebViewFrameworkHunter.sh