Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove these mangled selectors from iOS app

I need help in removing known mangled selectors in my iOS app.

Apple rejected my app stating:

Regarding Guideline 2.3.1, this app is verified to contain mangled selectors such as - x7kQPFEZS4af59md1eVMqf42YSTGAZVO: and i5B8qlaSJwvmVviceDOQkqQ0vwGq35XMmtV81zlsmHnws.

I tried running nm command which listed all the symbols, and then searched for above mentioned selectors using grep:

grep -r x7kQPFEZS4af59md1eVMqf42YSTGAZVO .

grep -r i5B8qlaSJwvmVviceDOQkqQ0vwGq35XMmtV81zlsmHnws .

Both grep shows following result:

Binary file ./Payload/MyAppName.app/MyAppName matches

MyAppName is a binary file (unix executable).

How do I proceed further and remove these mangled selectors from my iOS app? (or at least locate what code / framework is creating this selector)

like image 987
Ratan Avatar asked Feb 14 '19 05:02

Ratan


1 Answers

I used a disassembler Hopper to locate a library that had the mangled selectors. I followed these steps:

  1. Create .ipa file from Xcode project (Not sure if it was exported as development or App Store build, you may have to try each).
  2. Unzip the .ipa file
  3. Open Hopper application, drag and drop the .app file inside Payload folder after unzip.
  4. Load it as 'FAT archive' when asked.
  5. Let the application complete the scan.
  6. Search for the mangled selector name on the left menu.
  7. Select the matched selector, on the right detail pane, I could find some project specific class / method names. I searched these Class and method names in my project and located the library.

The app was approved after I removed that library.

like image 117
Ratan Avatar answered Oct 07 '22 09:10

Ratan