攔截應用Toast
frameworks\base\core\java\android\widget\Toast.java
/**
* Show the view for the specified duration.
*/
public void show() {
if (mNextView == null) {
throw new RuntimeException("setView must have been called");
}
TextView tv = (TextView)mNextView.findViewById(com.android.internal.R.id.message);
if(tv.getText().toString().contains("boot fail") || tv.getText().toString().equals("boot fail ->")){
cancel();
return;
}