MPKG安装程序转换=E680I转A780

零下九度

普通会员
2005-04-29
12
0
0
各位高手大侠同志们
74版A780无法装MPKG软件
经一些大侠研究破解终于可以不刷机装MPKG软件了
但是 这个A780的MPKG安装程序是把这些软件装到手机上的 不象680的可以装到卡了
现在我收集了这两个MPKG安装程序 用记事本打开研究了下里面的代码是几乎差不多了
但因为不是学这个的不会修改

恳请过往大侠研究一下这两个MPKG安装程序 把A780的也能修改成和680一样可以安装到内存卡上 造福广大机油

附件有这两个文件 请大侠们看看吧
 

附件

零下九度

普通会员
2005-04-29
12
0
0
#!/bin/bash
#
# MPKG installation file for A780. Written by yan0, begin from 2005/04/10, finished on 2004/4/26
# Support MPKG file packed by "tar cf" and "tar czvf". Updated on 2005/04/27.
# Support A780, update on 2005/05/05
# Improve on installation, uninstallation. Update on 2005/06/25

export QTDIR=/usr/lib/ezx
if [ -f /bin/alertprocess ]
then
my_alert='/bin/alertprocess'
elif [ -f /usr/SYSqtapp/phone/alertprocess ]
then
my_alert='/usr/SYSqtapp/phone/alertprocess'
fi

my_mid1='/usr/language/ringtone/门铃.mid'
if [ -f /usr/language/ringtone/叮音.mid ]
then
my_mid2='/usr/language/ringtone/叮音.mid'
else
my_mid2='/usr/language/ringtone/叮声.mid'
fi

myphone=''
if grep "A780" /usr/language/ezx_language_version.txt
then
myphone='A780'
elif grep "R51" /usr/language/ezx_language_version.txt
then
myphone='A780'
else
exit
fi

mpkg_file=''

myfile=`basename $0`
mypath=`echo $0 | sed -e 's/'$myfile'//g'`

mpkg_file_yan0=$mypath"MPKG.mpkg"

mpkg_install_directory='/mmc/mmca1/.system/QTDownLoad'

if [ -d /mmc/mmca1/.system ]
then
if [ -d /mmc/mmca1/.system/QTDownLoad ]
then
else
mkdir /mmc/mmca1/.system/QTDownLoad
fi
else
mkdir /mmc/mmca1/.system
mkdir /mmc/mmca1/.system/QTDownLoad
fi

cd $mpkg_install_directory
if [ -d yan0 ]
then
rm -R yan0
fi
mkdir yan0
cd yan0

mypath='non_system'
if echo $0 | grep ".system"
then
mypath='system'
else
mpkg_file=$mpkg_file_yan0
cp /mmc/mmca1/.system/java/PlugCardDB db_file
if [ -f "$mpkg_file" ]
then
if [ -d $mpkg_install_directory/mpkg_install ]
then
rm -R $mpkg_install_directory/mpkg_install
fi
if grep "mpkg_install" db_file
then
grep -n "mpkg_install" db_file >1.tmp
sed 's/:/ /g' 1.tmp |while read a b
do
b=$(($a - 3 ))
a=$(($a + 15 ))
if sed -e ''$b' s/AppLinkRecord/AppLinRecord/g' -e ''$a' s/uid/uid/g' db_file >/dev/null
then
sed -e ''$b','$a'd' db_file > db_file_0
mv db_file_0 db_file
fi
done
cp -f db_file /mmc/mmca1/.system/java/PlugCardDB
fi
else
# Click mpkg.lin in phone/SD without MPKG.mpkg in phone.
$my_alert -playvol 5 -playfile $my_mid2
$my_alert -playvol 10 -playfile $my_mid2
myphone=''
fi

fi

if [ "$2" = "" ]
then
else
mpkg_file="$2"
fi

if [ -f "$mpkg_file" ] && [ "$mpkg_file" != "" ] && [ "$myphone" != "" ]
then

# Packed by "tar cf", use "tar -xf"
if tar -tvf "$mpkg_file" >/dev/null
then
tar -xf "$mpkg_file"

# Packed by "tar czvf", use "tar -xzf"
elif tar -tzvf "$mpkg_file" > /dev/null
then
tar -xzf "$mpkg_file"
fi

dir -1 |while read mpkg
do
if [ -d "$mpkg" ]
then
# Get the target directory
a=""
while [ -d "$mpkg_install_directory/$mpkg$a" ]
do
a=$(($a + 1 ))
done
mpkg2="$mpkg$a"

if [ "$a" != "" ] && ( [ "$myphone" = "A780" ] && [ "$mpkg_file" = "$mpkg_file_yan0" ] )
then
## For A780 & MPKG.mpkg, can only install one time. Assume all MPKG use different directory name.
$my_alert -playvol 5 -playfile $my_mid2
$my_alert -playvol 10 -playfile $mpkg_install_directory/mpkg_install1/mpkg_onlyone.amr

else
# Get desktop file to begin MPKG configuration
cd "$mpkg"
dir -1 *.desktop |while read desktop_file
do
if [ -f "$desktop_file" ]
then

cp "$desktop_file" ../"$desktop_file"
cd ..

cp /mmc/mmca1/.system/java/PlugCardDB db_file
grep "AppLinkCount" db_file |while read a b c
do
b=$(($c + 1 ))
sed -e 's/AppLinkCount = '$c'/AppLinkCount = '$b'/g' db_file > db_file_0
echo [AppLinkRecord$b] >mpkg.tmp
echo "uid = "$b >1.tmp
done

echo "AllPosition = " >>mpkg.tmp
grep "^BigIcon" "$desktop_file" >>mpkg.tmp

if [ "$myphone" = "A780" ]
then
echo "Directory =" $mpkg2 >>mpkg.tmp
else
echo "Directory = ../../../.."$mpkg_install_directory"/"$mpkg2 >>mpkg.tmp
fi

grep "^Exec" "$desktop_file" >>mpkg.tmp

if [ "$myphone" = "A780" ]
then
echo Group = 1 >>mpkg.tmp
else
echo Group = 5 >>mpkg.tmp
fi

grep "^Icon" "$desktop_file" >>mpkg.tmp

dir --full-time mpkg.tmp |while read a a a a a a b c a d a
do
echo $b >2.tmp
b=`sed -e 's/Jan/01/' -e 's/Feb/02/' -e 's/Mar/03/' -e 's/Apr/04/' -e 's/May/05/' -e 's/Jun/06/' -e 's/Jul/07/' -e 's/Aug/08/' -e 's/Sep/09/' -e 's/Oct/10/' -e 's/Nov/11/' -e 's/Dec/12/' 2.tmp `
echo "InstalledDate = "$d/$b/$c >>mpkg.tmp
done

echo "JavaId = -1" >>mpkg.tmp
echo "Mime = " >>mpkg.tmp

echo "MpkgFile = " >>mpkg.tmp
# echo "MpkgFile = "$mpkg_file >>mpkg.tmp

grep "^Name" "$desktop_file" >>mpkg.tmp
grep "^OsVersion" "$desktop_file" >>mpkg.tmp

echo "Position = 1 " >>mpkg.tmp
echo "Rotation = " >> mpkg.tmp
echo "Shared = 0" >>mpkg.tmp

dir -s "$mpkg_file" |while read a b
do
echo "Size = "$a"K" >> mpkg.tmp
done

if [ "$myphone" = "A780" ]
then
echo "Type = 4" >> mpkg.tmp
else
echo "Type = 2" >> mpkg.tmp
fi

cat 1.tmp >>mpkg.tmp
echo >>mpkg.tmp
echo >>mpkg.tmp
echo '[MimeInfo]' >> mpkg.tmp
echo 'MimeCount = 1000' >> mpkg.tmp
echo >> mpkg.tmp
echo >> mpkg.tmp
echo >> mpkg.tmp

sed -e '/MimeInfo/d' -e '/MimeCount/d' db_file_0 > db_file
cat mpkg.tmp >>db_file

mv "$mpkg" /mmc/mmca1/.system/QTDownLoad/"$mpkg2"
cp -f db_file /mmc/mmca1/.system/java/PlugCardDB
cp -f $mpkg_install_directory/mpkg_install/active /mmc/mmca1/激活MPKG图标.jar

if [ "$mpkg_file" = "$mpkg_file_yan0" ]
then
# rm -f $mpkg_file_yan0
fi

$my_alert -playvol 5 -playfile $my_mid1
$my_alert -playvol 10 -playfile $mpkg_install_directory/mpkg_install1/mpkg_install_ok.amr

fi
done

fi
fi
done

# Uninstall MPKG for A780
elif [ "$myphone" = "A780" ] && [ "$mypath" = "system" ]
then
cp /mmc/mmca1/.system/java/PlugCardDB db_file
if [ -f 2.tmp ]
then
rm -f 2.tmp
fi

if [ -f "/mmc/mmca1/mpkg.txt" ]
then
c=''
cat /mmc/mmca1/mpkg.txt | while read mpkg
do
if [ "$mpkg" != "" ]
then
if [ -d $mpkg_install_directory/"$mpkg" ]
then
rm -R -f $mpkg_install_directory/"$mpkg"
fi

grep -n "^Directory" db_file | sed -e 's/:/ /g' -n -e '/'$mpkg'/p' | while read a b
do
b=$(($a - 3 ))
a=$(($a + 15 ))
if sed -e ''$b' s/AppLinkRecord/AppLinRecord/g' -e ''$a' s/uid/uid/g' db_file >/dev/null
then
sed -e ''$b','$a'd' db_file > db_file_0
mv db_file_0 db_file
echo $mpkg >> 2.tmp
fi
done
fi
done
rm -f /mmc/mmca1/mpkg.txt
if [ -f 2.tmp ]
then
mv -f db_file /mmc/mmca1/.system/java/PlugCardDB
mv -f 2.tmp /mmc/mmca1/mpkg_del.txt
$my_alert -playvol 5 -playfile $my_mid1
$my_alert -playvol 10 -playfile $mpkg_install_directory/mpkg_install1/mpkg_del_ok.amr
else
$my_alert -playvol 5 -playfile $my_mid2
fi

else
echo > 2.tmp
echo >1.tmp
grep "^Directory" db_file | sed -e '/MIDlet/d'| while read a b b
do
if [ -f 1.tmp ]
then
rm -f 1.tmp
fi
d=`basename $b`
if [ ! "$d" = "mpkg_install" ]
then
echo $d >>2.tmp
fi
done

if [ ! -f 1.tmp ]
then
cp 2.tmp /mmc/mmca1/mpkg
$my_alert -playvol 5 -playfile $my_mid2
$my_alert -playvol 10 -playfile $mpkg_install_directory/mpkg_install1/mpkg_del_notice.amr
else
$my_alert -playvol 5 -playfile $my_mid2
fi
fi
fi

cd $mpkg_install_directory
rm -R -f yan0