Beispiel #1
0
        public void onREC()
        {
            string ip = "0";

            timer = true;
            Java.IO.File           sdCard = Android.OS.Environment.ExternalStorageDirectory;
            Java.IO.File           dir    = new Java.IO.File(sdCard.AbsolutePath + "/SonryVitaMote");
            Java.IO.File           file   = new Java.IO.File(dir, "ip.scf");
            Java.IO.FileReader     fread  = new Java.IO.FileReader(file);
            Java.IO.BufferedReader br     = new Java.IO.BufferedReader(fread);
            ip = br.ReadLine();
            fread.Close();
            try {
                clientSocket.Connect(ip, 5000);
                if (clientSocket.Connected)
                {
                    Toast.MakeText(this, "PS VITA Connected", ToastLength.Long).Show();
                    RunUpdateLoop();
                }
                else
                {
                    Toast.MakeText(this, "Couldn't Connect", ToastLength.Long).Show();
                }
            }
            catch (System.Exception ex) {
                Toast.MakeText(this, "Network Error, try again", ToastLength.Long).Show();
                Log.Info("Exception: ", ex.ToString());
            }
        }
 /// <summary>
 /// 运行被克隆的应用,该应用会加载多开应用的so库,检测已经加载的so里是否包含这些应用的包名
 /// </summary>
 /// <returns></returns>
 public static bool CheckByMultiApkPackageName()
 {
     if (mCheckByMultiApkPackageName.HasValue)
     {
         return(mCheckByMultiApkPackageName.Value);
     }
     try
     {
         var reader = new Java.IO.FileReader("/proc/self/maps");
         using var bufferedReader = new Java.IO.BufferedReader(reader);
         string?line;
         while ((line = bufferedReader.ReadLine()) != null)
         {
             var hasContains = virtualPkgs
                               .Any(x => line.Contains(x, StringComparison.OrdinalIgnoreCase));
             if (hasContains)
             {
                 mCheckByMultiApkPackageName = true;
                 return(mCheckByMultiApkPackageName.Value);
             }
         }
     }
     catch (Java.Lang.Throwable t)
     {
         t.PrintStackTraceWhenDebug();
     }
     mCheckByMultiApkPackageName = false;
     return(mCheckByMultiApkPackageName.Value);
 }
Beispiel #3
0
        private string reFile()
        {
            string ip = "0";

            Java.IO.File sdCard = Android.OS.Environment.ExternalStorageDirectory;
            Java.IO.File dir    = new Java.IO.File(sdCard.AbsolutePath + "/SonryVitaMote");
            Java.IO.File file   = new Java.IO.File(dir, "ip.scf");
            if (!file.Exists())
            {
                Toast.MakeText(this, "Remember to store an IP", ToastLength.Long).Show();
                return("No IP Saved");
            }
            else
            {
                Java.IO.FileReader     fread = new Java.IO.FileReader(file);
                Java.IO.BufferedReader br    = new Java.IO.BufferedReader(fread);
                ip = br.ReadLine();
                fread.Close();
                return(ip);
            }
        }
Beispiel #4
0
        //Custom Mapping System
        public void loadCM()
        {
            try {
                int                    l = 0;
                string                 line;
                Java.IO.File           sdCard = Android.OS.Environment.ExternalStorageDirectory;
                Java.IO.File           dir    = new Java.IO.File(sdCard.AbsolutePath + "/SonryVitaMote");
                Java.IO.File           file   = new Java.IO.File(dir, "cm.scf");
                Java.IO.FileReader     fread  = new Java.IO.FileReader(file);
                Java.IO.BufferedReader br     = new Java.IO.BufferedReader(fread);
                while ((line = br.ReadLine()) != null)
                {
                    switch (l)
                    {
                    case 0:
                        bUp = (Android.Views.Keycode)Integer.ParseInt(line);
                        break;

                    case 1:
                        bRi = (Android.Views.Keycode)Integer.ParseInt(line);
                        break;

                    case 2:
                        bDo = (Android.Views.Keycode)Integer.ParseInt(line);
                        break;

                    case 3:
                        bLe = (Android.Views.Keycode)Integer.ParseInt(line);
                        break;

                    case 4:
                        bLt = (Android.Views.Keycode)Integer.ParseInt(line);
                        break;

                    case 5:
                        bRt = (Android.Views.Keycode)Integer.ParseInt(line);
                        break;

                    case 6:
                        bX = (Android.Views.Keycode)Integer.ParseInt(line);
                        break;

                    case 7:
                        bC = (Android.Views.Keycode)Integer.ParseInt(line);
                        break;

                    case 8:
                        bT = (Android.Views.Keycode)Integer.ParseInt(line);
                        break;

                    case 9:
                        bS = (Android.Views.Keycode)Integer.ParseInt(line);
                        break;

                    case 10:
                        bSe = (Android.Views.Keycode)Integer.ParseInt(line);
                        break;

                    case 11:
                        bSt = (Android.Views.Keycode)Integer.ParseInt(line);
                        break;

                    case 12:
                        aLu = (Android.Views.Keycode)Integer.ParseInt(line);
                        break;

                    case 13:
                        aLd = (Android.Views.Keycode)Integer.ParseInt(line);
                        break;

                    case 14:
                        aLl = (Android.Views.Keycode)Integer.ParseInt(line);
                        break;

                    case 15:
                        aLr = (Android.Views.Keycode)Integer.ParseInt(line);
                        break;

                    case 16:
                        aRu = (Android.Views.Keycode)Integer.ParseInt(line);
                        break;

                    case 17:
                        aRd = (Android.Views.Keycode)Integer.ParseInt(line);
                        break;

                    case 18:
                        aRl = (Android.Views.Keycode)Integer.ParseInt(line);
                        break;

                    case 19:
                        aRr = (Android.Views.Keycode)Integer.ParseInt(line);
                        break;
                    }
                    l++;
                }
                fread.Close();
            }
            catch (System.Exception ex) {
                Log.Verbose("{1}", ex.ToString());
            }
        }
Beispiel #5
0
        public void loadCM()
        {
            try {
                int                    l = 0;
                string                 line;
                Java.IO.File           sdCard = Android.OS.Environment.ExternalStorageDirectory;
                Java.IO.File           dir    = new Java.IO.File(sdCard.AbsolutePath + "/SonryVitaMote");
                Java.IO.File           file   = new Java.IO.File(dir, "cm.scf");
                Java.IO.FileReader     fread  = new Java.IO.FileReader(file);
                Java.IO.BufferedReader br     = new Java.IO.BufferedReader(fread);
                while ((line = br.ReadLine()) != null)
                {
                    switch (l)
                    {
                    case 0:
                        s1.SetSelection(allM.IndexOf((Keycode)Java.Lang.Integer.ParseInt(line)));
                        break;

                    case 1:
                        s2.SetSelection(allM.IndexOf((Keycode)Java.Lang.Integer.ParseInt(line)));
                        break;

                    case 2:
                        s3.SetSelection(allM.IndexOf((Keycode)Java.Lang.Integer.ParseInt(line)));
                        break;

                    case 3:
                        s4.SetSelection(allM.IndexOf((Keycode)Java.Lang.Integer.ParseInt(line)));
                        break;

                    case 4:
                        s5.SetSelection(allM.IndexOf((Keycode)Java.Lang.Integer.ParseInt(line)));
                        break;

                    case 5:
                        s6.SetSelection(allM.IndexOf((Keycode)Java.Lang.Integer.ParseInt(line)));
                        break;

                    case 6:
                        s7.SetSelection(allM.IndexOf((Keycode)Java.Lang.Integer.ParseInt(line)));
                        break;

                    case 7:
                        s8.SetSelection(allM.IndexOf((Keycode)Java.Lang.Integer.ParseInt(line)));
                        break;

                    case 8:
                        s9.SetSelection(allM.IndexOf((Keycode)Java.Lang.Integer.ParseInt(line)));
                        break;

                    case 9:
                        s10.SetSelection(allM.IndexOf((Keycode)Java.Lang.Integer.ParseInt(line)));
                        break;

                    case 10:
                        s11.SetSelection(allM.IndexOf((Keycode)Java.Lang.Integer.ParseInt(line)));
                        break;

                    case 11:
                        s12.SetSelection(allM.IndexOf((Keycode)Java.Lang.Integer.ParseInt(line)));
                        break;

                    case 12:
                        s13.SetSelection(allM.IndexOf((Keycode)Java.Lang.Integer.ParseInt(line)));
                        break;

                    case 13:
                        s14.SetSelection(allM.IndexOf((Keycode)Java.Lang.Integer.ParseInt(line)));
                        break;

                    case 14:
                        s15.SetSelection(allM.IndexOf((Keycode)Java.Lang.Integer.ParseInt(line)));
                        break;

                    case 15:
                        s16.SetSelection(allM.IndexOf((Keycode)Java.Lang.Integer.ParseInt(line)));
                        break;

                    case 16:
                        s17.SetSelection(allM.IndexOf((Keycode)Java.Lang.Integer.ParseInt(line)));
                        break;

                    case 17:
                        s18.SetSelection(allM.IndexOf((Keycode)Java.Lang.Integer.ParseInt(line)));
                        break;

                    case 18:
                        s19.SetSelection(allM.IndexOf((Keycode)Java.Lang.Integer.ParseInt(line)));
                        break;

                    case 19:
                        s20.SetSelection(allM.IndexOf((Keycode)Java.Lang.Integer.ParseInt(line)));
                        break;
                    }
                    l++;
                }
                fread.Close();
            }
            catch (Exception) {
                setDefaults();
                saveCM();
            }
        }