[tbb-bugs] #28640 [Applications/Tor Browser]: System addon does not override app-profile addon
Tor Bug Tracker & Wiki
blackhole at torproject.org
Thu Nov 29 14:09:23 UTC 2018
#28640: System addon does not override app-profile addon
-------------------------------------------------+-------------------------
Reporter: sysrqb | Owner: tbb-
| team
Type: defect | Status: new
Priority: Very High | Milestone:
Component: Applications/Tor Browser | Version:
Severity: Normal | Resolution:
Keywords: tbb-mobile, TorBrowserTeam201811, | Actual Points:
TBA-a2 |
Parent ID: | Points:
Reviewer: | Sponsor:
-------------------------------------------------+-------------------------
Comment (by gk):
Okay, I have something for the Torbutton issue (not sure where you were
with the preferences file but it seemed you were in good shape with it).
Testing this has been a pain in the butt but I think I now have a setup
where I can develop code without rebuilding the whole .apk and test the
update case. The following works for me (it still needs to get applied
only on Android and not on all platforms):
{{{
diff --git a/toolkit/mozapps/extensions/internal/XPIProvider.jsm
b/toolkit/mozapps/extensions/internal/XPIProvider.jsm
index a8be063ddbde..20544a3d37d4 100644
--- a/toolkit/mozapps/extensions/internal/XPIProvider.jsm
+++ b/toolkit/mozapps/extensions/internal/XPIProvider.jsm
@@ -1601,6 +1601,13 @@ var XPIStates = {
for (let [id, file] of location.getAddonLocations(true)) {
knownIds.delete(id);
+ if (id === "torbutton at torproject.org" &&
+ location.name === KEY_APP_PROFILE) {
+ location.uninstallAddon(id);
+ changed = true;
+ continue;
+ }
+
let xpiState = loc.get(id);
if (!xpiState) {
logger.debug("New add-on ${id} in ${location}", {id, location:
location.name});
--
2.19.2
}}}
I *think* that should be all we need but `XPIProvider.jsm` code is quite
complex. Thus, I could have missed some bit. I chose `uninstallAddon()` as
this does a variety of things which could be useful, including deleting
the file and I set `changed` to `true` in order to rebuild all databases
if needed and get rid of old state. The log shows that Torbutton is taking
from the update and no old one is initialized. It seems HTTPS-E and
NoScript are not showing up in the menu anymore but that has happened on
my phone before randomly. So, might just be a correlation.
Feel free to use it if you think it's worthwhile. :)
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/28640#comment:8>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tbb-bugs
mailing list