隐藏在果冻豆平板系统栏(扎根)(Hide System Bar in Jelly Bean Tabl

2019-07-03 23:24发布

我有一直扎根并试图运行它具有代码隐藏系统栏中的应用程序在Android果冻豆平板电脑,但它没有得到隐藏任何一个可以帮助我在这。

获得输出在终端: Result Parcel(00000000 '....')

public class MainActivity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Button hide=(Button)findViewById(R.id.button1);
        Button show=(Button)findViewById(R.id.button2);
        hide.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                // TODO Auto-generated method stub
                 Log.v("ds", "hideSystembar");
                    try {
                        Process proc = Runtime.getRuntime().exec(new String[]{
                                "su","-c","service call activity 79 s16 com.android.systemui"});
                        proc.waitFor();
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
            }
        });
        show.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                // TODO Auto-generated method stub
                  Log.v("f", "showSystembar");
                    try {
                        Process proc = Runtime.getRuntime().exec(new String[]{
                                "am","startservice","-n","com.android.systemui/.SystemUIService"});
                        proc.waitFor();
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
            }
        });
    }
} 

虽然我得到获准的敬酒:

超级用户登录屏幕截图:

Answer 1:

对于进程id SystemUI类从79变更为42 ICS被引入时。
下面的代码工作为Android的任何版本,您的应用程序可能运行。

//HIDE TOOLBAR
try{
    //REQUIRES ROOT
    Build.VERSION_CODES vc = new Build.VERSION_CODES();
    Build.VERSION vr = new Build.VERSION();
    String ProcID = "79"; //HONEYCOMB AND OLDER

    //v.RELEASE  //4.0.3
    if(vr.SDK_INT >= vc.ICE_CREAM_SANDWICH){
        ProcID = "42"; //ICS AND NEWER
    }

    //REQUIRES ROOT
    Process proc = Runtime.getRuntime().exec(new String[]{"su","-c","service call activity "+ ProcID +" s16 com.android.systemui"}); //WAS 79
    proc.waitFor();

}catch(Exception ex){
    Toast.makeText(getApplicationContext(), ex.getMessage(), Toast.LENGTH_LONG).show();
}


Answer 2:

我写了介绍如何获取root权限,并隐藏/显示系统栏,甚至在Android 4.2的文章

http://masashi-k.blogspot.com/2013/09/hide-show-system-bar-of-android.html

获取使用RootTools库root权限。

隐藏系统栏



文章来源: Hide System Bar in Jelly Bean Tablet (Rooted)
标签: android root