xreDirectory is used to determine when the omnijar location changes and for
some crash reporter logic that is not used on Android.
On Android, this location currently points to the App data folder, something
where <App identifier> is the unique App identifier, e.g. org.mozilla.firefox
for Firefox for Android.
while the omnijar is located inside the APK (which is just a zip file) in a
location that looks like this
where <base64 string> is a base64-encoded string that's unique to the current
APK (it might be a hash of the APK but I'm not sure). This value changes every
time the app is updated.
Code that uses the StartupCache assumes that whenever the location of the
omnijar (and its contents) change, the cache will be invalidated.
The assumption is usually true for code that resides inside the omnijar as part
of Gecko, as anytime the contents of the omnijar change, the Gecko version
changes too, invalidating the cache.
There is an exception however, extension built-in scripts are stored in the
same path as the omnijar (inside the apk) but can change without a Gecko
This causes the StartupCache to have invalid data that points to the old apk
To resolve this proble, we store the apk path as xreDirectory, and the data
path as directory, so that if either change, the StartupCache will be
The new compatibility.ini will look like this:
where today LastAppDir and LastPlatformDir are both equal to the data path