最近上架一个老项目总是收到如下内容的邮件:
由于项目太老,第三方库中存在UIWebView被拒
以下有两种方式查看项目中是否用到了UIWebView
1.cd到项目的根目录
2.复制一下命令到终端并执行
方式一:
find . \( -name "*.framework" -o -name "*.a" \) -exec sh -c '
usefullArray=();
echo "------------<🔎 search in *.framework & *.a>-------------"
for file do
if nm "$file"/`basename "$file" | sed -e s/\\.framework$//g` 2>/dev/null | grep UIWebView > /dev/null;
then
usefullArray+=("$file")
#echo "⚠️ UIWebView appears in "$file"";
else
echo "✅ UIWebView does not appear in "$file"";
fi;
done
echo "------------------------------------------------"
for i in "${usefullArray[@]}"
do
echo "⚠️ UIWebView appears in "$i"";
done
echo "------------------------------------------------"
echo "🎉 Done!"
' sh {} +
方式二:
find . \( -name "*.framework" -o -name "*.a" -o -name "*.h" -o -name "*.m" -o -name "*.swift" \) -exec sh -c '
usefullArray=();
echo "------------<🔎 search in *.framework & *.a & .h. m .swift>-------------"
for file do
if nm "$file"/`basename "$file" | sed -e s/\\.framework$//g` 2>/dev/null | grep UIWebView > /dev/null;
then
usefullArray+=("$file")
#echo "⚠️ UIWebView appears in "$file"";
else
echo "✅ UIWebView does not appear in "$file"";
fi;
done
echo "------------------------------------------------"
for i in "${usefullArray[@]}"
do
echo "⚠️ UIWebView appears in "$i"";
done
echo "------------------------------------------------"
echo "🎉 Done!"
' sh {} +