1. Download our Official Android App: Forums for Android!

Root /data/data

Discussion in 'Android Devices' started by TehJibba, Jul 21, 2013.

  1. TehJibba

    TehJibba Android Enthusiast
    Thread Starter
    Rank:
    None
    Points:
    53
    Posts:
    294
    Joined:
    Feb 10, 2013

    Feb 10, 2013
    294
    98
    53
    Male
    Website Development
    On A Boat
    So in my quest to make a nice rom ive hit a small snag. Im trying to use the saved app data for the launcher layout and some other basic settings from /data/data folder in the rom. Ive also got one app in /data/app that needs to be installed on flash also (wont work from /system/app already tried)

    What id like to happen is flash the rom and boom its was like using a cwm backup(sorta) my widgets and desktop layout is intact.

    This is what i have for the /data partiton in my updater script so far.
    Its partially working as it does extract the /data folder from the rom. But the app in /data/app is not installed on boot and indeed is not even in the /data/app folder once booted. The stuff from /data/data is installed however the settings and widgets are reset like when you first flash any rom.

    A little assistance from someone that knows more then i do would be greatly appreciated
     

    Advertisement

  2. SuperR

    SuperR Android Expert
    Recognized Developer
    Rank:
    None
    Points:
    433
    Posts:
    3,980
    Joined:
    Aug 23, 2010

    Aug 23, 2010
    3,980
    1,995
    433
    Male
    Invisible
    try this:
    Code (Text):
    1. mount("ext4", "EMMC", "/dev/block/mmcblk0p19", "/data");
    2. package_extract_dir("data", "/data");
    3. set_perm(1000, 1000, 0771, "/data");
    4. set_perm_recursive(1000, 1000, 0771, 0644, "/data/app");
    5. set_perm_recursive(1000, 1000, 0771, 0644, "/data/data");
    6. unmount("/data");
     
  3. TehJibba

    TehJibba Android Enthusiast
    Thread Starter
    Rank:
    None
    Points:
    53
    Posts:
    294
    Joined:
    Feb 10, 2013

    Feb 10, 2013
    294
    98
    53
    Male
    Website Development
    On A Boat
    Figures i used the wrong mount point didnt i
     
  4. junkie2100

    junkie2100 Android Expert
    Rank:
    None
    Points:
    313
    Posts:
    3,311
    Joined:
    Mar 11, 2012

    Mar 11, 2012
    3,311
    696
    313
    Male
    basically, zte made some weird partition shifting thing happen. you installed it to cache

    outside of cwm, you are correct mmcblk0p18 is data, but if you take a look at /proc/partitions in a text editor you will see that the 2.7gb partition mmcblk0p19 cant possibly actually be carrier, and data is obviously not 300mb

    179 16 57344 mmcblk0p16
    179 17 8192 mmcblk0p17
    179 18 311296 mmcblk0p18
    179 19 2736128 mmcblk0p19

    cwm however uses the ACTUAL partition layout
    carrier in cwm is 16, in rom its 19
    data in cwm is 19, in rom its 18
    cache in cwm is 18, in rom its 17
     
  5. junkie2100

    junkie2100 Android Expert
    Rank:
    None
    Points:
    313
    Posts:
    3,311
    Joined:
    Mar 11, 2012

    Mar 11, 2012
    3,311
    696
    313
    Male
    its not your fault, you actually had the right block number for in rom use, but zte tricked you as they have many others. had us all fooled for a while, till superr and i were working on cwm and shinru noticed something odd, dont remember what it was but luckily it led to me manually checking all the partitions and figuring all that crazy shit out lol
     
  6. TehJibba

    TehJibba Android Enthusiast
    Thread Starter
    Rank:
    None
    Points:
    53
    Posts:
    294
    Joined:
    Feb 10, 2013

    Feb 10, 2013
    294
    98
    53
    Male
    Website Development
    On A Boat
    Ah ok gotcha. so i changed it in the updater-script and YAY /data/app installed correctly. Im still having trouble with the /data/data bit loding up properly. Or am i doing it wrong for trying to get the launcher widgets and layout the way i want them after flashing.

    Does /data/data get formated on boot? Or how else can i maintain the custom desktop layout/widgets after flashing?
     
  7. junkie2100

    junkie2100 Android Expert
    Rank:
    None
    Points:
    313
    Posts:
    3,311
    Joined:
    Mar 11, 2012

    Mar 11, 2012
    3,311
    696
    313
    Male
    on first boot maybe, not really sure about that. but if its not holding settings its either that or the programs themselves are taking over then rejecting the manually created files or you didnt get ALL the programs files so it assumes it has to create its settings

    for instance, say there is a main.conf and a secondary.conf
    the program looks for main.conf when started, if it doesnt find it, it hasnt been run before obviously then proceeds to make its own default settings files
    the presence of secondary.conf is irrelevant if main.conf isnt there because that isnt what the program was looking for

    if you didnt copy absolutely everything from data/data on a fresh install without inputting any passwords or personal info, try doing that. it may be a file outside of there that tells it whether its been set up yet or not though, or it may just format it all as you said
     
    TehJibba likes this.
  8. TehJibba

    TehJibba Android Enthusiast
    Thread Starter
    Rank:
    None
    Points:
    53
    Posts:
    294
    Joined:
    Feb 10, 2013

    Feb 10, 2013
    294
    98
    53
    Male
    Website Development
    On A Boat
    Ok gotcha. Ill run a few more tests to see if i can track it down. If it dont work then meh ill scrap the idea for now and just move on to other things that need attention

    *edit* I do wonder if that is the case, needing to copy over all of /data/data to trick the system. Seems messy tho to do it that way. Wonder if theres an xml file that i could edit the defaults of, will look around some more
     
  9. junkie2100

    junkie2100 Android Expert
    Rank:
    None
    Points:
    313
    Posts:
    3,311
    Joined:
    Mar 11, 2012

    Mar 11, 2012
    3,311
    696
    313
    Male
    if copying all of data/data doesnt work out. try copying the entire data partition, see if that works, then remove one folder at a time, narrow things down folder by folder and eventually file by file, by the end youll know exactly what files you need and what you dont
     
  10. junkie2100

    junkie2100 Android Expert
    Rank:
    None
    Points:
    313
    Posts:
    3,311
    Joined:
    Mar 11, 2012

    Mar 11, 2012
    3,311
    696
    313
    Male
    that works too. but yea if you want to put in the work and track it down just use the whole data partition and remove one folder from /data/ at a time, then once you know which ones are needed and which ones arent from there, say you needed /data/misc/, you can go inside there and delete one folder at a time, see which ones you can eliminate from that, then keep going deeper till you get rid of all the bloat
     
  11. SuperR

    SuperR Android Expert
    Recognized Developer
    Rank:
    None
    Points:
    433
    Posts:
    3,980
    Joined:
    Aug 23, 2010

    Aug 23, 2010
    3,980
    1,995
    433
    Male
    Invisible
    data/data should not get formatted during flash unless you tell it to and i am assuming you did not. In addition to what junkie said, It may just be perms. I don't know what they should be for /data/data.
     
    TehJibba likes this.
  12. junkie2100

    junkie2100 Android Expert
    Rank:
    None
    Points:
    313
    Posts:
    3,311
    Joined:
    Mar 11, 2012

    Mar 11, 2012
    3,311
    696
    313
    Male
    good point. though im pretty sure its set up to be at least readable by everyone, might not be able to write over them but that would just mean the settings would be stuck for good

    you know how much i love linux though... lol, so i dont remember what a permission setting of 1 actually is like at the end of 771. i know that root is what is being given full access, thats the two 7s, but everyone else gets a 1 which i assume is read only access?
     
  13. TehJibba

    TehJibba Android Enthusiast
    Thread Starter
    Rank:
    None
    Points:
    53
    Posts:
    294
    Joined:
    Feb 10, 2013

    Feb 10, 2013
    294
    98
    53
    Male
    Website Development
    On A Boat
    i could just use root browser and find out what the perms need to be, that very well could be it too. I will try all of these suggestions and go from there. I know it can be done ive seen roms that do it so its gotta be possible :D Will report back after more tests thank you guys for helping debug this bit

    *edit* Perms at the moment are rwxrwx--x

    will flash the stock b11 rom and see what they are
     
  14. junkie2100

    junkie2100 Android Expert
    Rank:
    None
    Points:
    313
    Posts:
    3,311
    Joined:
    Mar 11, 2012

    Mar 11, 2012
    3,311
    696
    313
    Male
    np, its what we do, and considering we fell for the same partition bullshit ourselves we cant really blame you for getting mixed up lol
     
  15. SuperR

    SuperR Android Expert
    Recognized Developer
    Rank:
    None
    Points:
    433
    Posts:
    3,980
    Joined:
    Aug 23, 2010

    Aug 23, 2010
    3,980
    1,995
    433
    Male
    Invisible
    true that lol
     
  16. junkie2100

    junkie2100 Android Expert
    Rank:
    None
    Points:
    313
    Posts:
    3,311
    Joined:
    Mar 11, 2012

    Mar 11, 2012
    3,311
    696
    313
    Male
    also, make sure you check the owner and group setting. kuz right now youre setting it to root if im not mistaken
    the first 1000 is the owner identifier
    the second is the group

    should give you a couple drop down lists with the name and reference number you need

    rwxrwx--x owned by root is much different than if it was owned by system or user
     
  17. TehJibba

    TehJibba Android Enthusiast
    Thread Starter
    Rank:
    None
    Points:
    53
    Posts:
    294
    Joined:
    Feb 10, 2013

    Feb 10, 2013
    294
    98
    53
    Male
    Website Development
    On A Boat
    I usually blame it on a bit to much 420... but blaming ZTE sounds like more fun these days ;)
     
    boricuakiller likes this.
  18. SuperR

    SuperR Android Expert
    Recognized Developer
    Rank:
    None
    Points:
    433
    Posts:
    3,980
    Joined:
    Aug 23, 2010

    Aug 23, 2010
    3,980
    1,995
    433
    Male
    Invisible
    make sure the file perms inside the /data/data/app match, not just the dir.
     
  19. junkie2100

    junkie2100 Android Expert
    Rank:
    None
    Points:
    313
    Posts:
    3,311
    Joined:
    Mar 11, 2012

    Mar 11, 2012
    3,311
    696
    313
    Male
    or just say screw it and 666 or 777 it all lol. thats probably what i would do but i tend to be rather destructive at times so doing it the right way might be better in the end
     
  20. SuperR

    SuperR Android Expert
    Recognized Developer
    Rank:
    None
    Points:
    433
    Posts:
    3,980
    Joined:
    Aug 23, 2010

    Aug 23, 2010
    3,980
    1,995
    433
    Male
    Invisible
    the data/data dir on b11 is rwxrwx--x like you said, but the app dirs inside are rwxr-x--x
    and the shared_prefs inside that are -rw-rw----
     
  21. TehJibba

    TehJibba Android Enthusiast
    Thread Starter
    Rank:
    None
    Points:
    53
    Posts:
    294
    Joined:
    Feb 10, 2013

    Feb 10, 2013
    294
    98
    53
    Male
    Website Development
    On A Boat
    **EDIT**
    hmm everything is the same on mine right now with the exception of shared prefs mine are rwxrwx--x

    Lol im usually the same way but since i bricked my hydro (1 day after rooting it) ive become way more cautious
     
  22. junkie2100

    junkie2100 Android Expert
    Rank:
    None
    Points:
    313
    Posts:
    3,311
    Joined:
    Mar 11, 2012

    Mar 11, 2012
    3,311
    696
    313
    Male
    that happens, i bricked my first sequent, luckily i was able to return it to walmart, that was about the time i decided i needed to find a way to make cwm work lol
     
  23. theminor19

    theminor19 Android Enthusiast
    Rank:
    None
    Points:
    53
    Posts:
    349
    Joined:
    May 12, 2012

    May 12, 2012
    349
    70
    53
    Male
    Assembly Man
    Michigan
    yeah i bricked my hydro less then a month after getting it, locked bootloader didnt help. looking forward to your rom.
     
  24. TehJibba

    TehJibba Android Enthusiast
    Thread Starter
    Rank:
    None
    Points:
    53
    Posts:
    294
    Joined:
    Feb 10, 2013

    Feb 10, 2013
    294
    98
    53
    Male
    Website Development
    On A Boat
    Thank you but its out already as a beta. Im working on the second beta now which is what this is all about
     
  25. TehJibba

    TehJibba Android Enthusiast
    Thread Starter
    Rank:
    None
    Points:
    53
    Posts:
    294
    Joined:
    Feb 10, 2013

    Feb 10, 2013
    294
    98
    53
    Male
    Website Development
    On A Boat
    So after many attmepts and tweaking today ive managed to get the default launcher setup and widgets the way i wanted. the only issues is that /data/data just does not want to stick for some reason ive tried various perm settings and same result. so i might just keep it as is for now and work on the rest of it later. thank all of you for the suggestions and help
     

Share This Page

Loading...