Hide Applications ?

Discussion in 'Jiggy Runtime Development' started by pabloppp, Jul 5, 2008.

  1. pabloppp

    pabloppp New Member

    Joined:
    Feb 21, 2008
    Messages:
    53
    Likes Received:
    0
    I want to know how to hide applications with adding the "hide" string to the Info.plist...
    I've tried with the toggle function of Erica Utitlities but even if when i use it I recive a command "Hidding com.app.*** " nothing happens and the app I want to hide is not hidden...

    I have another doubt, I know how to list all the apps but I want to know how to list only the hidden or unhidden apps...
    Thanks!
  2. qbal1

    qbal1 New Member

    Joined:
    May 2, 2008
    Messages:
    254
    Likes Received:
    0
    install: poof
    it hides and shows apps and is really easy to use
  3. gojohnnyboi

    gojohnnyboi Well-Known Member

    Joined:
    Jan 25, 2008
    Messages:
    3,339
    Likes Received:
    55
    add this to the Info.plist of an app.

    Code:
    <key>SBAppTags</key>
            <array>
                    <string>hidden</string>
            </array>

    pretty sure that will do it.
  4. Totally 1337

    Totally 1337 Active Member

    Joined:
    Mar 27, 2008
    Messages:
    3,966
    Likes Received:
    17
    Device:
    iPhone 4S (Black)
    use the tutorial in my sig! its the exact thing you want

    Please Register or Log in to view images

  5. PAEz

    PAEz New Member

    Joined:
    Jan 29, 2008
    Messages:
    201
    Likes Received:
    10
    I used your tutorial Totally 1337 and made some code out of it, thanks for the tut.

    Ive been meaning to do this for a while, but life, other interests, you know.....

    anywayz.....

    Code:
    //The bulk of this code is from Jake Wolpert (as usual;)...thanks Jake
    
    loadplist = function(filename){
        var data = new Data()
        if (!data.loadFromFile(filename))  throw "missing file:"+filename;
        var plist = new XML(data.asXMLPList().replace(/<\?.*?\?>|<!.*?>/g,""));
        return plist;
      }
    
    
    saveplist = function (filename, plist){
       var data = new Data();
       plist=plist.toXMLString();
       plist = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
       "<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n" + plist;
       data.loadFromString(plist);   
       if (!data.writeToFile(filename))  throw "Save Error:"+filename;
       }
    
    getKey = function (plist, keyValue){
        var key = plist.dict.key.(* == keyValue)
        if (key.length()) key = key.parent().child(key.childIndex()+1)
        return key
      }
    
    deleteKey = function (plist, keyValue){
                    var key = plist.dict.key.(* == keyValue)
                    var val = key.childIndex()+1
                    if (key.length()){
                            delete plist.dict.*[val]
                            delete plist.dict.*[val -1]
                    } 
    }
    
    //addKey expects two xml elements, key and keyValue
    addKey = function(plist, key, keyValue){
    plist.dict.appendChild( key+keyValue );
    }
    
    changeKey = function (plist, keyValue, newValue){
        var key = plist.dict.key.(* == keyValue);
        if (key.length()) key.parent().child(key.childIndex()+1)=newValue;
      }
    
    appHidden = function (plist) {
    var node =getKey(plist,"SBAppTags");
    return node.string.(* =='hidden').length();
    }
    
    toggleHidden = function (plist) {
    if (appHidden(plist)) {
    deleteKey(plist,"SBAppTags");
    }else{
    addKey( plist, <key>SBAppTags</key> , <array><string>hidden</string></array> );
    }
    }
    
    var plist = loadplist( Bundle.bundlePath + "/Info.plist" );
    toggleHidden(plist);
    saveplist(Bundle.bundlePath+"/Info.plist",plist);
    executeShellCommand("killall SpringBoard");
    
    havent tested it heaps or nothing but works for me.
    It hides and unhides itself, just run it from the Jiggy IDE and restart the springboard with SMB or sumthn (shoulda added that).

    This plist code might be useable on other plists aswell, thats what Im hopeing. Im hopeing it will so people can do lots more with it all. Like the Ax could only save the iconmatrix of the plist and not the whole thing for iRemember and BigDaveyJ can do his thing dynamically (altho I allready know he can) and so on.
    Have fun.

    EDIT: Took out a bit that didnt need to be there and added the respring code so its less tedious to see it work.

    OH and its not as good as it could be, but I might fix that later....Its just that SBAppTags actually contains an array and an array could contain more than just the hidden tag....havent noticed anything yet but if you do please say. Still alot safer than copying over whole plists.
  6. Winterboard

    Winterboard Well-Known Member

    Joined:
    Dec 26, 2007
    Messages:
    2,345
    Likes Received:
    53
    Device:
    iPad 2 (Black)
    use poof or bigdaveyj's new app.
  7. PAEz

    PAEz New Member

    Joined:
    Jan 29, 2008
    Messages:
    201
    Likes Received:
    10
    and using a modification of the above code biddaveyj's app could hide all apps and not just some and anyone else could make their own Poof app.
    Thats the point of this code, this is after all the Jiggy Runtime Development section.
  8. pabloppp

    pabloppp New Member

    Joined:
    Feb 21, 2008
    Messages:
    53
    Likes Received:
    0
    I love you PAEz!!!
    Thanks for your help!!!!
    Now I'm really near of finishing my app!
    The only thing I want to know is how to list only the hidden apps...
    Or at least hot to put a little picture in the apps that are hidden!!!
    Thanks!

    Edit: I've made an example using the PAEz command of an application like poof that hides and unhides applications... Right now all the applications are listed even if they are hidden or not but when you select the app you want you can see a message telling you if the app is hidden...
    If someone wants to try it and look the code send me a Private Message!
  9. rob spriggs

    rob spriggs New Member

    Joined:
    Jan 26, 2008
    Messages:
    28
    Likes Received:
    0
    how about, instead of changing the plist to say hidden, try moving the app into a folder by a different name, that way the ipod wont find it and therefore wont display it on the springboard, you could then use the same code again to display the contents of the new folder. that would display all the hidden apps with an option to move them back into the application folder... it works in my application, hope it gives a few ideas
  10. PAEz

    PAEz New Member

    Joined:
    Jan 29, 2008
    Messages:
    201
    Likes Received:
    10
    but then how do you launch them?
    I once tried launching stuff with executeshellcommand and there was problems (cant remember them now). If their hidden the correct way then you can still use launchapplicationwithidentifier. Maybe I did something wrong last time, but this works perfect. Plus if other apps want to execute them or modify their files (theme mods) they still can.
    Plus Im just looking for excuses to practice playing with plists

    Please Register or Log in to view images



    pablopp:
    Making some code soon to make it even easier for you, not sure if it will be tonight or tomorrow...been busy
    OH and there is code in there to check to see if an app is hidden, just do something like....
    var plist = loadplist( Bundle.bundlePath + "/Info.plist" );
    if ( appHidden( plist ) ) {
    log("This app is hidden);
    }else{
    log("This app isnt hidden);
    }

Share This Page