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);
            }
        }
예제 #2
0
 private void ShowApplicationsNull()
 {
     this.statusMain.Text = "Loading Application List";
     if (localApps == null)
     {
         String installedAppPath = "//private/var/root/Library/Installer/LocalPackages.plist";
         if (myPhone.Exists(installedAppPath))
         {
             using (Stream inStream = iPhoneFile.OpenRead(myPhone, installedAppPath)) {
                 localApps = AppList.ReadXmlStream(inStream);
             }
         }
         CreateAppListGroups(localApps);
         listApps.Items.Clear();
         for (Int32 i = 0; i < localApps.Applications.Length; i++)
         {
             iPhoneApp    app  = localApps.Applications[i];
             ListViewItem item = new ListViewItem();
             item.Name        = app.Name;
             item.Text        = app.Name;
             item.ToolTipText = app.Name + Environment.NewLine + app.Description;
             ListViewItem.ListViewSubItem version = new ListViewItem.ListViewSubItem();
             version.Name = "Version";
             version.Text = app.Version;
             item.SubItems.Add(version);
             ListViewItem.ListViewSubItem desc = new ListViewItem.ListViewSubItem();
             desc.Name = "Description";
             desc.Text = app.Description;
             item.SubItems.Add(desc);
             ListViewItem.ListViewSubItem pub = new ListViewItem.ListViewSubItem();
             pub.Name = "Publisher";
             pub.Text = app.Source;
             item.SubItems.Add(pub);
             item.Group = listApps.Groups[app.Category];
             listApps.Items.Add(item);
         }
     }
     listApps.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);
     listApps.Visible  = true;
     listFiles.Visible = false;
     SetStatus();
 }
예제 #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);
        }