Edit Google Analytics for iPhone to use a Hidden Database

1 minute read

I use Google Analytics in my iPhone apps to track how my customers are using them. It is very useful for determining the answers to questions such as:

- Do users prefer Browsing or Searching
- Do users setup simple, or complex alarms
- Do users even tap _____ at all?

In Ambiance 3.0, I have added File Sharing through iTunes in order to process the App's Backup Files and capabilities. The way this works is that iTunes will list the entire contents of your Documents Directory in the iTunes File Sharing pane for your app, unless they are a hidden file. This means that every data file Ambiance uses has a "." prefix as I do not want to share these files. The only problem is that I could not find a way to hide the googleAnalytics.sql file that was created by Google, thus, the customer saw this:

While this isn't the worst thing in the world, it isn't ideal either. I contacted a friend of mine for some help and he had the brilliant idea of using a Hex Editor, editing the libGoogleAnalytics.a file to change the name of this string. Now, the string is hidden and all is good with the world!

Here is the tip he gave me:
I have modified the
library with an hexadecimal editor, I have used 0xed
(http://www.suavetech.com/0xed/0xed.html), and changed the first
letter of the string, the g, by a dot. The library seem to work and
generates the file. I have changed the first letter because I don't
know if you can add a new character to the string in a binary file
without side effects, and this way the length of the string and
library remains the same.
- Antonio Cabezuelo ( tapsandswipes.com )

So I installed 0xED, opened libGoogleAnalytics.a and searched for "googleAnalytics.sql" and changed it to ".oogleAnalytics.sql", saved and ran the app and it works great.

Hope this helps somebody out because it really made my life easier working with the Google Analytics library. BTW, don't bother contacting Google with any issues, their support is horrible. I emailed at least 10 times about this before asking a friend.

Was this page helpful for you? Buy me a slice of 🍕 to say thanks!