yashsingh1/xdaforums huggingface dataset:
[Nook Touch General] ApokrifX:
I’m root, I think, it’s just lowering itself down…

shell@GT-N7000:/ $ id
uid=2000(shell) gid=2000(shell) groups=1003(graphics),1004(input),1007(log),1009(mount),1011(adb),1015(sdcard_rw),3001(net_bt_admin),3002(net_bt),3003(inet)
shell@GT-N7000:/ $ su
shell@GT-N7000:/ # id
uid=0(root) gid=0(root) groups=1003(graphics),1004(input),1007(log),1009(mount),1011(adb),1015(sdcard_rw),3001(net_bt_admin),3002(net_bt),3003(inet)

Looks like it’s a feature...

On what condition it runs OR not run setuid (to drop its privileges to those of a shell account)? :o

http://www.quora.com/What-are-the-e...-against-the-cage-and-z4root-Android-exploits

Renate,

BlueStacks is very fast emulator, comparing with Google one.

But without adb working properly there is no way to use it for development... :(

http://xdaforums.com/showthread.php?t=1970577
[Nook Touch General] Renate:
Hmm, that's quite interesting.

Still, I really don't bother with emulators.

A real device operates more like a real device.

I use makefiles to compile, push and intent start an app on a real device.

It's all quite fast.
[Nook Touch General] ApokrifX:
BlueStacks even has ALSA, I was about to ask you how to configure it properly ;)

Me too, but Nook is the only rooted real device I have. Warranty issues... :o
[Nook Touch General] osm0sis:
To get back on topic, would it be possible to have an option to ignore file creation errors? Some files on my sdcard have too long of a path for my Windows machine (notably those in the Pulse cover and image caches), so as soon as one of those tries to be pulled it halts the whole sync. I'd like it to ignore those; I've already got a little script I made to zip up those longfilenames to preserve them in my backups. :)
[Nook Touch General] Renate:
Really?

How long are the longest directory names? filenames? number of subdirs? total path lengths?

Are you saying that Windows itself is incapable or that adbsync.exe can't do it?
[Nook Touch General] osm0sis:
Windows itself can't handle it, which makes adbsync throw up a "Can't create file" error and exit the operation. I think Windows has a limit of 256 char for the full path?

All in all it's something like the following:

/data/media/0/Android/data/com.alphonso.pulse/files/catalogImageCache/https%3A%2F%2Fpulseapi.appspot.com%2Fapi%2Fv2%2Fcatalog%2Fcatalog_image%3Fcatalog_item_primary_key%3D53727967%26image_type%3Dicon%26width%3D120%26height%3D120.0

And combine that with the fact that I pull all my backups down to C:\Users\Admin\Downloads\Samsung Galaxy Nexus GT-i9250\backup\sdcard\ and you get the picture. ;)

Anyway, definitely a Windows limitation more than anything, so I was just hoping you could make it so adbsync doesn't stop syncing when it can't create a file, or at least have a commandline switch that will tell it to ignore the file creation errors so that the sync can complete and then I can just go ahead and run my zip script to grab the catalog* folders from Pulse to preserve my long filenames.

Edit: Worked around it for now by adding /i*catalog* to my command, but the ability to ignore/handle creation errors better would definitely be welcome. :)
[Nook Touch General] osm0sis:
Had another idea.. the ability to have it delete files on the host that don't exist on the android.

So my command is:

adbsync /hscu /s /ld /v ".\backup\sdcard\" "/data/media/" /i*catalog*

But that leaves all the deleted android files still on my host copy, any chance adbsync could have a flag to remove those host-only files?
[Nook Touch General] Renate:
As far as the path length thing goes, Windows has a default path length limit of 260 chars.

You do realize that 260 chars (if it's used in an intelligent way) is enough to specify every sub-atomic particle in the universe?

It's pretty silly that the software you are using generates such silly paths,

especially since it's a cache and some hashed GUID would work fine.

Moreover if it's a cache, you really don't want/need to back it up.

One solution, don't try to sync with a single adbsync.exe command.

I use about 8 to sync my devices, I pick the directories which have useful stuff in them.

While the subtrees of stuff are the same on my desktop and devices,

their locations are split up and I need to do this anyway.

I can modify adbsync.exe so that it will work flawlessly with insanely long paths.

The problem is, you won't be able to open these files in the command line or File Explorer or even most applications.

They all use the default scheme and 260 chars is their limit.

I could modify adbsync.exe to skip long paths.

That could get tricky.

You could have C:\ReallyLongPath\A.txt work and C:\ReallyLongPath\ReallyLongFile.txt fail.

I could modify adbsync.exe to use some bogus .nosync file to skip directories.

I think the best solution is to use a bit more careful selection of what you want to sync.

On the delete issue, yes, I'll consider that.

The first rule of any software is to "do no harm".

With gigabytes at my disposal I'd rather have a few loose files than accidentally delete something.
[Nook Touch General] osm0sis:
Could adbsync setting the .hidden files to actually be hidden in Windows also be optional? Pretty please. :)
[Nook Touch General] Renate:
Well, there is no such thing as "hidden" files in *nix (unlike DOS & Windows).

There is only the issue that ls does not print files starting with "."

You want hidden?

attrib +h .* /s

Or if you don't want to copy "hidden" files at all:

adbsync /h C:\Here sdcard/There /i.*
[Nook Touch General] pbelcl:
not a problem, but a question

hi again,

using adbsync now for some weeks i have to say "works perfect".

but i have a question:

after syncing my audio books folder, about 200 files, i think that everything ist synced!

when i start sync again then i get following summary:

Dirs match: 15
A> Android file newer: 206

as i think the files should be "same" not ""newer" , after a completed sync!?

or am i wrong ?

so when i compare the files with total commander i can see that all is synct correct ?

but why does adbsync "newer" ??
[Nook Touch General] osm0sis:
No adbsync actually does this already; it copies the files starting with "." then appears to set them as hidden on my Windows side, I was hoping for the option to disable that behavior! :p

attrib -h .* /s /d would work of course. :)
[Nook Touch General] Renate:
@ osm0sis: No, adbsync doesn't touch Windows attributes.

Is the +H attribute set on these files?

Do they appear hidden in the command line or file Explore or where?

Did something set them already?

@pbelcl: I've run into this problem before.

I think it may be an artifact of FAT directories on the SD card.

The problem is, unlike a real file system, FAT stores file stamps in local time.

If there is some sort of hiccup where the Nooks gets the timezone wrong it will screw everything.

Then there is the question of daylight savings, which is even thornier.

Can you just sync again and does it stick?

It really should.

I've only had this problem on my Nook, never my Kyocera Rise.

In both cases I sync 6000 files of all sizes in deep directories.
[Nook Touch General] osm0sis:
Weird. Yes, they're hidden in Windows Explorer, I was wondering if adbsync hadn't synced the hidden files until I went to Folder Options and enabled Show hidden and system files. adb pull was the only way I'd ever done backups before and they were never hidden that way, so adbsync is the only new thing in the mix that could have done it. I'll set them all back to -h and see if it does it the next time I make a backup. Could you try recreating using my usage command from my above batch file?

(Just added a few lines to ensure the correct attribs but I'll comment that out the next time I test). :)

Thanks again for all your work on this.
[Nook Touch General] Renate:
I don't know. I can't follow your batch file, it's too complicated for me.

echo Hello>.hello
echo Goodbye>.goodbye

ls doesn't show it.

ls -a does.

adbsync /h /v E:\Sync sdcard

The files comes through Ok with only the "A" archive set.
[Nook Touch General] osm0sis:
adbsync /hscu /s /ld /v ".\backup\sdcard\" "/data/media/" /i*catalog*

Is the only one I was hoping you'd try. The rest is just awkward DOS for/do's. :)
[Nook Touch General] strifej:
Hi,

How do I use the /d flag? I have my phone connected by USD so I get a regular serial string and my Nexus 7 connected by wifi. adb devices will list the tablet name as the ip address: 192.168.1.107:5555

In adbsync when I tried a list differences with the "/d 192.168.1.107:5555" or "/d 192.168.1.107" it returns this:

Flag D must specify a value

There are no examples in this entire thread that use the /d flag to specify device so I don't have anything to go on.

I know it's connected because I can do "adb -s 192.168.1.107:5555 shell" and I can browse my tablet.

Thanks
[Nook Touch General] Renate:
@osm0sis: I only create files on Windows in one place and they are created as normal files.

I do not set any attributes.

Which Windows are you using?

If you want to show me this phenomena:

dir to show that the file does not exist

adbsync it

dir it

attrib it to show that it has +H

@strifej: All flags that take arguments take them immediately after (no space):

adbsync /dnook ... [color=red]if you put nook in your host file and adb connect nook[/color]
adbsync /d192.168.1.107:5555 ...
[Nook Touch General] pbelcl:
TimeStamp ?

yes it does!

in my music folder i get this summary every sync:

Dirs match: 9
A Android dir only: 1
A Android file only: 2
A> Android file newer: 176

Strange, i have this on my Nexus 4 also as aon my One X...
[Nook Touch General] Renate:
We're running in circles here.

Are all the files in that directory "newer"?

Are only half the files in that directory "newer".

When you are getting this "newer" message do you have update enabled and does it copy over the files?

What is the exact command that you are using?

If it says newer and you never allow adbsync to copy over the files then of course they will remain newer forever.

I was simply saying, that if you allow update and it copies it, then it won't be "newer".

How did you initially copy over the files in the first place?

Pick a file that abdsync says is newer: What is the exact timestamp using stat?

What is the exact timestamp (to 1000ths of seconds) in Windows?

(You'll have to use something besides dir or Explorer to see that.)

abdsync (without the /1 flag) rounds to the nearest even second.

If you used some other program (or even UMS and Windows) it may use some other method.
[Nook Touch General] pbelcl:
yes!

i made an test for solving this.

1.) deleted ALL FIles on my nexus in folder "Music"

them made an sync with: (%1 is sourcedir, %2=target on the device)

adbsync /ascu /v /s /ld %1 %2

after this i got:

H Host dir only: 10
H Host file only: 175
=> Created on android: 175

then i synced again with parameter "/1"

adbsync /ascu /v /s /ld /1 %1 %2

Dirs match: 10
A> Android file newer: 175

then i synced again with parameter "/2"

adbsync /ascu /v /s /ld /2 %1 %2

same:

Dirs match: 10
A> Android file newer: 175

in my mind it should not say that 175 files are newer, because they are EQUAL.

i think the problem ist that the files are copied with adbsync get a new fliedate, and thats the reason!!

mayber this is a problem from adb protokoll ??
[Nook Touch General] Renate:
Sorry that this is dragging on so long, it's hard to get a grip on this.

It is an intermittent problem.

I just ran into this problem when I rolled back to Nook 1.1 for a test.

First of all, the /1 flag is only if you are syncing to a non-FAT disk

and want to have the time more accurate than the 2 second time resolution of FAT.

The /2 flag is the default and the option only exists for completeness.

The core problem is FAT stores filetimes in local time, which is really stupid.

As I said before, if there is a timestamp discrepancy between two files they will continue to list differently forever until you replace one of the files somehow.

You didn't quote any timestamps for a file.

What is the time difference?

How about a dir, a ls, a stat?

When this pops up on my Nook/PC setup the Nook files are mysteriously 5 hours newer,

the difference between local and UTC here.

All I can think is that the Nook goes crazy sometimes and tries to write or cleanup or fix the FAT directory

and applies the timezone as correction.

Edit:

There was a bug in adbsync.exe, but only as for displaying the older timestamp when two files were unequal.

I've fixed that and added stuff on the end that displays the difference in size and time:

A> 13 2013-02-24 15:53 greenshutters.epub +6B +2m

That means the file is 6 bytes bigger and 2 minutes newer.

Download in the signature.
[Nook Touch General] osm0sis:
I was seeing that timestamp issue too with a hand full of files. I'm still working on a wlan_rx_wake lock issue so I haven't backed up things since upgrading to 4.2.2 but I'll report back on this and the other stuff soon hopefully. :)
[Nook Touch General] pbelcl:
Tried this, but the logfile looks very messy!! (see attached file)
[Nook Touch General] Renate:
Oops. :eek:

It's just a case of mixing printing to two different queues.

I'll fix that later tonight.

Still, the content should be correct.

It seems to say that the files on your Nook are newer by 10 years?
[Nook Touch General] pbelcl:
in some cases thats right, because i startet to digitize audio CD's 1990 i think ;)

on my nexus4 the filedate looks like the day i copied it...
[Nook Touch General] Renate:
Ok, I fixed the message queuing problem.

That was annoying, but strictly cosmetic.

I added in more units including week and year.

I didn't add decade and century because you're the only one who'd use it. :p

A> 9,216 2013-02-25 17:02 SYNC.TXT +6B +22y

Download a new version in the signature.

If you are getting filestamp discrepancies of years, your problem is not filesystems or local/UTC.

Find an old file, do a regular adb push of it to the /data directory (because it's not a FAT partition).

Then do a busybox stat myfile

If it's shows the current date, then something is screwy with either adb or adbd on your unit.

Delete the file, sync the file with adbsync and look at the filestamps.
[Nook Touch General] Renate:
All the discrepancies with timestamps seem to be from three unrelated causes:

The adb.exe on Windows uses the stat() system call instead of GetFileTime(). Microsoft acknowledges that stat() plays silly games with the timezone. More on this can of worms can be read here: http://www.codeproject.com/Articles/1144/Beating-the-Daylight-Savings-Time-bug-and-getting This may cause a one hour difference in files transferred with adb.exe vs. adbsync.exe (which uses GetFileTime()).

adb.exe does not set the modify date on files written to the host. (adbsync.exe does). It appears that some adbd do not set the modified date on files written to the android.

A random bug in the Nook's vfat implementation screws up modify timestamps. This appears as 4 or 5 hour discrepancies when in the EST/EDT timezone. It's not clear when/how this happens. It does happen on random subdirectories.
[Nook Touch General] pbelcl:
Tried this but get an error messge:

failed to copy 'p:\Progs\Util\ADB\testfile.mp3' to '\data': Read-only file system

maybe the \data partition is not ready for write access ??

Sorry but this gets over my mind. i am no developer and i dont know how to get write access to \data partition

I'm sorry, I'd like to help you more....
[Nook Touch General] Renate:
@pbelcl: Well, forget about the /data directory then.

What I really wanted to know is does ADB always leave files with the current time

for the modify timestamp when copying to your devices?

adb push reallyoldfile.txt /mnt/sdcard
adb shell
ls -l /sdcard
busybox stat /sdcard/reallyoldfile.txt
[Nook Touch General] pbelcl:
gives back:

busybox stat /sdcard/test.mp3
File: /sdcard/test.mp3
Size: 1282057 Blocks: 2512 IO Block: 4096 regular file
Device: 11h/17d Inode: 1094473992 Links: 1
Access: (0664/-rw-rw-r--) Uid: ( 0/ UNKNOWN) Gid: ( 1015/ UNKNOWN)
Access: 2013-03-01 10:22:49.000000000
Modify: 2013-03-01 10:22:49.000000000
Change: 2013-03-01 10:22:49.000000000

shell@android:/ $

on the filesystem of my windows pc this file has a CHANGE filedate from 2003 but a generated date from 2013!!

see attachement!
[Nook Touch General] Renate:
Yes, create date (at least on Windows) is a strange creature.

It can be earlier or later than the modified date.

If you take an old file, copy it to another disk or CD, delete the original, then copy it back,

you will have "created" that file at that instance, but the modify date will be old.

I'm presuming that this example is based on ADB'ing (not adbsync.exe) an old file to your android where it didn't exist?

It's clear that the adbd on your android is missing the utime() call.

I don't know why that is.

The adbd on my Nook, my Kyocera Rise and the latest code from Google all have it.

An excerpt out of the adbd, file_sync_service.c, handle_send_file:

if(msg.data.id == ID_DONE) {
timestamp = ltohl(msg.data.size);
...
struct utimbuf u;
adb_close(fd);
u.actime = timestamp;
u.modtime = timestamp;
utime(path, &u);

Another interesting point is that your file times end in 49 seconds.

When you reboot you will find that has changed to 48 or 50 (I forget which).

vfat uses DOS date compression which only has 2 seconds resolution.

The cached info in Linux has 1 second resolution.

I think that you have to find another adbd for your android.
[Nook Touch General] pbelcl:
all dates are SAME now ...

Hi Renata,

I found a tool

Attribute Changer and now ALL Date Fields are the same!!

(see attachement)

i set all to the creation date, and so there is now stranges filesettings anymore!

after syncing first time i got:

Dirs match 10
A Android dir only 1
A Android file only 1
H> Host file newer 175
~> Updated on android 175

the next time i got:

Dirs match 10
A Android dir only 1
A Android file only 1
A> Android file newer 175

i dont understand this anymore ;-(
[Nook Touch General] Renate:
Setting all the times to the current time is not going to help matters.

It's not a discrepancy if the create date is newer or older than the modify date.

Most ADB setups should write the modify timestamp of the host source file to the android destination file.

Yours doesn't, that is the main problem.

All ADB setups don't write the modify timestamp of the android source file to the host destination file,

but because adbsynce.exe found this file by a directory scan it knows the modify timestamp and can apply it at the end of the copy.
[Nook Touch General] pbelcl:
Thats very strange, because i use the latest ADB 1.31 from Android 4.2.2 Setup.

As i see this case there is nothing more i can do to solve this problem.

so i have to use is "as it is".

Anyway thanks for your program, because it works very well in principle!

and it does a good job for me ;)
[Nook Touch General] Renate:
Ok, finally solved (or at least determined what the deal is).

You write a file to the SD card.

The owner of that file is now sdcard_rw

If you try to change the timestamp you may get a permission error if you are not rooted.

Here is a test:

cd /sdcard
echo Hello > hello.txt
busybox stat hello.txt
busybox touch -d "2000-01-01 00:00:00" hello.txt
busybox stat hello.txt

Solution: Root your phone or fix this permission problem somehow.
[Nook Touch General] pbelcl:
tried this with following feedback:

1.) echo hello.txt

OK!

2.) >> busybox stat hello.txt

busybox stat hello.txt
File: hello.txt
Size: 1 Blocks: 8 IO Block: 4096 regular file
Device: 11h/17d Inode: 1093408488 Links: 1
Access: (0664/-rw-rw-r--) Uid: ( 0/ UNKNOWN) Gid: ( 1015/ UNKNOWN)
Access: 2013-03-04 12:45:35.000000000
Modify: 2013-03-04 12:45:35.000000000
Change: 2013-03-04 12:45:35.000000000

2.) busybox touch -d "2000-01-01 00:00:00" hello.txt

busybox touch -d "2000-01-01 00:00:00" hello.txt
touch: hello.txt: Operation not permitted

3.) busybox stat hello.txt

busybox stat hello.txt
File: hello.txt
Size: 1 Blocks: 8 IO Block: 4096 regular file
Device: 11h/17d Inode: 1093408488 Links: 1
Access: (0664/-rw-rw-r--) Uid: ( 0/ UNKNOWN) Gid: ( 1015/ UNKNOWN)
Access: 2013-03-04 12:45:35.000000000
Modify: 2013-03-04 12:45:35.000000000
Change: 2013-03-04 12:45:35.000000000

thos is like it runs on my nexus 4!

hope it helps....

btw: my phone is rootet...

i use titanium backup and restore, so i think it HAS to be rooted...
[Nook Touch General] Renate:
Well, ignoring the fact that "Hello\n" is 6 characters and not 1....

Do you have $ or # as a prompt?

If you have a $, try to do a su command.

If you get a #, repeat the test I quoted above.

Do this:

getprop ro.secure

What exact model are you running there?
[Nook Touch General] pbelcl:
and this is like it worked on my One X

2.) >> busybox stat hello.txt

busybox stat hello.txt
File: hello.txt
Size: 1 Blocks: 64 IO Block: 32768 regular file
Device: b30eh/45838d Inode: 3536 Links: 1
Access: (0075/----rwxr-x) Uid: ( 1000/ UNKNOWN) Gid: ( 1015/ UNKNOWN)
Access: 2013-03-04 12:54:38.000000000
Modify: 2013-03-04 12:54:38.000000000
Change: 2013-03-04 12:54:38.000000000

2.) busybox touch -d "2000-01-01 00:00:00" hello.txt

1|root@android:/sdcard # busybox touch -d "2000-01-01 00:00:00" hello.txt
busybox touch -d "2000-01-01 00:00:00" hello.txt
touch: invalid option -- 'd'
BusyBox v1.19.0.git (2010-12-21 01:56:03 MST) multi-call binary.

Usage: touch [-c] FILE [FILE]...

Update the last-modified date on the given FILE[s]

Options:
-c Don't create files

btw: One X is also rooted...

---------- Post added at 02:10 PM ---------- Previous post was at 02:01 PM ----------

i get a "$"

there comes back:

shell@android:/ $ getprop ro.secure
getprop ro.secure
1
shell@android:/ $
[Nook Touch General] pbelcl:
what do you mean?

which Model ?

-> see attached
[Nook Touch General] Renate:
The first thing (not that it is that important) is that you are jumbling the commands all together.

echo Hello > hello.txt

That puts 6 chars in hello.txt.

The first one you quoted gave a permission error.

You were running under shell, not root (it was showing $, yes?)

With ro.secure=1 that means ADB would run as shell and not root.

That means ADB would run into the same problem when doing a utime() to set the filestamp after a copy.

Apparently the 2nd busybox you were using does not have that option for touch.

I'm getting all confused with what you are pasting.

I really don't have any experience with these models.

You have a "One X" and a "Nexus 4".

The "One X" gave a permission problem when doing a touch, yes?

Were you in $ or #?

When you copy/paste this stuff, please don't make a mess of it.

Tell me which device you are using and copy the prompt!

So presumably on the first one you have to fix it so that ro.secure=0
[Nook Touch General] pbelcl:
go further ?

Sorry Renata, but I'm sometimes overwhelmed with linux commands in your instructions

for me:

it ist ok to use adbsync AS IT IS, because it works fine, and i can overlook the small problem in the logfile ;)

for you:

i want to help you fix that,then unfortunately, please give instructions for dummies...

and we should choose ONE of my devices. preferred the Nexus 4, because otherways we get in confusion...

therefore I tell you some framework conditions:

1.) i dont have installed the development tolls of android, because i dont need them.

so i only downlaodet the adb files in the list, and use them in absoluth path conditions:

aapt.exe

adb.exe

adbsync.exe

AdbWinApi.dll

AdbWinUsbApi.dll

fastboot.exe

i rooted my nexus with Nexus Root Tolkit from:

http://xdaforums.com/showthread.php?t=1766475

so when i can help anything furter please let me know how.....