Jump to content

KingRalph

Senior Member
  • Posts

    1,300
  • Joined

  • Last visited

Posts posted by KingRalph

  1. No, that apparently didn't work.

    Put this code in the preinst script:

    #!/bin/sh
    cd /usr/bin
    if [ -f "*lipoARM64*" ]
    then
       rm -f -- *lipoARM64*
    fi
    exit 0   

    It will remove all files in the /usr/bin directory that contain the string lipoARM64 in their name

     

    Also, the variable 'dir' in the postinst script is useless. It is not used in lipoARM64 or the postinst

    @DiDA

  2. Cool
     
    Edit:
     
    Aren't you supposed to add %orig; to this function?

    %hook AppDelegate
     
    - (void)applicationDidBecomeActive:(id)application {
        NSUserDefaults *validate = [NSUserDefaults standardUserDefaults];
        NSString *alreadyRun = @"already_run";
        if ([validate boolForKey:alreadyRun])  
        return;
        [validate setBool:YES forKey:alreadyRun];
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Test Title"
        message:@"Test Message" delegate:nil cancelButtonTitle:@"Close Test Pop-Up"
        otherButtonTitles:nil];
        [alert show];
        [alert release];
    }
     
    %end

    Also, I think you place the %new outside of the function

    %hook AppDelegate
    
    -(BOOL)application:(id)fp8 didFinishLaunchingWithOptions:(id)fp12 {
    
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Test Title"
    message:@"Test Message" delegate:self cancelButtonTitle:@"Close Test Pop-Up"                       otherButtonTitles:@"Test Link", nil]; 
    [alert show];
    [alert release]; 
    return %orig();
    %new
    }
    
    -(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
           if(buttonIndex !=alertView.cancelButtonIndex) 
    { 
            [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.test.com"]];                                                                              
            }
    }
    
    %end 
    • Agree 1
  3. Something about how many third party products had code like:

    if(version.StartsWith("Windows 9"))

    { /* 95 and 98 */

    } else {

    It's somewhere online. But idk. Just what I've read before

    That's interesting :)

    Couldn't these third party apps just change their code instead of Microsoft skipping a number?

    That shouldn't be how it works...

    It should be something like this IMO:

    if(version.ContainsString("Windows 9"))
    {
    //Version compatible code here
    } else {
    //Error message here
    }
    It makes no sense to search for a prefix and not the entire string O.o
  4. :dunno: I just do it this way all the time

    I got errors when packaging my deb with your method. :/

    After reading compiler errors, I figured out an alternate method.

     

    Alternate solution:

     

    Create a directory in your tweak's root directory and name it com.yourname.yourcompanyname

    Inside that directory, create a directory called DEBIAN. Enter your newly created DEBIAN directory and add your postinst, preinst, prerm, and postrm scripts inside there. Also, you have to take your control file from your tweak's root directory and copy it into ./com.yourname.yourcompanyname/DEBIAN

     

    To compile do this:

     

    Open MobileTerminal and type the following lines of code

     

    su
    alpine //or your root password
    cd /var/mobile/tweakdirectory
    dpkg-deb -Z gzip -b com.yourname.yourcompanyname
    Your deb will stil be unarchiveable without using lzma and you don't have to make any modifications to your project beforehand. :)

     

    Hope this helps fix any errors you may encounter ^_^

     

    @@DiDA

×
  • Create New...

Important Information

We would like to place cookies on your device to help make this website better. The website cannot give you the best user experience without cookies. You can accept or decline our cookies. You may also adjust your cookie settings. Privacy Policy - Guidelines