Change Adobe Air apps default browser

Adobe Air BrowserI'm currently using Adobe Air just for Twitter clients, Seesmic and [blippr]Tweetdeck[/blippr]. I noticed that the browser used to open links was not the gnome default one (Epiphany in my case) but [blippr]Firefox[/blippr]. After looking for firefox string into the apps folder I tried looking for it on the adobe air installation directory and... yes that was there.

Unfortunately it's compiled in a .so files and as I couldn't recompile it I decided using mighty vim to do the dirty trick.

First of all, to avoid segmentation faults errors the file have to remain of the same bytes of the original one => as firefox is composed by 7 chars I had to replace it with a 7 chars executable.  I then created a symlink called browser (7 digits) pointing to my epiphany binary

ln -s /usr/bin/epiphany /usr/local/bin/browser

Then I opened the .so file with vim ( in my case adobe air was installed on /opt/air , but this may vary depending on your installation method)

vim /opt/air/runtimes/air/linux/Adobe\ AIR/Versions/1.0/

On vim I went to line 15500 doing


then looked for 'firefox' and replaced it with 'browser'.
If you can't find 'firefox' at line 15500 it's probably due to a different sdk version. Try at line 16104 as suggested in the comments.
Closed and saved with


I then restarted the app and the links were being opened with epiphany. Using the symlink makes it very easy to switch from one browser to an other one. For example I switched from epiphany to Google [blippr]Chrome[/blippr] just doing

rm /usr/local/bin/browser && ln -s /opt/chrome/google-chrome /usr/local/bin/browser

Update: ubuntu users

In the comments, Victor gave some good advices for Ubuntu users.

Update: more abstraction

In the comments, mjg reported how to improve abstraction using x-www-browser

Update: default browser on Gnome Environments

In the comments, saidimu pointed out how to preserve your default browser preferences in Ubuntu

adobe, air, Browser, gentoo
Andrea Olivato