[tip] install, sign apk, ..etc on right click (windows) - Nexus One General

I've been hesitating on posting this for a while now (as its quite simple) but It may save you a ton of time like it continues to save for me.
1) write a batch file to do what you want, %1 is the file name+path argument passed to it
2) associate .apk files with the batch file. right click on apk-> open with-> choose program ->select the batch file
Many possibilities:
sign, install, decompile etc
here is the code for install.bat which I keep at x:\android-sdk\tools (same folder as adb)
Code:
adb install -r %1
pause
For sign: (creates a new .apk with -signed appended at the same location)
Code:
cd "x:\path\to\signapk.jar\"
java -jar signapk.jar testkey.x509.pem testkey.pk8 %1 %1-signed.apk
pause
For decompile: (decodes to a new folder with the same name+"-decoded" as the .apk
Code:
cd x:\path\to\apktool.jar\
java -jar apktool.jar d %1 %1-decoded
pause

thats pretty neat, nice tip

I'm dumb. I didn't read the first part of what you typed, figured the rest didn't work, searched google to come up with my own routine, figured out yours is extremely easy once you actually read it haha.
Oh well, at least I learned a little more DOS.
APK install bat with a prompt:
Code:
@echo off
set /p userinp=Do you want to install %1 y/n:
if "%userinp%"=="y" goto ADBINSTALL
exit
:ADBINSTALL
adb install -r %1
pause
EDIT: Forgot to say thanks.

yeah simple dos batch files can automated lot of monotonous tasks, I use them a lot for work

Related

[App] Tiny apk installer (adb required)

A small app I wrote for my convenience. The source code is about 13 lines long, it has no advanced features, simply an easier way of typing in "adb install path/to/file".
Currently windows only, if it gains a few downloads i'll release a linux app.
If anyone wants the source feel free. It was coded in C++
Simply drag the apk file onto the exe. or set it as the default program for opening the file, then all you have to do is double click on the apk for it to install.
It won't tell you if there are any errors (though you may see it in the command window that pops up momenterilly). This was a personal project for my own convenience I just thought I'd post it here.
Nice, I created similar thing:
a little batch-script for windows
Code:
@echo off
echo Installing %1
echo ---------------------------------------------------
"C:\android-sdk-windows\tools\adb.exe" install %1
echo ---------------------------------------------------
pause
@echo on
I saved it in my windows folder and assigned the *.apk filetype to it in Folder Settings->File types with this:
apkinstaller.bat %1
After that: double click on your apk and voila

Decompiling/Recompiling Launcher2.apk [HELP!]

Hey everyone. I'd like to decompile/recompile the Launcher2.apk from Paul (MoDaCo)'s rip of the Gingerbread system. I'm trying to fix the annoying fade time on the 2D app drawer for the launcher. However, I'm running into problems.
Here's my process:
apktool d -f com.modaco.android.launchergb-1.apk
Move through the com.modaco.android.launchergb-1 folder to res/values/integers.xml
Change fade in and fade out time to "300" instead of "700".
apktool b -f com.modaco.android.launchergb-1
Copy build/apk/resources.arsc to the original com.modaco.android.launchergb-1.apk using WinRAR.
Attempts to install all fail. When I try "adb install" I get this error: Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES]
You try ApkManager by daneshm90?
Sent from my phone
tnpapadakos said:
You try ApkManager by daneshm90?
Click to expand...
Click to collapse
Doesn't seem to work either.
You need to sign the package first.
jarsigner -verbose modradio.apk mykey
Check the METAINF/ folder in the apk of the newly built one and delete the extra files from the original one. Then you need to resign the edited apk. I think there should just be MANIFEST.MF, delete the CERT.* files. And when you resign it it should make new ones, in this case above it would be MYKEY.RSA and MYKEY.SF. Not too familir with it, but try that out.
Keep in mind that you have to resign it after any modifications, so do it last and it should work.
This thread does a good job guiding you though compiling/decompiling an apk.
http://forum.xda-developers.com/showthread.php?t=725870
trimeijer said:
You need to sign the package first.
jarsigner -verbose modradio.apk mykey
Check the METAINF/ folder in the apk of the newly built one and delete the extra files from the original one. Then you need to resign the edited apk. I think there should just be MANIFEST.MF, delete the CERT.* files. And when you resign it it should make new ones, in this case above it would be MYKEY.RSA and MYKEY.SF. Not too familir with it, but try that out.
Keep in mind that you have to resign it after any modifications, so do it last and it should work.
This thread does a good job guiding you though compiling/decompiling an apk.
http://forum.xda-developers.com/showthread.php?t=725870
Click to expand...
Click to collapse
Thank you so much for the help. In the thread you mentioned, I'm stuck at this point:
now type the following commands in this order:
this command changes all occurances of htc/fm to htc/modradio in your xml and .java files.
find ./ -type f | xargs perl -pi -e 's/htc\/fm/htc\/modradio/g'
this command changes all occurances of htc.fm to htc.modradio
find ./ -type f | xargs perl -pi -e 's/htc.fm/htc.modradio/g'
Click to expand...
Click to collapse
If my filename is com.modaco.android.launchergb-1 and the application name is com.modaco.android.launchergb, what do I do to make these commands work.
Would it be:
find ./ -type f | xargs perl -pi -e 's/modaco\/launchergb/modaco\/launchermod/g'
??

[Tool\Script] Sign, Zipalign and adb push apk's

Sign, Zip align and ADB push Apk's
What's different about this script?
*It's simple, easy to understand
*It can be used with any JDK. All that is required is replacing the PATH
This was intended to be used on HTC Skins; however, it can be used for any APK.
About
I wrote this batch file because the tools currently on XDA seem very complex or are based on JDK 7. People like myself that prefer to use JDK 6 are at a loss. This batch file assumes you already know how to sign APK's, Zipalign and ADB push Apk's. I've included some of my other threads below if you need further instructions.
Other threads a noob might need
Noobs guide to signing an APK
Noobs guide to installing and running zipalign
****All that is required to make this run, is replacing the directory paths with YOUR OWN Directory paths.
Source Code below, below that is the Multi to the .bat file.
Code:
@ECHO OFF
C:
CD\
CLS
cd c:\Program Files\Java\jdk1.6.0_26\bin (This can be replaced with whatever JDK you're using. Simply, replace the path)
jarsigner -verbose -keystore skin.keystore -signedjar C:\Users\Reynolds\ANDROID\SKINS\Rezound\Pitch_Black\dist\New-Pitchblack.apk C:\Users\Reynolds\ANDROID\SKINS\Rezound\Pitch_Black\dist\Pitchblack.apk [B]REPLACE-THESE-CAPS-W-YOUR-ALIAS[/B]
DEL C:\Users\Reynolds\ANDROID\SKINS\Rezound\Pitch_Black\dist\New-Pitchblack.apk
C:
CD\
CLS
cd C:\Users\Reynolds\ANDROID\SKINS\Rezound\Pitch_Black\dist
zipalign -fv 4 New-Pitchblack.apk Pitchblack.apk
cd c:\android-sdk-windows\platform-tools
C:
CD\
CLS
cd c:\android-sdk-windows\platform-tools [B](Your directory might be different)[/B]
adb install -r C:\Users\Reynolds\ANDROID\SKINS\Rezound\Pitch_Black\dist\Pitchblack.apk [B]( This Path can be replaced with whatever your apk is located in order to push the apk to your device[/B]
Media Fire DL Link: http://www.mediafire.com/?c3f0thcv6cmdwws

[TUTORIAL] How to make your own APK installer for Windows.

Disclaimer:
Code:
Though it's really not possible bricking your device due to this tutorial, but still if something or the other happens, I'll 100% try to help you but it's not my responsibility. ThankYou
What you need:
1. ADB drivers and some other files to run the tool, since it will be based on adb. Get from my zip.
2. Notepad++(Search for it)
3. Bit knowledge about ADB to avoid non-sense questions.
4. Kindness to press THANKS button.
Ways to do it:
There are 2 basic ways you can make your tool:
1. To install a specific app.
2. To install all the apps from a folder or directory.
Method 1(Make single apk installer):
1. Open notepad++ and write some codes like this:
Code:
ECHO OFF
CLS
ECHO Single-apk installer.
ECHO Press any key to install your apk.
ECHO.
PAUSE
adb install APP.apk
ECHO Done
ECHO.
2. Now save your script as "name.bat". Here replace name with anything but remember the extension will be ".bat"(obviously without quotes).
Now understading this method:
Here you can practically edit or add anything after the ECHO command. Now here, adb install is the basic command we use to install our apps and replace "APP" with your app name, for e.g. if it's RootBrowser.apk so change APP.apk with that. But remeber your app should be in the same directory as the batch script. But if it is in some other directory, then in adb install APP.apk before APP.apk write the complete location of the folder it is in. For e.g. if it is in C:/test/ the write the code as adb install C:/test/RootBrowser.apk and you're done. But if the folder is in the same directory as the tool is then no need for this. For e.g. the folder is test, then change the code to adb install test/RootBrowser.apk and done!!
Note - The PAUSE command is used to stop the tool at that point.
Method 2(Make multi apk installer):
1. Open notepad++ and write some codes like this:
Code:
ECHO OFF
CLS
ECHO Multi-apk installer.
ECHO Press any key to install your apk.
ECHO.
PAUSE
FOR /r %%f in (*.apk) DO adb install "%%f"
ECHO Done
ECHO.
2. Now save your script as "name.bat". Here replace name with anything but remember the extension will be ".bat"(obviously without quotes).
Now understading this method:
The ECHO and PAUSE parts go same as above. Same goes for directory part, but remember for example if your apps are in same directory as the tool but another folder for e.g. INSTALL, then change the code to FOR /r INSTALL/ %%f in (*.apk) DO adb install "%%f" and you will be good to go
Credits:
Soumya_digi for teaching me
Note- Will add some screenshots soon. Please report if this works for your device and don't forget to press THANKS
Re: [GUIDE] How to make your own APK installer for Windows.
Nice...esp. The second method , however i didn't understand the %% part in the second method clearly.....
Nice work though..!!
Sent from my GT-S5360 using xda app-developers app
Re: [GUIDE] How to make your own APK installer for Windows.
anubhavrev said:
Nice...esp. The second method , however i didn't understand the %% part in the second method clearly.....
Nice work though..!!
Sent from my GT-S5360 using xda app-developers app
Click to expand...
Click to collapse
We use %%ff to target all the apps for multiapps
Press THANKS if I helped,
Best Regards,
AJ

[Tutorial] copy files to android from windows and the other way for locked phones

hi.
so we now have android in windows phone.there's a tutorial on how to copy files from that android and to that android os but i think you're phone needs to be unlocked (interop).and if you're phone is locked you can do it (i've been away from these kind of things for a long time.correct me if i'm wrong)
i used adb before and knew there was some kind of command to check the folders and files in the phone.so i took my chances and i tried them.
here is the code:
1-
Code:
adb shell
2-result will be something like
Code:
/system/bin/sh: No controlling tty: open /dev/tty: No such file or directory
/system/bin/sh: warning: won't have full job control
[email protected]:/ $
3-type this
Code:
ls
it will gives you a list of all folders in the phone (in android os in windows phone in this case)
4-the main folder is "mnt" so type this code
Code:
cd mnt
5- you can still type
Code:
ls
but it'll take a lot of times to find folders so i'll just give it to you guys.these are the command you need to enter and press enter.(each line must be typed separately)
Code:
cd shell
Code:
cd emulated
Code:
cd 0
6-in here is you type
Code:
ls
you can see that you have Pictured,Music and things like this.so if you want to create a folder in your android just type
Code:
mkdir YourFolder
7-after you created your folder enter
Code:
exit
to exit the shell and now you can "push" and "pull" commands.here's how push command work
Code:
adb push Path\To\Your\File.txt mnt\shell\emulated\0\YourFolder
i like to put my files that i want to push in the same folder that i have adb.exe so i just need to type the file name and extension.
8-after that you can install an android file manager to manage your files.
i haven't tested "pull" command but it'll work.i just need to test it.
so sorry if you guys knew this method , i just wanted to share it with you.
this method is really good for phone like 920 and for apps and games that has .obb data files (like Fallout Shelter )
Really appreciate you for this tutorial and helping nature,but we had a ""shortcut ""way using file Explorer
http://forum.xda-developers.com/win...utorial-how-to-copy-files-android-to-t3178808

Categories

Resources