[Google Fi][HOW-TO] Uploading an MP3 as your Voicemail - General Topics

1. On your computer, convert the mp3 file to a 3gp file with a particular file name:
Code:
laptop $ ffmpeg -i path/to/some/music.mp3 -ar 8000 /tmp/pending_voicemail_greeting.3gp
2. Push that file to your phone and cleanup:
Code:
laptop $ adb push /tmp/pending_voicemail_greeting.3gp /sdcard && rm /tmp/pending_voicemail_greeting.3gp
3. Open the Google Fi app and record a new voicemail containing whatever garbage you want. (It won't be used.) It will show you the screen to preview it before committing to it. DO NOT COMMIT TO IT. Instead, just leave that screen open.
4. Overwrite the preview file with your file:
Code:
laptop $ adb shell
phone $ su
phone # cat /sdcard/pending_voicemail_greeting.3gp > /data/data/com.google.android.apps.tycho/files/pending_voicemail_greeting.3gp && rm /sdcard/pending_voicemail_greeting.3gp
5. Press "keep" in the Fi app to upload the preview as your new voicemail.

Related

[APP][DEV][GUIDE] Using the Android Java Internal/Hidden API classes

Using Java Reflection with Eclipse ADT to Access Internal/Hidden API classes.
Purpose
We present a way to access all the Internal and Hidden Java packages/classes
in the AOS. To do this we need to both repackage the Android.jar and hack the
Eclipse ADT plugin, to allow using these internal packages.
Posting
==================================================
Do NOT post general questions/requests on how to
do this or that, they will not be answered here.
DO post if you have additional tricks, hacks or
information that can help/benefit this tutorial.
==================================================
Background
There are two reasons one cannot use internal packages. One reason is that, if
you're using Eclipse as your development platform, those packages are
internally blocked in the Eclipse ADT plugin. Second reason is that the normal
development android.jar runtime does not contain those *.class files that
belong to the internal packages.
"There is no easy way to use com.android.internal package (internal API) or
anything marked with @hide attribute (hidden API) without using reflection.
That’s because android.jar file does not contain classes from internal and
hidden API and because of this nobody can reference those classes in compile
time."
Thus we need to first restore the "original" android.jar which will allow us
to use internal and hidden APIs. But the runtime equivalent of Android SDK’s
android.jar file is framework.jar. This file is located in the
/system/framework/ directory of your device. We will extract and use this for
our pleasure.
The general procedure:
A) Grab the "full" framwork.jar from your device
B) extract the class files
C) add them to "full" android.jar ??
D) Hack the Eclipse ADT plugin jar.
Finally, NOTHING would have been possible without the excellent step-by-step
instructions on the devmaze-blog by senior Android developer Ievgenii Nazaruk
(aka. "inazaruk"). THANK YOU Ievgenii!​References
http://stackoverflow.com/questions/...d-sdk-with-hidden-and-internal-apis-available
http://stackoverflow.com/questions/...-state-permission-for-apps-ran-on-gingerbread
http://code.google.com/p/smali/wiki/DeodexInstructions
http://code.google.com/p/adt-addons/
​
The General Procedure
NOTE: All this was performed on Windows Vista with Cygwin.(1) Grab BOOTCLASSPATH from init.rc
Find the line in your init.rc file that reads something like:
Code:
[SIZE=2]export BOOTCLASSPATH /system/framework/core.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/core-junit.jar[/SIZE]
Extract and reformat the path to:
Code:
[SIZE=2]core.jar:bouncycastle.jar:ext.jar:framework.jar:android.policy.jar:services.jar:core-junit.jar[/SIZE]
(2) Grab the "framework" from your device
Create a working directory somewhere, let's call it "_framework":
Code:
[SIZE=2]mkdir ./_framework[/SIZE]
[SIZE=2]cd _framework[/SIZE]
Grab all the framework files from your device:
Code:
[SIZE=2]adb pull /system/framework .[/SIZE]
Rename directory if needed.
NOTE-1: From now on I'll assume you know where you are!
NOTE-2: Most GB 2.3.4+ devices uses .odex'ed files,
with name pairs like: <package>.jar and <package>.odex.
These need to be converted.
(3) Use baksmali with (1)
You can also use baksmali with the switch: -d <framwork-dir>.
The general command is something like below, but in windows there may be "wrappers"
that allow you to just type "baksmali" without the "java -jar" prefix and without
the ".jar" post fix. Anyway here is the command I used:
Code:
[SIZE=2]java -Xmx1024m -jar ./../../baksmali.jar -a 10 -c :core.jar:bouncycastle.jar:ext.jar:framework.jar:android.policy.jar:services.jar:core-junit.jar -x framework.odex[/SIZE]
==> This results in all files put in the "out" sub-directory.
This directory contain 3 sub-directories (for GB 2.3.4):
Code:
[I]android [/I](Hidden APIs)
[I]com [/I](Internal APIs)
[I]javax [/I](Hidden APIs)
NOTE: If you are using Google's own API's, you will probably also need to add
those packages to the path above. (Eg. Email.jar, etc etc ?)
(4) Then use smali to create a dex file from "out" directory
Code:
java -jar smali.jar out
==> creates out.dex from "out" directory.
(5) Run dex2jar on out.dex
Code:
[SIZE=2]./dex2jar.bat out.dex[/SIZE]
==> creates out_dex2jar.jar
(This .jar contain close to 4900 files at 12 MB!)
(6) Rename "out_dex2jar.jar" to "framework-classes.zip"
Code:
[SIZE=2]mv out_dex2jar.jar framework-classes.zip
unzip framework-classes.zip[/SIZE]
(7) Find and copy your Android SDK's android.jar file
Go to: /path/to/android-sdk-windows/platforms/android-X/android.jar
where X is the API level of interest. This obviously have to match the
API level of the files you extracted from your device in: /system/framework .
This .jar file contain more than 5300 files when expanded, but missing all
the internal packages. Our job is to add them back in.
Let's first make a copy that we can use to expand and add files from (6):
Code:
cp android.jar custom-android.zip
unzip custom-android.zip
(8) Add all *.class files from (6) in to (7)
Copy and replace all existing *.class files from framework-classes.zip into
custom-android.zip:
Code:
[SIZE=2]cp -R /path/to/framework-classes/* /path/to/custom-android/.[/SIZE]
The root content of that directory should then look something like this:
Code:
[SIZE=2]android[/SIZE]
[SIZE=2]assets[/SIZE]
[SIZE=2]com[/SIZE]
[SIZE=2]dalvik[/SIZE]
[SIZE=2]java[/SIZE]
[SIZE=2]javax[/SIZE]
[SIZE=2]junit[/SIZE]
[SIZE=2]META-INF[/SIZE]
[SIZE=2]org[/SIZE]
[SIZE=2]res[/SIZE]
[SIZE=2]AndroidManifest.xml[/SIZE]
[SIZE=2]resources.arsc[/SIZE]
(9) Rename directory and create your new "classy-android.jar"
We rename it so not confuse with the original:
Code:
mv custom-android classy-android
zip classy-android
mv classy-android.zip classy-android.jar
IMPORTANT:
Make absolutely sure that the folder structure of your zip archive
is exactly the same as what you intended. To check, unzip the file
and see if it is what you (and eventually Eclipse) would expect.
(For example, if you use 7zip to zip a directory file called "test",
into "test.zip", you may end-up extracting it to ./test/test/... )
(10) Enabling & Restricting Access to classy-android.jar
Instead of just replacing the android.jar with classy-android.jar, we choose
to create a customized Android platform. This way you can enable the Internal
and Hidden API's for those projects requiring them, while other standard
projects doesn't have access to those.
(a) Go to: /path/to/android-sdk-windows/platforms/
and copy the relevant directory (for example):
Code:
cp -R android-10 android-10-internals
(b) Replace android.jar with your classy-android.jar:
Code:
cp classy-android.jar android.jar
("cp" overwrites!)
(c) Edit the build.prop file:
Edit/replace the following lines:
Code:
[SIZE=2]ro.build.version.sdk=10 ==> ro.build.version.sdk=[COLOR=Black][B]-10[/B][/COLOR][/SIZE]
[SIZE=2]ro.build.version.release=2.3.3 ==> ro.build.version.release=2.3.internal[/SIZE]
(11) Customizing the Eclipse ADT
In order to be able to use com.android.internal packages in the Eclipse ADT,
you have to disable the internal protection mechanism of the plugin, that
prevent you to use these libraries. You can see this by right-clicking on your
project package and navigate to:
Code:
[SIZE=2]==> Properties ==> Java Build Path ==> Libraries (tab) [/SIZE]
[SIZE=2]--> Android 2.x.x --> android.jar [/SIZE]
[SIZE=2]--> "Access rules: 1 rule defined": [B][COLOR=Red](X)[/COLOR][/B] [B]Forbidden: com/android/internal/**[/B][/SIZE]
This can not be removed (bug?), even though the interface allows changing, it
never persists after closing the Properties window. So we have to hack it!
The way to do it, is to hexedit the correct java class file and change the
name from "internal" to "internax". First let's find the correct file. The
plugin file is located in the ./eclipse/plugins/ directory, and its name is
something like:
Code:
com.android.ide.eclipse.adt_18.0.0.v201203301601-306762.jar
(a) make a backup copy of this (with the exact name preserved) in another directory.
(b) make a another copy of this in another directory.
(c) unzip (b) in that directory
Code:
[SIZE=2]cp com.android.ide.eclipse.adt_18.0.0.v201203301601-306762.jar hacked_adt.zip[/SIZE]
[SIZE=2]unzip hacked_adt.zip[/SIZE]
[SIZE=2]cd hacked_adt[/SIZE]
This is a huge directory system, so forget poking around in it,
just go to the correct sub-directory:
Code:
[SIZE=2]cd ./com/android/ide/eclipse/adt/internal/project/[/SIZE]
Then find the correct file and the approximate string location within that file:
Code:
[SIZE=2]strings.exe -f -4 -t x ./*.class |grep "android\/internal"[/SIZE]
It happens to be in "AndroidClasspathContainerInitializer.class". Now, use a
hexeditor to find and change the string "com/android/internal/**"
to "com/android/internax/**". That will do it!
Now zip-up your hacked jar directory and copy it over the old one.
(Remember that "cp" overwrites without warning!)
Code:
[SIZE=2]zip hacked_adt[/SIZE]
[SIZE=2]cp hacked_adt.zip /path/to/eclipse/plugins/com.android.ide.eclipse.adt_18.0.0.v201203301601-306762.jar[/SIZE]
You Are Done!
Enjoy your newly hacked Eclipse! ​Errors
If you get any errors;
1. make sure you have zipped up everything properly as warned before.
2. make sure you have included Google API packages in your BOOTCLASSPATH in step (3).
3. Try to "clean-up" the Java by: "Right-Click" ==> Source ==> "Clean Up...".
4. Google them
5. Ignore them
6. Give up. Not! But I can't help you!
If it still doesn't work, try to download inazaruk's pre-compiled set of internal android.jar's from here.
(For android 7,8,10,15.)
​
WIP! <here be dragons2>
For a project using internal package imports, see my thread:
"[TOOL][APP][WIP] Native AT Command Injector"
<here be more dragons>
Following the instructions in posts 1-2 above, may not always work. It is not known to me at this time, why it shouldn't. One theory is that it can have something to do with how Eclipse and Android.jar is packaging their files and the resulting sizes.
This was mentioned in this Stackoverflow post:
"Jar files: why does extracting then compression a jar file create a file of a different size to the original?"
Then reading the man pages for "jar" we can inform ourselves with:
Code:
[SIZE=2] c Creates a new archive file named jarfile (if f is specified) or to
standard output (if f and jarfile are omitted). Add to it the
files and directories specified by inputfiles.
u Updates an existing file jarfile (when f is specified) by adding
to it files and directories specified by inputfiles.
x Extracts files and directories from jarfile (if f is specified) or
standard input (if f and jarfile are omitted). If inputfiles is
specified, only those specified files and directories are
extracted. Otherwise, all files and directories are extracted.
t Lists the table of contents from jarfile (if f is specified) or
standard input (if f and jarfile are omitted). If inputfiles is
specified, only those specified files and directories are listed.
Otherwise, all files and directories are listed.
i Generate index information for the specified jarfile and its
dependent jar files.
[/SIZE]
More info is provided here:
The JAR Overview @
http://java.sun.com/javase/6/docs/technotes/guides/jar/jarGuide.html
The JAR File Specification @
http://java.sun.com/javase/6/docs/technotes/guides/jar/jar.html
The JARIndex Spec @
http://java.sun.com/javase/6/docs/technotes/guides/jar/jar.html
JAR Tutorial @
http://java.sun.com/docs/books/tutorial/jar/
pack200 Reference Page @
http://java.sun.com/javase/6/docs/technotes/tools/share/pack200.html
Another theory is that it may have something to do with what seem to be, that Google have revoked the the use of MODIFY_PHONE_STATE since Android 2.3, and that this influences the Eclipse behavior, when using and modifying older android.jar's. This was mentioned here and here.
Any help would be very much appreciated!
< bump >
Hi, thanks for the info, I made it using linux and worked really nice, these were the lines that I used, hope be useful.
This is my Android folder at home
Code:
Android/
├── eclipse
├── ndk
├── platforms-internals
├── sdk
└── tools
Start an avd running the desired API to modify in this case API-17
Code:
$ emulator -avd avd_api_17 -no-window &
Get the framework
Code:
$ cd ~/Android/
$ mkdir _framework
$ cd _framework
$ adb -s emulator-5554 pull /system/framework .
Grab BOOTCLASSPATH
Code:
$ adb -s emulator-5554 shell cat init.rc | grep BOOTCLASSPATH > bootclasspath
I didn't have the tools used in this tutorial, so I included the steps for getting them
Decompile with baskmali
Code:
$ cd ~/Android/tools
$ wget https://smali.googlecode.com/files/baksmali-1.4.2.jar
$ cd ~/Android/_framework
$ java -Xmx1024m -jar ../tools/baksmali-1.4.2.jar -a 17 -c core.jar:core-junit.jar:bouncycastle.jar:ext.jar:framework.jar:telephony-common.jar:mms-common.jar:android.policy.jar:services.jar:apache-xml.jar -x framework.odex
The parameter -a for baksmali refers to the API we are working with.
Generate out.dex with smali
Code:
$ cd ~/Android/tools
$ wget https://smali.googlecode.com/files/smali-1.4.2.jar
$ cd ~/Android/_framework
$ java -jar ../tools/smali-1.4.2.jar out
Get internal and hidden classes using dex2jar
Code:
$ cd ~/Android
$ wget https://dex2jar.googlecode.com/files/dex2jar-0.0.9.15.zip
$ unzip dex2jar-0.0.9.15.zip
$ rm dex2jar-0.0.9.15.zip
$ cd _framework/
$ ../tools/dex2jar-0.0.9.15/d2j-dex2jar.sh out.dex
$ unzip out-dex2jar.jar -d framework-classes
Add these classes to plataform's default android.jar
Code:
$ cd ~/Android
$ unzip sdk/platforms/android-17/android.jar -d custom-android
$ cp -r _framework/framework-classes/* custom-android/
$ rm -r _framework
$ cd custom-android
$ zip -r ../custom-android.jar *
$ cd ..
$ rm -r custom-android
Create new extended platform
Code:
$ cd ~/Android
$ cp -r sdk/platforms/android-17 platforms-internals/android-17-internals
$ mv custom-android.jar platforms-internals/android-17-internals/android.jar
$ vi platforms-internals/android-17-internals/build.prop
ro.build.version.release=4.2.2
ro.build.version.release=4.2.2.internal
$ ln -s ~/Android/platforms-internals/android-17-internals ~/Android/sdk/platforms/android-17-internals
I use a symlink for keep it a little organized
Hack ADT
Code:
$ cd ~/Android
$ unzip eclipse/plugins/com.android.ide.eclipse.adt_22.0.4.v201307151829--741630.jar -d hacked_adt
Go to right folder
Code:
$ cd hacked_adt/com/android/ide/eclipse/adt/internal/project/
Find file where is our desired string
Code:
$ strings -f -a -t x * | grep "android\/internal"
Edit with an hex editor
Code:
$ bless AndroidClasspathContainerInitializer.class &
Here we change the l for the x.
Replace original file making a backup
Code:
$ cd ~/Android
$ cp eclipse/plugins/com.android.ide.eclipse.adt_22.0.4.v201307151829--741630.jar eclipse/plugins/com.android.ide.eclipse.adt_22.0.4.v201307151829--741630.jar.original
$ cd hacked_adt/
$ zip -r ../eclipse/plugins/com.android.ide.eclipse.adt_22.0.4.v201307151829--741630.jar *
$ cd ..
$ rm -r hacked_adt
This worked for me... thanks E:V:A
I got just one error related to a dropbox class, but i think this is not important... hope that
lenieto3 said:
...Start an avd running the desired API to modify in this case API-17... This worked for me... I got just one error related to a dropbox class, but i think this is not important...
Click to expand...
Click to collapse
Thanks and sorry for late reply. I'm very happy to hear these instructions still works with API-17! Could you also upload your hacked JAR somewhere so that people can save some time when experimenting?
I was just here to check-in and try to bump this thread to see if it is still useful to anyone.
E:V:A said:
Thanks and sorry for late reply. I'm very happy to hear these instructions still works with API-17! Could you also upload your hacked JAR somewhere so that people can save some time when experimenting?
I was just here to check-in and try to bump this thread to see if it is still useful to anyone.
Click to expand...
Click to collapse
ive got access to ActivityManager's hidden methods.
I want to use the removeTask method, but it keeps saying that I dont have the REMOVE_TASKS permissions even though I added it to the manifest (and turned off lint).
Permission Denial: removeTask() from pid=9963, uid=10179 requires android.permission.REMOVE_TASKS
Does someone know if there are any automated tools to do/performs steps 1-9?
I'd like to see a tool to automatically pull (from phone), extract and create a compatible android.jar.
@Mohammad_Adib: Sorry, this is the wrong thread for those type of questions.
see this link stackoverflow.com|questions|30656933|android-system-framework-jar-files

[TOOL][WINDOWS][RECOVERY][SYSTEM][SNAPS][VIDEO][GUI]android-shot! (version 2.1)

#android-shot
#your one stop screenshot solution!
#screenshot recovery for windows!
#screenshot system for windows!
#video_record recovery for windows!
#video_record system for windows!
Looking for a Linux Version???
Go Here: http://forum.xda-developers.com/showthread.php?t=2260704
This solely uses the SD Card, which, by default is always kept mounted by
a partition. So, you wouldn't run into any trouble except when you try to
partition or format the SD Card.
I repeat, no need to mount any partition... By default, the SD Card is always mounted, so, I thought using it will be way better than using the /data partition
To take a screenshot:
Code:
Run "shot.bat"
Your screenshot will be saved in a folder named screenshots automatically.
To capture video:
Code:
Run "record.bat"
Press "Ctrl+C" when you have finished recording.
This will basically start recording your screen frame by frame, and automatically
save it in your SD card. Note that recording the video alone is not enough.
Do the following to pull those frames from the SD card, and make a video out of them.
Code:
Run "mkvideo.bat"
Enter the Name that you want to name your video. DON'T ADD AN EXTENSION!
The files will be collected from the SD Card, and a video will be made out
of them. Then, the temporary files will be cleaned automatically, from both
your SD card, and your system.
Downloads:
Version 2.1 (GUI) (Android-Andi): http://forum.xda-developers.com/showpost.php?p=45891403&postcount=59
Version 2.1.3 (Android-Andi): http://forum.xda-developers.com/showpost.php?p=44447366&postcount=40
Version 2.1.2 (Android-Andi): http://forum.xda-developers.com/showpost.php?p=44288806&postcount=36
Version 2.0.1 (Android-Andi): http://forum.xda-developers.com/showpost.php?p=44011267&postcount=17
Version 2.0 (Thanks to Android-Andi): http://forum.xda-developers.com/showpost.php?p=43982996&postcount=12
Version 1.0: http://www.mediafire.com/download/26gi88xdd5c6rly/android-shot_windows.zip
Note: A GUI version can be found here: http://forum.xda-developers.com/showpost.php?p=45891403&postcount=59
Not personally tested by me, as I don't have the appropriate tools (i.e. windows) no more...
Credits:
Kyan He (https://plus.google.com/116857119889961125943) and his wonderful tool "fb2png" (https://code.google.com/p/android-fb2png/)
Whiskey103 (http://forum.xda-developers.com/member.php?u=2632943) and his guide (http://forum.xda-developers.com/showthread.php?p=40260716) on taking screenshot in windows.
Android-Andi (http://forum.xda-developers.com/member.php?u=5153662) for version 2.0 and some cool ideas
Sample:
Recovery!
Recovery & System Video Sample! [With instructions ]
not working and said
"ECHO off 'and' is not recognized as an internal or external command, operable program or batch file.
'C:\Doccuments' is not recognized as an internal or external command, operable program or batch file.
will try your linux version, when get home
Strange....
antutu said:
not working and said
"ECHO off 'and' is not recognized as an internal or external command, operable program or batch file.
'C:\Doccuments' is not recognized as an internal or external command, operable program or batch file.
will try your linux version, when get home
Click to expand...
Click to collapse
Anyways, thanks for your report
I will look into it, as soon as possible
P.S. Only problem is... I don't have Windows :silly: So, it would be a beta :angel:
vineethraj49 said:
Anyways, thanks for your report
I will look into it, as soon as possible
P.S. Only problem is... I don't have Windows :silly: So, it would be a beta :angel:
Click to expand...
Click to collapse
Take your time mate:thumbup:
Sorry bro i just found out how this can work out
I've to put it in root folder
It's working great now:thumbup::thumbup:
Thanks al lot! That´s what i was looking for.
I tried to get better Video-Quality (libx264 as *.mp4).
I modified the .bat
Code:
ECHO off
REM snaps mode
REM fb2png credits go to respective developers
REM thanks to whiskey103 for his screenshot.bat for windows
REM thanks to vineethraj49 for his mkvideo.bat (video as *.avi)
REM thanks to me and my computer
IF EXIST %~dp0tmp ECHO tmp directory found! :)
IF NOT EXIST %~dp0tmp ECHO tmp directory not found! :( && MKDIR tmp && ECHO initialised new tmp directory! :)
IF EXIST %~dp0output_video ECHO output_video directory found! :)
IF NOT EXIST %~dp0output_video ECHO output_video directory not found! :( && MKDIR output_video && ECHO initialised new output_video directory! :)
%~dp0tools\adb pull /sdcard/fb2png/screens/ tmp
SET /P name=Enter the name for your video:
%~dp0tools\ffmpeg.exe -f image2 -r 2 -i tmp/1%%09d.png -c:v libx264 -r 30 output_video/%name%.mp4
%~dp0tools\adb shell rm /sdcard/fb2png/screens/*
rm tmp/*
REM hit enter to exit
pause
Someone knows how to make the quality better then with my modified bat?
Me again:
To use your shot.bat i had to download 2 *.dll´s to get "date.exe" working (libiconv2.dll and libintl3.dll). Without these .dll screenshot not possible.
Maybe you can add these two *.dll into your tool directory (don´t know if it´s allowed, check it here).
Download (GnuWin) Libintl.exe(?) from here and install it.
You´ll find the 2 needed *.dll at "C:\Program Files (x86)\GnuWin32\bin".
I´m, running Windows 8 Pro.
Maybe you can add (after changeing directory path) my modified "record.bat" for taking screenshots from running androidsystem
Code:
@ECHO off
REM Record_running_Android
IF EXIST %~dp0new ECHO new directory found! :)
IF NOT EXIST %~dp0new ECHO new directory not found! :(
mkdir new
ECHO initialised new directory! :)
:loop
%~dp0tools\adb shell screencap -p /extSdCard/screen.png
%~dp0tools\adb pull /extSdCard/screen.png %~dp0new
%~dp0tools\adb shell rm /extSdCard/screen.png
FOR /F "tokens=*" %%i in ('%~dp0tools\date.bat') do SET DATE=%%i
MOVE %~dp0new\screen.png %~dp0new\%DATE%.png
goto loop
pause
I´m using extSdCard as directory, because my Micro-SD-Card is mounted there.
Maybe change it like this:
Code:
@ECHO off
REM Record_running_Android
IF EXIST %~dp0new ECHO new directory found! :)
IF NOT EXIST %~dp0new ECHO new directory not found! :(
mkdir new
ECHO initialised new directory! :)
:loop
%~dp0tools\adb shell screencap -p /sdcard/screen.png
%~dp0tools\adb pull /sdcard/screen.png %~dp0new
%~dp0tools\adb shell rm /sdcard/screen.png
FOR /F "tokens=*" %%i in ('%~dp0tools\date.bat') do SET DATE=%%i
MOVE %~dp0new\screen.png %~dp0new\%DATE%.png
goto loop
pause
Whoa! Someone actually cares
Android-Andi said:
Thanks al lot! That´s what i was looking for.
I tried to get better Video-Quality (libx264 as *.mp4).
I modified the .bat
Code:
ECHO off
REM snaps mode
REM fb2png credits go to respective developers
REM thanks to whiskey103 for his screenshot.bat for windows
REM thanks to vineethraj49 for his mkvideo.bat (video as *.avi)
REM thanks to me and my computer
IF EXIST %~dp0tmp ECHO tmp directory found! :)
IF NOT EXIST %~dp0tmp ECHO tmp directory not found! :( && MKDIR tmp && ECHO initialised new tmp directory! :)
IF EXIST %~dp0output_video ECHO output_video directory found! :)
IF NOT EXIST %~dp0output_video ECHO output_video directory not found! :( && MKDIR output_video && ECHO initialised new output_video directory! :)
%~dp0tools\adb pull /sdcard/fb2png/screens/ tmp
SET /P name=Enter the name for your video:
%~dp0tools\ffmpeg.exe -f image2 -r 2 -i tmp/1%%09d.png -c:v libx264 -r 30 output_video/%name%.mp4
%~dp0tools\adb shell rm /sdcard/fb2png/screens/*
rm tmp/*
REM hit enter to exit
pause
Someone knows how to make the quality better then with my modified bat?
Click to expand...
Click to collapse
Remember that the *quality* is always the same. It pulls the images (frames) in the same resolution as of your phone. If you are talking about the FPS, you should modify this line...
Code:
ffmpeg -r 4
The -r switch controls the FPS.
Again, the FPS depends upon how many screens are actually captured by your device. If you have a fast SD-Card, and a fast processor, it is indeed likely that the frames captured would be more. You can try increasing the -r 4 by 2/3 frames and see if the video is suitable to your needs. (eg. -r 5/ -r 6, etc...)
Android-Andi said:
Me again:
To use your shot.bat i had to download 2 *.dll´s to get "date.exe" working (libiconv2.dll and libintl3.dll). Without these .dll screenshot not possible.
Maybe you can add these two *.dll into your tool directory (don´t know if it´s allowed, check it here).
Download (GnuWin) Libintl.exe(?) from here and install it.
You´ll find the 2 needed *.dll at "C:\Program Files (x86)\GnuWin32\bin".
I´m, running Windows 8 Pro.
Click to expand...
Click to collapse
Didn't know about that... It worked for me without those two DLLs. Anyways, I will just add it for safety.
Android-Andi said:
Maybe you can add (after changeing directory path) my modified "record.bat" for taking screenshots from running androidsystem
Code:
@ECHO off
REM Record_running_Android
IF EXIST %~dp0new ECHO new directory found! :)
IF NOT EXIST %~dp0new ECHO new directory not found! :(
mkdir new
ECHO initialised new directory! :)
:loop
%~dp0tools\adb shell screencap -p /extSdCard/screen.png
%~dp0tools\adb pull /extSdCard/screen.png %~dp0new
%~dp0tools\adb shell rm /extSdCard/screen.png
FOR /F "tokens=*" %%i in ('%~dp0tools\date.bat') do SET DATE=%%i
MOVE %~dp0new\screen.png %~dp0new\%DATE%.png
goto loop
pause
I´m using extSdCard as directory, because my Micro-SD-Card is mounted there.
Maybe change it like this:
Code:
@ECHO off
REM Record_running_Android
IF EXIST %~dp0new ECHO new directory found! :)
IF NOT EXIST %~dp0new ECHO new directory not found! :(
mkdir new
ECHO initialised new directory! :)
:loop
%~dp0tools\adb shell screencap -p /sdcard/screen.png
%~dp0tools\adb pull /sdcard/screen.png %~dp0new
%~dp0tools\adb shell rm /sdcard/screen.png
FOR /F "tokens=*" %%i in ('%~dp0tools\date.bat') do SET DATE=%%i
MOVE %~dp0new\screen.png %~dp0new\%DATE%.png
goto loop
pause
Click to expand...
Click to collapse
You could change it yourself... Reason why I wouldn't change it? Because different devices have different mount points. If it is extSDcard, you can change accordingly. (If that wasn't the point, please clarify the last post. I understood it as: my mountpoint for sdcard is different :silly
p.s. thanks.. i was thinking no one cared
vineethraj49 said:
Remember that the *quality* is always the same. It pulls the images (frames) in the same resolution as of your phone. If you are talking about the FPS, you should modify this line...
Code:
ffmpeg -r 4
The -r switch controls the FPS.
Again, the FPS depends upon how many screens are actually captured by your device. If you have a fast SD-Card, and a fast processor, it is indeed likely that the frames captured would be more. You can try increasing the -r 4 by 2/3 frames and see if the video is suitable to your needs. (eg. -r 5/ -r 6, etc...)
Click to expand...
Click to collapse
This will change how long the picture stays (i set it down to 2, beacause in my case it was to fast).
MP4 and libx264 codec will give you better quality. I tested it yesterday the whole evening Trust me. Screenshot added (mp4 more clearly).
Try that one (video looks better):
Code:
ECHO off
REM snaps mode
REM fb2png credits go to respective developers
REM thanks to whiskey103 for his screenshot.bat for windows
REM thanks to vineethraj49 for his mkvideo.bat (video as *.avi)
REM thanks to me and my computer
IF EXIST %~dp0tmp ECHO tmp directory found! :)
IF NOT EXIST %~dp0tmp ECHO tmp directory not found! :( && MKDIR tmp && ECHO initialised new tmp directory! :)
IF EXIST %~dp0output_video ECHO output_video directory found! :)
IF NOT EXIST %~dp0output_video ECHO output_video directory not found! :( && MKDIR output_video && ECHO initialised new output_video directory! :)
%~dp0tools\adb pull /sdcard/fb2png/screens/ tmp
SET /P name=Enter the name for your video:
%~dp0tools\ffmpeg.exe -f image2 -r 2 -i tmp/1%%09d.png -c:v libx264 -r 30 output_video/%name%.mp4
%~dp0tools\adb shell rm /sdcard/fb2png/screens/*
rm tmp/*
REM hit enter to exit
pause
vineethraj49 said:
Didn't know about that... It worked for me without those two DLLs. Anyways, I will just add it for safety.
Click to expand...
Click to collapse
Adding will take you on the safe side Thanks I think they are under GPLv2, but i´m not shure.
You can also download libiconv-1.9.2-1-bin.zip and libintl-0.14.4-bin.zip. DLL´s are in the "bin" directory after extracting.
vineethraj49 said:
You could change it yourself... Reason why I wouldn't change it? Because different devices have different mount points. If it is extSDcard, you can change accordingly. (If that wasn't the point, please clarify the last post. I understood it as: my mountpoint for sdcard is different :silly
Click to expand...
Click to collapse
Code:
[user=279333]@ECHO[/user] off
REM Record_running_Android
IF EXIST %~dp0new ECHO new directory found! :)
IF NOT EXIST %~dp0new ECHO new directory not found! :(
mkdir new
ECHO initialised new directory! :)
:loop
%~dp0tools\adb shell screencap -p /sdcard/screen.png
%~dp0tools\adb pull /sdcard/screen.png %~dp0new
%~dp0tools\adb shell rm /sdcard/screen.png
FOR /F "tokens=*" %%i in ('%~dp0tools\date.bat') do SET DATE=%%i
MOVE %~dp0new\screen.png %~dp0new\%DATE%.png
goto loop
pause
Internal SD? Same path you use in your batch-scripts. Should work for everyone.
[The Script i posted before was for use on micro-sd (working for my device) - i have changed it later ( ) to use on internal-sd for everyone]
Only one problem: the name of the files... can´t use the mkvideo.bat to make a video... i had to rename them after captureing using Ant Renamer2.
But you can add the 2 .bat from me as a "Bonus" into your zip if you want.
Sure!
Android-Andi said:
This will change how long the picture stays (i set it down to 2, beacause in my case it was to fast).
MP4 and libx264 codec will give you better quality. I tested it yesterday the whole evening Trust me. Screenshot added (mp4 more clearly).
Try that one (video looks better):
Code:
ECHO off
REM snaps mode
REM fb2png credits go to respective developers
REM thanks to whiskey103 for his screenshot.bat for windows
REM thanks to vineethraj49 for his mkvideo.bat (video as *.avi)
REM thanks to me and my computer
IF EXIST %~dp0tmp ECHO tmp directory found! :)
IF NOT EXIST %~dp0tmp ECHO tmp directory not found! :( && MKDIR tmp && ECHO initialised new tmp directory! :)
IF EXIST %~dp0output_video ECHO output_video directory found! :)
IF NOT EXIST %~dp0output_video ECHO output_video directory not found! :( && MKDIR output_video && ECHO initialised new output_video directory! :)
%~dp0tools\adb pull /sdcard/fb2png/screens/ tmp
SET /P name=Enter the name for your video:
%~dp0tools\ffmpeg.exe -f image2 -r 2 -i tmp/1%%09d.png -c:v libx264 -r 30 output_video/%name%.mp4
%~dp0tools\adb shell rm /sdcard/fb2png/screens/*
rm tmp/*
REM hit enter to exit
pause
Adding will take you on the safe side Thanks I think they are under GPLv2, but i´m not shure.
You can also download libiconv-1.9.2-1-bin.zip and libintl-0.14.4-bin.zip. DLL´s are in the "bin" directory after extracting.
Code:
[user=279333]@ECHO[/user] off
REM Record_running_Android
IF EXIST %~dp0new ECHO new directory found! :)
IF NOT EXIST %~dp0new ECHO new directory not found! :(
mkdir new
ECHO initialised new directory! :)
:loop
%~dp0tools\adb shell screencap -p /sdcard/screen.png
%~dp0tools\adb pull /sdcard/screen.png %~dp0new
%~dp0tools\adb shell rm /sdcard/screen.png
FOR /F "tokens=*" %%i in ('%~dp0tools\date.bat') do SET DATE=%%i
MOVE %~dp0new\screen.png %~dp0new\%DATE%.png
goto loop
pause
Internal SD? Same path you use in your batch-scripts. Should work for everyone.
[The Script i posted before was for use on micro-sd (working for my device) - i have changed it later ( ) to use on internal-sd for everyone]
Only one problem: the name of the files... can´t use the mkvideo.bat to make a video... i had to rename them after captureing using Ant Renamer2.
But you can add the 2 .bat from me as a "Bonus" into your zip if you want.
Click to expand...
Click to collapse
cool! i have no objection. as of mp4 encoding too, you could add it as a feature, but do release it in this thread only. I sure would give you credits for a version 2.0 :angel: i don't want xda to be weeded by one more thread. there are already many (by a gazillion n00bs )
I did some cool batch-scripts (modified scripts from yours). You can download from here. Extract and copy the *.bat into the android-shot folder.
What have i done?
E.g. you can set a different path for storing the *.png on your device untill they get pulled. You can also change the destination-folder (on your local computer).
(All codes only from line 7 to ~ line 15 in batch-script)
1. batch: screenshot_recovery-universal.bat
Click to expand...
Click to collapse
Code:
REM Please enter the path where your internalstorage or micro-SD is mounted in recovery
[COLOR="Red"]set extpath=/sdcard[/COLOR]
REM
REM E.g. set "extpath=/extSdCard" if your micro-sd is mounted at /extSdCard.
REM (default-path: /sdcard for internal storage)
REM
REM
REM Please enter the name of your destinationfolder on your computer:
[COLOR="Red"]set pngpath=screenshots[/COLOR]
REM (default-path:screenshots)
Mountpoint of micro SD is different on any devices, you can change it to your´s.
You can change also the destination folder - but leave it as it is If you do: you have to change it in the converting-video batch-script too.
2. batch: record_recovery-universal.bat
Click to expand...
Click to collapse
Code:
REM Please enter the path where your internalstorage or micro-SD is mounted in recovery:
[COLOR="Red"]set extpath=/sdcard[/COLOR]
REM e.g. set "extpath=/external_sd" if your micro-sd is mounted IN RECOVERY at /external_sd
REM (default-path: /sdcard for internal storage)
Mountpoint of micro SD is different on any devices, you can change it to your´s.
3. batch: record_running_android-universal.bat
Click to expand...
Click to collapse
Code:
REM Please enter the path where your internalstorage or micro-SD is mounted:
[COLOR="Red"]set extpath=/sdcard[/COLOR]
REM E.g. set "extpath=/extSdCard" if your micro-sd is mounted at /extSdCard
REM (default-path: /sdcard for internal storage)
REM
REM
REM
REM Please enter the name of your destinationfolder on your computer:
[COLOR="Red"]set destpath=tmpandroid[/COLOR]
REM (default-path: tmpandroid)
Mountpoint of micro SD is different on any devices, you can change it to your´s.
You can change also the destination folder - but leave it as it is If you do: You have to change it in the converting-video batch-script too.
4. batch: mkvideo_mp4_recovery-universal.bat
Click to expand...
Click to collapse
Code:
REM Please enter the path where your internalstorage or micro-SD is mounted in recovery
[COLOR="Red"]set extpath=/sdcard[/COLOR]
REM e.g. set "extpath=/external_sd" if your micro-sd is mounted IN RECOVERY at /external_sd
REM (default-path: /sdcard for internal storage)
REM
REM
REM Please enter the name of your png-folder on your computer
REM (same as "destpath" in record_recovery-universal.bat)
[COLOR="Red"]set pngpath=tmp[/COLOR]
REM (default-path:tmp - if you have modified the path do the same here)
Mountpoint of micro SD is different on any devices, you can change it to your´s. If you have changed it in the record_recover-batch-script - you have to do it too.
You can change also the destination folder - but leave it as it is If you have changed it in the record_recovery-batch-script - you have to do it too.
5. batch: mkvideo_mp4_running_android-universal.bat
Click to expand...
Click to collapse
Code:
REM Please enter the name of your png-folder on your computer
REM (same as "destpath" in record_runnning_android-universal.bat)
[COLOR="Red"]set pngpath=tmpandroid[/COLOR]
REM (default-path:tmpandroid - if you have modified the path do the same here)
You can change also the png folder - but leave it as it is If you have changed it in the record_running_android-batch-script - you have to do it too.
Please use Notepad++ if you want to change something in the batch-script.
For watching the .mp4 you can use Media Player Home Cinema.
Cool, but, one small change that I would like to say...
Android-Andi said:
I did some cool batch-scripts (modified scripts from yours). You can download from here. Extract and copy the *.bat into the android-shot folder.
What have i done?
E.g. you can set a different path for storing the *.png on your device untill they get pulled. You can also change the destination-folder (on your local computer).
(All codes only from line 7 to ~ line 15 in batch-script)
Code:
REM Please enter the path where your internalstorage or micro-SD is mounted in recovery
[COLOR="Red"]set extpath=/sdcard[/COLOR]
REM
REM E.g. set "extpath=/extSdCard" if your micro-sd is mounted at /extSdCard.
REM (default-path: /sdcard for internal storage)
REM
REM
REM Please enter the name of your destinationfolder on your computer:
[COLOR="Red"]set pngpath=screenshots[/COLOR]
REM (default-path:screenshots)
Mountpoint of micro SD is different on any devices, you can change it to your´s.
You can change also the destination folder - but leave it as it is If you do: you have to change it in the converting-video batch-script too.
Code:
REM Please enter the path where your internalstorage or micro-SD is mounted in recovery:
[COLOR="Red"]set extpath=/sdcard[/COLOR]
REM e.g. set "extpath=/external_sd" if your micro-sd is mounted IN RECOVERY at /external_sd
REM (default-path: /sdcard for internal storage)
Mountpoint of micro SD is different on any devices, you can change it to your´s.
Code:
REM Please enter the path where your internalstorage or micro-SD is mounted:
[COLOR="Red"]set extpath=/sdcard[/COLOR]
REM E.g. set "extpath=/extSdCard" if your micro-sd is mounted at /extSdCard
REM (default-path: /sdcard for internal storage)
REM
REM
REM
REM Please enter the name of your destinationfolder on your computer:
[COLOR="Red"]set destpath=tmpandroid[/COLOR]
REM (default-path: tmpandroid)
Mountpoint of micro SD is different on any devices, you can change it to your´s.
You can change also the destination folder - but leave it as it is If you do: You have to change it in the converting-video batch-script too.
Code:
REM Please enter the path where your internalstorage or micro-SD is mounted in recovery
[COLOR="Red"]set extpath=/sdcard[/COLOR]
REM e.g. set "extpath=/external_sd" if your micro-sd is mounted IN RECOVERY at /external_sd
REM (default-path: /sdcard for internal storage)
REM
REM
REM Please enter the name of your png-folder on your computer
REM (same as "destpath" in record_recovery-universal.bat)
[COLOR="Red"]set pngpath=tmp[/COLOR]
REM (default-path:tmp - if you have modified the path do the same here)
Mountpoint of micro SD is different on any devices, you can change it to your´s. If you have changed it in the record_recover-batch-script - you have to do it too.
You can change also the destination folder - but leave it as it is If you have changed it in the record_recovery-batch-script - you have to do it too.
Code:
REM Please enter the name of your png-folder on your computer
REM (same as "destpath" in record_runnning_android-universal.bat)
[COLOR="Red"]set pngpath=tmpandroid[/COLOR]
REM (default-path:tmpandroid - if you have modified the path do the same here)
You can change also the png folder - but leave it as it is If you have changed it in the record_running_android-batch-script - you have to do it too.
Please use Notepad++ if you want to change something in the batch-script.
For watching the .mp4 you can use Media Player Home Cinema.
Click to expand...
Click to collapse
drawbacks of your method :fingers-crossed: :
not all devices are fast enough to process the "capture>pull>remove" loop which you have implemented.
except that, awesomeness quotient is great. you have added support for capturing the screen while android is running in normal mode :victory:
It can be just downloaded and extracted into the folder where you already have the files... releasing it as version 2.0
p.s. Guess its time for me to update the linux version
vineethraj49 said:
drawbacks of your method :fingers-crossed: :
not all devices are fast enough to process the "capture>pull>remove" loop which you have implemented.
Click to expand...
Click to collapse
Maybe i can make 2 batch files (pulling as a second step). Maybe add the pull line into the "mkvideo_mp4_running_android-universal.bat".
I can test it after sleeping :silly:
And you´re right: its not so fast like in recovery (on my Galaxy Tab 2 7.0 P3110)
vineethraj49 said:
except that, awesomeness quotient is great. you have added support for capturing the screen while android is running in normal mode :victory:
Click to expand...
Click to collapse
Thank you Thanks for your great work before my modification - my modification wouldn´t be possible without you :good:
vineethraj49 said:
It can be just downloaded and extracted into the folder where you already have the files... releasing it as version 2.0
p.s. Guess its time for me to update the linux version
Click to expand...
Click to collapse
Do it
Because i´m not running a linux i couldn´t make it (and i´m not that good at linux).
Maybe i can make 2 batch files (pulling as a second step). Maybe add the pull line into the "mkvideo_mp4_running_android-universal.bat".
I can test it after sleeping :silly:
And you´re right: its not so fast like in recovery (on my Galaxy Tab 2 7.0 P3110)
Click to expand...
Click to collapse
Yeah, recovery... too slow
Thank you Thanks for your great work before my modification - my modification wouldn´t be possible without you :good:
Click to expand...
Click to collapse
Thank Kyan He and Whiskey103 too
Do it
Because i´m not running a linux i couldn´t make it (and i´m not that good at linux).
Click to expand...
Click to collapse
https://github.com/vineethraj49/android-shot
If you are interested, you can send in pull requests to https://github.com/vineethraj49/android-shot/tree/windows. PM me if interested to maintain the git,I will add you as a collaborator.
vineethraj49 said:
Yeah, recovery... too slow
Thank Kyan He and Whiskey103 too
https://github.com/vineethraj49/android-shot
If you are interested, you can send in pull requests to https://github.com/vineethraj49/android-shot/tree/windows. PM me if interested to maintain the git,I will add you as a collaborator.
Click to expand...
Click to collapse
sure, big thank @ Kyan He and Whiskey103 too!
i'll release update 2.0.1 later. i'm working on it. PM to you later.
pull won't work on windows. i tryed over vbs but didn't got it work.
Version 2.0.1 (extra batch-files)​
Download 2.0.1 from here
Installation:
Download and extract V 1.0 from op.
Extract "universal-bat2.0.1.zip" and copy all *.bat to "android-shot" directory.
Changes:
Code:
[LIST][*]not pulling data from your device (slowed down the recording process) @ record_running_android-universal.bat
[*]pulling before converting (better for recording process) @ mkvideo_mp4_running_android-universal.bat[/LIST]
How-To make a video in recovery:
1. start "record_recovery-universal.bat" (press CTRL + C if you are finished)
2. start "mkvideo_mp4_recovery-universal.bat" and follow the instructions.
How-To make a video in running android:
1. start "record_running_android-universal.bat" (press CTRL + C if you are finished)
2. start "mkvideo_mp4_running_android-universal.bat" and follow the instructions.
You can change the path from sdcard (default) to your micro-SD like before (different devices = different mountpoints) (instructions)
Thanks
@vineethraj49
Kyan He (https://plus.google.com/116857119889961125943) and his wonderful tool "fb2png" (https://code.google.com/p/android-fb2png/)
Whiskey103 (http://forum.xda-developers.com/member.php?u=2632943) and his guide (http://forum.xda-developers.com/showthread.php?p=40260716) on taking screenshot in windows.
Edit 30.07.2013:
Changed Download-Link, still 2.0.1 (some UI changes of the running batch)
time to update thread title I guess!
@Android-Andi, could you post a video for android_running_system for video recording as a sample?
vineethraj49 said:
@Android-Andi, could you post a video for android_running_system for video recording as a sample?
Click to expand...
Click to collapse
Shure,can do it next days,maybe today.
for rooted devices
is there anyby some gesture

[UBUNTU][DEBIAN]Common Commands used in Linux

Common Commands used in Linux.
Since, Android is based on Linux, there is much possibility that there is a need to use a Linux based OS. For such use, UBUNTU
is favoured, for its easy and more user friendly.
Today, I am going to Post a few commands that are very useful to the newbies to development
I myself am new, and have faced many problems with this, so I am posting a this thread, to help all the noobs/newbies find what they need in a single place
Okay so, lets start with some basic commands, which can be classified as general commands, and each Linux user MUST KNOW ALL OF THEM !!
Code:
sudo
It simply means "Superuser do". It requires password.
Code:
sudo apt-get install APPLICATION_name
This installs the application finding it on the internet, and gives you the suitable output(If the app exists or not).
Code:
sudo apt-get remove APPLICATION_name
It Removes the application
Code:
sudo apt-get update
it updates the repositories
Code:
sudo apt-get upgrade
upgrades your installed application with their latest versions from Ubuntu repositories
Code:
killall APPLICATION_NAME
kills (terminates) an application
Code:
ps -e
displays currently running processes
Code:
kill APPLICATION_PID
kills an application; where APPLICATION_PID.
NOTE: YOU CAN FIND "PID" USING EARLIER CODE.
Code:
wget http://path_to_file.com
downloads a file from the web to current directory
Code:
cd /PATH/TO/DIR
changes current directory to DIR. Use cd to change the current directory into any dir
Code:
cd ..
Like ms-dos, goes up one directory
Code:
dir
OR
Code:
ls
lists directory content
Code:
man COMMAND
Displays manual for command.
eg: man sudo
Code:
cp ORIGINALFILE NEWFILE
Copy a file
Code:
mv SOURCE DESTINATION
Moves a file
NOTE: YOU CAN ALSO RENAME A FILE WITH THIS.
EG: mv old_filename new_filename
Code:
mkdir FOLDERNAME
Make a directory/folder
Miscellaneous: Level 2
Code:
du -sh folder name
This calculates the size of the folder
Code:
ps -aux
This shows all the running processes
Code:
chown -R User:User dir
Change owner of files and directories
Code:
chmod 777 yourScript
This makes a shell script ".sh" extension
Code:
netstat -anltp | grep "LISTEN"
See all open ports on your machine
Code:
sudo apt-get install ufw
sudo ufw allow 80/tcp
sudo ufw allow 22/tcp
sudo ufw allow 443/tcp
sudo ufw allow 21/tcp
sudo ufw enable
Ubuntu provides a uncomplicated firewall (ufw). To install it and only allow SSH, FTP, and webtraffic use the following command.
Network Commands
Code:
ifconfig
Shows the network connections
WILL UPDATE REGULARLY AS MUCH I COULD.
Code:
passwd
Run after installing Linux when you see "[email protected]:~$" to set your root pass word
Code:
adduser
Replace and run to add a new user
Code:
adduser sudo
Replace and run to add that user to sudo
Code:
sudo apt-get purge
Replace and run to purge your system of that package
Code:
apt-cache search
Replace and run to search for new packages to install
Note: "wild cards" eg "*" are acceptable
Code:
find -type f -iname 'some-compressed-file*' -print0 | xargs -0 sudo tar -vxpzf
Replace with at least the "root" directory you want to search through and Replace " some-compressed-file " (leave the single quotes ' ' and the wild card *) and run to find every file under the given directory that has that name and the pipe " | " it out to tar so that'll extract to your current directory
Note: "find" does the finding, the "-type -f" tells find to only look for files, the "-iname" tells find to search parts of file names, the ' ' around "some-compressed-file" keeps the * from doing bad things, the "print0" tells find to "scrub" for spaces and such before outputting a result, the " | " pipes the results of find to xargs, the "-0" is because of "print0" in the find side of the pipe, and "sudo tar - vxpzf" is where tar extracts the findings of find.
Code:
find $HOME -type f -iname '*zip' -print0 | xargs -0 ls
Run to find and list every zip file under the home folder
Say you want to make a file to contain some notes wile in the command line
Code:
sudo cat > $HOME/someNotes.txt <<EOF
# place a command here
echo "hello world, I update aptget"
sudo apt-get update -q
EOF
Try editing the part after $HOME; type it in or write a file that contains the combo of " cat > $HOME/someNotes.txt <<EOF " some text or commands " EOF " and you'll find making custom scripts of varying complexity to be easy.
.......
Hope some of these are also found to be useful for others.
Thanks for starting this here thread.
Hit the link in my signature for more help with Linux for new and seasoned users
Edit 08082013- added another useful tip and reformatted commands to better fit the OP's formatting.
Sent from either my SPH-D700 or myTouch3Gs
Debian Kit/QEMU Linux Install guide for all android devices that I'm writing:
http://forum.xda-developers.com/showthread.php?t=2240397
Now have working Installers for ARM Java 7 JDK + Maptools + jMonkey
Yo ! Nice Share
To delete contents of a large text file ..
Code:
cat /dev/null > NameOfTheFile
Useful variations of ls command :
Show dir content in a list
Code:
ls -l
Show dir content in a list sorted by modification time (newer first)
Code:
ls -lt
Show dir content in a list sorted by modification time (older first)
Code:
ls -lrt
Show subdirectories recursively
Code:
ls -R
If you want to show files starting with . (hidden file), you can add -a option.
More options with command :
Code:
man ls
Useful variations of grep command :
grep is used to print lines matching a pattern.
Find the entry for current user in file /etc/passwd :
Code:
cat /etc/passwd | grep $USER
Find all the entry except current user entry in file /etc/passwd :
Code:
cat /etc/passwd | grep -v $USER
Find all the numbers in file /etc/passwd :
Code:
cat /etc/passwd|grep '[0-9]*'
Add color to grep command :
Code:
cat /etc/passwd | grep --color $USER
(You can add
Code:
alias grep='grep --color=auto'
in ~/.bashrc to always have colored grep)
Useful variations of tar command :
Create archive_name.tar from dirname :
Code:
tar cvf archive_name.tar dirname/
Create archive_name.tar.gz (compressed) from dirname :
Code:
tar zcvf archive_name.tar.gz dirname/
Extract archive_name.tar.gz :
Code:
tar zxvf archive_name.tar.gz
Useful variations of mkdir command :
Create directory and subdirectories if not existing :
Code:
mkdir -p /tmp/a/b/c
(mkdir /tmp/a/b/c will fail if /tmp/a and /tmp/a/b don't exist)
Useful tip :
Use bash variable "!$" to get the value of the last argument of the last command interpreted.
For example :
Code:
mkdir /tmp/test_a
cd !$ (equivalent cd /tmp/test_a)
or,
Code:
mv /tmp/a /tmp/b
ls !$ (equivalent ls /tmp/b)

[Q] Hangouts - UAProf Modification

Hello Everyone,
I'm usually more of a lurker and use XDA to gather info mostly, but I've been trying to get Hnagouts to work with MMS for a while. So my issue is that I am using Softbank Prepaid in Japan, and Softbank for whatever reason is VERY particular about what is allowed on their network. I have a Galaxy S4 GT-I9505 and have been able to get the stock Messaging app to work with the MMS settings by figuring out the backend way of changing the UAProf settings so that Softbank sees it as an iPhone, thus enabling the MMS. (to do this launch ADB (on computer) / Terminal Emulator (on Phone, I believe SU access is needed) then launch command:
Code:
am broadcast -a com.sec.android.app.mmsprovision
Now I've been wanting to integrate with Hangouts for a while, and the settings that are available on hangouts doesn't really let you do anything, worse of all it seems to bypass the settings of the system, so the backend way doesn't work as hangouts seems to report it's own UAProf settings and doesn't seem to let you customize much. Even the custom APN settings seem to miss some files that are normally found.
Recently I have searched and I found that someone had posted about it in Japanese, using their HTC One (M7).
As I am not a programmer and work in very basics with command codes I was hoping someone could help me to make sense of this. I've used Google Chrome to translate the page but I'm still not 100% what needs to be done before I attempt it.
Please note that none of this is my work and it all comes from: http://d.hatena.ne.jp/shimooka/20140212/1392176717
From what I can see he has found a way to change the UAProf settings so that Hangouts reports that it is an iPhone. I can see that it needs to use ADB, but does it also need Perl and Java? also what is this modifying? Or is this similar to what I've already done using the command above?
Code:
$ export PATH = / Path/to/jre7/bin :/ path / to / Android-sdk-windows / build-tools / 19 . 0 . 0 /: $ PATH
$
$ Adb Shell mount -a
$
$ # fetch Framework-Res.Apk
$ Adb pull / system / framework / framework-res.apk
$
$ # Backup
$ \ cp -pf -Res.Apk Framework Framework-Res.Apk_
$ Java -jar Apktool_2. 0 .0 B9.Jar D -Advance Framework-Res.Apk
$
$ # modify user-agent, Uaprofile in Resources
$ cp -P Framework-res/res/values/strings.Xml Strings.Org.Xml
$ Perl -I -P -s -e ' s # # Http://Www.Google.Com/oha/rdf/ua-profile-kila.Xml Http://Www.Apple.Com/mms/uaprof.Rdf # g ' Framework-res/res/values/strings.Xml
$ Perl -I -P -s -e ' s # <string Name="config_mms_user_agent"> CyanogenMod </ string> # <string Name="config_mms_user_agent"> IPhoneOS/3.0 (7A341) </ string> # g ' Framework- res / res / values ​​/ strings.xml
$ find. -iname \ *. BAK -delete
$
$ # install as 127.Apk
$ java -jar Apktool_2. 0 .0 B9.Jar if Framework-Res.Apk_
$
$ # build-Framework Res.Apk
$ java-jar Apktool_2. 0 .0 B9.Jar b-Advance Framework-res
$
$ # Update Resources.Arsc only
$ cp -P Framework-res/build/apk/resources.Arsc.
$ 7z u-tzip-mx0 framework-res.apk resources.arsc
$
$ # push Framework-Res.Apk
$ Adb push framework-res.apk / system / framework / framework-res.apk
$ Adb Shell chmod 644 / system / Framework / Framework-Res.Apk
$
Thanks for the insights!

Restore your Baseband in MT65XX Devices

HOW TO RESTORE YOUR BASEBAND IF YOU LOST IT DURING A FORMAT - MT65XX DEVICES
Thanks go to abdullahi_ for this solution. His original post from another forum can be found below:
https://forum.hovatek.com/thread-116-post-376.html#pid376
Prequisites
Phone Rooted
Smart Phone Flash Tool Backup - Specifically protect_f file (for a Dual SIM phone, maybe different for a single SIM phone)
Linux OS - I used Ubuntu in a virtual machine
Android SDK platform tools for ADB access
From a terminal (CTRL + ALT + T)
Code:
mkdir -p ~/protect_f/f
cd ~/protect_f
At this point copy the file "protect_f" in the ~/protect_f
then continue:
Code:
sudo mount -t ext4 -o loop protect_f f/
Enter your password
then continue:
Code:
cd f
sudo chown -R $USER:$USER *
Copy the files in the f/md folder to a folder on your phone and using a file manager with root access copy the two files into the /protect_f folder or any toher means
NOTE: You will probably get back your cell access immediately. However, please continue to make the permissions and ownership are the same as the original.
Also if you have a dual SIM, one of the files from the protect_f folder will automatically be created in the protect_s folder
To clean up the files on the Linux OS:
Code:
cd ~/protect_f
sudo umount f/
cd ~
rm -rf protect_f
To change permissions and ownership on the files
From an adb shell for your phone:
Code:
su
cd /protect_f
ls -l
Take note of the ownership of the md folder, on the phone I used they were ccci & nvram, in Linux the ownership was 9996 & 9997.
At this point I put the phone in airplane mode, just as a precaution to make sure the rest went smoothly
Code:
cd md
chown ccci:nvram *
chmod 660 *
If you have a DUAL SIM phone, for the second folder....
Code:
cd /protect_s/md
chown ccci:nvram *
chmod 660 *
You can now take the phone off of airplane mode and reboot your phone to be sure it is working,
ALL DONE!
REMOVED

Categories

Resources