Last active
April 25, 2017 00:17
-
-
Save jjsahalf/f2024fcbd3e7cb60436d9776c02d7770 to your computer and use it in GitHub Desktop.
handy shell 2
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
#!/bin/bash | |
cd ../runnableJar/target/sootOutput/ | |
v=$(find . -name "*apk") | |
cd ../../../Done/ | |
for line in $v | |
do | |
echo $(pwd) | |
echo $line | |
cp -v $line /data/RedDroid/evaluation/original/ | |
done |
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
#!/bin/bash | |
find . -name "*apk" | while read line | |
do | |
apktool d $line | |
rm $line | |
dirname=$(echo $line | sed 's/\.apk//g') | |
echo $dirname | |
cd $dirname | |
find . -name "android_wear_micro_apk*" | while read innerline | |
do | |
echo $innerline | |
rm $innerline | |
done | |
grep -r "android_wear_micro_apk" . | sed 's/:.*//g' | while read innerline2 | |
do | |
sed --in-place '/android_wear_micro_apk/d' $innerline2 | |
done | |
cd .. | |
apktool b $dirname -o "${dirname}.apk" | |
done |
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
#!/bin/bash | |
find . -name "*apk" | while read line | |
do | |
printf "\n" | |
echo "processing ${line} ..." | |
dirname=$(echo $line | sed 's/\.apk//g') | |
echo $dirname | |
unzip $line -d $dirname | |
cd $dirname | |
if [ -d "lib" ]; then | |
cd "lib" | |
dirNum=$(find . -mindepth 1 -type d | wc -l) | |
echo "there are ${dirNum} directories in lib" | |
if [ $dirNum -gt 1 ]; then | |
if [ -d "arm64-v8a" ]; then | |
rm -r "arm64-v8a" | |
echo "arm64-v8a has been removed" | |
fi | |
if [ -d "x86" ]; then | |
rm -r "x86" | |
echo "x86 has been removed" | |
fi | |
if [ -d "x86_64" ]; then | |
rm -r "x86_64" | |
echo "x86_64 has been removed" | |
fi | |
if [ -d "mips" ]; then | |
rm -r "mips" | |
echo "mips has been removed" | |
fi | |
if [ -d "mips64" ]; then | |
rm -r "mips64" | |
echo "mips64 has been removed" | |
fi | |
if [ -d "armeabi" ] && [ -d "armeabi-v7a" ]; then | |
rm -r "armeabi" | |
echo "armeabi has been removed" | |
fi | |
fi | |
cd .. | |
fi | |
cd .. | |
cleanDirName=$( echo "${dirname}" | sed 's/\.\///g') | |
echo ${cleanDirName} | |
if [ $dirNum -gt 1 ]; then | |
echo "move ${dirname} ..." | |
mv "$dirname" "./modified" | |
unzip $line -d $dirname | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment