Пример #1
0
 private string OnClick()
 {
     if (RootUtil.isDeviceRooted())
     {
         if (TempUnroot.unRoot())
         {
             return(not_rooted);
         }
         else
         {
             return(rooted);
         }
     }
     else
     {
         if (TempUnroot.Root())
         {
             return(rooted);
         }
         else
         {
             return(not_rooted);
         }
     }
 }
Пример #2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            // Get our button from the layout resource,
            // and attach an event to it
            Button button = FindViewById <Button>(Resource.Id.button1);

            if (RootUtil.isDeviceRooted())
            {
                button.Text = rooted;
            }
            else
            {
                button.Text = not_rooted;
            }

            button.Click += delegate { button.Text = OnClick(); };
        }