apkbuilder - Is anyone familiar with how it works? - G1 Q&A, Help & Troubleshooting

I've found some commands to use but I am not sure if I've done them correctly. I was able to get a file out of the commands (a .apk file) but it seemed to be created as a document rather than a unix executable file. The icon appears as a sheet of paper rather than that black box of other executable files. I am on a mac right now so anyone familiar with it on a mac would be a great help.

What about just adding the .apk extention? cp /filepath/ /sdcard/app.apk then mount the sdcard and pull it over if you can't work out adb.

evilkorn said:
What about just adding the .apk extention? cp /filepath/ /sdcard/app.apk then mount the sdcard and pull it over if you can't work out adb.
Click to expand...
Click to collapse
When I change a file name and save it as a .apk, it doesn't seem to truly save it as a .apk. Normally, on a mac, .apk's are seen as a unix executable file and the icon is a little black square. If I change a files extension to <filename.apk> it just sees it as a document with the name <filename.apk>, NOT <filename>.apk. It doesn't recognize the file as a true .apk. I'm not sure if that makes sense but its a much more difficult process on a mac than it is on a PC. If i save a file with .apk at the end then try to sign it, an error comes up saying that the file is not a file.

apk's are just zip files with a signing signature, they "unpack" like a zip/rar archive. There is no reason to open them with terminal. They are either damaged or you didn't copy them off your phone correctly, see the second sentence of my post.

I know what you mean and I know how they work, I'm just not explaining myself correctly...I think I have it figured out though.

Related

Tux App bar

Ok, maybe I'm going a little overboard here, but I jailbroke the phone just yesterday. I thought that it was time to see what all I would be able to do with it. So i got to looking around trying to figure out what I could skin. /system/app/Launcher.apk provided what i needed to redo the app bar. Here are my results.
I didn't do any modification to the xml files yet. I would like to get where I can edit the images out of those files as well. I removed the up/down arrows, but it was more of a replace with a 1x1px png. you get errors if the files are not put back with the right names or if files are missing. So I'm sure in the xml you would be able to edit it out.
One last thing. There really isn't much space on the /system mount. even when coping the file back up after repacking, I would ofter get not enough space on disk error. Trying again resulted in a success.
How about something else. I am not the best artist or graphics person. I'm sure that my files are larger then they should be. I had to do a 255 index on the color to get the image files down small enough. I'm sure with proper programming on my part, I wouldn't need the bar image, just the tux image. /shrug. I'm tired and going to be.
Enjoy.
Impressive. What does it look like with the apps menu expanded?
Oh, and how do you take screenshots?
It looks like it would noramally but with a tux on it instead of the grey bar. I will have to gt another image up.
The program to take screen shots is ddms (i think). It is in the tools directory of the sdk. Sorry, I just woke up for work.. not much sleep. But I do know if you are running linux it has to be on a 32bit os. It wouldn't run on my 64bit ubuntu.
a question I received
kron2 said:
can you help me i am new to linux and would like to edit some off the images in the app folder on the G1 my phone is jailbroke and i have the files to resign the apk's but don't no how to use them i no how to remove the files from the phone and edit them with rar. and thin i put the files back and rename the file apk but don't no how to resign it i have the emulator and ddms plus eclipse working i would think i resign it after i edit it but don't no where to put the files or how to use signapk.jar thx for your help
Click to expand...
Click to collapse
I don't know how much help I can be with the jar tool. I can tell you what I did though.
I used adb to get the /system/app/Launcher.apk file. The I extracted the file. So now I have the .apk file and a folder with all of the files in it. I then copied the .apk file to make a backup of it, just in case I needed to push it to the device.
Ok now I am set to do the editing of the files. I use Linux so I started gimp up editing an image. Then saved the image, keeping it the same size (56x295 - something like that) as the previous file. The files size (k/mb) will change. You need to keep this as small as you can.
I then started up Archive Manager, I think that you said that you use winrar or something. You might want to try 7zip, not sure though. Onward. I opened the .apk with the archive manager. The allowed me not to have repack the archive. I then dragged and dropped the edited .png file into the same folder I edited it from, into the same folder browsing though the archive manager. This did nothing more than update the .apk archive with the edited file.
then I pushed the file back to the droid. I hit the end button to turn the screen off and then menu x2 to get into the interface again. This refreshed the interface. and my edits were there.
That is about it. I'm going to copy and paste this reply in the forum so others will benefit from your question.

Standalone apk installer with adb

I made a little file where u can drag'n'drop files u want to install on ur phone.
No need of any settings.
When your phone is allready "adb ready" you dont need to have anything running.
Just take the apk File and drag on the exe and it will install. thats all.
perhaps i'll add more features soon. i made it for myself, to install the apk's faster after a full-wipe i made.
In Windows7 and Vista, it needs Admin rights (so it asks when starting) and AFTER its done, it gives an error. But it works how it should!
so don't worry
PS: Doubleclicking it won't do anything! Its Drag'n'Drop only!!
Another one by me
copy and paste the following into a file and save it on your desktop as install.bat (or whatever you fancy)
@echo off
adb install %1
pause
Then drag and drop files onto it, or associate apk files with install.bat and double click an apk file and will install to your phone.
htcmagic said:
copy and paste the following into a file and save it on your desktop as install.bat (or whatever you fancy)
@echo off
adb install %1
pause
Then drag and drop files onto it, or associate apk files with install.bat and double click an apk file and will install to your phone.
Click to expand...
Click to collapse
What do u want to say with ur post?
Did i made any question? i think not, so what r u explaining and for WHO??
It's just what i made in my "tool".
Made little bigger better Tool with 5 Options now
if anyone wants it, its at the bottom.
Now u can install apks, uninstall non-stock apks, push and pull files to & from /system/app/ and reboot ur phone.
ahhh, and not it wont make any errors or need for "admin rights" when starting the tool.
Works like a charm and now it has an Sketched android in it ! Yeehaaa
your program (the install part) doesnt really work. it doesnt install. i found that making the batch file was better.
hmm ok, thats weird. for me the new tool works perfekt.
And it IS a batchfile, i just merged the needed files from adb and the .bat file to one exe file. thats all.
do u get any error when trying to install ?
You do drag and drop the file to the exe and choose install apk, right?
Geeze, are people these days so lazy that they can't move their hand off the mouse? Just type the command!!!! Its easy... "adb install {file.apk}".
You know, back in the dark ages of not very long ago, NOBODY had a mouse. Or drag and drop. EVERYTHING was on the keyboard and involved typing commands.
If you guys want and you are running Windows, check out our app. www.androidmanager.net ... we added feature for installing apk-s by double-clicking few days ago

Help with editing apk files on MAC osX!

As the title says can someone show me how to do this strictly on a mac!
I have failed miserably at it!
All the tools are for windows..
I have the sdk for mac all set up and I can push an pull files!
but everything I edit on the mac and push to the phone crashes the phone with force closes and stuff...
-kitt050383
I came across this in a google search for the same thing. Can someone post a how-to step by step for modding .apk files with adb commands to push to the phone? Thanks in Advance.
Me as well please, been searching for a good 30 minutes now and cant find any tools to do this on a MAC, especially to edit the .9.png's
I just pull the apk and open it with BetterZip. APKs are pretty much like zip files. Then after I'm done, I sign it and push it back to the phone.
ajones7279 said:
I just pull the apk and open it with BetterZip. APKs are pretty much like zip files. Then after I'm done, I sign it and push it back to the phone.
Click to expand...
Click to collapse
So, i change the extension to .zip double click and it unzips it. Open the folder, edit the files... and then i just switch the extension back to .apk?
I dont get what you are saying.
If you're using the default archiver, you may have to change it to .zip. Since I use betterzip, I just associated the .apk extension with BetterZip so it automatically opens it like an archive. Now, extract the contents of the apk, make whatever changes you please, put the contents back into the archive, sign the apk, then push it back to the phone. I'm typing this from my Hero so I'll try to make a more detailed post when I get off.
ajones7279 said:
If you're using the default archiver, you may have to change it to .zip. Since I use betterzip, I just associated the .apk extension with BetterZip so it automatically opens it like an archive. Now, extract the contents of the apk, make whatever changes you please, put the contents back into the archive, sign the apk, then push it back to the phone. I'm typing this from my Hero so I'll try to make a more detailed post when I get off.
Click to expand...
Click to collapse
Thanks for the tip! I'll give it a shot tomorrow.
Didn't know Betterzip was out there. I'll give it a try later tonight as well.
almost there...
ok i can transform an apk to a zip and unzip for editing, but how do i change it back? i just did a bunch of editing work, and now i am stuck. please help me....
So pretty much we all want to know the same thing...
Once we get the apk open... and we change files around how do we get it back to an apk file.
anyone gonna help?
ipeench said:
So pretty much we all want to know the same thing...
Once we get the apk open... and we change files around how do we get it back to an apk file.
anyone gonna help?
Click to expand...
Click to collapse
someone did.
http://forum.xda-developers.com/showpost.php?p=5849463&postcount=6
Better Zip works great for this. Now, if there was a way to do zero compression like the APK Manager. Without that, the sounds for lock/unlock won't work.
Me too have the same problem. I think installing windows on your mac will work fine with all .exe tools. if you don't wanna do anything o your osx then you can run a virtualbox and run windows without affecting os x.
NO WAY
ajones7279 said:
I just pull the apk and open it with BetterZip. APKs are pretty much like zip files. Then after I'm done, I sign it and push it back to the phone.
Click to expand...
Click to collapse
Hi, I have tried to extract the APK with BetterZip.
I can extract files. But, XML file are like unable to open.
The image files are quite OK.
My purpose is to check out Manifest File and other XML Files.
So, if you can actually do those things after extracting with BetterZip, do let me know.
Thanks in advance.
The most useful way is install Windows via Bootcamp or Virtual Machine...
While I don't have a Mac, I should be able to help. First, rename the extension from .apk to .zip so it can be viewed and extracted from whatever archive manager you use. Doing this won't decompile the apk but it will at least let you modify the images. If you want to modify the xml's in the apk file. You can use Apktool which will decompile and recompile apk's, and sign the apk if it's a non-system app. You will also need to have JDK installed to do this.
JDK: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
Apktool: https://code.google.com/p/android-apktool/downloads/list

.png question

Is there a way i can change png files on my phone from my phone? I want to change the calling icon in the framework-res.apk. i found out a way to change it with an app in the market. But i dont know how to put it back in the apk. Help please.
find the picture --> backup it --> put in your picture with the same name and exactly the same bigness (pixels) --> bingo
cheers, stephan1
its not that easy. any other ideas anybody please.
Well if the file is a .9.png then it won't be that easy because these files are compiled to binary. (correct me if I'm wrong devs) You will need to do a little more reading to figure this one out. Also, you can't just "unzip" an apk and mess around with the pics and think that it's going to work when you zip it backup. My understanding is that you have to place the file that you are replacing into the compressed(i.e. zipped) apk.
Once again, Devs, correct me if I am wrong but all my info comes straight from using the search button...Try it out
jballz0682 said:
Well if the file is a .9.png then it won't be that easy because these files are compiled to binary. (correct me if I'm wrong devs) You will need to do a little more reading to figure this one out. Also, you can't just "unzip" an apk and mess around with the pics and think that it's going to work when you zip it backup. My understanding is that you have to place the file that you are replacing into the compressed(i.e. zipped) apk.
Once again, Devs, correct me if I am wrong but all my info comes straight from using the search button...Try it out
Click to expand...
Click to collapse
You're right, and wrong. You can unzip an .apk and mess with the images, then rezip it back up and rename it to (yourapk).apk from (yourapk).zip, you just need to sign it when you're done.
I haven't messed with anything entitled ".9.png", but if it's binary then hex editing it is probably the quickest way to edit it, otherwise there is a program called 'apktool' that can decompile apk's and is pretty effective, I've used it a few times
dmullins80 said:
its not that easy. any other ideas anybody please.
Click to expand...
Click to collapse
Pull framework-res.apk from your phone, to your computer's desktop. Use Winrar, or a similar archive extracting program, to open the file, then click Extract -> (some folder on your desktop that has nothing else in it)
Find the picture you want to change, make sure your new picture is the same dimensions (e.g; 320x480) and is the same type of file (e.g; .png) and replace the stock image with your custom image.
Once that's done, highlight all files and folders in the root of the folder you extracted framework-res.apk to -> (if using Winrar) Right-Click -> Add to archive -> Change archive type to .zip and click OK -> Right click on your newly created framework-res.zip and change the extension to .apk (you might need to open a windows explorer window and select tools->folder options->view tab->uncheck 'hide extensions for known filetypes).
Once that's done, you'll need to sign your new framework-res.apk. You can do that with EasySign. Download EasySign to your desktop, extract the archive and open a Windows Command Prompt (Start->All Programs->Accessories->Command Prompt). You'll need the Java JDK installed.
Drag your newly created framework-res.apk file into your EasySign folder on your desktop and down the following;
Type the following, assuming you have Windows 7 or Vista:
Code:
cd C:\Users\(your username on your PC)\Desktop\EasySign
You should now see the following;
Code:
C:\Users\(your username on your PC)\Desktop\EasySign>
You should now type the following;
Code:
java -jar signapk.jar testkey.x509.pem testkey.pk8 framework-res.apk framework-res_signed.apk
It'll take a moment, then you'll see;
Code:
C:\Users\(your username on your PC)\Desktop\EasySign>java -jar signapk.jar testkey.x509.pem testkey.pk8 framework-res.apk framework-res_signed.apk
C:\Users\(your username on your PC)\Desktop\EasySign>
...and you should now have framework-res_signed.apk in your EasySign folder on your desktop.
Pull it to your desktop and rename it framework-res.apk and put it back where you got it, most likely using adb (if using adb, put it in C:\(your androidsdk folder)\tools and type the following;
Code:
adb remount
adb push framework-res.apk /system/framework
adb reboot
Alternatively, you can place it on your sdcard and use a program like Astro to move it to /system/framework and immediately reboot your phone for the changes to take effect.
Enjoy, it took me like 10 minutes to type this
-mak
Thanks for the wirte up, (i've been try to do something simaler to this for a while). I got to the end but then I get this error in the cmd window. Any thoughts?
'java' is not recognized as an internal or external command,
operable program or batch file.
jadesdan said:
Thanks for the wirte up, (i've been try to do something simaler to this for a while). I got to the end but then I get this error in the cmd window. Any thoughts?
'java' is not recognized as an internal or external command,
operable program or batch file.
Click to expand...
Click to collapse
Sorry, I should have mentioned you'll need the Java JDK installed.
.mak is that the same one by Stericson?
here
sorry if that is slightly OT, just rebuilding the PC setup and need the files, so not sure which one I want to use - his worked last time for me well.
thanks~
dianeofarcadia said:
.mak is that the same one by Stericson?
here
sorry if that is slightly OT, just rebuilding the PC setup and need the files, so not sure which one I want to use - his worked last time for me well.
thanks~
Click to expand...
Click to collapse
EasySign? I'm not sure, I've only downloaded it from grdlock's site. The one you linked to actually looks easier to use..
when you re-zip the file after editing do you use normal compression or store?
Magnum72 said:
when you re-zip the file after editing do you use normal compression or store?
Click to expand...
Click to collapse
Normal if you're in Windows, otherwise .gz (most compatible) under linux.
.mak said:
Sorry, I should have mentioned you'll need the Java JDK installed.
Click to expand...
Click to collapse
I've installed it, but I still get the same error. Do I need to set a system path within java?
If I get this working it will solve many of my 'problems' Thank you!
I used ubuntu... what I did was change the default unknown call icon... I opened the Phone.apk in ubuntu and replaced the pic with another icon from another rom of my choice making sure it had the exact same name.. then went back to windows, pushed phone.apk and got it no problem... ubuntu opens the apk's without having to unzip them...
droidfreak said:
I used ubuntu... what I did was change the default unknown call icon... I opened the Phone.apk in ubuntu and replaced the pic with another icon from another rom of my choice making sure it had the exact same name.. then went back to windows, pushed phone.apk and got it no problem... ubuntu opens the apk's without having to unzip them...
Click to expand...
Click to collapse
I did that with the numbers on the dialer and the home launcher icon in the Tainted Vanilla thread. But there are other apk's that are a bit touchy. Once I learn how to sign them, I think it might open up a whole new world of skinning for me.
Yeh it would be good to get that down... it would open a huge door.. make things easier..
Question; in order for the above process to work, must you be rooted? I would love to change icons...unfortunately my naive-impatient self flashed the leak when it was first brought public.
Ngmanis said:
Question; in order for the above process to work, must you be rooted? I would love to change icons...unfortunately my naive-impatient self flashed the leak when it was first brought public.
Click to expand...
Click to collapse
Unfortunately you do need to be rooted for these changes to occur, however you can still do some customization with apps like Bettercut or ones similar.
jadesdan said:
I've installed it, but I still get the same error. Do I need to set a system path within java?
If I get this working it will solve many of my 'problems' Thank you!
Click to expand...
Click to collapse
I didn't, and it works for me. Are you using the proper commands, exactly as shown in my tutorial?
.mak said:
I didn't, and it works for me. Are you using the proper commands, exactly as shown in my tutorial?
Click to expand...
Click to collapse
Yes! Even coy and paste (except for changing the name of the apk I'm trying to sign).
I've downloaded the java link that you provided and installed, redownloaded and installed the JRE, rebooted. THe java site tells me I have the latest and greatest of everything.
I know it's got to be something I'm doing wrong, I get the same error with Autosign and other batch signing tools. I just don't know what my problem is.
jadesdan said:
I've installed it, but I still get the same error. Do I need to set a system path within java?
If I get this working it will solve many of my 'problems' Thank you!
Click to expand...
Click to collapse
jadesdan said:
Yes! Even coy and paste (except for changing the name of the apk I'm trying to sign).
I've downloaded the java link that you provided and installed, redownloaded and installed the JRE, rebooted. THe java site tells me I have the latest and greatest of everything.
I know it's got to be something I'm doing wrong, I get the same error with Autosign and other batch signing tools. I just don't know what my problem is.
Click to expand...
Click to collapse
Did you make sure to cd into the proper folder from command prompt? I've made this mistake a time or two;
Code:
cd C:\Users\(your username on your PC)\Desktop\EasySign>
^^ assuming you have EasySign in a folder called EasySign on your desktop, and that you change (your username on your PC) to your actual username.

how do I drag a hidden file from my N6 (or any Android phone) to my computer?

This question is not really N6 specific. It could be for any rooted Android device... It's just that I have an N6 and I don't know where else on XDA to ask it
N6 running great, rooted, final stock ROM they issued...
Mine has a hidden file (a Barnes and Noble Nook book) that is only discoverable using a root file explorer. Which I have, and I found the file I want to drag to my desktop. So far so good.
BUT
How do I drag that file over to my desktop? Android File Transfer (I'm on a Mac), doesn't see all of the file structure and definitely not hidden files, (unless I can change something in configuration). I've tried middle manning it by moving it to Drive or attaching it to an email and mailing it to myself, but each time I try, "Root Browser" crashes.
So in short, I need root to find this file. I have root and I found the file. All I need to do is to take a copy of the file (it's a data file not a system file). But I don't know how to.
-Peter
There are a number of ways, but you may end up disappointed in the end. Your book is likely protected by DRM, so even if you copy the file, you can't open it.
Here is one of the many ways to copy:
Install a terminal app on your phone. I use JuiceSSH, but there are many others.
You'll need the path to your file. It might be something like /sdcard/barnesnoble/book.pdf.
If the file requires root to read, first write su <enter>
Then use cp to copy:
cp <from path> <to path> <enter>
For to path, use /sdcard/
Once copied, it should be visible on your computer.

Categories

Resources