标签:android init.rc shell 设置 开发者选项
【实现逻辑】 { "app.launcher.start", AID_SYSTEM, 0},
+ { "app.phonesky.show", AID_SYSTEM, 0}, //Add By zj
{ "cdma.", AID_RADIO, 0 }, //Add by gfzhu VIAprivate static final String SHOW_PHONESKY = "show_phonesky"; private CheckBoxPreference mShowPhonesky; mShowPhonesky = findAndInitCheckboxPref(SHOW_PHONESKY);
(BatteryManager.BATTERY_PLUGGED_AC | BatteryManager.BATTERY_PLUGGED_USB) : 0);
+ } else if (preference == mShowPhonesky) { // ZJ Add
+ if(mShowPhonesky.isChecked())
+ {
+ SystemProperties.set("app.phonesky.show","1");
+ }else{
+ SystemProperties.set("app.phonesky.show","0");
+ }
} else if (preference == mBtHciSnoopLog) { android:targetClass="com.android.settings.SetFullBackupPassword" />
</PreferenceScreen>
+ <CheckBoxPreference
+ android:key="show_phonesky"
+ android:title="@string/show_phonesky"
+ />
<CheckBoxPreference <string name="show_phonesky">Show Google Play Store</string>
package com.android.settings;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.SystemClock;
import android.util.Log;
import android.os.SystemProperties;
public class BootReceiver extends BroadcastReceiver{
@Override
public void onReceive(Context arg0, Intent arg1) {
// TODO Auto-generated method stub
String action = arg1.getAction();
if(action.equals(Intent.ACTION_BOOT_COMPLETED))
{
SharedPreferences shared = arg0.getSharedPreferences("com.android.settings_preferences", Context.MODE_PRIVATE);
boolean show_phonesky = shared.getBoolean("show_phonesky", false);
if(show_phonesky){
SystemProperties.set("app.phonesky.show","1");
}else{
SystemProperties.set("app.phonesky.show","0");
}
}
}
}<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<receiver android:name=".BootReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>+# ZJ Add START +#Hide or Show Google Play Dynamicly +#disabled:服务不会自动运行,必须显式地通过服务器来启动。 +#oneshot:当此服务退出时不会自动重启。 +service hidePhonesky /system/bin/hidePhonesky + disabled + oneshot +service showPhonesky /system/bin/showPhonesky + disabled + oneshot +#on property:sys.boot_completed=1 +# start renamePhonesky +on property:app.phonesky.show=1 + start showPhonesky +on property:app.phonesky.show=0 + start hidePhonesky +# ZJ Add END
#!/system/bin/sh #!/system/bin/busybox mount -o remount,rw /system; mv /system/priv-app/Phonesky.apk /system/priv-app/Phonesky.bak
#!/system/bin/sh #!/system/bin/busybox mount -o remount,rw /system; mv /system/priv-app/Phonesky.bak /system/priv-app/Phonesky.apk
+#添加重命名GooglePlay脚本 +PRODUCT_COPY_FILES += + vendor/ThirdParty/App/dte/hidePhonesky:system/bin/hidePhonesky + vendor/ThirdParty/App/dte/showPhonesky:system/bin/showPhonesky + vendor/ThirdParty/App/dte/Phonesky.bak:system/priv-app/Phonesky.bak
标签:android init.rc shell 设置 开发者选项
原文地址:http://blog.csdn.net/zhoumushui/article/details/42245481