How to view NSString defined in a given iOS ipa fi

2019-03-27 15:12发布

问题:

I remember I have done this before, but forgot the command.

e.g.

I have a NSString defined in source, e.g.

NSString * s = @"secret";

I remember I can view the content using the strings command, but I forgot the exact command to view it,

e.g.

strings my.ipa | grep "secret"

does not work. Anyone have idea?

回答1:

I'm not sure it's possible directly with strings on an ipa, but you can do the following:

  1. Rename your .ipa file to have the .zip extension. ipa's are simply renamed zips.
  2. Extract (it should create a directory named Payload)
  3. cd into the Payload/<app-name>.app
  4. You should have a file named <app-name> in the current directory.
  5. Call strings <app-name> | grep secret.