android MTK 禁止第一次开机向导
来源:互联网 发布:淘宝店铺默认模板颜色 编辑:程序博客网 时间:2024/04/26 11:03
判断添加在:
public void systemReady(final Runnable goingCallback) {
恢复出厂设置:AdvanceReset
if(getAndSetAdvanceResetFlag()==0){
Log.d("csh", "0000");Settings.Global.putInt(mContext.getContentResolver(), Settings.Global.DEVICE_PROVISIONED, 1);
Settings.Secure.putInt(mContext.getContentResolver(), Settings.Secure.USER_SETUP_COMPLETE, 1);
}else{
Log.d("csh", "1122");
Settings.Global.putInt(mContext.getContentResolver(), Settings.Global.DEVICE_PROVISIONED, 0);
Settings.Secure.putInt(mContext.getContentResolver(), Settings.Secure.USER_SETUP_COMPLETE, 0);
}
private int getAndSetAdvanceResetFlag() {-----------------------MTK读取标志位
byte[] reservedbuff = null;
byte resetflag = 1;
int file_lid = 59; //AP_CFG_REEB_PRODUCT_INFO_LID == 36
IBinder binder = ServiceManager.getService("NvRAMAgent");
NvRAMAgent agent = NvRAMAgent.Stub.asInterface(binder);
try {
reservedbuff = agent.readFile(file_lid);
} catch (RemoteException e) {
e.printStackTrace();
}
if(reservedbuff[105] == 0)
{
int reservedbuffnv =(int)(reservedbuff[105]);
Log.d("csh", "ResetCompletedReceiver reservedbuffnv "+reservedbuffnv);
Log.d("csh", "ResetCompletedReceiver reservedbuff[105]!=2 ");
return 0;
}
package com.android.server.am;
import java.lang.String;
import android.os.RemoteException;
import android.os.IBinder;
import android.os.IInterface;
import android.os.Binder;
import android.os.Parcel;
public interface NvRAMAgent extends android.os.IInterface
{
/** Local-side IPC implementation stub class. */
public static abstract class Stub extends android.os.Binder implements NvRAMAgent
{
private static final java.lang.String DESCRIPTOR = "NvRAMAgent";
/** Construct the stub at attach it to the interface. */
public Stub()
{
this.attachInterface(this, DESCRIPTOR);
}
/**
* Cast an IBinder object into an NvRAMAgent interface,
* generating a proxy if needed.
*/
public static NvRAMAgent asInterface(android.os.IBinder obj)
{
if ((obj==null)) {
return null;
}
android.os.IInterface iin = (android.os.IInterface)obj.queryLocalInterface(DESCRIPTOR);
if (((iin!=null)&&(iin instanceof NvRAMAgent))) {
return ((NvRAMAgent)iin);
}
return new NvRAMAgent.Stub.Proxy(obj);
}
public android.os.IBinder asBinder()
{
return this;
}
public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
{
switch (code)
{
case INTERFACE_TRANSACTION:
{
reply.writeString(DESCRIPTOR);
return true;
}
case TRANSACTION_readFile:
{
data.enforceInterface(DESCRIPTOR);
int _arg0;
_arg0 = data.readInt();
byte[] _result = this.readFile(_arg0);
reply.writeNoException();
reply.writeByteArray(_result);
return true;
}
case TRANSACTION_writeFile:
{
data.enforceInterface(DESCRIPTOR);
int _arg0;
_arg0 = data.readInt();
byte[] _arg1;
_arg1 = data.createByteArray();
int _result = this.writeFile(_arg0, _arg1);
reply.writeNoException();
reply.writeInt(_result);
return true;
}
case TRANSACTION_readFileByName:
{
data.enforceInterface(DESCRIPTOR);
System.out.println("NVRAM TRANSACTION_readFile="+data.readString());
String _arg0;
_arg0 = data.readString();
byte[] _result = this.readFileByName(_arg0);
reply.writeNoException();
reply.writeByteArray(_result);
return true;
}
case TRANSACTION_writeFileByName:
{
data.enforceInterface(DESCRIPTOR);
String _arg0;
_arg0 = data.readString();
System.out.println("NVRAM TRANSACTION_writeFile="+data.readString());
byte[] _arg1;
_arg1 = data.createByteArray();
int _result = this.writeFileByName(_arg0, _arg1);
reply.writeNoException();
reply.writeInt(_result);
return true;
}
}
return super.onTransact(code, data, reply, flags);
}
private static class Proxy implements NvRAMAgent
{
private android.os.IBinder mRemote;
Proxy(android.os.IBinder remote)
{
mRemote = remote;
}
public android.os.IBinder asBinder()
{
return mRemote;
}
public java.lang.String getInterfaceDescriptor()
{
return DESCRIPTOR;
}
public byte[] readFile(int file_lid) throws android.os.RemoteException
{
android.os.Parcel _data = android.os.Parcel.obtain();
android.os.Parcel _reply = android.os.Parcel.obtain();
byte[] _result;
try {
_data.writeInterfaceToken(DESCRIPTOR);
_data.writeInt(file_lid);
mRemote.transact(Stub.TRANSACTION_readFile, _data, _reply, 0);
_reply.readException();
_result = _reply.createByteArray();
}
finally {
_reply.recycle();
_data.recycle();
}
return _result;
}
public int writeFile(int file_lid, byte[] buff) throws android.os.RemoteException
{
android.os.Parcel _data = android.os.Parcel.obtain();
android.os.Parcel _reply = android.os.Parcel.obtain();
int _result;
try {
_data.writeInterfaceToken(DESCRIPTOR);
_data.writeInt(file_lid);
_data.writeByteArray(buff);
mRemote.transact(Stub.TRANSACTION_writeFile, _data, _reply, 0);
_reply.readException();
_result = _reply.readInt();
}
finally {
_reply.recycle();
_data.recycle();
}
return _result;
}
public byte[] readFileByName(String filename) throws android.os.RemoteException
{
android.os.Parcel _data = android.os.Parcel.obtain();
android.os.Parcel _reply = android.os.Parcel.obtain();
byte[] _result;
try
{
_data.writeInterfaceToken(DESCRIPTOR);
_data.writeString(filename);
mRemote.transact(Stub.TRANSACTION_readFileByName, _data, _reply, 0);
_reply.readException();
_result = _reply.createByteArray();
}
finally
{
_reply.recycle();
_data.recycle();
}
return _result;
}
public int writeFileByName(String filename, byte[] buff) throws android.os.RemoteException
{
android.os.Parcel _data = android.os.Parcel.obtain();
android.os.Parcel _reply = android.os.Parcel.obtain();
int _result;
System.out.println("writeFile"+filename);
try
{
_data.writeInterfaceToken(DESCRIPTOR);
_data.writeString(filename);
_data.writeByteArray(buff);
mRemote.transact(Stub.TRANSACTION_writeFileByName, _data, _reply, 0);
_reply.readException();
_result = _reply.readInt();
}
finally
{
_reply.recycle();
_data.recycle();
}
return _result;
}
}
static final int TRANSACTION_readFile = (IBinder.FIRST_CALL_TRANSACTION + 0);
static final int TRANSACTION_writeFile = (IBinder.FIRST_CALL_TRANSACTION + 1);
static final int TRANSACTION_readFileByName = (IBinder.FIRST_CALL_TRANSACTION + 2);
static final int TRANSACTION_writeFileByName = (IBinder.FIRST_CALL_TRANSACTION + 3);
}
public byte[] readFile(int file_lid) throws android.os.RemoteException;
public int writeFile(int file_lid, byte[] buff) throws android.os.RemoteException;
public byte[] readFileByName(String filename) throws android.os.RemoteException;
public int writeFileByName(String filename, byte[] buff) throws android.os.RemoteException;
}
- android MTK 禁止第一次开机向导
- 隐藏Android第一次开机向导(提示气泡)
- android 开机向导
- android开机向导实现
- android开机向导的实现
- android开机向导的实现
- MTK开机向导完成后直接跳转到默认网页
- Android系统之路(初识MTK) ------ 默认第一次开机屏幕亮度/日期格式/picture makeer model
- Android开机向导setupwizard,设置系统语言,WiFi向导
- Android Provision(开机向导setupwizard程序)
- android 开机向导OOBE源码分析
- Mtk android LCD开机启动过程
- Mtk android LCD开机启动过程
- android开机动画修改(MTK)
- MTK (android 开机)Android开机流程解析
- Android MTK平台修改开机动画,开机logo
- Android MTK 6572 修改开机logo和开机动画
- Android M 概率跳不过google开机向导原因分析
- 24岁小朋友,生日快乐!
- kill和kill -9的区别
- java8新特性_其他类库的变化
- WildFly 10设置热部署
- Gof23种设计模式+简单工厂设计模式总结(二)
- android MTK 禁止第一次开机向导
- 如何理解SessionId?
- cocoaPods 引发的BUG
- 基于lora物联网技术的牛羊定位应用
- http://start.spring.io/
- Android shell命令行中过滤adb logcat输出的几种方法
- yii2整合umeditor编辑器
- Android 录音实现方法、仿微信语音、麦克风录音、发送语音
- BZOJ 2718: [Violet 4]毕业旅行 二分图最大点独立集 传递闭包