[Marble-devel] Review Request 124561: Do not load orphane plugins on Android
Dennis Nienhüser
dennis at nienhueser.de
Fri Jul 31 16:40:25 UTC 2015
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/124561/
-----------------------------------------------------------
Review request for Marble.
Repository: marble
Description
-------
Qt's plugin loading mechanism is unable to load plugins from the assets virtual file system they're bundled in (via the .apk). The current workaround in PluginManager is to copy the files from assets:/ (the system plugin path) to the local plugin path. A similar approach is done by Qt internally. Our app's private storage is organized as follows:
apps/org.kde.marble.maps/
f/.local/share/marble/maps/earth/ // Downloaded map tiles etc
f/.marble/plugins // Marble plugins
r/qt-reserved-files/plugins // Qt plugins
r/qt-reserved-files/qml // QML plugins including QtQuick Android controls
r/qt-reserved-files/android-style // Graphics resources
I can't tell how the r/ files are handled during package upgrades (can anyone help out?), but the ones in f/ stay untouched. Therefore we can end up in the following scenario:
- Marble Maps version n installs plugin foo
- Marble Maps version n+1 does not ship foo anymore, or has foo renamed bar
- User updates from n to n+1. f/ files stay intact, so foo stays around
- User starts n+1, foo is loaded
This can have all sorts of undesired effects, from having foo around although we don't want it to crashes or random runtime behavior due to ABI changes.
The patch fixes this by generating a whitelist of plugins shipped in the current version, then refusing to load any other plugins it encounters. Given the path structure outlined above it should be safe to delete such orphane plugins even (currently not implemented, just a comment in the code).
Diffs
-----
src/lib/marble/PluginManager.cpp 5cc47b2
Diff: https://git.reviewboard.kde.org/r/124561/diff/
Testing
-------
checking qDebug output on a Nexus 4 with adb logcat.
Thanks,
Dennis Nienhüser
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/marble-devel/attachments/20150731/885cf9c5/attachment.html>
More information about the Marble-devel
mailing list