FolioTNTmod 0.4 - Issues and bugs - Folio 100 General

This thread should be used for bugreporting and troubleshooting.
FolioTNTmod 0.4 ONLY.
Please make sure to post a detailed description of the issue, under what curcumstances it occures, and which processes are running.
Use the search function to make sure your issue hasn't already been solved before you post.

I've found a way to access Accounts Sync and Keyboard installation.
first, Accounts Sync :
- you must install LauncherPro even if you do not use it.
- On the desktop, add a new shortcut, select "Activities".
- Under "Account Settings and Sync" select "com.android.settings.ManageAccountsSettings.
Well, now you have a shortcut on the desktop to access the sync settings.
Keyboard installation :
After installing your alternative keyboard, copy the APK from /data/app/ to /system/app/
I create a simple script (in Gscript) that mount the file system as read/write , copy the APK, and enable the "SmartKeyboardPro" keyboard (after reboot).
code :
Code:
su
mount -o remount,rw /dev/block/mmcblk0p1 /system
cp /data/app/net.cdeguet.smartkeyboardpro-1.apk /system/app/
**optional**
reboot
**optional**

I was playing with Angry birds and after a reboot the application was corrupted in some way, the icon dissapeared and I had to reinstall, but the configuration was saved.
In anycase I used Angry Birds backup to backup it and after Andexplorer to copy the backup from the internal SD to the external one, to my surprise, the internal one was not present on Andexplorer (but I was able to go trought /mnt/sdcard).
Now I can see it again but there are a lot of files DiskCacheIndexxxxx.tmp, any clues?

julio77 said:
Keyboard installation :
After installing your alternative keyboard, copy the APK from /data/app/ to /system/app/
I create a simple script (in Gscript) that mount the file system as read/write , copy the APK, and enable the "SmartKeyboardPro" keyboard (after reboot).
Click to expand...
Click to collapse
Yeah, thank you for this tweak

Orientation has some problems..
getWindowManager().getDefaultDisplay().getRotation()
should return 0, when Orientation is setted to Landscape...
but it returns Surface.ROTATION_90.
(I'm using 0.4a version)
Davide

This is intended behaviour. It fixes the sensor issues for many applications, as developers didn't prepare their apps for devices with natural orientation set to landscape.
Is this causing any problems for you?

Thank you for your reply.
I'm developing an android game that uses accelerometer to evaluate gravity force's vector. I would like to write portable code (to work on both phones and tablets), so the right code to evaluate gravity (ignoring other forces) should be:
screenRotation = getWindowManager().getDefaultDisplay().getRotation();
[...]
float x;
float y;
float z;
if (screenRotation == Surface.ROTATION_0) // Default portrait
{
x = event.values[0];
y = event.values[1];
} else if (screenRotation == Surface.ROTATION_90) // Default landscape
{
x = -event.values[1];
y = event.values[0];
} else if (screenRotation == Surface.ROTATION_180)
{
x = -event.values[0];
y = -event.values[1];
} else// (screenRotation == Surface.ROTATION_270)
{
x = event.values[1];
y = -event.values[0];
}
z = event.values[2];
gravity.x = -x;
gravity.y = -y;
gravity.z = -z;
This should be the right way to ensure portability.. (it's similar to the Nvidia 'Android Accelerometer Whitepaper''s way),
but it's not working with this patch on Folio (y results in reverse, and rotation sensibility is weird)..
So, to ensure compatibility to games coded only for portrait-native oriented (and, in the same time, ensure correctness to the right written codes), it is not enough to return Surface.ROTATION_90 on landscape orientation, but it should emulate it reversing the values returned by onSensorChanged(SensorEvent event).
In other words,
(EMULATED)event.values[0] = (ORIGINAL)event.values[1]
(EMULATED)event.values[1] = -(ORIGINAL)event.values[0]

The patch should do that. Could you verify that on FolioMod? Maybe something got broken when this was ported to tnt.
Also the Nvidia whitepaper states the following for rotating the values:
90°
x = -v[1]
y = -v[0]
180°
x = -v[0]
y = v[1]
270°
x = v[1]
y = v[0]
Also, please check if you are using the newer API for listning to events (the one that uses SensorEventListener) The legacy Api handles rotations by itself, so you should not handle this in your code.

Yes, I'm using SensorEventListener.
weeds2000 said:
Also the Nvidia whitepaper states the following for rotating the values:
90°
x = -v[1]
y = -v[0]
180°
x = -v[0]
y = v[1]
270°
x = v[1]
y = v[0]
Click to expand...
Click to collapse
This is the canonicalToScreen transform for rotating values,
for screen coordinates, increasing y is down (so I'm using world transform).
Sure that the returned value are (for every rotation angle) these:
(EMULATED)event.values[0] = (ORIGINAL)event.values[1]
(EMULATED)event.values[1] = -(ORIGINAL)event.values[0]
?
To understand if it's a my mistake, I've downloaded a free app from the market, JumpyBall 3D Lite, and I noticed that also in this game tilt behaviour is reversed in one direction (could someone test it on the FolioMod?)..

I've checked the code, and yes in the last version for the fix the accelerometer values are rotated in the correct way:
Code:
switch ( sensor.getType() ) {
// ...
case Sensor.TYPE_ACCELEROMETER: {
if ( legacy == false ) {
valuesOut[0] = valuesIn[1];
valuesOut[1] = -valuesIn[0];
}
break;
}
}
However there was an issue with the first release of the fix, as my portrait testgame was using legacy API, and therefore values were somewhat broken.
Maybe only the first version of the patch is in TNT?
By the way, the code that was modified for the fix has been posted in the kernel and tweaks thread. You should be able to verify that TNT has the correct version of the fix or be able to create a patch for TNT. (Do not try to flash the update, it will most certainly break your framework.jar)
Edit:
JumpyBall 3D is working as expected on FolioMod, therefore i think TNT only has the first revision of the patch included.

Ok, thank you!!

Problems
Thanks for a great ROM...
I have a few problems.. Hope someone can help:
Some applications like NFS:Shift and Grooveshark can't access the internet..
Contacts gives a FC..
I can't seem to sync contacts and calendar from my exchange sync.. I can choose to do so, by entering the sync & accounts through pro launcher, but I can't enable sync, so only email works..
I think that was it for now...
Hope someone can help
***Update***
I got contact and calendar sync to work by installing the contacts application from FolioMod and the Calendar app from The TnT Lite mod from Viewsonic...

Related

[BUG REPORTING] DizzyDen's IMEIme IMEI Generator

BUG REPORTING:
This program was initially ineteded to generate a unique IMEI based on your device S/N and update Dev's install zip files... it has become so much more, and as such there are many functions involved in this process.
Due to the complexity the program has taken on... far beyond what I initially intended... to report bugs please try to use the following as a template:
Function attempting: i.e. Updating ROM... In Place Upgrade... Update framework saved on computer... etc.
Error Messages: any error message you receive... or the last message you saw prior to the issue.
End result: i.e. TelephonyManager updated, ROM not... TelephonyManager updated framework.jar not... etc....
Environment: ROM in same folder as !IMEIme.exe... ROM on same drive as IMEIme.exe... ROM on different drive... etc. (same for framework if updating framework instead)
!IMEIme.ini settings: you can put your entire ini file if you'd like.
If you could take notes of EXACTLY what buttons you click on which prompt it would be EXTREMELY helpful...
As I said, this program has taken on functions I initially had not imagined including... the more features added, the more complex testing and tracking bugs becomes... I don't want to include a bunch of messages just for the sake of letting you know where in the code you are... would not be beneficial to you... more buttons to click for no reason, etc.
The more detailed you can be, the quicker I can see what is happening... otherwise I have to try to duplicate what I think you are doing when you get the error.
Everyone should click "Thanks" on bug report posts... they have been instrumental in getting the program where it is so far.
RESERVED...
Adverse effects after running
First off, thanks for a wonderful application! Your app did in fact correctly give my Kindle a IDEI number, but it seems to have adverse effects.
Function attempting: Tried both in place Rom and update device and now attempting to use app with sound
Error Messages: Unfortunately DSP Manager has stopped (repeatably on any app)
End result: No sound and music apps crash. Some apps work but many do not. (I can provide logcat if needed)
Environment: Kindle Fire running cm9 using Hashcodes 3.0 Kernal latest (11) update.
!IMEIme.ini settings:
Use_In_Place = 0
Use_Previous_Patch = 0
Use_Serial_Number = 0
Use_MAC_Address = 0
Use_Manual_Input = 1
Encrypt_IMEI = 0
Use_IMEI(15) = 0
Use_ADB = 1
Use_ADB(usb) = 1
Use_ADB(WiFi) = 0
Clean_Up = 1
Include_Patch = 1
Device_Manufacturer = TI
Manufacturer_Device = Blaze
Device_Model = Full Android on Blaze or SDP
Build_Fingerprint = google/passion/passion:2.3.6/GRK39F/189904:user/release-keys
LCD_Density =
WiFi_IP_Address =
IMEI = 00127948612384612
Although I have tried multiple settings and configurations. I am sort of a noob so sorry if this is a silly problem.
Having looked into this... I can tell you there's nothing that the IMEI Generator does that would cause the issues you are seeing. I would recommend flashing a non-IMEI'd ROM for testing... then either do in place IMEI generation or running the IMEI Generator against the same ROM you flash.
For what you are doing... there are 2 files that are being modified, and neither should cause FC issues...
/sysem/build.prop for the manufacture, device, and build fingerprint
/system/framework/framework.jar is being extracted and edited to patch the IMEI in the GetDeviceID() function in android/telephony/TelephonyManager.smali and recompiled.
Clearing cache and dalvik cache may be something to try.
Thanks! Clearing both caches AFTER the install made it work great. I had been clearing all of the memory beforehand but it did not work. My apps now work great!
Motorola Razr GSM (SPDREM_U_01.6.7.2-180_SPU-19-TA-11.6_SIGNEuropeAustraliaEMEA_USASPDRICSRTGB_HWp2b_Service1FF) ICS.
I deodexed framework.jar because application seems to not work on odex files (as stock is), anyway new deodexed framework have not /com/android/internal/telephony/gsm/GSMPhone.smali file?! (or dir!!) infact !IMEIme 2.2.0.2 tell me about this issue (no GSMPhone.smali found). framework patched do not present diffecence between original one. exactly the same. no /android/telephony/TelephonyManager.smali mod applied.
I tryied to patch framework by "update device" + adb usb, with no device connected i choosed my framework.jar in my pc.
[Settings]
Use_In_Place = 1
Use_Previous_Patch = 0
Use_Serial_Number = 1
Use_MAC_Address = 0
Use_Manual_Input = 1
Encrypt_IMEI = 0
New_Type = 1
Use_IMEI(15) = 0
Use_ADB = 1
Use_ADB(usb) = 1
Use_ADB(WiFi) = 0
Clean_Up = 1
Include_Patch = 0
Device_Manufacturer =
Manufacturer_Device =
Device_Model =
Build_Fingerprint =
LCD_Density =
WiFi_IP_Address =
IMEI = 02546451548481584
stock framework.odex, jar and my deodexed framework attached.
Yes... due to another user trying to use the generator on a device with a framework.odex file instead of framework.jar I am looking into the most effective method of handling that situation. As of now... the generator will not work for you to patch imei functionality into the framework on these devices.
i deodexed also framework.jar but no way to patch it, GSMPhone.smali is missing totally even in backsmalied odex too!!!!
I decided to apply the patch manually, but without this file and TelephonyManager.smali not regoular i was thinking about hard mod by motorola?! do you know something about?
Pls man, give me an hand, show me the way, backsmali it you too http://forum.xda-developers.com/attachment.php?attachmentid=1634550&d=1357865096
I'm looking into the method to implement the imei into this.
do you mean into TelephonyManager.smali? I'm looking on it too. Seems so strange this framework...
Actually... looking through to find the best call to implement the patch into... TelephonyManager was the original method... but there may be better places to patch it.
Code:
invoke-direct {p0}, Landroid/telephony/TelephonyManager;->getSubscriberInfo()Lcom/android/internal/telephony/IPhoneSubInfo;
move-result-object v2
invoke-interface {v2}, Lcom/android/internal/telephony/IPhoneSubInfo;->getDeviceId()Ljava/lang/String;
All does make sense now:
http://grepcode.com/file/repository...nternal/telephony/IPhoneSubInfo.java?av=f#174
BUT, where is com.android.internal.telephony.iphonesubinfo!?!?! seems not present... all "internal" dir is missing here, backsmali fault or my fault?!
hiiii
hi,
any news of this? =)
This is the best software for this!
I'm working on the best solution... I understand the desire for this... but I want to ensure the method I choose is the best overall... and to ensure I can properly detect which method to implement during the operation.
If you could zip your entire /system/framework folder and add your /system/build.prop file it would help me test some things I've been putting together for odexed systems.
attaching files
DizzyDen said:
If you could zip your entire /system/framework folder and add your /system/build.prop file it would help me test some things I've been putting together for odexed systems.
Click to expand...
Click to collapse
Hi, Im attaching my files.
You can download here: w w w . 4 s h a r e d . c o m / z i p / j Q n n 9 8 _ B / s y s t e m . h t m l
Thanks for the help
Error ...
Hi Dizzy
I tried to use your update, but have a error ... My device is Motorola Razr XT910 with 4.0.4
after I choose the "framework.jar" he return this error:
Line 3710 (File: ".....\IMEI\!IMEIme.exe");
Error: Variable used without being declared.
After this the program close without any click to exit ..
Im, attaching a print screen
Tnx a lot man
waldirsp11 said:
Hi Dizzy
I tried to use your update, but have a error ... My device is Motorola Razr XT910 with 4.0.4
after I choose the "framework.jar" he return this error:
Line 3710 (File: ".....\IMEI\!IMEIme.exe");
Error: Variable used without being declared.
After this the program close without any click to exit ..
Im, attaching a print screen
Tnx a lot man
Click to expand...
Click to collapse
fixed... I guess nobody has been using the "Use Previous Fix" option for a while. New version uploaded... thank you for the bug report. The screen shots really helped track it down.
another error...
Hi DizzyDen,
I want to add an IMEI to my "SUPERPAD 6", but after the window: "IMEI is..." is displayed, then popup an autoit error window:
Line 3710 (File "..."): Error: Variable used without being declared.
Can you help?
Ponozka said:
Hi DizzyDen,
I want to add an IMEI to my "SUPERPAD 6", but after the window: "IMEI is..." is displayed, then popup an autoit error window:
Line 3710 (File "..."): Error: Variable used without being declared.
Can you help?
Click to expand...
Click to collapse
Before I start looking into this... note that the IMEI generator does not support de-odexing odexed systems yet... I would suggest using it on the ROM then flashing it to the device and let the device odex it again.

[Q] Can someone make an app for me?

Hello,
I need an app and wanted to know if there is someone who has the "know how", the time and the willingness to make it for me.
The app shall ask me where 'the' folder of pictures is,
where I want to save the new pictures,
what the name the folder new folder is,
then for each picture in that folder it shall make 3 versions (jpg compression and picture size would be different),
save them "optimized for the web" and
write a a two dimensional Java-array with informations which are based on the height and width of each version and the filename (it would be awesome if I could configure that output via settings).
Code:
var bilder = new Array();
bilder[0] = new Array();
bilder[0][0] ="Bild-1"; //filename
bilder[0][1] =64; //hight of small version
bilder[0][2] =45; //width of small version
bilder[0][3] =512; //height of medium version
bilder[0][4] =362; //width of medium version
bilder[0][5] =864; //height of big version
bilder[0][6] =611; //width of big version
bilder[0][7] =35; //position in the gallery (to configure this would be awesome)
bilder[0][8] =7; //position in the mini-gallery (to configure this would be awesome)
bilder[0][9] =false; //loading state
bilder[1] = new Array();
bilder[1][0] ="Bild-2";
bilder[1][1] =45;
bilder[1][2] =64;
bilder[1][3] =356;
bilder[1][4] =512;
bilder[1][5] =802;
bilder[1][6] =1152;
bilder[1][7] =432;
bilder[1][8] =59;
bilder[1][9] =false;
...
Thanks for reading and helping me!?
Snorfes

[Q - Solved] Live with Walkman compass issues.

Hi.
I'm having some issues with the compass on my phone (Live with Walkman)
When I use Google Maps, Sky Map or Smart Tools Compass. The compass doesn't point towards the north and it seems that I have "2 magnetic wests" as when I point my phone to the east it reads west.
However, when I use other compass apps like GPS Status, Super Compass, and Compass (from Catch.com developer in Market) it works flawlessly, even the compass test on the service menu works ok.
I know how to calibrate by doing the 8 shape with the phone, and I don't have any source of magnetic field near me. I tested another device (Galaxy tab) with the aforementioned conflictive apps and they work all right.
Does anybody have this same issue? Do you think is software or hardware?
Edit: I'm using Stock Kernel and .58 FW
Ok, I solved my problem by changing some values in /system/etc/sensors.conf
Originally the file was:
Code:
#Setup AKM897x axis
ak897xorientation_axis_map = 0,1,2
ak897xorientation_axis_sign = 1,1,-1
ak897xmagnetic_axis_map = 1,0,2
ak897xmagnetic_axis_sign = -1,1,1
...
Using zDevice test I noticed that the X and Y axes were transposed, after trial and error I came to a solution:
Code:
#Setup AKM897x axis
ak897xorientation_axis_map = 0,1,2
ak897xorientation_axis_sign = 1,1,-1
ak897xmagnetic_axis_map = 0,1,2
ak897xmagnetic_axis_sign = -1,-1,1
...
The reason some apps did work is because the sensors.conf is not used by those apps, instead they bypass it somehow. If you check Compass Test on the service menu (Or GPS Status compass), you'll see that it isn't affected by the .conf edition.
Be sure to make a backup of sensors.conf and reboot your phone to apply changes, if you use this fix.
Thanks I was using 1,-1,1 so it was not working in portrait mode and was somewhat jerky.
Now with -1,-1,1 it works perfect and smooth.
Not work for me. I used this method with "CyanogenTimeScape v1" but no luck.
Hello, looking for help.
Application "Compass" and "AndroSensor" show that axes "X" and "Z" are inverted.
To change the phone's location added (subtracted) opposite values.
The axes are not swapped, but their values ​​counted backwards.
Tilting the phone left axis values ​​are "Z" and negative tilt to the right are positive.
On the left the phone lying rotation axis value "X" up at the right rotation is reduced.
Behave opposite.
/system/etc/sensors.conf - does not exist
Phone ZTE Vodafone 945 / CM 7.2.0 / kernel 2.6.35.7-perf + / SDK 10
ROM: forum.andronova.net/showthread.php?45898-Vodafone-945-2-3-7-G%FDngerbread-Rom-100-T%FCrk%E7e
(Sorry for bad English. I do not speak English. I only use Google translator.)
what program do I have to use to change that file with?
what program did you used to change that file? - thanks for your solution btw, I have the exact same problem with my wt19
joaco.romero said:
Ok, I solved my problem by changing some values in /system/etc/sensors.conf
Originally the file was:
Code:
#Setup AKM897x axis
ak897xorientation_axis_map = 0,1,2
ak897xorientation_axis_sign = 1,1,-1
ak897xmagnetic_axis_map = 1,0,2
ak897xmagnetic_axis_sign = -1,1,1
...
Using zDevice test I noticed that the X and Y axes were transposed, after trial and error I came to a solution:
Code:
#Setup AKM897x axis
ak897xorientation_axis_map = 0,1,2
ak897xorientation_axis_sign = 1,1,-1
ak897xmagnetic_axis_map = 0,1,2
ak897xmagnetic_axis_sign = -1,-1,1
...
The reason some apps did work is because the sensors.conf is not used by those apps, instead they bypass it somehow. If you check Compass Test on the service menu (Or GPS Status compass), you'll see that it isn't affected by the .conf edition.
Be sure to make a backup of sensors.conf and reboot your phone to apply changes, if you use this fix.
Click to expand...
Click to collapse
There is no program. You need to root the device and update file yourself.
Please search forum to know how to root wt19i.
my problem fits the description... so.... nevermind

[GUIDE] Removing Duplicate Media Entries with root/adb/sqlite3

STD DISCLAIMER: I am not responsible for you screwing up your phone. Make BACKUPS!
I have the ever-present problem with the media files on my phone showing up as duplicates. I see from around the forums that several other users experience this regularly on CM9/CM10/AOKP based roms. I'm not sure why this is happening, but it seems to be a side-effect of the mediascanner re-indexing media it shouldn't. In this guide I show you what is going on with your data and how to remove the duplicates.
REQUIREMENTS
Your phone must be rooted to access the sqlite3 database.
You must have debugging turned on your phone
You must have access to adb and ideally have used it in the past. This thread is not about adb/driver setup!
PROCEDURE
Connect your phone via USB and make sure your adb server is started.
Code:
[[email protected] ~]$ adb start-server
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
Run 'adb shell' and become superuser (run 'su')
Code:
[[email protected] ~]$ adb shell
[email protected]:/ $
255|[email protected]:/ $ su
su
[email protected]:/ #
cd to /data/data/com.android.providers.media/databases/
Code:
[email protected]:/ # cd /data/data/com.android.providers.media/databases/
cd /data/data/com.android.providers.media/databases/
[email protected]:/data/data/com.android.providers.media/databases # ls
ls
external.db
external.db-shm
external.db-wal
internal.db
internal.db-shm
internal.db-wal
Attach to the external.db database with sqlite3
Code:
[email protected]:/data/data/com.android.providers.media/databases # sqlite3 external.db
external.db <
SQLite version 3.7.4
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite>
view the avaible tables (.tables). Now almost every table here, except for the 'files' table is a view based on the files table. What happens is that some data is in 'files' is blanked out and the views create duplicates of the data with seemingly good filenames. However since the primary piece of data in 'files' is missing, all the media players relying on this database freak out.
Code:
sqlite> .tables
.tables
album_art audio files
album_info audio_genres images
albums audio_genres_map search
android_metadata audio_genres_map_noid searchhelpertitle
artist_info audio_meta thumbnails
artists audio_playlists video
artists_albums_map audio_playlists_map videothumbnails
sqlite>
look at the files table sql schema and find an example (.schema files). With the duplicate problem bad data is created with the '_data' field blanked out, but a valid media_type=2, since views rely on the media_type=2 but merges other fields with the file name, etc. you get a media entry that looks good but no entry to pull off the file system. See the _data section of the single entry I queried below to see what a good record looks like. A bad record will have a different '_id' and blank '_data'
Code:
sqlite> .schema files
.schema files
CREATE TABLE files (_id INTEGER PRIMARY KEY AUTOINCREMENT,_data TEXT,_size INTEGER,format INTEGER,parent INTEGER,date_added INTEGER,date_modified INTEGER,mime_type TEXT,title TEXT,description TEXT,_display_name TEXT,picasa_id TEXT,orientation INTEGER,latitude DOUBLE,longitude DOUBLE,datetaken INTEGER,mini_thumb_magic INTEGER,bucket_id TEXT,bucket_display_name TEXT,isprivate INTEGER,title_key TEXT,artist_id INTEGER,album_id INTEGER,composer TEXT,track INTEGER,year INTEGER CHECK(year!=0),is_ringtone INTEGER,is_music INTEGER,is_alarm INTEGER,is_notification INTEGER,is_podcast INTEGER,album_artist TEXT,duration INTEGER,bookmark INTEGER,artist TEXT,album TEXT,resolution TEXT,tags TEXT,category TEXT,language TEXT,mini_thumb_data TEXT,name TEXT,media_type INTEGER,old_id INTEGER, storage_id INTEGER, is_drm INTEGER, width INTEGER, height INTEGER);
CREATE INDEX album_id_idx ON files(album_id);
CREATE INDEX artist_id_idx ON files(artist_id);
CREATE INDEX bucket_index on files(bucket_id, media_type, datetaken, _id);
CREATE INDEX bucket_name on files(bucket_id, media_type, bucket_display_name);
CREATE INDEX format_index ON files(format);
CREATE INDEX media_type_index ON files(media_type);
CREATE INDEX parent_index ON files(parent);
CREATE INDEX path_index ON files(_data);
CREATE INDEX sort_index ON files(datetaken ASC, _id ASC);
CREATE INDEX title_idx ON files(title);
CREATE INDEX titlekey_index ON files(title_key);
CREATE TRIGGER audio_meta_cleanup DELETE ON files WHEN old.media_type = 2 BEGIN DELETE FROM audio_genres_map WHERE audio_id = old._id;DELETE FROM audio_playlists_map WHERE audio_id = old._id;END;
CREATE TRIGGER audio_playlists_cleanup DELETE ON files WHEN old.media_type = 4 BEGIN DELETE FROM audio_playlists_map WHERE playlist_id = old._id;SELECT _DELETE_FILE(old._data);END;
CREATE TRIGGER files_cleanup DELETE ON files BEGIN SELECT _OBJECT_REMOVED(old._id);END;
CREATE TRIGGER images_cleanup DELETE ON files WHEN old.media_type = 1 BEGIN DELETE FROM thumbnails WHERE image_id = old._id;SELECT _DELETE_FILE(old._data);END;
CREATE TRIGGER video_cleanup DELETE ON files WHEN old.media_type = 3 BEGIN SELECT _DELETE_FILE(old._data);END;
sqlite>
sqlite> select * from files where _data like '%Unhuman%';
select * from files where _data like '%Unhuman%';
16566|/mnt/emmc/mp3/Architect - 2010 - Consume Adapt Create/Architect - 04 - Unhuman.ogg|8176842|47362|16559|1345650424|1337460350|application/ogg|Unhuman||Architect - 04 - Unhuman.ogg|||||||-1041554543|Architect - 2010 - Consume Adapt Create|| O A 5 O ? ' A |5|7||4||0|1|0|0|0||338973||||||||||2||131073|0||
query the duplicates in the files tables. Here I look at just one example... This is from a later date than the earlier section. You can see how the one media file id = 16566 has been re-indexed again. 16566 and 19522 have been blanked and new record 22822 has been indexed with the complete record.
Code:
sqlite> select _id,_data,_display_name from files WHERE _data = '' AND media_type = 2;
select _id,_data,_display_name from files WHERE _data = '' AND media_type = 2;
19518||Architect - 13 - Wachsmuth.ogg
19519||Architect - 01 - The ***** is Back.ogg
19520||Architect - 02 - The Shadow of Eve.ogg
19521||Architect - 03 - Fast Lane (Freeze Frame).ogg
19522||Architect - 04 - Unhuman.ogg
19523||Architect - 05 - For You.ogg
19524||Architect - 06 - So I Went Out.ogg
19525||Architect - 08 - Attack Ships on Fire.ogg
19526||Architect - 09 - Pure.ogg
19527||Architect - 10 - I Lost my 808 on a Rainy Day.ogg
19528||Architect - 11 - Awake (Album Version).ogg
19529||Architect - 12 - The Beauty and the Beat (Rokka).ogg
<<more bad entries>>
sqlite> select * from files where _display_name like '%Unhuman%';
select * from files where _display_name like '%Unhuman%';
16566||8176842|47362|16559|1345650424|1337460350|application/ogg|Unhuman||Architect - 04 - Unhuman.ogg|||||||-1041554543|Architect - 2010 - Consume Adapt Create|| O A 5 O ? 'A |5|7||4||0|1|0|0|0||338973||||||||||2||131073|0||
19522||8176842|47362|19515|1345728924|1337460350|application/ogg|Unhuman||Architect - 04 - Unhuman.ogg|||||||-1041554543|Architect - 2010 - Consume Adapt Create|| O A 5 O ? 'A |5|7||4||0|1|0|0|0||338973||||||||||2||131073|0||
22822|/mnt/emmc/mp3/Architect - 2010 - Consume Adapt Create/Architect - 04 - Unhuman.ogg|8176842|47362|22815|1346073675|1337460350|application/ogg|Unhuman||Architect - 04 - Unhuman.ogg|||||||-1041554543|Architect - 2010 - Consume Adapt Create|| O A 5 O ? ' A |5|7||4||0|1|0|0|0||338973||||||||||2||131073|0||
delete all the duplicates. Note we won't be able to delete until we temporarily remove any triggers referring to api functions. If you look at '.schema' again you'll note a trigger refer to _OBJECT_REMOVED, we'll need to remove them. So STEP1. List schema -- cut and paste this to notepad or something. STEP2. DROP TRIGGER on anything referencing _OBJECT_REMOVED. STEP 3. delete our duplicates. STEP 4. re-create all triggers.
Code:
sqlite> drop TRIGGER files_cleanup;
drop TRIGGER files_cleanup;
sqlite> DELETE FROM files WHERE _data = '' and media_type = 2;
DELETE FROM files WHERE _data = '' and media_type = 2;
sqlite> CREATE TRIGGER files_cleanup DELETE ON files BEGIN SELECT _OBJECT_REMOVED(old._id);END;
(optional) Add a trigger to nuke duplicates. So maybe I'd like sqlite3 to remove dupes for me anytime it re-indexes, say for a deletion? Some other events might be too expensive to have this triggering all the time, but I've tested it with a file delete and it works.
Code:
CREATE TRIGGER duplicates_cleanup DELETE ON files WHEN old.media_type = 2 BEGIN DELETE FROM files WHERE _data = '' and media_type = 2;END;
That's IT.
Code:
sqlite> .quit
.quit
Takes about 2-5 minutes to clean up manually, vs waiting 14-30 minutes to re-index a huge collection. This could also be automated if you were so inclined with a better trigger or an app.
UPDATE: 10/26/2012
One clarification: media_type = 2 is audio files -- mp3, ogg, wav and the like. If you have issues with other media you can simple use that media type, or leave the qualifier off for all media types.
I was 'trying out' this trigger, but now have gone for months without any duplicates. I think it works. Basically, you can skip doing any other sql work in the above guide -- just creating this trigger and adding a media audio file. Adding a media file should launch this trigger and clear out any duplicates (may have to reboot once).
Code:
sqlite> create trigger duplicates_cleanup AFTER UPDATE OF _data ON files BEGIN DELETE FROM files WHERE _data = '' and media_type = 2;END;
create trigger duplicates_cleanup AFTER UPDATE OF _data ON files BEGIN DELETE FROM files WHERE _data = '' and media_type = 2;END;
Interesting.
Where do you see duplicates show up? I'm not running aosp.
The reason this caught my eye is because I've always had the issue of duplicate entries in ringtone and notification sounds lists, while there are not duplicate files in /system/media/audio/*. I don't think this is the same issue you are adressing, is it?
creepyncrawly said:
Interesting.
Where do you see duplicates show up? I'm not running aosp.
The reason this caught my eye is because I've always had the issue of duplicate entries in ringtone and notification sounds lists, while there are not duplicate files in /system/media/audio/*. I don't think this is the same issue you are adressing, is it?
Click to expand...
Click to collapse
It's a similar issue. Note the following items in the schema:
is_ringtone INTEGER,is_music INTEGER,is_alarm INTEGER,is_notification INTEGER,is_podcast INTEGER
The same thing could very well be happening where you have two records with mostly the same records but a blank '_data'.
othermark said:
It's a similar issue. Note the following items in the schema:
is_ringtone INTEGER,is_music INTEGER,is_alarm INTEGER,is_notification INTEGER,is_podcast INTEGER
The same thing could very well be happening where you have two records with mostly the same records but a blank '_data'.
Click to expand...
Click to collapse
Meaning it would be the same database?
creepyncrawly said:
Meaning it would be the same database?
Click to expand...
Click to collapse
If the duplicates are all on external media, yes, however, if it's on the internal media then it will be in the internal.db instead of the external.db as posted in my guide.
So if you're seeing duplicates with 'Whistle' showing up twice in notifications, there's probably a problem with internal.db.
Had a little time to play around with this today. First, I was surprised that I didn't have sqlite3 on my phone. I had to install it, using a market app called SQLite Installer for Root by ptSoft. (SHOstock2 v4.1.3)
I ran the query "select _id,_data from files WHERE _data = '' and media_type = 2;" on both the external.db and internal.db but in both cases no entries were found. So no joy finding duplicate entries in notifications and ringtones with this method.
creepyncrawly said:
Had a little time to play around with this today. First, I was surprised that I didn't have sqlite3 on my phone. I had to install it, using a market app called SQLite Installer for Root by ptSoft. (SHOstock2 v4.1.3)
I ran the query "select _id,_data from files WHERE _data = '' and media_type = 2;" on both the external.db and internal.db but in both cases no entries were found. So no joy finding duplicate entries in notifications and ringtones with this method.
Click to expand...
Click to collapse
The schema is maybe different in samsung based roms? How I originally found this was to pick a duplicate and look at the various tables and work backwards through the views and matching up fields.
You can always start with a select * from files and see if you can find where it lists the same name or file name twice. This should be easy to do on the internal.db with it's limited number of entries.
for the past year that i've had my sgs2, i've constantly had this issue with my phone and it's been a constant annoyance. i honestly want to say thank you for this but the problem is i got to step 1 and i went full retard. for some reason, i already have adb on my comp and i guess i used it for something at some point, possibly when i was rooting my phone a while back but i have no clue how to use it that well. i would love to try and get this to work on my phone but can you really dumb it down for those not really familiar with how to do all this? if not, i thank you for putting this up in the first place, i'll try to give it another go.
I tried the fix and it seemed to work until I pulled up ringtones a second time and there were the doubles and even triples. Frustrated that it didn't take I delved deeper into my files and discovered a couple unzipped (but not installed) ROMs that I had extracted just to look at. Deleted them and problem solved. Did I mention I'm a noob, lol?
bandit1210 said:
I tried the fix and it seemed to work until I pulled up ringtones a second time and there were the doubles and even triples. Frustrated that it didn't take I delved deeper into my files and discovered a couple unzipped (but not installed) ROMs that I had extracted just to look at. Deleted them and problem solved. Did I mention I'm a noob, lol?
Click to expand...
Click to collapse
Cool
ok, is there anyway to undo all of this because i have a feeling this might have caused my phone to delete all my pictures i've taken and when i try to flash a new rom, it sends me into a boot loop and i can't reflash anything.
ender127 said:
ok, is there anyway to undo all of this because i have a feeling this might have caused my phone to delete all my pictures i've taken and when i try to flash a new rom, it sends me into a boot loop and i can't reflash anything.
Click to expand...
Click to collapse
Flash to stock?
ender127 said:
ok, is there anyway to undo all of this because i have a feeling this might have caused my phone to delete all my pictures i've taken and when i try to flash a new rom, it sends me into a boot loop and i can't reflash anything.
Click to expand...
Click to collapse
You can "Clear Data" on the "Media Storage" app, this has the same effect as removing the db files.
However a boot loop is already beyond all this... You need to get into recovery to fix that.
well, i figured it was one of two things. after i did this on saturday, i tried to flash new firmwarm (10.31 task) but i got stuck in a boot loop. i can flash to another rom (super nexus) without problems and i can get to a really old nandroid backup. but basically you're telling me if i do a clear data on media storage, it'll wipe anything i did on adb? i really appreciate the responses by the way, i literally just flew out of the country for vacation and luckily i brought a laptop to fix this, but i can't function without my phone running.
ender127 said:
basically you're telling me if i do a clear data on media storage, it'll wipe anything i did on adb.
Click to expand...
Click to collapse
I believe so, yes. At least that is my experience.
How do delete duplicates if the _data is NOT empty
If you have root and can put sqlite3 on your device, this works without scanning and all that silliness:
http://forum.xda-developers.com/showthread.php?t=1847586
---------- Post added at 02:09 PM ---------- Previous post was at 01:49 PM ----------
Sweet, thank you so much for this. I found that on my Galaxy S3, Zedge creates a mess of things. I had up to 5 of each notification and ringtone, all with the same valid info aside from _id. Here's what I did to pick the first entry and clean things up:
sqlite3 external.db
FROM files WHERE _id not in (select MIN(_id) FROM files GROUP BY _data);
You can choose to keep the LAST entry for each by changing MIN to MAX, which might be a better idea if you trust recent modifications over earlier ones. If they all have valid _data it probably does not matter.

[Q] Want a tool to backup /phone & /sdcard entirely, over wifi

Hi all,
Anyone know of a tool to do this?
I know what Titanium backup is and what it's for, I'm after a simple data copying tool for the ENTIRE contents of the SD Card and the phone itself just to a network drive.
I can do this manually now, by plugging in the phone and dragging and dropping the files. I'd prefer something which does it over wifi to an SMB share.
I'd assume such a tool already exists, scheduling would be nice, options to enforce only when plugged in to power too (since it'll take half the night while it's charging)
Any tips?
Hi
wizzbang3 said:
Hi all,
Anyone know of a tool to do this?
I know what Titanium backup is and what it's for, I'm after a simple data copying tool for the ENTIRE contents of the SD Card and the phone itself just to a network drive.
I can do this manually now, by plugging in the phone and dragging and dropping the files. I'd prefer something which does it over wifi to an SMB share.
I'd assume such a tool already exists, scheduling would be nice, options to enforce only when plugged in to power too (since it'll take half the night while it's charging)
Any tips?
Click to expand...
Click to collapse
Yes I got one. Helium Backup. You can upload your files to your dropbox account, that's over wifi
I don't want to send it "to the cloud" just a local FTP / SMB server. It's near 80gb of data.
I do it the other way around. I use a Samba Server on the phone and run a sync tool on my PC to sync phone to backup directories on my PC.
On the phone I use [APP][2.0.1+][Root] Samba Filesharing Server for Android [Play & Dev builds].
On the PC I use Syncovery – file synchronization and backup.
You may also use GoodSync: File Sync & Backup Software. It has its own server to run on the phone and is somewhat easier to setup.
Sergio Barbosa said:
I do it the other way around. I use a Samba Server on the phone and run a sync tool on my PC to sync phone to backup directories on my PC.
On the phone I use [APP][2.0.1+][Root] Samba Filesharing Server for Android [Play & Dev builds].
On the PC I use Syncovery – file synchronization and backup.
You may also use GoodSync: File Sync & Backup Software. It has its own server to run on the phone and is somewhat easier to setup.
Click to expand...
Click to collapse
Thanks man, I'll give it a shot - it'll be a drain on the phone overnight but as long as it's charging - I'll have a nice regular sync of my data.
If you decide to go with the Syncovery/Samba Filesharing here is my smb.conf file with mappings for internal storage, sdcard, root and data.
The file must be placed in data/data/com.funkyfresh.samba/files.Just change the workgroup, netbios name and remote announce to suit your needs.
You must use the dev-version of Samba - download from the OP. In settings tick the "Don´t rewrite smb.conf".
Code:
#
#
#
[global]
interfaces = wlan0
bind interfaces only = yes
workgroup = WORKGROUP
server string = Samba on Android
netbios name = SERGIO-SGN3T
remote announce = 255.255.255.0
encrypt passwords = yes
security = USER
restrict anonymous = 1
load printers = no
printcap name = /dev/null
disable spoolss = yes
deadtime = 5
delete readonly = yes
nt acl support = no
inherit permissions = yes
socket options = SO_SNDBUF=16384 SO_RCVBUF=16384
unix extensions = no
[IntSD]
vfs objects = fake_perms
path = /storage/sdcard0
force user = root
read only = no
writable = yes
guest ok = no
[ExtSD]
vfs objects = fake_perms
path = /storage/sdcard1
force user = root
read only = no
writable = yes
guest ok = no
[root]
vfs objects = fake_perms
path = /
force user = root
read only = no
writable = yes
guest ok = no
[data]
vfs objects = fake_perms
path = /data/data
force user = root
read only = no
writable = yes
guest ok = no
Actually, it just occurred to me, I am running a linux based NAS (well BSD) so it would be really better if I could just "push to" an SMB or FTP share, since my PC's are often off at night Any ideas?
For anyone curious, I ended up using FolderSync - it's well supported and works perfectly. I back up my phone once every other night with TitaniumBackup, then the every other night FolderSync backs up the ENTIRE phone and the ENTIRE SD card over wifi, if plugged in to power.
Sure it's 80gb of data but I can lose my phone and get everything back, perfectly.

Categories

Resources