Introduction
As I like to stay connected via Putty to my Android phone, from time to time I missed the functionality of updatedb / locate that I so got used to within Linux environment.
I've decided to cross compile the findutils package (I couldn't get the latest version 4.4.2, but an older before, 4.2.33).
Screenshot
You can see the updatedb command followed by some locate commands.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Installation
Busybox is required.
1. Copy the archive onto your /sdcard/ folder.
2. mount your /system folder as read-write
3. cd /system/
4. tar xf /sdcard/findutils-4.2.33.tar.gz
It is mandatory that you are inside /system/ folder when you extract the archive.
Then you have to create the database (using updatedb script). It will take a bit of time - but not too much.
Then you can use the locate command giving any part of a file name that you can remember, you can also use wildcards!
Observations
1. No integration with cron / etc. If you know your updatedb database is out of date, rebuild it using "updatedb"
2. Busybox comes with a /system/xbin/find command. The trouble with it is that it doesn't support the fstype argument, and thus, updatedb cannot prune some standard file system type paths. However, the bundled package here comes with its own find utility which unpacks into /system/bin/find.
3. Busybox is required for sort / sed, but updatedb script is patched to use the /system/bin/find (its own find executable) instead of the default busybox one.
4. My phone did not have an /etc/mtab file (list of mounts which mount is supposed to update whenever something happens). Thus, there is a line in the updatedb script which recreates that file on each updatedb invocation (mount > /etc/mtab). If you phone / tablet has it, please modify updatedb script and remove the mount command.
Download
Use it at your own risk!
findutils-4.2.33.tar.gz
This is great! Thanks for your work!
I hope that there will be a file manager for android which uses updatedb/locate to index/search files in the future, that would be sooooo awesome!
Don't know about other software that searches - but it would be nice too.
Maybe I can create something, but I'm sure there are others more integrated - such as looking in SMSes or in mails too, etc.
nice! find takes for ever lol now i have locate!
Any chance of getting the code. Did you create your own Android.mk? Did you use the FindUtils make?
When I run updatedb, I get these errors:
/system/bin/find: /preload: Value too large for defined data type
/system/bin/find: /storage/sdcard0: Value too large for defined data type
/system/bin/find: /system: Value too large for defined data type
/system/bin/find: /data: Value too large for defined data type
yelkarama said:
When I run updatedb, I get these errors:
... <snip>
/system/bin/find: /data: Value too large for defined data type
Click to expand...
Click to collapse
I also get this error
This doesn't work. Might have worked a couple years ago before 4.x Android...
Use something like es file Explorer
Sent from my SAMSUNG-SGH-I747 using XDA Premium 4 mobile app
I will rebuild it in the weekend I think back in the days the file systems were only 32bit, and now a lot of phones have 64bit file systems ...
viulian said:
I will rebuild it in the weekend I think back in the days the file systems were only 32bit, and now a lot of phones have 64bit file systems ...
Click to expand...
Click to collapse
Thanks for your efforts, I guessed it needed a rebuild from a google, but given how long ago you posted this I didn't think it would happen. Looking forward to the update!
Sent from my GT-N7100 using Tapatalk
Please upload the new build
viulian said:
I will rebuild it in the weekend I think back in the days the file systems were only 32bit, and now a lot of phones have 64bit file systems ...
Click to expand...
Click to collapse
Hi
Please upload the new built binaries.
Thanks
Don't work with Oreo. Please make a update.
Related
I've searched the web, and found no lynx binaries for android, so I set out to compile it myself.
For the uninitiated, lynx is a text-based browser. No images, no javascript, no flash. Just pure content.
You can use it by connecting to your phone through adb, telnet, ssh or a shell on the phone itself.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
This is lynx version 2.8.8 with ncurses 5.9
I pretty much just followed the instructions at http://www.embedu.org/Column/Column294.htm, and added a flag to make the linking static. No code changes were required.
Installation instructions
Root is not required.
You need to unzip the file on the /sdcard folder. The following files must exist:
/sdcard/lynx/lynx.cfg
/sdcard/lynx/lynx.lss
/sdcard/lynx/cache/
Then you need to move the binary to /data/local (or /system/xbin if you want something more permanent. Then you'd need root)
and run this command:
chmod 755 /data/local/lynx
Then run :
/data/local/lynx
and enjoy!
Additional information
If you want to put these files somewhere else, you must redefine the following variables, respectively:
LYNX_CFG (eg: export LYNX_CFG=/system/etc/lynx.cfg)
LYNX_LSS (eg: export LYNX_LSS =/system/etc/lynx.lss)
TMPDIR (eg: export TMPDIR =/cache)
If you receive an error message about the terminal, you need to configure a terminal.
Here are some instruction (for nano, but it works the same)
Sources are at the following addresses:
http://lynx.browser.org/
http://www.gnu.org/s/ncurses/
reserved
soon get the flash-able package
Thanks! I installed this on my ZTE Blade with 2.3.4 Gingerbread, but after setting everything in Terminal Emulator, I get these errors:
Alert!: Unable to connect to remote host.
Looking up lynx.isc.org
Unable to locate remote host lynx.isc.org.
lynx: Can't access startfile http://lynx.isc.org
Click to expand...
Click to collapse
As if there were no internet connection...
Awesome
Will be testing on my thunderbolt later today. I'll let you guys know how it goes.
However, would you mind reposting this on RW, or would you mind if I were to repost it and link back?
[EDIT] In having just configured everything, I also get the error from the post above. It seems as though lynx thinks it doesn't have internet access. This is the case on 3g and wireless networks. Let me know if you want me to test anything for you.[/EDIT]
All the best,
-HG
Looks great.
May I add that to my script ?
http://forum.xda-developers.com/showthread.php?t=1191984
Well, I was able to install it from a chrooted ubuntu 10.10 distro on my device. It's already compiled for ARM on ports.ubuntu.com, so maybe it's not so exclusive.
Sent from my Milestone 2 XDA App
Sure
sebsch1991 said:
Looks great.
May I add that to my script ?
http://forum.xda-developers.com/showthread.php?t=1191984
Click to expand...
Click to collapse
Sure, go ahead. It's open-sourced after all, I just built it.
dangpzanco said:
Well, I was able to install it from a chrooted ubuntu 10.10 distro on my device. It's already compiled for ARM on ports.ubuntu.com, so maybe it's not so exclusive.
Sent from my Milestone 2 XDA App
Click to expand...
Click to collapse
Nice. Can you point me to the correct file? I got as far as http://ports.ubuntu.com/pool/universe/l/lynx-cur/, but I don't know which one contains the binary.
While this is quite cool, why lynx? Why not elinks? It has much better layout capabilities. It has tabs! It even has javascript.
Code:
[email protected]:/# apt-get install lynx
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
lynx
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B/215kB of archives.
After this operation, 254kB of additional disk space will be used.
Selecting previously deselected package lynx.
(Reading database ... 66275 files and directories currently installed.)
Unpacking lynx (from .../lynx_2.8.8dev.2-1_all.deb) ...
I installed it that way.
Search for opkg (i think this is the name) if you are curious. It's a way of using deb packaging on Android (G1), but not in development anymore...
Sent from my Milestone 2 XDA App
I would be nice if someone could compile the HTTPS version of this so I could browse my banks mobile site
norti said:
Thanks! I installed this on my ZTE Blade with 2.3.4 Gingerbread, but after setting everything in Terminal Emulator, I get these errors:
As if there were no internet connection...
Click to expand...
Click to collapse
any solution ? i got the same problem...
hawkeyexp said:
any solution ? i got the same problem...
Click to expand...
Click to collapse
Can you ping any web address from the shell? What about wget, can you try that?
both pissble without problems
I am getting the following error
Looking up <url>.
Unable to locate remote host <url>
Alert!: Unable to connect to remote host.
I'm hoping to be able to get some feedback and bounce this idea around. I wasn't able to figure out the right terms for a google search with good results even though I spent a while trying.
From an Android application, I want to determine where the busybox binary is installed on the system or data partition. I was hoping for a pure java solution, but I don't think there are any android java APIs for calling the shell PATH variable...
I also wanted to avoid hard coding the common linux binary directories (ex. /system/bin and /system/xbin, etc.)
From a shell perspective, I would usually run busybox find / -name busybox to locate it. Or I'd run busybox which busybox .. none of these are pure Android java solutions.
There are only two ways I'm aware of:
1) Using the linux binary "which". I could compile this for arm (or use the busybox applet) and package this binary into the application, have it extract when the application loads and execute and parse the output. Could do the same with the find linux binary...
2) Use the RootTools method Stericson published - InternalMethods.java. Although his approach uses a root shell to run dd to copy it from /init.rc (permissions usually read only for root) into /data/local/tmp and set it 777 so the android application and parse it for the export PATH line.
EDIT: found another method .. kind of an interesting approach.
http://osdir.com/ml/AndroidDevelopers/2009-03/msg04053.html
ps | grep /system/bin/sh
cat /proc/<pid>/environ
have to parse some of that output, but it seems to work thru adb shell w/o root.
I very well might have overlooked something or missed another approach. Any other ideas or other approaches?
Thanks in advance!
Include busybox with your app, no need to worry about its version
Couldn't you use java.lang.System.getenv()?
http://developer.android.com/reference/java/lang/System.html#getenv(java.lang.String)
doixanh said:
Include busybox with your app, no need to worry about its version
Click to expand...
Click to collapse
lol. unfortunately the scope of my app is only to show the user where their busybox binary is currently located, not provide them with a busybox binary.
Gene Poole said:
Couldn't you use java.lang.System.getenv()?
http://developer.android.com/reference/java/lang/System.html#getenv(java.lang.String)
Click to expand...
Click to collapse
Wow! very interesting. Sad I couldn't find this in all my searching through the android docs.
Two questions after looking over the information I can probably answer through testing, but can't test at the moment. If anybody knows the answer, would be helpful. Otherwise I'll post back when I am able to test.
1) Would the SecurityManager block a 3rd party app from using this call as it might be reserved for only apps signed with platform keys? I can compile and test watching logcat to see if it blocks this call.
2) For the getenv(String name) method, what value should be passed as the string? I can probably bypass this by just running the getenv w/o a string to have it return the Map and sort through the map.
Thanks for the help/suggestions/feedback!
Finally had a chance to test!
Gene Poole said:
Couldn't you use java.lang.System.getenv()?
http://developer.android.com/reference/java/lang/System.html#getenv(java.lang.String)
Click to expand...
Click to collapse
Turns out to be the perfect answer!!
This is the exact command I was looking for:
textBox.setText(System.getenv("PATH"));
Found a great test example for implementing real quick - How do I get Environment Variables?
Here is the output on my EVO 3D:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Installation
Step - 1 : Setting Up your PC!
Download The following resources first:
Java SE Run-time Environment 7 [ Java Dependencies For Signing APK tool ]
Now let's begin setting up your PC,
Install the above mentioned programs.
Go to Advanced System Properties.
It looks like this:
Go to Environment Variables, then create a new System Variable, having name JAVA_HOME and value as the path where you have installed the JRE.
It looks like this:
Now after creating the JAVA_HOME variable, search for Path system variable in the System Variables list. Now this is a bit tricky. Once found click on it and then on Edit. Move the cursor to the end of the string till you see ";" (without quotes), add the path to your JRE bin folder just after it.
It looks like this:
OK, so if everything went fine and just as what instructed then you are all good to proceed to Step - 2!
Step - 2 : Installing Cassini on your PC!
Download the latest build from the download section.
Extract the zip Cassini.[CURRENT-VERSION].zip, and execute Cassini.[CURRENT-VERSION].exe.
Now follow the Installation wizard and you are done!
It looks like this:
How to Use?
Firstly, open up your C: Drive and then go to Program Files [Program Files (x86) in case of 64-bit system] folder, then just look for a folder named Divya Mamgai, go in it and you will find a folder named Cassini and that's it, it is your Main directory.
Now copy your apk files to the working directory of it, and then start the program.
Now just press enter to start compressing!
Wait for the process to complete, and all your apk files will be available to be used while saving a lot of data on your device in the build folder.
Download
Cassini.1.1 - [5.76 MB (6041289 bytes)]
Currently Compatible Apps
All System Apps, except - LatinIME.apk [ Results in force close of keyboard?! ]
Some PlayStore Apps.
Example of working - ZPlayer, Textra, Solid Explorer and even more!
Example of non-working - WhatsApp and especially all the games i had (!), please try it out and report me of what apps are compressible and what are not?
Screens
Cassini.1.1 -
Hit thanks if you like my work! [ ]
Change Log
Version - 1.1
Initial release with minimal features.
[Tool][Windows] Cassini.1.2 - App Compressor is Back!
thank you, perfect
thank you, perfect, that's what I needed
hugo.gabriel999 said:
thank you, perfect, that's what I needed
Click to expand...
Click to collapse
You are welcome buddy!
does this work on unbutu 13.10? i guess it is for windows.
correct me if i am wrong.
Does app compression also boost file system performance in anyway? Regardless, this is great!
Su vaat che!
Are there any downsides such as a slower phone?
Could we have more info on what it does ?
Does it open apk res and compress them ?
really productive, that is. would definitely try it soon
Does this make any impact on receiving updates from the Play store? After updating would the apps be uncompressed?
by comparing at files which was compressed i can see Res and resources.arsc got compressed. and th compression ratio is great too. i was using similar method called Go Optimizer by gu5t3r without any isse and helped me saved more space in my phone.
try it out right now ... really awesome dude! thanks
this is the best tool! I'm a dev, so can I use this n the system apps of my roms before I make them into a flashable zip? Also, does this work on the framework-res.apk?
Have tried some system apps. But non of,them works after replace them.
SystemUI
Mms
Phone
Settings
Contacts
Camera
Sent from my Xperia Ray using XDA Premium 4 mobile app
I respect your work but its not The Only of its kind!
as Dilesh Perera said,goptimizer like..
what is the png compression/optimization technique used?
Is this working on kitkat?
First of all sorry to not reply so late cause, I had exams and also the fact that I forgot to subscribe the thread.
I'm really sorry.
desalesouche said:
does this work on unbutu 13.10? i guess it is for windows.
correct me if i am wrong.
Click to expand...
Click to collapse
Yes you are right it is based on some of basic functions of Windows, also I don't think the setup might not work in Unbuntu.
DroidOnRoids said:
Does app compression also boost file system performance in anyway? Regardless, this is great!
Click to expand...
Click to collapse
Well I don't know accurately but check out this rom - Hyperion Xperia U , I have used Cassini in it and it really helped my device to handle multitasking in a much better way. But I won't get my hopes up in getting better performance.
Hey there,
i'd like to share a little application i made.
The problem:
I was annoyed by the uncomfortable use of MTP in Windows.
Especially when having more and more files in one folder like the camera folder.
Windows needs several minutes to get the complete filelist.
The solution:
i created a little application which pulls files from your android-device via adb.
the app checks all specified folders from the configuration-file and pulls all files which are not existing to the destination folder.
there is also an option to change the created/modified timestamp of images/videos by parsing the filename. this function may be useful for sorting your pictures/videos.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Setting up the app:
the app creates all necessary files on the first start.
after creating, it automatically opens the configuration-file for you to edit it.
there is a comment in every line to understand what the application will do.
there are a couple more of options, read the ini-file-comments to understand.
Requirements:
- Microsoft .Net Framework 4.0
- the ability to modify a textfile
- ADB-Debugging must be enabled on your device
- the internal path you want to sync from your android-device
if you don't know the path, install "es file explorer" or any other file-explorer and try to find out the path. see screenshot...
if you like this tool feel free to donate.
THX and have fun!
ignore the following files
View attachment 2383672
--- DOWNLOAD BELOW ---
It's a great idea but the tool does not really work well. I tried many different things now and it either didn't sync at all saying there were no files to copy or only copies the one given directory without subdirectories.
I hope it's not programmed that way since it'd be very un-useful for those who'd want to make a backup of their phone before flashing (as example me right now).
Good idea tho, really like it yet!
Hi, thanks for your work. I have a Zenfne 2 and this works for me, but i need to copy all the sdcard folder and subfolders. What i need to do?
Great no-nonsense tool!
Allow me to recommend two minor additions
1) For JPG and PNG file, examine the "DATE TAKEN" meta-tag, and use this for filestamp (by an option)
2) A flag for Traverse Subdirs.
(If not easy on the source side, it could be OK with the destination side, one could easily do a initial full copy in explorer)
ADD:
3) An option NOT to try to supply it's own ADB.exe, without a confirmation dialogue as this might be wrong compared to the version used on the system...
...And a tiny bug.
4) When "OpenAfterCopyOnly" is selected and multiple sync-sections is in use, it should ONLY open the destination folders for the dirs that got new files, not all destinations.
Thanks! Just used this to solve my issue. Phone rebooted within 2 minutes, so doing it straight didn't work for me. Good work!
People interested in this, might find this little tool PortableDevicesIncrementalCopy helpful too
It can do INCREMENTAL copies via MTP of the entire tree, so very handy and reasonably quick to keep a backup including all your images on your PC
https://eskerahn.dk/wordpress/?p=1668
Note it is not a MIRROR-function, so files deleted on the device will stay on the PC.
Not work on my pc. Error cannot write file.
Hello Friends~!
I decided to play with some forks of android and chrome os in vmware this week, it was a lot of fun!
A problem I would like to create a solution for, is the inability for vmware tools to install natively.
Here is a toolset I prepared called "droidvmtools" DOWNLOAD
I was able to create this toolset based off of the prelGlibc25 Linux iso that came with VMWare, that is stored in Windows in this directory:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
If you care about the extra steps added to "droidvmtools" I tried to document that process HERE
This exercise is performed using this Prebuilt copy of PrimeOS for VMWare DOWNLOAD
In theory, this method should work on other android images with root access, then likely fail as this example does at the end.
INSTALLATION:
Obtaining the perl binaries:
In termux run the command
Code:
pkg install perl
Then in Root Explorer, go to
Code:
/data/data/com.termux/files/usr/bin
and copy the perl binaries.
Now paste the binaries to:
Code:
/system/bin
To install the Toolset:
Extract droidvmtools and paste it to the root file system. The video goes over this step at 2:34 if you need reference. ( I also used my yt channel to easily dl the tools youtube.com/@jennn/about the tools are there if no usb)
Open a terminal emulator and type:
Code:
su
chmod 777 -R /droidvmtools
Then in Root Explorer, open droidvmtools, select all, copy, and then paste the contents to the root file system
You will be prompted with this message, select these options:
Now when you type:
Code:
perl run.pl
The tools are able to start installation but they crash at this part:
This is the part I am stuck on. I had never heard of recursion until this happened..
Here is a PASTEBIN dump of the code, maybe someone is able to look and see why this would be happening?
This thread is in preparation for a megathread I want to make. If you want to preview some of the images early see HERE
PLEASE NOTE:
I Understand that "Vmware Tools is not supported" in Linux let alone Android, blah blah. Let's try!
I also already know about and have tried every emulator in existence... So Please! Let's refrain from "just use x emulator", this is about problem solving.