yashsingh1/xdaforums huggingface dataset:
[Samsung Galaxy S (4G Model)] jeffsf:
If you haven't heard of rsync before, welcome. If you have, just skip to the end.

rsync is a pretty standard Unix utility that was originally for syncing a local and a remote filesystem. It it "smart" in that it only copies what it needs to, so you can (and I do) rsync your SD card to a computer on your desk that gets backed up regularly, and only send the changed files every time, not the whole 64 GB. It will work over ssh so you can even sync over the air securely. It is also a great tool for copying a Unix filesystem from one place to another, for example, copying your internal /data to a new 2 GB partition on your microSD (yes, foreshadowing).

For more, see http://rsync.samba.org/documentation.html

Installing:

extract the tar

copy rsync to /system/xbin/rsync

chmod 755 /system/xbin/rsync

I've been using it for a couple years, but it was a pain to build on Android with tons of patches needed, like "standard" keyboard-input libraries which aren't part of the Android libraries. With GPL requirements on rsync, I just couldn't reasonably maintain a "turnkey" build chain to be able to distribute a binary before.

Well, a lot of the changes I used to have to make are now in v3.0.1, that now configures and builds with the standard Android NDK, or directly in an AOSP-like build environment, like CyanogenMod 9, with the attached Android.mk.

Source code for rsync is available at http://rsync.samba.org/
[Samsung Galaxy S (4G Model)] jeffsf:
You can do very fast backups of your /data and /system with rsync, which is nice when trying out new ROMs. You don't need to use something like the Hefe Hook kernel to do this, as long as your recovery will let you mount an ext2/3/4 partition that is big enough for the backup. 1 GB is generally big enough if you are just using internal flash.

Assuming you have a spare partition on your microSD, that it is formatted ext4, it has a "cm9-backup" directory you created, and that it gets mounted to /mmc0p4/, you can do a fast backup "snapshot" of your device by booting into recovery, getting in with adb, and doing something along the lines of:

mount -a
rsync -axvihP --delete /system/ /mmc0p4/cm9-backup/system/
rsync -axvihP --delete /data/ /mmc0p4/cm9-backup/data/
rsync -axvihP --delete /and-sec/ /mmc0p4/cm9-backup/and-sec/

Restore is the opposite, once /system, /data, and /and-sec (special directory in your microSD card's FAT partition) are mounted and writable

rsync -axvihP --delete /mmc0p4/cm9-backup/system/ /system/
rsync -axvihP --delete /mmc0p4/cm9-backup/data/ /data/
rsync -axvihP --delete /mmc0p4/cm9-backup/and-sec/ /and-sec/

Note that these paths are what I see on my phone using the Hefe Hook kernel and its configuration of TWRP. Your paths may be different. You don't need to mess with /and-sec/ if you know you don't have any apps moved to SD.

You can add --dry-run to the rsync command line before you commit to things to make sure the rsync command is doing what you would expect. The other flags I generally use are:

-a -- archive mode, recursively copy "everything"

-x -- one file system, don't descend into mount points

-v -- verbose

-i -- information on each file being copied

-h -- "human" readable output

-P -- show progress and allow for partial updates

--delete -- if the file isn't in the source and is in the destination, delete it form the destination as well​

As this is "real" rsync, you can look at the man page for more information.
[Samsung Galaxy S (4G Model)] jeffsf:
also reserved
[Samsung Galaxy S (4G Model)] FBis251:
Dude awesome, I'll definitely use this on my other android devices. :D. Will make cloning my SD card simple.
[Android Apps and Games] tdhite:
[APP][2.3.5+][1.14 - 12/21/2014] DnsQache: Custom DNS + HTTP(S) Proxy

*** Disclamer: Read the [URL="http://xdaforums.com/showpost.php?p=48623656&postcount=2"]DISCLAIMER[/URL] file before committing to the use of this application.

Introduction

Images

Installation instructions

Download

Changelog

FAQ

Thanks To/Credits

XDA:DevDB Information

DnsQache, App for the Apps & Games

Contributors

tdhite

Source Code: https://github.com/Android-Apps/DnsQache

Version Information

Status: Stable

Current Stable Version: 1.14

Stable Release Date: 2014-12-21

Created 2014-12-21

Last Updated 2014-12-21
[Android Apps and Games] tdhite:
Reserved
[Android Apps and Games] tdhite:
Disclaimer and Download Link

*** Legal Disclaimer -- READ ALL OF THE FOLLOWING ***

The Download Links Are After This Disclaimer Information

DOWNLOAD LINKS:

DnsQache 1.14 - PIE (Lollipop) Support

MD5 Checksum: c4939d4a8f09e66ce9ea8645a6499f97

DnsQache 1.13

MD5 Checksum: 3549c7732613e3a0963f15efb0cf3562

Version 0.85 (for pre-Android 3.0 users): dnsqache.apk

MD5 Checksum: f05161d291ec47ca1fbed95a10356908 dnsqache.apk
[Android Apps and Games] android404:
whow!
[Android Apps and Games] tdhite:
Hope you like it. Let me know how it goes.
[Android Apps and Games] killoid:
[MENTION=4988866]tdhite[/MENTION] first of all,great work! there is only oneappsimilar to yours.

i was using crossbreeder until now,i've been testing your app on my samsung galaxy y duos running stock 2.3.6. i've faced one bug,when i click about it does nothing.i am using opendns & polipo under dns & proxy settings. also i dont know wheather your app is working or not,so i've attached the logs from data/data/com.tdhite.dnsqache. plz tell me if it works or not.

i will suggest you should work on the app UI & icon.a holo dark look will be better.& plz make this app an foreground application & hide the notification bar icon or include an option to do it.

p.s. when i type 'su getprop net.dns1' it shows 127.0.0.1. & for 'su getprop net.dns2' it shows 119.30.37.10.
[Android Apps and Games] tdhite:
Given the logs, it appears the DNS caching / redirection is working quite well. You can also watch the DNS operations using a command (terminal emulator or similar):

logcat -s dnsmasq:*

That will let you watch the DNS queries -- of course assuming you have 'Log Queries' turned on in the settings.

As for the 'net.dns?' property settings, DnsQache will set the phone to use localhost (dnsmasq) as the primary, but if it were to blow away the secondary setting, no network at all would work if dnsmasq failed for any reason. So in the event port 53 on localhost is not listening, the secondary dns server would get used by Android so at least you get network. As another point, Jelly Bean and above don't even use those properties, so not to worry if you're not on an older Android version.

Polipo, however, appears to have a bad value for the CIDR settings. I surmise this might be a bug, I'll fix it if so. The issue, as a bet, is that without at least *one* click of the 'Set Allowed CIDRs' button in the Proxy settings, the default value somehow is getting missed in the configuration manager. The key log was "can't parse network null" so polipo refused to start. I need to surface that kind of error better -- will work on that. You can see the error in /data/data/com.tdhite.dnsqache/conf/polipo.conf where the line:

allowedClients=127.0.0.1, null

probably appears. That's because, for whatever reason, the default is not taking so the configuration is wrong.

So, can you try going to the 'Settings|Settings:Proxy" menu and click the 'Set Allowed CIRDs' button it should properly set the configuration. Then restart the service (click the big DQ so it goes grey, give it a few secs to clear the messages that popup, then click the big DQ again to start it). That will then properly start polipo.

My apologies for the bug -- I have to attest I always set the CIDR differently than default because the tethering (native) usually is set differently for me. This is a bug and I'll fix it and re-upload a new version. I'll post here when it's fixed and uploaded (probably evening, I have work-work to do).

Finally -- polipo provides an internal status page (actually many). You can view that on your phone or on any device tethered (thus with an IP address in the allowed CIDR range). For instance, on your phone browser, go to http://localhost:3128/polipo/status? to see current status. See this page for more: http://www.pps.univ-paris-diderot.fr/~jch /software/polipo/polipo.html.
[Android Apps and Games] killoid:
yes after trying your method polipo is seemed to be working ok.in the log now it says 'Established listening socket on port 3128.'

when you find enough time,you do it.no hurry! we all have a life. :)

i've tried to access to the address you mentioned with opera mini,but no success.it says in the page 'could not connect to remote server'.
[Android Apps and Games] tdhite:
Check download link -- updated version with fixes. Attached is a screenshot of hitting localhost to see polipo status. As well, you can now enter multiple CIDRs by comma separating them. That way you can turn on your WiFi, include your WiFi CIDR in the 'allowed' settings, start DnsQache with polipo enables and then hit your device via the Wifi network (e.g., http://192.168.208.77:3128/polipo/status?).
[Android Apps and Games] killoid:
download link is not working,giving 404 error.
[Android Apps and Games] tdhite:
fixed. :o
[Android Apps and Games] killoid:
as i am currently not in any wifi network,i cant test the link u posted.but i am posting the logs from data/data/* . hope it helps. but when i installed the new app over the old & started it,in the polipo log it was showing null.i made it right using the method u told me before.& another thing,u said it is v0.81 but in the app it shows v1.0.
[Android Apps and Games] killoid:
is the proxy setting right now? attached screenshot.
[Android Apps and Games] tdhite:
Hi, your logs look fine, polipo is also running. It's logs will be relatively benign when operating correctly. It looks like you turned off query logging on the DNS settings -- either that or you've just not made any DNS queries yet, but dnsmasq also logged that it's redirecting. Unless you turn on Log Queries, the DNS logs will be rather silent. Just look at logcat to see them when Log Queries is on (logcat -s dnsmasq:*) -- we don't have dnsmasq log to the file system as it would grow to much.

I'll explain the CIDR a little later this evening when I'm done working. It dawns on me you might not understand how the tethering networking works, and your CIDR for the proxy needs to match the CIDR you setup for the mobile hot stop or wifi-tether.
[Android Apps and Games] tdhite:
Note -- I put up an updated (slipstream) release of the apk file in the upload link. It has the version number correctly stated (thanks for noticing). To install it, download it, turn off the DnsQache service, install the apk, verify you got v0.81 as the version of the app, then start the service again.

Let me explain the CIDR values now, as work is over (for a break, but I'm doing some very cool coreOS and mesos stuff later on Amazon).

Anyway -- the CIDR is a network specification that you also select in your mobile hotspot / wifi-tether application. For instance, in the Android Wifi Tether app, you go to settings and select from a list of networks it will support for supplying IP addresses to the tethered devices (laptops, etc.). That network is what is critical to polipo as a proxy service. To maintain security, you can set the "allowed CIDRs" in DnsQache to limit connections that polipo will serve as a proxy to the Internet.

When you set the allowed CIDRs in DnsMasq, it lets you specify one or more networks that you want polipo to serve as as a proxy. So, I have my mobile hotspot program (native as I run a custom ROM) set the tethering network as 172.20.21.0/24 -- meaning the hotspot program will sit on 172.20.21.1 and give out to tethered devices addresses from 172.20.21.2 up to 172.20.21.254. So, for a tethered device in that range to use polipo as a proxy, you have to tell polipo (via DnsMasq settings) to accept connections from devices with addresses from the "allowed CIDRs" -- namely 172.20.21.0/24. I often add another one -- my WiFi network so I can check out the phone from other computers on my network.

As an example, let's say you setup your tethering app to use the network 10.10.10.0/24 as your tethering network. But you also want to let your home computer open the stats page on the phone just to make sure stuff is to your liking (or even the polipo configuration page). Further, let's say that you have WiFi turned on on your phone, and your home WiFI network is 192.168.1.0/24, and your phone got an address of 192.168.1.110. You might setup the allowed CIDRs as:

10.10.10.0/24, 192.168.1.0/24

Then, restart the DnsQache service. After that, you should be able to see the polipo config page from your phone ( by going to http://localhost:3128/polipo/config? ) or any tethered device (by going to http://10.10.10.1:3128/polipo/config? ) or your home network (by going to http://192.168.1.110:3129/polipo/config? ).

Now remember also -- for your tethered devices devices to get proxied internet via polipo, you have to start the mobile hotspot (or wifi-tether) and that will kill your home network connection since the WiFi is used for the tethering network.

Does that help?
[Android Apps and Games] killoid:
well,hadn't made any dns queries then so it didnt show up in the log.but later i saw dns is lock & loaded. :D

---------- Post added at 11:39 AM ---------- Previous post was at 11:29 AM ----------

it is correct now. :good:

well that helped a lot! i've understood that whole CIDRS thing much better now.but as a noob i will req u to quote this explanation about CIDRS on the 1st page. people will quit asking about CIDRS then maybe. :D
[Android Apps and Games] smeejaytee:
Hi when I set cache to 1024 after reboot it's back to 0 any ideas please great app by the way seems to boost internet quite nicely thanks
[Android Apps and Games] tdhite:
Can you tell me what version of Android you are on? Possibly recent changed introduced a persistence bug with newer Jelly Bean file structures and file system security. Not sure, but I'll hunt it down as soon as I can. Still would like to know the version of your Android, though.
[Android Apps and Games] smeejaytee:
Jb 4.2.2 thanks for the reply could I also ask which is the best dns server as your app has a few choices I've only ever used Google and I tried open dns once but don't know whenever it's better or not any advise would be appreciated thanks for your work
[Android Apps and Games] Titchener17:
wow ! amazing work thank you very much ! gotts to donate @ the end of this month ! DnsQache has always rocked and now funks, jazzes, and souls !
[Android Apps and Games] starcallr:
if I select as primary dns my individualized router dns (NOT the 192......), it gets accepted, but when I re-open it, the input field is blank/

in the previous version it was still there/

the secondary one stays (google, 8.8.4.4 entered manually)

ne ideas?

for now I just downgraded to the previous version (which I'm pretty happy with neway)
[Android Apps and Games] user2k10:
I have DNS provider set to Custom and am trying to set specific IP addresses. I leave Provider Country blank and enter the Custom Primary and Secondary Server IP addresses, but they get blanked out.
[Android Apps and Games] Titchener17:
living in raleigh is the optimal setup to pick a primary in raleigh and secondary close by (only found one in town so far this is pretty awesome thank you big-time!)?
[Android Apps and Games] PiggyFlooper:
Hello sir, great work n app. Unfortunately, I can't download DNS file without app crashing, happens every time. Where is file being downloaded to? I'm guessing /data/data/com.tdhite.dnsqache. Could you make this file available on afh,? so I can download and plug it in wherever it goes, to get this badass thing going

Sent from above using XDA Premium
[Android Apps and Games] tdhite:
The download dies not store any files. Please send a logcat dump after the failure.
[Android Apps and Games] tdhite:
Seems like a good approach. :thumbup:
[Android Apps and Games] PiggyFlooper:
Okay, here- https://db.tt/kGUzK25i

Well, why not:

08-20 20:00:09.818 20760 20802 I dalvikvm:

com.tdhite.dnsqache.task.DnsProvidersTask.doInBackground( DnsProvidersTask.java:1)

08-20 20:00:09.989 1629 1873 E EmbeddedLogger: App crashed! Process: com.tdhite.dnsqache

08-20 20:00:09.989 1629 1873 E EmbeddedLogger: App crashed! Package: com.tdhite.dnsqache v9 (1.1)

08-20 20:00:09.989 1629 1873 W ActivityManager:

finishing activity com.tdhite.dnsqache/.ui.MainActivity

08-20 20:00:10.399 130 410 E SurfaceTexture: [com.tdhite.dnsqache/com.tdhite.dnsqache.ui.MainActivity] abandon: SurfaceTexture(0x0x58d758) has been abandoned!

08-20 20:00:10.619 20760 20760 E WindowManager: Activity com.tdhite.dnsqache.ui.MainActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@423 866c0 that was originally added here

08-20 20:00:10.619 20760 20760 E WindowManager: android.view.WindowLeaked: Activity com.tdhite.dnsqache.ui.MainActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@423 866c0 that was originally added here

08-20 20:00:10.619 20760 20760 E WindowManager:

com.tdhite.dnsqache.task.Task.onPreExecute(Task.java:44)

08-20 20:00:10.619 20760 20760 E WindowManager:

com.tdhite.dnsqache.ui.MainActivity.updateDnsProviders(Main Activity.java:281)

08-20 20:00:10.619 20760 20760 E WindowManager:

com.tdhite.dnsqache.ui.MainActivity.onClick(MainActivity.java :265)

08-20 20:00:15.554 1629 2947 I ActivityManager: Process com.tdhite.dnsqache (pid 20760) has died

Sent from above using Xparent Tapatalk Blue
[Android Apps and Games] starcallr:
that's pretty much the same what I described/
[Android Apps and Games] Titchener17:
DnsQache alpha is working wonderfully thank you !
[Android Apps and Games] smeejaytee:
Loving the Alfa thank you again
[Android Apps and Games] kosique:
Using the alpha a couple if hours now. No problems so far. I can use some custom DNS servers I couldn't use before.
[Android Apps and Games] tamingsarix:
Wowww...working on. 1st apps ever work on kitkat....i have try many script,mod and apps..but this only work for 4.3 above....great work
[Android Apps and Games] rootlinux:
Nice work brother. Slam dunk yet again. :)
[Android Apps and Games] tdhite:
Brother root, good to see you here.
[Android Apps and Games] rootlinux:
Just saw you had a new project going on.

Had to come see what's up. :)

Good to see you too brother. :)
[Android Apps and Games] Titchener17:
TouchDown-been suggesting this awesomeness to folks and resuggesting since your surprise alpha update...seeing and knowing of solid folks like rootlinux here being aware of you and this top-shelf contribution, make it a matter of time til this thread expands rapidly...

seriously not sure if have donated yet, but pleas pm me or post if haven't done so by the first, as eom is paycheck and you definitely deserve for creating such a wonderful app and sharing it with everyone - and for being a solid captain of this ship giving thanks !
[Android Apps and Games] Titchener17:
td , is the alpha version linked in the op ?
[Android Apps and Games] avd:
No, a dozen posts up about?
[Android Apps and Games] nmtuan.pnt:
Im use KK rom :( it dont work
[Android Apps and Games] tdhite:
The vast majority of users are KK and above. Works fine. What's the issue?
[Android Apps and Games] killoid:
[MENTION=4988866]tdhite[/MENTION] does the alpha supports gb?
[Android Apps and Games] Titchener17:
was thinking more for ease of alpha install for the folks that am suggesting/linking for this awesome app
[Android Apps and Games] Titchener17:
Forget if you need transaction id for anyreason lemme know if so made donation thank you very much for sharing this great work with everyone !
[Android Apps and Games] user2k10:
Stop filling this thread with junk posts
[Android Apps and Games] tdhite:
I'm sorry dude -- it does not. There's some specific features used in the code that don't track back to gingerbread API. If I ever find a free moment -- I'll give a shot to trying backwards compat -- but truthfully, if you're ok with the .8x versions, the fundamentals really are similar so you get all the speed up, just not the flashy UI.
[Android Apps and Games] tdhite:
Got the transaction, thanks so much my friend.
[Android Apps and Games] tdhite:
Now listed in the Downloads section of the original posts. Go to this post.

:victory:
[Android Apps and Games] user2k10:
[MENTION=4988866]tdhite[/MENTION]

Did you get a chance to look at this problem?
[Android Apps and Games] tdhite:
not yet -- I'll try today / tomorrow.

----------- update --------------

Took a look and I can modify it. Alas, it'll take a couple days. There is a (sick and twisted) work around. Just pick a country, then two providers. After that, literally, set your own custom provider values (don't use the lists). After that, just back out of the custom dns settings screen. Believe it or not, it will keep the custom (hand-entered) values. Drag is, next time you enter the preferences screen to reset that, DnsQache will overwrite your values with that of the list selection. That's what I have to fixup.
[Android Apps and Games] Titchener17:
https://www.youtube.com/watch?v=stdi-1tIUhM&feature=youtube_gdata_player
[Android Apps and Games] killoid:
[MENTION=4988866]tdhite[/MENTION] can u tell me what does it mean 'bad line in the etc/hosts' in the log??
[Android Apps and Games] tdhite:
That means something wrote bad records into your /etc/hosts file. If you are using adware, or things like that, that can happen.

What are you using other than DnaQache for mucking with hosts file entries?

Finally, that you have 547349 (probably more) lines in your /etc/hosts file is a disaster, imho. That's a ridiculous setup to be sure. Something is producing a mess for you.
[Android Apps and Games] killoid:
i am using mother of all ad-blocking. maybe i should use a smaller hosts file.
[Android Apps and Games] biopsin:
It´s a total overkill, his hosts file in current size is meant for a hostsserver or similar, load it on the router not on the device.

use the old hosts file in last crossbreeder, its small it does the main point of ad- and track blocking, fine tune it to your location and surf habits.

Optimize it with replacing every 127.0.0.1 with 0.0.0.0 except for the localhost, and further you can have 9 hosts per line(or maybe more, have not tested beyond 9), it´s undocumented bla bla - it works fine..

So a hosts file at 13830 lines = 415k drops to 1540 lines = 290k - use the ram for other things instead of wasting it on trillion domains you probably never gonna hit the next 20 years,..
[Android Apps and Games] tdhite:
Updated 09/06/2014

Fixed up the ability to manually override the Country setting in Custom DNS (just set the Country to 'None' which is now the default value).

Always read the DISCLAIMER.

Please also read the Change Log post.

Then you can pull the update from the Download Link.

Have fun.

---------- edit ------------

Updated the link to point at DnsQache-1.12.apk to include recent fix.

----------------------------

:cool:
[Android Apps and Games] tamingsarix:
I have FC when update providers
[Android Apps and Games] tdhite:
Only way I can reproduce is if I completely turn off data. That means there's a slight error handling a failed internet connection.

Please make sure you can connect to internet sites and send a logcat on further failure. Honestly, just telling me you had a problem with no way for me to debug the issue is less than optimal.

Thanks in any event.
[Android Apps and Games] tamingsarix:
Although have error, i have success update..strange
[Android Apps and Games] user2k10:
It still won't save the entered custom DNS addresses. If I restart the app they default back to the Google addresses.
[Android Apps and Games] tdhite:
fixed. go download it again from: http://xdaforums.com/showpost.php?p=55277177&postcount=215
[Android Apps and Games] jallenhayslett:
For some reason, this kills my Dropbox connection.

Anyone have similar issues and is there a workaround?