obfuscate.sh 1.63 KB
Newer Older
Motohisa Nakano committed
1 2 3
#!/bin/sh
DIR=`dirname $0`/..

Masaru Abe committed
4 5 6 7 8 9
TARGET0=""
TARGET1=""
TARGET2=""

if [ $# -eq 1 ]; then
  TARGET0=$1
Masaru Abe committed
10 11
else
  TARGET0="abvw"
Masaru Abe committed
12 13
fi

Motohisa Nakano committed
14
# abvw/js/*
Masaru Abe committed
15
if [ "$TARGET0" = "abvw" ]; then
Masaru Abe committed
16
   TARGET1='Limit_Access_Content.js bookmark.js contentsearch.js contentview.js contentview_3d.js contentview_Anket.js contentview_CallApi.js contentview_ContentTypeNone.js contentview_CreateObjects.js contentview_Events.js contentview_General.js contentview_GetData.js contentview_Gomu.js contentview_ImagePreview.js contentview_InitObjects.js contentview_Maker.js contentview_Marking.js contentview_Memo.js contentview_Paint.js contentview_Pen.js contentview_PopupText.js detail.js header.js history.js home.js login.js settings.js share.js stview.js contentview_Streaming.js contentview_Getits.js'
Masaru Abe committed
17 18 19
else
   TARGET1='contentview.js contentview_3d.js contentview_Anket.js contentview_CallApi.js contentview_ContentTypeNone.js contentview_CreateObjects.js contentview_Events.js contentview_General.js contentview_GetData.js contentview_ImagePreview.js contentview_InitObjects.js contentview_PopupText.js contentview_initDefautValue.js'
fi
Motohisa Nakano committed
20 21

# abvw/common/js
Masaru Abe committed
22
if [ "$TARGET0" = "abvw" ]; then
Masaru Abe committed
23
   TARGET2='avweb.js common.js i18n.js screenLock.js script.js tab.js textObject.js zoomDetector.js'
Masaru Abe committed
24 25 26
else
   TARGET2='avweb.js common.js i18n.js script.js textObject.js zoomDetector.js'
fi
Motohisa Nakano committed
27 28 29 30 31

OBFUSCATE_EXECUTABLE="$DIR/packer/jsPacker.pl -e10"

for f in $TARGET1
do
Masaru Abe committed
32
		ORG=$DIR/$TARGET0/js/$f
Motohisa Nakano committed
33 34 35 36 37 38
		TARGET=$DIR/ob/abvw/js/$f
		$OBFUSCATE_EXECUTABLE -i $ORG -o $TARGET
done

for f in $TARGET2
do
Masaru Abe committed
39
		ORG=$DIR/$TARGET0/common/js/$f
Motohisa Nakano committed
40 41 42
		TARGET=$DIR/ob/abvw/common/js/$f
		$OBFUSCATE_EXECUTABLE -i $ORG -o $TARGET
done