Signing Android Applications In 3 Easy Steps - Android General

It took me a really long time to figure out how to sign android apps. I figured I would give everyone a tutorial about application signing.
Step 1: Go to the Command Prompt (Run/Cmd) (this also works with terminal)
Step 2: Type the following code into the command prompt: keytool -genkey -v -keystore mykeystore.keystore -alias aliasname -keyalg RSA -validity 999999
(replace mykeystore with the name of your application)
(If using Mac OS place sudo before keytool in the command line)
Step 3: The command prompt will ask you for passwords etc. Fill it all in. When it asks if you want to use a different password, just click enter to use the one that you entered previously.
There you go, that is how you sign your android app. Now go to Corona and build your application, browse the folder that you saved it in and your done!

Related

[GUIDE] ADB on Ubuntu

This will setup ADB to work on Ubuntu with your Transformer Tablet.
Step 1: Download the Android SDK.
Step 2: Unzip the Android SDK to /home.
Step 3: Next we will add the SDK to your path, substitue the example will the path to the tools folder of your SDK.
Example Path:
export PATH=/home/USER/android-sdk/tools/:$PATH
Click to expand...
Click to collapse
Step 4: To make 99-android.rules, run the following command.
sudo gedit /etc/udev/rules.d/99-android.rules
Click to expand...
Click to collapse
Step 5: Add the following lines:
#Transformer
SUBSYSTEMS=="usb", SYSFS{idVendor}=="0b05", MODE="0666", OWNER="USER"
Click to expand...
Click to collapse
Step 6: Save the file.
Step 7: To restart udev, run the following command.
sudo restart udev
Click to expand...
Click to collapse
Step 8: Run the following commands:
adb kill-server
adb start-server
adb devices
Click to expand...
Click to collapse
If device is saying 'no permissions', go to step 5 and add those lines to the other .rules files in /etc/udev/rules.d.
Great guide! You could add step three to ~/.profile or /etc/profile (no dot) to make it permanent at each login. You don't need to add it to both profiles. The /etc/profile is for every one that logs on, ~/.profile is just for your ID.
Also, if you are editing the rules files, you might as well add support for APX mode.
Code:
SUBSYSTEMS=="usb", SYSFS{idVendor}=="0955", ATTRS{idProduct}=="7820", MODE="0666"
You probably don't need the product ID.
EDIT: Not sure why the "no permissions" problem would come up, but I suspect it is because of conflicts with other rules in /lib/udev/rules.d/ You want to make changes in /etc/udev/... The rule with the highest number takes precedence. I think specifying the product ID will prevent conflicts too.
Hi thanks for the help, finally I get my adb working with my Transformer thanks to your .rules file (alwways kept me telling i had no permissions).
Perhaps, there is something I think you should specify for newbies:
Step 3: Open terminal and run the following commands.
export PATH=/home/USER/android-sdk/tools/:$PATH
Click to expand...
Click to collapse
Its important to exactly tell ubuntu where adb is.
In my case its not at TOOLS folder, its been move reciently to /android-sdk-linux_x86/platform-tools/
sylar666 said:
Hi thanks for the help, finally I get my adb working with my Transformer thanks to your .rules file (alwways kept me telling i had no permissions).
Perhaps, there is something I think you should specify for newbies:
Its important to exactly tell ubuntu where adb is.
In my case its not at TOOLS folder, its been move reciently to /android-sdk-linux_x86/platform-tools/
Click to expand...
Click to collapse
It was an example path, you have to give the actual location of your sdk because it may vary.
Sorry if I'm missing something obvious, but doesn't the SDK download off the Google site (linked above) not include adb by default?
I've had to go into the actual program:
Code:
cd /home/USER/[B]Android-SDK[/B]/tools/
./android
(substitute the bold for whatever your SDK directory is called)
Then via the GUI:
- click the Available packages menu option
- click the arrow on Android Repository
- choose to install Android SDK Platform-tools, revision X package
Then once the platform-tools package is installed, you can make sure it's in your path as well as "Tools" (shown in original post). I do this in my .bashrc file (in your home directory):
Code:
export PATH=/home/USER/[B]Android-SDK[/B]/platform-tools/:$PATH
(again, the replace the bold with your SDK directory)
Depending on how you do this, the adb command should now work in a terminal by typing 'adb'. If you put the path in your .bashrc or profile, you might like to run the command 'exec bash' first then try.
Confirmed to work on Arch (get it from the AUR) and just did it tonight on Ubuntu 11.04 x86-64. And thanks for the guide, OP Took me ages to work the udev rules out when I first got my TF. Hopefully this helps someone in the same position in the future.

ADB batch quick launch

So this isn't anything amazing, but it's a handy little shortcut I made for myself that might help someone else, too.
If you regularly find yourself needing to fire off a command from ADB, but don't want to have to go to the trouble of adding ADB to your path or remembering where it's saved, you can create a batch file so you only have to press three letters to get adb ready to go.
Using a text editor (I like Notepad++), create a new text file with this inside of it:
@echo off
cd "path to where your Android SDK installation is located\android-sdk-windows\platform-tools"
(I find it easiest to just navigate to where you have ADB installed and copy and paste the folder location.) For example, my adb.bat file says:
@ echo off
cd "C:\Users\(me)\Other\mod\tools\android-sdk-windows\platform-tools"
Once you have those two lines above in place, do a "Save As" command, and save the file as "adb.bat" (with quotes).
Once you have that batch file ready to go, assuming you're on Windows 7 (may work on other versions of Windows, I just haven't tried) put it in whatever location comes up by default whenever you open a command prompt (It's C:\Users\[my account] for me).
The next time you open a command prompt (Win-R, type cmd), just type adb into the prompt and hit enter, and you're sitting at the directory where ADB is installed, ready to fire off other commands.
thanks, awesome!! works perfectly minus my lack of adb skill...
We will be waiting for new ROM from you. No less.

How to run a Minecraft Server on the Xperia Play

Hello everyone! This is a simple guide on how to run a Minecraft Server on your Xperia Play. Note that this is not a Minecraft Pocket Edition server, it is a server for the full version of Minecraft for computers!
This is my first guide ever, so if something isn't clear or is missing because I thought it was obvious, ask me!
Why do this?
I did this to see if I could get it running. If you do it, you will be able to carry your Minecraft world with you whenever you go! You could run the server on the computer that you're using to connect to the server, but what if you only have your Xperia Play and a friend's laptop with you?
What you will need:
- Your phone
- Root access to your phone
- Working Busybox on your phone
- A kernel that supports loop devices (I am using the stock GB rom and DooMKerneL and it works fine)
The limitations that the server will have:
- It will be creative mode, because survival mode makes it crash more
- It will only be able to handle 1-2 players because it's a phone
- It will be slow (especially with redstone) because it's a phone
- The world will be flat because it crashes a lot less if the world is flat
- There won't be any mobs, npcs or monsters.
But it will work!!!
So, let's start!
1. Download the "Ubuntu Installer Free" app on your phone
2. In the app, press Install Guides > Ubuntu 12 Install Guide > Next
3. Say "Unicorn" three times (this step is optional)
4. Download the Boot Script and the Core Ubuntu Image with the two buttons that you see in the app. It is important to download the core image, and not the small or large images.
5. Also download the Terminal app on your phone if you don't have it already. (the app has a button for that, too!)
6. Close the Ubuntu Installer app, and make a folder on your SD card named "ubuntu" without the quotes. Then decompress the files that you downloaded (the script and the core image) and put their contents in that folder. Your "ubuntu" folder should now have these files inside it: ubuntu.sh, ubuntu.img
7. Open the Terminal that you downloaded in step 5 and write these commands:
Code:
su
cd sdcard/ubuntu
sh ubuntu.sh
Because this is the first time you are running it, it will ask you for a password. Enter one and remember it or write it somewhere in case you need it later. Then it will ask you for a resolution, but this doesn't do anything since you won't have a GUI so enter "800x480" and then enter "y" to make this the default.
If Ubuntu doesn't boot, try updating your busy box. If you don't get Ubuntu working, you won't be able to continue from here. You will know it has booted when you see [email protected]:/#
8. Now you have to install Java, nano and wget. To install these enter these commands:
Code:
sudo apt-get install openjdk-7-jre
sudo apt-get install icedtea6-plugin
sudo apt-get install wget
sudo apt-get install nano
you can also enter this to install cowsay because it is epic but this is completely unrelated to this guide:
Code:
sudo apt-get install cowsay
9. Now that you have Java and the other things installed, you have to download the minecraft server and put it in a folder of your sdcard. First, go to your sdcard with the command:
Code:
cd sdcard
Then create a folder to put the server in and go to it with the commands:
Code:
mkdir mcserver
cd mcserver
Now you have to download the file minecraft_server.jar and put it in the folder that you created (mcserver for me)
You can do this with a browser and a file manager, or with the command:
Code:
wget https://s3.amazonaws.com/MinecraftDownload/launcher/minecraft_server.jar
10. It's time to configure the server! To do this, we will create the file server.properties by running the command:
Code:
nano server.properties
then copy this and paste it into nano:
Code:
#Minecraft server properties
#Tue Jun 26 14:43:57 EEST 2012
allow-nether=false
level-name=world
enable-query=false
allow-flight=false
server-port=25565
level-type=FLAT
enable-rcon=false
level-seed=
server-ip=
max-build-height=64
spawn-npcs=false
white-list=false
spawn-animals=false
online-mode=false
pvp=false
difficulty=0
gamemode=1
max-players=2
spawn-monsters=false
generate-structures=false
view-distance=3
motd=Minecraft Server on a phone!
(as you can see, this puts the server into offline mode. I did this because when it is in online mode it has to check the username online and you are likely to get a time out error)
Then you have to press CTRL + O to save the file. This is very easy to do if you have installed the Hacker's Keyboard from Google Play (it's free). If you don't have it and don't want to install it you can use a file manager like Root Explorer to create the file, or press menu > special keys in the Terminal and figure out how to press CTRL with a hardware button. After you press CTRL + O press the enter key and then CTRL + X to close nano.
11. You should now be able to start the server! Do this with the command
Code:
java -Xms512M -Xmx512M -jar minecraft_server.jar nogui
It will create a flat world and start. Then you should be able to connect to it from Minecraft on your computer.
Yay! You got it running! A server on your phone! :good:
To stop the server enter the command "stop" and then to shutdown Ubuntu enter "exit", all without quotes.
I guess that if you got it running, you'll be able to figure out how to start it again the second time so I won't cover that.
I was actually wondering if something like this was possible. Thanks a lot for the tutorial!
There's an easy way to connect to a server...
Get pocket tool from the play tore and change the server ip to one of the pocket edition specialized minecraft servers.
look at this link: http://www.minecraftforum.net/topic/1284148-minecraft-pe-mcpe-fan-mulltiplayer-server-closed/
only problem, the server is currently offline, you need to find another one
Thank you so much for this tutorial.
I've searched something like this for a while, but i ain't successful in finding this.
Thank you!:highfive:

(Tutorial) Setting up Linux for ADB to recognize Pantech Burst

Anyone wanting to use adb with your Pantech Burst through Ubuntu/Linux... follow these steps (these steps will make accessing adb much easier and allow abd to recognize your phone)[Please note - modifying the .bashrc in step 1 is not required; it will just make using Android SDK much easier for beginners]:
1. Modifying the PATH Environment Variable will help out immensely when it comes down to making use of SDK tools like ADB. Doing this will also allow you to execute certain protocols like ADB from ANY location. So if you're operating from the Desktop, you don't have to redirect to the SDK's platform-tools folder to make use of ADB if you need to make use of it.
To modify the PATH variable of your system, you need to edit your .bashrc file. To do so, in a terminal, execute the following command:
$ nano ~/.bashrc
You will now have the Nano text editor enabled on the terminal. Now, at the very top of the file(yes, that means go to the top and hit enter to create some space at the top. Then just copy and paste - a caveman really could do it!), enter the following:
#AndroidDev PATH
export PATH=${PATH}:~/android-sdk-linux/tools
export PATH=${PATH}:~/android-sdk-linux/platform-tools
Once you're finished, press CTRL + X, Y, and then hit Enter to save your changes and exit the Nano text editor.
2. Now that we have our PATH variable set up, we need to make sure our hardware will be detected once we initialize ADB. However, Ubuntu won't allow ADB access to the Android phone via USB unless the appropriate udev rule is set. This is Bug #316215. In order to get around this rule, you need to create a rule file as root.
In a terminal, execute the following command that will create the rule file. This will utilize the graphical sudo command, so that we can still have control over the file if we're not a root user.
Now, you create a file:
sudo nano /etc/udev/rules.d/51-android.rules
Copy and paste the following udev rule in the text editor that opened up which contains the new rule file we created:
SUBSYSTEM=="usb", ATTRS{idVendor}=="10a9", MODE="0666"
Once you've copied and pasted the udev rule in the text editor which contains your newly created rule file, save your changes and quit (Control+X, Y, Enter). Now that you've set your udev rule you have to reboot (shut down terminal and reopen; I also recommend unplugging your phone from usb and plugging it back in) so that ADB will be in your path.
To test your changes, open up a terminal and execute the following:
$ adb devices
You should now see:
List of devices attached
PRESTO01111085383518 device
If you see:
List of devices attached
???????????? no permissions
Reread this post and try to follow directions next time.
idProduct
To complete we can add the "idProduct"
On my computer doing in the console "lsusb":
Bus 001 Device 006: ID 10a9:6050 SK Teletech Co., Ltd
Click to expand...
Click to collapse
So, if I'm not mistaken, the line including "idProduct" would be:
SUBSYSTEM=="usb", ATTRS{idVendor}=="10a9", ATTRS{idProduct}=="6050", MODE="0666"
Click to expand...
Click to collapse
Thank you. Greetings.
worked for me!
USB debugging also needs to be on. To enable it, the USB cable must be disconnected.
My adb devices only picked it up after I switched the USB connection type to USB Storage mode. Not sure if that's necessary but it could help.
Also, slight typo here:
jackattack79 said:
In a terminal, execute the following command that will create the rule file. This will utilize the graphical sudo command, so that we can still have control over the file if we're not a root user.
Now, you create a file:
sudo nano /etc/udev/rules.d/51-android.rules
Click to expand...
Click to collapse
I think either terminal "sudo nano" or "gksudo gedit" will work just fine. But you should remove the bit about "this will utilize the graphical sudo command" when using "sudo nano" so as not to confuse people!
But anyway, thanks! The method worked and now I am off to the races.

Sign Your APK for the PLAY Store

Hey Guys,
I found it very hard to find this method on the net. I looked for around 12 hours (over a period of 2 days). But here it is!
This method is very helpful if you need to increase the length of your signature on your apk. As Google Play has a minimum length of validity for signatures.
This tutorial contains some knowledge from other websites and some from my own self. Please feel free to use my hard work below. But try to reference me if you can. Thanks!
First of all,
jarsigner and keytool are .exe files that help create your "signed" application for release to the market to prevent fraud.
1.
Make a folder somewhere called "keytools" and make a folder in that called "key"
2. Now move your apk file to the folder keytools.
(Not inside any other folders)
3. Check
"C:\Program Files\Java\jdk1.7.0_11\bin" for jarsigner and keytools..
... or whatever jdk version you have
If you DONT have it install the following: http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
4. open cmd.exe,
5. cd your way to where you have your keytools folder...
I had to do.. cd desktop, and to keytools to get to C:\Users\Matt\Desktop\keytools\
In this directory is you apk file which we will manipulate.
Now add the directory C:\"Program Files"\Java\jdk1.7.0_11\bin\ or something like that to PATH in Environment Variables.
Directions on how to do this can be found here: http://www.computerhope.com/issues/ch000549.htm
type the following now (or something similar to my example)
keytool -genkey -alias xda.keystore -keyalg RSA -validity 20000 -keystore keys/xda.keystore
Then you will have be presented with:
Enter keystore password: (type in a password you will use)
Re-enter new password: (type in same password here)
What is your first and last name? Matt <LAST NAME HERE>
What is the name of your Organization unit? (You dont NEED to type anything)
What is the name of your city or locality? <What it says>
What is the name of your state or providence? <What it says>
what is the two-letter country code for this unit? AU
is CN=Matt C=AU.....etc. correct?
[no]: yes (type yes there)
Enter key password for <xda.keystore>
<RETURN if same as keystore password>: (push enter)
6.
To add the directory of jarsigner to the PATH variable just do the steps from here: http://www.computerhope.com/issues/ch000549.htm but with the path of jarsigner. Which should be something like this: echo "PATH=/cygdrive/c/Program\ Files/Java/jdk1.7.0.11/bin:\${PATH}" >> .bash_profile
Now, type the following now (or something similar to my example) NOTE: This is all in cmd.
jarsigner -verbose -keystore key/donate.keystore -signedjar Donate_signed.apk xda.apk xda.keystore
Enter Passphase for keystore: (your password you made earlier)
DO NOT TYPE --> adding: META-INF/MINFEST.MF ....
.......
.....
...Signing: classes.dex <--DO NOT TYPE
and you're all set! you signed your apk file or whatever you wanted to create!
Congratulations.
NOW STOP BEING FRUSTRATED LIKE I WAS FOR HOURS!
Come on guys! Post what you think AKA I just bumped this thread.
I did this but the file gets signed , but when trying to install on device the signed file, it says its not signed .
LOL
Thanks but I can not do this

Categories

Resources