Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Gro-Tsen/d5fe429cbaeb53fbaa88c988204f0df4 to your computer and use it in GitHub Desktop.
Save Gro-Tsen/d5fe429cbaeb53fbaa88c988204f0df4 to your computer and use it in GitHub Desktop.
Possible steps under Android to copy Firefox profile to Firefox Nightly
## FIRST, install Firefox Nightly on Android. Then run it once and let it start.
## Then force stop it and clear its cache (but not further data).
## Then understand the following commands, adapt them, and use them
## (as root through adb).
# Get the original profile name:
cd /data/data/org.mozilla.firefox/files/mozilla
srcsalt="$(echo *.default)"
echo "$srcsalt"
## should look like "xxxxxxxx.default"
# Rename Nightly profile:
cd /data/data/org.mozilla.fennec_aurora/files/mozilla/
for salt in *.default ; do sed -e "s/$salt/$srcsalt/g" profiles.ini > profiles.ini.temp ; cat profiles.ini.temp > profiles.ini ; mv "$salt" "$srcsalt" ; rm profiles.ini.temp ; done
# Get uid name for Nightly:
cd /data/data/org.mozilla.fennec_aurora/files/mozilla/
newuid="$(ls -ld . | cut -d ' ' -f 3)"
echo "$newuid"
## should look like "u0_a48"
# Now copy the data:
cd /data/data/org.mozilla.fennec_aurora/files/mozilla/"$srcsalt"
for file in * ; do echo $file ; rsync -avHX /data/data/org.mozilla.firefox/files/mozilla/"$srcsalt/$file" ./ ; chown -R "$newuid:$newuid" $file ; done
# The following ought to be better, but it seems to break things (WHY???),
# so don't do it...
#cd /data/data/org.mozilla.fennec_aurora/files/mozilla/"$srcsalt"
#rsync -avHX --delete-after /data/data/org.mozilla.firefox/files/mozilla/"$srcsalt"/ ./
#chown -R "$newuid:$newuid" * .parentlock .startup-incomplete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment