Save dictionary - Ubuntu Touch Q&A, Help & Troubleshooting

How can I save the dictionary?
Wanna flash my phone with a fresh Ubuntu installation and don't wanna lose the collected words.

I just typed a new word : Happyass**** and long pressed it so the maliit keyboard should remember. Then I did
Code:
find -mmin -1 2>/dev/null
in the terminal, which points me to .local/share/maliit-server/en_userDictionary.dic, which seems to be a plain text file with the trained word. So, I'd guess backing this file up and copying back (maybe with a reboot?) could do the trick?!
Hth

Thanks a lot!
Annoying to train the dictionary every time after installing a fresh system.

So, have you tried it? Curious to hear the outcome when you do.

Actually there are all the collected words but I didn't have to restore them because I reflashed without doing a factory reset.

Replaced the file. Seems to work.

Related

[Q] Scripting on the Archos 70

Hi!
Could anyone help steer me towards a solution please?
Or tell me if its impossible (and why).
I am trying to put together a script of some kind which I can use to do a basic rebuild of my Archos 70 after I have done a Full Reinitialization. I like to mess around installing all sorts of stuff, but when done, it's nice to reset and go
back to a clean machine.
As it's not rooted (yet?) I generally rebuild manually which takes ages.
Although a relative newbie at Android/Linux, I have worked with scripting
on mainframes and in the Windoze arena for many years.
The scripting requirement is quite simple, namely to install packages one by one from the SD card. Also to copy back Bookmarks, launcher setting etc
I am happy to work in any language which will work, but to date have just been trying with .SL (Bash?) scripts which run quite happily from within the SL4A environment or according to my theory, should work also from Android natively.
I envisage the script residing on the SD card and when invoked installing my launcher, Dolphin Browser, various other apps and games, then copying back the settings which I have saved (also by script) before the Initialisation.
Trouble is, I can find no simple samples which help. When I try, I can 'cp' stuff about and echo messages etc, but when I try to install, I don't really know where to start. I have tried just the name of the app package
'/sdcard/sdcard/packagename.apk', it replies 'permission denied' and if I try 'sudo package.apk', it says 'not found'.
I am assuming that the 'permission denied' is a good sign because it understands what I'm trying to do at least. But if I am allowed to do it myself, then surely my script should be allowed to do it?
I am quite happy messing around myself. But if anyone has any pointers
(sample scripts, which language/environment to use, etc.) I would be most grateful.
Sorry if this is covered elsewhere. I have searched but was unable to find much which helped. I am continuing the search!
Thanks in anticipation!
1. All normal installed Apps are installed in /data/app as the apk
2. Local/private data comes into /data/data/name.of.the.package
Both directories are ony accessible with root.
Hell again,
Thanks for your reply fzelle, but I'm not sure as to whether I may have explained it properly.
I am running 'Quick System Info' which is great, and it has a function to backup all the installed apps to a directory you can get at without root access. From there I have copied them onto the SD card.
I am not just trying to copy them into the working directory.
If I click on an app, it lets me install it without any problem.
I am trying to automate that part of the process, and I need the name of the software which does the installation, and how to actually give it the parameters for it to do the install. Although a Linux newbie, I don't really understand why, if I am allowed to install apps myself,
a script that I run should not be allowed to install them also?
Anyone got any ideas please?
Oops! - Sorry for that unfortunate typo at the beginning of my last post. Please read as 'Hello'!
No, i didn't understand you wrong.
You want to automate the installation of your std programs, and that normaly doesn't only include the apk but also the private Data.
And if you manually want to install this, you need root to be able to write in /data/data
If you just want to Backup/Install the apps, use appSaver from the market.
That has allready everything you need, and doesn't need root.
fzelle said:
1. All normal installed Apps are installed in /data/app as the apk
2. Local/private data comes into /data/data/name.of.the.package
Both directories are ony accessible with root.
Click to expand...
Click to collapse
Not entirely true.
I have some SSH tunnels set up on my rooted phone that use keys and a shell script to launch them, all set up with Better Terminal Emulator. The key and script files are located under /data/data/com.magicandroidapps.bettertempro/home. I wanted to use the same keys and script on my A70, so I copied the files from my phone to the same directory on my A70 using the terminal command line. Although you can't browse to the app folders under /data/data/, there is some ability to copy stuff into them. I guess the trick is knowing what and to where.
I've not used appsaver, but Astro will also let you back up and reinstall your apps all at once.

phone force closing

I have been talking this over with Condemned Soul but wanted to see if anyone else has ran into this problem since he & I are both confused.
My fiances phone has been force closing a lot lately aka com.android phone not responding. I saw the first force close when I tried flashing Tazzs cm7 on his phone so thats when I first put on gsb 1.2
I switched his over to Sheds GSB on the 8th and it was great everything was fine but then I decided to try to improve on a few settings and when I restarted the phone it decided to start force closing.
I reflashed the rom and the gapps and everything seemed fine but then I wanted to put cs skull theme on his phpne since we had it on Kaos v9 but then when I restarted the phone after flashing the theme it force closed again.
So then I reflashed the rom and gapps again and got all his apps and settings all back how he had it and decided to do a Nandbackup so that we wouldnt have to keep reflashing the rom again and once I restarted the phone after the nandbackup it force closed again.
Long story short I reflashed the rom and gapps and now am in the process of getting his apps and settings back how he had it once again.
Am I doing something wrong to make it keep force closing? I would like to make a nandbackup at least for him so that we wont have to keep setting up his phone.
Thank you for any help
When you say you flash the ROMs, do you also do a wipe beforehand? If not, try doing a wipe and then install and see if that changes anything.
Yes I wiped both the factory and dalvk sorry I thought I mentioned that. lol.
labnjab said:
Yes I wiped both the factory and dalvk sorry I thought I mentioned that. lol.
Click to expand...
Click to collapse
Its a problem that happens on certain ROMs with certain themes. Not sure there's a fix for it, I just got around it by not applying the phone.apk theme.
zerocool79346 said:
Its a problem that happens on certain ROMs with certain themes. Not sure there's a fix for it, I just got around it by not applying the phone.apk theme.
Click to expand...
Click to collapse
phone.apk wasn't changed in the theme. Strange part is it's only on the one phone and haven't heard of it on any of the others.
CondemnedSoul said:
phone.apk wasn't changed in the theme. Strange part is it's only on the one phone and haven't heard of it on any of the others.
Click to expand...
Click to collapse
That is odd.
Update:
This is still causing issues. Going to try and format the sd like tazz suggested, but moving my phone.apk to his didnt work, and yesterday he had to restart his phone and it did it again and needlessto say hes not very happy with his phone. Says its not reliable at all. If anyone else has anything else I can try it would be a big help. I have tried searching on google but dont find a whole lot of information. I just wish I could figure this out its got to be something I did or something stupid that I am missing.
There are a couple of next steps you can take.
If the problem is a software configuration issue, then it is possible that you will see the reason for the FC in the logcat.
The system logcat is designed as a "circular buffer" (in a way that it has a maximum size) - once you fill it to capacity, each new record which is added to the end causes information at the beginning to be lost. But, this also means that if a FC occurs, so long as you "dump the logcat" within a reasonable period of time after the FC happens, you will capture the moment in time that the FC occurred,
Generally, the "logcat" buffers get filled to capacity quite quickly at boot time (because there is lots and lots of "android" app activity), and quite a bit slower after the phone has been completely booted. If you are trying to capture a logcat event during the first boot, you need to continuously capture output to a file on your PC (it will be quite large) - but once the phone has completed booting, so long as you "run a logcat" within 5 or 10 minutes after a FC occurs, the relevant event(s) will be in the logcat.
If you want to capture it during the first boot cycle of a freshly flashed ROM, probably you ought to have a PC attached and dump the prodigious output to a file on the PC, as in
Code:
C:\MyWindozePC> adb shell logcat -v time > LogcatFileOnMyPC.txt
So long as the ROM you have flashed has "USB debugging" turned on by default, you can run the above command about 10-15 seconds after you see the 3 skating droids, and it will continuously place output into the local file on your PC. You need to interrupt the above command (Control-C) to get it to stop; you would usually do that a few seconds after you saw the FC, and then you would know that the log entries you are looking for at the end of the file.
(Note that logcat dumps are usually huge - don't bother trying to look at them with a text file viewer on the phone - they suck at handling large files... well, at least the ones that I have tried).
You could also instrument this on the BF's phone in a way where he can capture the info to the SD card anytime he is using the phone during the day with a couple taps of the screen, and then you could look at the logcat(s) later at your leisure - for instance by using Gscript Lite, and a simple script like this:
Code:
#! /system/bin/sh
_LOGDIR='/sdcard/logcats'
if [ ! -d ${_LOGDIR} ]; then
mkdir ${_LOGDIR}
fi
_tstamp=`date +%Y%m%d-%H%M`
logcat -v time -d > ${_LOGDIR}/logcat_${_tstamp}.txt
With this method, you just need to train him like a monkey to press the right keys after a FC occurs. If he's a clever monkey, you could even train him to send the logcat files to you via e-mail.
If the problem is due to an intermittent hardware issue with the phone, that will be tougher to identify. About the best you can do to make that determination is to return the phone software to stock and use the phone without installing any apps for a reasonable period of time and see if the problem continues to occur.
cheers
bftb0
Thank you for the detailed reply bfbt0 I was about to msg you when you responded.
I will have to give what you mentioned a try.
Is the gscript lite what I use for the adb shells or do I need another app as well. I have never done anything with adb or if I have it was something simple.
To clarify I would have to get his phone to fc again which is easy to do and then run a logcat. It sounds easy through the pc I just want to make sure I do it right. I would make a folder dedicated to where the logcats would be stored and then run it in the gscript lite? Meaning run the first code you posted.
Update ~ Never mind I found you had to have android sdk on your pc Im downloading that now. I still may need help tho.
labnjab said:
Update ~ Never mind I found you had to have android sdk on your pc Im downloading that now. I still may need help tho.
Click to expand...
Click to collapse
GScript Lite is a free app on the market. It was put together by XDA member "rogro", and he has a paid version as well if you want to throw a couple bucks his way.
Using the script above with Gscript (Lite or Pro), you don't need to be tethered to a computer nor set up the SDK and drivers. (Only when you want to capture a full first ROM boot do you need to use a PC (because the logfile grows so big in that specific case).
If you can force the FC to occur, then using the Gscript Lite script I showed above will capture the information you want.
bftb0
PS There is a brief outline of how you load a script into Gscript Lite in that "Universal Root for Dummies" thread over on AF.
cheers
Thank you I will try that tonight and hopefully can figure out what the issue is
labnjab said:
To clarify I would have to get his phone to fc again which is easy to do and then run a logcat. It sounds easy through the pc I just want to make sure I do it right. I would make a folder dedicated to where the logcats would be stored and then run it in the gscript lite? Meaning run the first code you posted.
Click to expand...
Click to collapse
That code I posted checks to see if a folder exists, and if not creates it - /sdcard/logcats
No need for you to do it manually; the first time the script runs it creates that folder
But, yeah - wait for the FC to happen and then run that script within the next couple of minutes (no real hurry). It is also useful to make note of the time the phone displays when the FC occurs - it will be easier to find things in the logcat file by timestamp if you do that.
bftb0
Thank you I will do that as well. Thanks also for taking the time to help me.
I did the code on my phone to make sure I did it right and it gave me an error
says cannot create/logcat_20110222-1558.txt read only file system
did I do something wrong, just want to make sure that I can get it right before attempting it on his phone tonight. Thanks in advance.
labnjab said:
I did the code on my phone to make sure I did it right and it gave me an error
says cannot create/logcat_20110222-1558.txt read only file system
did I do something wrong, just want to make sure that I can get it right before attempting it on his phone tonight. Thanks in advance.
Click to expand...
Click to collapse
If you typed that script in by hand, you made a typo.
I checked it by cutting and pasting it - and then I tested it afterward, and it worked.
Probably you bolluxed up the _LOGDIR variable, or you inserted a space in the logcat command where there should not be one.
I would suggest that you cut and paste, rather than type.
Hmmmm... it occurs to me that those little "scrolling CODE text boxes" don't render correctly on the phones browser. Here's the same script, but without enclosing it in [ CODE ] [ /CODE ] tags:
#! /system/bin/sh
_LOGDIR='/sdcard/logcats'
if [ ! -d ${_LOGDIR} ]; then
mkdir ${_LOGDIR}
fi
_tstamp=`date +%Y%m%d-%H%M`
logcat -v time -d > ${_LOGDIR}/logcat_${_tstamp}.txt
Thank you for all your help. I got it to work and come to find out I didnt even need to use that program because it hasnt forced closed yet. He said he wiped the phone a bunch of times the other day when he was trying to get it back up and running when it forced closed on him while at work and now i rebooted it and backed it up and that usually caused a problem, so far so good.
I am tho going to format the sd card and redo the rom again just to be sure this problem doesnt happen again. Thank you again for all the help.
On some builds (even though it shouldn't be required) it is necessary to wipe multiple times. On Tazz's earlier builds of GB, people reported having to wipe 3x or more to get it running smooth. Always make sure you do a nand backup before flashing in the future lol. Hopefully the phone stays running good! If not, people are always here to help!
Sent from my Ginger Tazz using XDA App

[Q] Make a backup before flashing

Hi.
Last time I flashed a new firmware I made a backup of the phone. The problem was that I couldn't get it back after flashing.
So, my question is:
How on earth do I make a backup of everything before flashing. And how do I restore it afterwords.
Thanks in advance
Pemell
Hi pemell,
How did you generate the backup? Yesterday I generated a full backup of my Lumia 800 and the command that I executed was the following:
sudo dd if=/dev/sdX of=~/fulldump
This generated the fulldump file (16GB).
David Ortega.
I'd suggest that you back up in two ways: First in Zune and then via the DD. I would suggest that you create a separate backup of each partition in order to make reflashing easier.
davortsan - I didn't update by cab sending so aren't that familiar with these commands. I guess of course I could find out by some testing and reading.
chrisKringel - two partitions? are there two partitions? If the phone had a memorycard I would get where you're going.
kind of strange there are no step by step guide of how to backup pre flashing and restore afterwords. I'm too much of a noob to write it myself.
pemell said:
chrisKringel - two partitions? are there two partitions? If the phone had a memorycard I would get where you're going.
Click to expand...
Click to collapse
Let's take a computer for example. When you open up explorer on said computer you see multiple HDD-icons. One for the system, one for Music and Pictures and one for games. This doesn't necessarily mean that this computer has 3 physical HDDs as you can split up a storage device into multiple logical partitions. The computer can easily have only one physical drive.
Same thing goes for our Lumias. They have (as far as I know) only one NAND chip that stores all the data. But this chip is split up into 9 logical partitions, containing the bootloader, serialnumber, mac etc. (head over to the Development Section, a few of the early posts discuss the partitions). When you have a Linux at your hands you can use the DD command to dump every single partition. Of course you should only touch the 9th partition later but better safe than sorry. In order to backup with Linux you have to either run the full dump command from above. When you want to reflash the fulldump every single partitions gets reset to the state from when you created the backup. I never tried this but I would not advise to reflash all partitions. I'd rather advise you to create a single backup of each partition. Charge your phone and enter QUALCOMM mode. Plug it into your Linux and run the commands
Code:
dd if=/dev/sdX1 of=backup1.bin
Code:
dd if=/dev/sdX2 of=backup2.bin
... repeat for every number until the following ...
Code:
dd if=/dev/sdX9 of=backup9.bin
X refers to the mount point where your device is connected. You can use fdisk -l to get the right letter. When you need to restore your device you need only partition 9, but better safe than sorry You never know, these additional backups might come in handy sometime...
What do you intend to do? Do you want to have your Apps back after you flashed your phone?
Thanks Chris, a perfect post!
I know that most of the information on the phone comes from the cloud, but some doesn't. For exemple I use the call history a lot and I would like to keep all of my sms+mms. Reinstalling all the apps is, of course, something i would prefer not to do at every update (even though they don't come that often).
I'll look into the information you posted and see what I can come up with. / Pemell
pemell said:
Thanks Chris, a perfect post!
I know that most of the information on the phone comes from the cloud, but some doesn't. For exemple I use the call history a lot and I would like to keep all of my sms+mms. Reinstalling all the apps is, of course, something i would prefer not to do at every update (even though they don't come that often).
I'll look into the information you posted and see what I can come up with. / Pemell
Click to expand...
Click to collapse
Keeping the specified data like messages, settings and call history during a reflash is not easily possible. When you reflash (or flash) your phone all the data gets wiped and completely new data is written to the phone. There are some homebrew solutions for texts in the WP7 Dev & Hacking boards that might work, depending on your current ROM. Another thing is that the flash you do when using the methods described in this board is different from a flash in a Nokia Care Point. The official flashing flashes in a certain way that the first boot writes all the phone data in the registry, like the WP activation key and some other serials. This won't happen when you write the file in Qualcomm mode. This could cause problems when you try to restore a backup from Zune. I'm not really sure about this, though.
Another thing to note is that some ROMs are not updateable through Zune, on these ROMs you have to do a manual update or a new flash to get up to date.
I would suggest that you wait a few weeks if you can. Maybe Microsoft will announce a cloud backup for text messages when the introduce WP8. A official backup would be the safest way.
Thanks Chris, a good advice.

Backing up FreeOTP on OnePlus 7 Pro (Unlocked US)

Hi there,
I have been having endless headaches trying to backup FreeOTP so I can move on to something that has native import/export support and I cannot seem to get it right. I am able to get ADB to see the device, I am able to initiate a backup using `adb backup` but there's an odd behavior I'm noticing. First, upon requesting a backup, I get a prompt on my phone asking me if I want to authorize and if I want to type a password. If I leave the password field blank and hit backup, I get a 1KB .ab file. However, if I do type any password, I get nothing at all. In both cases, a small toast appears saying "Backup finished".
I tried to then use abe-all.jar to turn the .ab to a .tar, it spits out a 1kb .tar file, however extracting that tar files gives back nothing. I should be getting a manifest.xml file but I am getting nothing. So I am certain that something is not right in the backup process itself.
I can't deny the fact that I am starting to panic a bit as I have at least 8 different site's OTP tokens setup with FreeOTP and if anything happens to my phone I will have to go through a painful process of recovering them. This is precisely why I need to move away from FreeOTP.
Using Mac OS El Capitan and the OP7 is not rooted.
Greatly appreciate any help I can get with this.
I know this might come in late, but here's a link to an article that might help migrating from FreeOTP to FreeOTP+ (a.k.a FreeOTPPlus):
FreeOTP: Export Secrets and Migrate to FreeOTPPlus
Photo by Markus Spiske on Pexels.com This article is about the android app(s) which can be used as 2FA, MFA with TOTP. The original FreeOTP app for android was developed by RedHat, but had no optio…
externalmem.wordpress.com

Symlinks causing missing memory?

This may be a little complicated but here is the basic gist:
1. Android 2.1 (B&N Nook Simple Touch)
2. I backup the dictionary files in /system/media/reference and then delete the originals. This shows a corresponding increase in the available space in /system
3. I create a symlink to alternate dictionary files in /sdcard/Dictionary (or /data/media/B&N Downloads/Dictionary--same result either way)
4. After rebooting I have access to new dictionary. Then I change my mind and want a different dictionary.
5. I delete the symlinks in /system/media/reference
6. I create new symlinks to a different dictionary, reboot, etc.
7. Now I get tired of all this and want to return to the stock dictionary.
8. I delete the symlinks in /system/media/reference and prepare to copy the stock backups to their original location.
BUT
9. I see that there is no longer enough space on /system to restore the original files! As an example, the stock available space in /system is 55906 kb (80% full--that's with the dictionary files in their normal place). After a few symlink cycles it may drop down to something like 30359 kb (89% full). Restoration of the stock dictionary requires about 57000 kb available space.
Blah-blah-blah. I've done this many times now, each time searching diligently for what is taking up the space that should be free. The only way to get the space back is to restore an earlier nandroid backup.
Surely this is not supposed to happen with symlinks? To delete one I am using adb shell rm. Is there something else I should be doing?
Why does the use of symlinks in /system gradually erode available space?
I am working on a routine for swapping dictionaries on an e-reader (Nook Simple Touch--Android 2.1). I've got the shell commands nailed down and have constructed an app using Tasker. It all works g...
android.stackexchange.com
Yep, and I did see your comment which turned out to be really helpful, @alecxs! I've solved the problem and answered my own question over at Stack Exchange.
The key is to kill the background process which is holding on to the dictionary databases before doing any file manipulations. If that is done, everything works as it should and no funny /system storage losses.
Thanks so much for nudging me in the right direction.
don't thank me, I had something different in mind. but yes, reading your answer remind me some strange behavior in 5 years old backup script:
after lazy umount + rm -rf /data still there was ~1GB disk space occupied.
this is because deleted files remain open for running processes, just the inode becomes orphaned.
killing system_server immediately freed up these 1GB and solved for me. lsof is your friend

Categories

Resources