Results 1 to 11 of 11

Your favorite Apple, iPhone, iPad, iOS, Jailbreak, and Cydia site.


Thread: How to write a "postinst" file FULL GUIDE {mods plz sticky}

  1. #1
    Green Apple NicholasLAranda's Avatar
    Join Date
    Sep 2011
    Location
    Hayward, California, United States
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How to write a "postinst" file FULL GUIDE {mods plz sticky}
    This isn't necessarily a guide on how to make a deb, but it gives you almost the whole idea.
    I need some one to help me re-write this, using eye candy coding, so that I can get it stickied!!
    If you just post a reply with sections that should be changed, I'll post your name & what ever links you want for you on that section!!


    If your on windows, make a folder on your desktop, lets call this "GameMod".
    In "FileMod", make a folder called "DEBIAN" (yes in all caps).
    Go into there, right click the folder & make a new text document. Name it: "postinst".
    Hopefully you have file extensions showing, because this file is NOT supposed to have an extension, it's just called "postinst".

    Now open up "postinst", and choose to choose to open with... "NotePad"
    Here is a sample:
    #!/bin/bash

    cd /var/mobile/Applications/*/Game.app

    mkdir Backups

    cp -a ./Original_File.ext ./Backups/Original_File.bak

    killall Game

    mv -f /var/mobile/Documents/GameMod/Game/* ./
    exit 0
    MAKE SURE THERE IS A BLANK LINE UNDER exit 0 IT HAS TO BE THERE

    Now the 1st part is the command to run the file, it will ALWAYS have to be there, the #!/bin/bash part

    The 2nd part changes the directory (cd) to where the game it located, the * is because we don't know the directory of the Game.
    Just try to imagine that your in a command prompt entering in these commands one, by one.

    The "mkdir" makes a new folder, we need this made BEFORE we move the files, otherwise it will fail to make backups.

    "cp -a" means to "copy & archive" which allows you to rename a file once you move it.
    So: "copy & archive (cp -a) ./ (this means to add the cd command before, shortening the amount of code needed) Original_File.ext to (the space means to) ./Backups (the folder we just made) /Original_File.bak (.bak means backup)

    "killall Game" will exit the app, weather it be a game or not, so that the files will absolutely copy over.
    In most cases, the files wont copy over cause their open in the game.
    Now remember: just because an app FOLDER has .app doesn't mean the actual running process also has .app, that is JUST the folder name.

    Now, since this is a postinst guide, you already know to have a folder in your GameMod that matches the iPhone directory structure, so that's where this command comes in.

    "mv-f" forces a "move" of files from your directory you created, into the game directory, very similar to the cp command.

    Now the last thing you need is: "exit 0" & make sure there is another line under it, but blank, like this:
    line1: exit 0
    line2: -blank-

    That's it! now you should also know how to make the deb, if not:
    dpkg -b GameMod

    LAST THING!!! YOU MUST DO THIS IF YOU ARE ON WINDOWS ====BEFORE==== YOU PACKAGE THE DEB

    If you are on windows, and are using WinSCP, navigate into the remote directory: /private/var/root/YourHack/DEBIAN/
    and open the WinSCP Terminal by holding crtl and pressing T

    Then type in the command:
    tr -d '\15\32' <postinst> postinst2
    Then just delete the postinst & rename postinst2 to postinst
    YOUR ALSO going to have to set the permissions back to 0755, just right click on the file & go to Properties & at the bottom, change the 0653 (or what ever it is) to 0755


    If you have questions or need a command to use, post here & I'll try to help you as best as I can!
    Last edited by NicholasLAranda; 2011-09-19 at 07:08 AM.

  2. #2
    Livin the iPhone Life
    Join Date
    May 2008
    Posts
    8,021
    Thanks
    102
    Thanked 789 Times in 731 Posts

    Q? Run "dpkg -b Gamemod" on windows?

  3. #3
    Green Apple NicholasLAranda's Avatar
    Join Date
    Sep 2011
    Location
    Hayward, California, United States
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Quote Originally Posted by Mes View Post
    Q? Run "dpkg -b Gamemod" on windows?
    If you are on Windows, you need: WinSCP
    The right side is your iPhone, and the left is your computer.

    Once you navigate to /private/var/root this is where your FileMod should be.

    Go into the DEBIAN folder, then simply hold Ctrl and then Press T to open up the terminal.

    This is where you can run the dpkg -b command.

  4. #4
    Livin the iPhone Life
    Join Date
    May 2008
    Posts
    8,021
    Thanks
    102
    Thanked 789 Times in 731 Posts

    So you're saying .... everything in your procedure is done within WinSCP?

  5. #5
    Green Apple NicholasLAranda's Avatar
    Join Date
    Sep 2011
    Location
    Hayward, California, United States
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Quote Originally Posted by Mes View Post
    So you're saying .... everything in your procedure is done within WinSCP?
    Yes , litterally.
    You can just get WinSCP, SSH into your iPhone & create the folders in there.
    Copy files in there.
    If they are files with just text in them, you can edit them with WinSCP.
    Then package it up into a deb using the terminal in there.

  6. #6
    Livin the iPhone Life
    Join Date
    May 2008
    Posts
    8,021
    Thanks
    102
    Thanked 789 Times in 731 Posts

    That little but important detail is not clear. Might I suggest a modification for clarity?

  7. #7
    Green Apple NicholasLAranda's Avatar
    Join Date
    Sep 2011
    Location
    Hayward, California, United States
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Quote Originally Posted by Mes View Post
    That little but important detail is not clear. Might I suggest a modification for clarity?
    Check the 1st 3 lines I just added in the guide

  8. #8
    Livin the iPhone Life
    Join Date
    May 2008
    Posts
    8,021
    Thanks
    102
    Thanked 789 Times in 731 Posts

    The 3 lines still don't make it clear that the procedure is run from a computer 'within' a WinSCP session.

  9. #9
    Green Apple NicholasLAranda's Avatar
    Join Date
    Sep 2011
    Location
    Hayward, California, United States
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    the 1st 3 lines say that this isnt a guide on how to make a .deb file.

    On top of that: I need help re-writing the guide, so feel free to post your suggestion & I'll quote you on it, into the guide so that you get credit

  10. #10
    Livin the iPhone Life
    Join Date
    May 2008
    Posts
    8,021
    Thanks
    102
    Thanked 789 Times in 731 Posts

    Thanks, but I don't have the time.

    Your information is good, but lacking important details.
    I have found ... if you take several pictures or screen shots of the major areas, it really helps. Helps the writer to create the guide, helps the user to understand the procedure

    I'll keep an eye on this for future sticky potential.

  11. #11
    Green Apple NicholasLAranda's Avatar
    Join Date
    Sep 2011
    Location
    Hayward, California, United States
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Quote Originally Posted by Mes View Post
    Thanks, but I don't have the time.

    Your information is good, but lacking important details.
    I have found ... if you take several pictures or screen shots of the major areas, it really helps. Helps the writer to create the guide, helps the user to understand the procedure

    I'll keep an eye on this for future sticky potential.
    ehh I'll get around to it lol
    I'm good at writing guides, I just don't have a whole day to sit and write & screen shot & upload

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •