It's me from the development section. I noticed a little while back that starting firefox 29, our device is explicitly blacklisted from mozilla not to use the flash plugin. Regardless of whether you're on kitkat or not and whether you installed flash or not firefox will check to see if you're using a tegra2 (and surprise) tegra3 device. If you have one of these, firefox goes out of its way to make sure you don't use flash. In place, it has a cheesy "we're sorry" message. On most kitkat roms flash will not work because you need to compile the rom with -DNEEDS_VECTORIMPL_SYMBOLS . However, this flag is automatically used for our tablet to get the camera driver to load. It would seem like a no-brainer to use flash on our tablet then.
Here's the code that disables flash for us: firefox-source/mobile/android/base/GeckoAppShell.java
Not feeling like recompiling firefox fore just those few lines I decided to use apktool to try and remove this function. The smali apktool produces, barely resembles the java code. I think I've managed to bypass the tegra check with this "v2" hack method:
/smali/org/mozilla/gecko/GeckoAppShell.smali
Here's how I think the new hack works as it does according to the screenshot. I think the first 6 lines check for the tegra2 display driver file. The 6th line says that "if the check returned a non zero value skip to condition 0". I can only assume that a non zero check would indicate the file was found. It's skipping straight to "condition 0" because the original java code had the check for the tegra2 and tegra3 driver in a logical OR. In this case, if the first half of the OR is true, there's no use to check the second half since a minimum of 1 of the halves must be true.
The second half is when the tegra2 driver hasn't been found it will try for the tegra3. **Note these lines are NOT executed if the tegra2 driver was found because of the jump to condition_0 which bypasses these lines.** However, at the end is an interesting "if the result of the search is zero, skip to condition 2". I'm assuming that if both checks failed then condition 2 must be what comes after the "if (isTegra)" in the java code. condition_2 likely skips past the body of that if staement. In that case, I'll have firefox skip right to the chase and directly go to condition 2 without checking. I consider this a more clean hack that removes the check altogether. While not poetic it's efficient.
As to why we shouldn't just stick to firefox 28.0.1... security issues! Each new version of firefox patches up security holes in the previous versions. As much as we like to poke fun at Internet Explorer for swiss cheese security (among other things...), we wouldn't be any better using an old firefox.
Download v30 here
Download v31 here
Download v32 here
Download v32.0.1 here
Download v32.0.3 here
**New**: just pick up your updates from the android file host link.
Screenshot to prove that it works below :cyclops: :
Here's the code that disables flash for us: firefox-source/mobile/android/base/GeckoAppShell.java
Code:
// An awful hack to detect Tegra devices. Easiest way to do it without spinning up a EGL context.
[B]boolean[/B] isTegra = (new File("/system/lib/hw/[B]gralloc.tegra.so[/B]")).exists() ||
(new File("/system/lib/hw/[B]gralloc.tegra3.so[/B]")).exists();
if (isTegra) {
// [COLOR="Red"][B]disable Flash[/B][/COLOR] on Tegra ICS with CM9 and other custom firmware (bug 736421)
File vfile = new File("/proc/version");
FileReader vreader = null; ...etc
Not feeling like recompiling firefox fore just those few lines I decided to use apktool to try and remove this function. The smali apktool produces, barely resembles the java code. I think I've managed to bypass the tegra check with this "v2" hack method:
/smali/org/mozilla/gecko/GeckoAppShell.smali
Code:
[Daniel@Daniel5 fennec]$ diff GeckoAppShell.smali.orig GeckoAppShell.smali
4166,4188c4166
< new-instance v1, Ljava/io/File;
<
< const-string v4, "/system/lib/hw/gralloc.tegra.so"
<
< invoke-direct {v1, v4}, Ljava/io/File;-><init>(Ljava/lang/String;)V
<
< invoke-virtual {v1}, Ljava/io/File;->exists()Z
<
< move-result v1
<
< [B]if-nez v1, :cond_0[/B]
<
< new-instance v1, Ljava/io/File;
<
< const-string v4, "/system/lib/hw/gralloc.tegra3.so"
<
< invoke-direct {v1, v4}, Ljava/io/File;-><init>(Ljava/lang/String;)V
<
< invoke-virtual {v1}, Ljava/io/File;->exists()Z
<
< move-result v1
<
< [B]if-eqz v1, :cond_2[/B]
---
> goto :[B]cond_2[/B]
Here's how I think the new hack works as it does according to the screenshot. I think the first 6 lines check for the tegra2 display driver file. The 6th line says that "if the check returned a non zero value skip to condition 0". I can only assume that a non zero check would indicate the file was found. It's skipping straight to "condition 0" because the original java code had the check for the tegra2 and tegra3 driver in a logical OR. In this case, if the first half of the OR is true, there's no use to check the second half since a minimum of 1 of the halves must be true.
The second half is when the tegra2 driver hasn't been found it will try for the tegra3. **Note these lines are NOT executed if the tegra2 driver was found because of the jump to condition_0 which bypasses these lines.** However, at the end is an interesting "if the result of the search is zero, skip to condition 2". I'm assuming that if both checks failed then condition 2 must be what comes after the "if (isTegra)" in the java code. condition_2 likely skips past the body of that if staement. In that case, I'll have firefox skip right to the chase and directly go to condition 2 without checking. I consider this a more clean hack that removes the check altogether. While not poetic it's efficient.
As to why we shouldn't just stick to firefox 28.0.1... security issues! Each new version of firefox patches up security holes in the previous versions. As much as we like to poke fun at Internet Explorer for swiss cheese security (among other things...), we wouldn't be any better using an old firefox.
Download v30 here
Download v31 here
Download v32 here
Download v32.0.1 here
Download v32.0.3 here
**New**: just pick up your updates from the android file host link.
Screenshot to prove that it works below :cyclops: :
Attachments
Last edited: