Пример #1
0
 private void RefreshFiles()
 {
     myPhone.GetFiles("/");
     FillTree();
     this.Show();
     connecting = false;
     connected  = true;
 }
        private void btnInstall_Click(object sender, EventArgs e)
        {
            // In this version user must respring by him/herself
            // Later I will add respring via OpenSSH feature.
            string appName    = listView.SelectedItems[0].Text;
            string iconName   = Data.dictIcon[appName][0];
            string bundleName = Data.dictIcon[appName][1];

            if (iDevice.Exists("/Library/Themes/Jaku Essentials.theme/Bundles"))
            {
                iDevice.CreateDirectory("/Library/Themes/Jaku Essentials.theme/Bundles/" + bundleName);
                sendFile("tmp\\icon.png", "/Library/Themes/Jaku Essentials.theme/Bundles/" + bundleName + "/" + iconName);
                // Delete cache, sometimes only respringing is not the solution.
                foreach (var item in iDevice.GetFiles("/var/mobile/Library/Caches/com.apple.IconsCache"))
                {
                    if (item.StartsWith(bundleName))
                    {
                        iDevice.DeleteFile("/var/mobile/Library/Caches/com.apple.IconsCache/" + item);
                    }
                }
                MessageBox.Show("The icon has been installed!\r\nYou have to respring your iDevice in order to see changes!", "Success!", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.Close();
            }
            else
            {
                MessageBox.Show(@"Make sure you have installed Jaku Theme!\r\n""Jaku Essentials.theme"" not found!", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #3
0
        //Implements the search for listings by means of identification FindFirst and FindNext
        public override NT_STATUS ReadDirectory(UserContext UserContext, FileContext FileObject)
        {
            NT_STATUS error = NT_STATUS.OK;

            MyFileContext HE = (MyFileContext)FileObject;

            if (!HE.IsDirectory)
            {
                Debug.WriteLine("Warning->Handle is not a directory, can not get a listing");
                return(NT_STATUS.INVALID_HANDLE);
            }

            if (!phone.Exists(root + HE.Name) || !phone.IsDirectory(root + HE.Name))
            {
                return(NT_STATUS.OBJECT_PATH_NOT_FOUND);   // Directroy not found, should never happen
            }
            HE.Items.Add(new DirectoryContext(".", FileAttributes.Directory));
            HE.Items.Add(new DirectoryContext("..", FileAttributes.Directory));

            DirectoryContext Item = null;

            foreach (string DirName in phone.GetDirectories(root + HE.Name))
            {
                error = GetAttributes(UserContext, root + HE.Name + DirName, out Item);
                if (error != 0)
                {
                    Trace.WriteLine("Warning->Error: '" + error + "' during listing directories: " + HE.Name + DirName);
                }
                HE.Items.Add(Item);
            }

            foreach (string FileName in phone.GetFiles(root + HE.Name))
            {
                error = GetAttributes(UserContext, root + HE.Name + FileName, out Item);
                if (error != 0)
                {
                    Trace.WriteLine("Warning->Error: '" + error + "' during listing files: " + FileName);
                }
                else
                {
                    HE.Items.Add(Item);
                }
            }

            return(NT_STATUS.OK);
        }