2 Star 0 Fork 0

huayi550/Coolpad8705

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
custom_app.sh 2.74 KB
一键复制 编辑 原始数据 按行查看 历史
apkBaseName=$1
tempSmaliDir=$2
if [ "$apkBaseName" = "SystemUI" ];then
echo ">>> in custom_app for $apkBaseName"
find $tempSmaliDir -name "*.smali" | xargs sed -i 's/com\/android\/internal\/statusbar\/StatusBarNotification/android\/service\/notification\/StatusBarNotification/g'
find $tempSmaliDir -name "*.smali" | xargs sed -i 's/Surface;->screenshot/SurfaceControl;->screenshot/g'
elif [ "$apkBaseName" = "Phone" ];then
echo ">>> in custom_app for $apkBaseName to add some permissions for android 4.3"
sed -i '/<original-package android:name="com.android.phone" \/>/a\<uses-permission android:name="android.permission.MANAGE_USERS" \/>\n\<uses-permission android:name="android.permission.UPDATE_APP_OPS_STATS" \/>\n\<uses-permission android:name="android.permission.CONNECTIVITY_INTERNAL" \/>' $tempSmaliDir/AndroidManifest.xml
echo ">>> in custom_app for $apkBaseName to change some permissions for android 4.3"
sed -i 's#android:name="android.permission.SEND_SMS_NO_CONFIRMATION"#android:name="android.permission.SEND_RESPOND_VIA_MESSAGE"#g' $tempSmaliDir/AndroidManifest.xml
elif [ "$apkBaseName" = "Contacts" ];then
echo ">>> in custom_app for $apkBaseName to remove AlwaysRunningService for android 4.3"
sed -i '/AlwaysRunningService/d' $tempSmaliDir/AndroidManifest.xml
echo ">>> in custom_app for $apkBaseName to change some permissions for android 4.3"
sed -i 's#android:permission="android.permission.SEND_SMS_NO_CONFIRMATION"#android:permission="android.permission.SEND_RESPOND_VIA_MESSAGE"#g' $tempSmaliDir/AndroidManifest.xml
elif [ "$apkBaseName" = "Settings" ];then
echo ">>> in custom_app for $apkBaseName to add UsbSettings"
sed -i '/<\/application>/i\<activity android:theme="@*android:style\/Theme.DeviceDefault.Light" android:name="com.android.settings.deviceinfo.UsbSettings" android:clearTaskOnLaunch="true" android:screenOrientation="portrait">\n<intent-filter>\n<action android:name="android.intent.action.MAIN" \/>\n<action android:name="com.android.settings.USBSETTING" \/>\n<category android:name="android.intent.category.DEFAULT" \/>\n<\/intent-filter>\n<\/activity>\n' $tempSmaliDir/AndroidManifest.xml
echo ">>> add timed power_off"
sed -i '/com.android.settings.ManageApplicationsSettings/r Settings/settings_headers.xml.part' $tempSmaliDir/res/xml/settings_headers.xml
#elif [ "$apkBaseName" = "HomePro" ];then
# echo ">>> in custom_app for $apkBaseName"
# find $tempSmaliDir -name "default_workspace.xml" | xargs sed -i 's/className="com.baiyi_mobile.search.MainActivity" packageName="com.baiyi_mobile.search"/className="com.baidu.musicplayer.activity.MainFragmentActivity" packageName="com.baidu.musicplayer"/g' $tempSmaliDir/res/xml/default_workspace.xml
fi
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/huayi550/Coolpad8705.git
git@gitee.com:huayi550/Coolpad8705.git
huayi550
Coolpad8705
Coolpad8705
master

搜索帮助