Related
hi folks!
i'm not a developer but sometimes i do some scripting.Now i'm working on a project that called "APK2",and i think that could be useful!
Some months ago, I thought "why don't create a package manager and a package system to install real linux packages, and not just apps? I may want to install some command-line tools to run with terminal emulator" then I wrote this script, named apk2.sh, that installs some particular packages (I wrote another script to easily create this type of packages): he simply does the apt-like un-tar in /, but it installs a config directory too, to remove the installed packages.
It supports the preinst, postinst, prerm, postrm scripts too.
Tell me if it could be interesting, and I'll put it here.
If so, I need testers
If not, simply tell me, and I give up.
so could you be able to run like air crack through debian with this or?
olvap377 said:
so could you be able to run like air crack through debian with this or?
Click to expand...
Click to collapse
I could be able to run it on Android if someone can port all the libs to armv5e
I know, you have to do the porting in order to run it, but for example if there is the package for debian armv5 I think it should work if you take all the deps from the repo (may need some repacking, just to remove the CONTROL folder, and maybe to add the file needed to uninstall and various preinst, postinst etc. ).
And you don't need to run a debian or an ubuntu on Android, that's not really fast.
What do you think?
i think that this sounds really good and if it worked fully it would be a major addition to android development im hoping youll continue with this
olvap377 said:
i think that this sounds really good and if it worked fully it would be a major addition to android development im hoping youll continue with this
Click to expand...
Click to collapse
Thank you!
Any tester? I attach the scripts to now how apk2 works, just run it without any parameter, and it will show you
The other script it's simple to use, you just have to run it once to create in your home the basilar directory tree, you have to complete it and put the files in it, then you just have to put your preinst-postinst-prerm-postrm scripts in the ~/yourpackage/system/etc/apk2 directory, if you have some.
Then run the script again, insert the same package name, and here we are! The package is build! It's in the packagename directory in your home, in .apk2 and in .tar.gz, if you have to edit something do it on the tar.gz, and then change the extension in .apk2
PS: rename the files *.sh.txt into *.sh, because this forum doesn't allow .sh attachments...
xela92 said:
Thank you!
Any tester? I attach the scripts to now how apk2 works, just run it without any parameter, and it will show you
The other script it's simple to use, you just have to run it once to create in your home the basilar directory tree, you have to complete it and put the files in it, then you just have to put your preinst-postinst-prerm-postrm scripts in the ~/yourpackage/system/etc/apk2 directory, if you have some.
Then run the script again, insert the same package name, and here we are! The package is build! It's in the packagename directory in your home, in .apk2 and in .tar.gz, if you have to edit something do it on the tar.gz, and then change the extension in .apk2
PS: rename the files *.sh.txt into *.sh, because this forum doesn't allow .sh attachments...
Click to expand...
Click to collapse
in non-linux speak (layman's terms), what could i do with this...my interest is peaked
what are some "real linux packages" that one might want
tnpapadakos said:
in non-linux speak (layman's terms), what could i do with this...my interest is peaked
what are some "real linux packages" that one might want
Click to expand...
Click to collapse
i.e., the one olvap377 mentioned: air crack (I think it's possible).
or, we can run every app that does not need X server.
I created some demo packages (containing 2 scripts), one is SwapTools, and lets you enable/disable swap with 2 simple cmds (swap-enable and swap-disable); at the first run it collects some info, like the swappiness and the swap partition, then it saves the conf in a file (using swap-disable with --remove-conf will remove the conf file).
Another one I created is remount: you can remount your /system partition rw or ro just by typing on a terminal emulator
Code:
remount rw
or
Code:
remount ro
But you can try to use other appz compiled for armv5 processors, like all the debian apps, except for the one with GUI (we run on framebuffer, no X server :/ )
PS: I attach the pkgs, I added the .zip extension, just rename it in pkgname.apk2
Honest question: Why reinvent the wheel? Other embedded Linux projects have used ipkg to good effect, or its close relative opkg (refs from same link) which is used by Openmoko. A port of this to Android systems which have uClibc should be nearly trivial.
xela92 said:
i.e., the one olvap377 mentioned: air crack (I think it's possible).
or, we can run every app that does not need X server.
I created some demo packages (containing 2 scripts), one is SwapTools, and lets you enable/disable swap with 2 simple cmds (swap-enable and swap-disable); at the first run it collects some info, like the swappiness and the swap partition, then it saves the conf in a file (using swap-disable with --remove-conf will remove the conf file).
Another one I created is remount: you can remount your /system partition rw or ro just by typing on a terminal emulator
Code:
remount rw
or
Code:
remount ro
But you can try to use other appz compiled for armv5 processors, like all the debian apps, except for the one with GUI (we run on framebuffer, no X server :/ )
PS: I attach the pkgs, I added the .zip extension, just rename it in pkgname.apk2
Click to expand...
Click to collapse
thanks dude
olearyp said:
Honest question: Why reinvent the wheel? Other embedded Linux projects have used ipkg to good effect, or its close relative opkg (refs from same link) which is used by Openmoko. A port of this to Android systems which have uClibc should be nearly trivial.
Click to expand...
Click to collapse
I have also an Openmoko phone
I know very well ipkg/opkg, it could be interesting a porting, but I thought it was better to create a little lighter script to do it, because 1. a script that uses sh is usable in every system, you can either to install armv5e pkgs, or any armv* pkg, you have just to change some little things; 2. I don't know how to port, and I'm not able to do programming.
If you are interested and know how to do a porting, it could be very useful, because opkg has really lots of functions...
I just did what I could
xela92 said:
I have also an Openmoko phone
I know very well ipkg/opkg, it could be interesting a porting, but I thought it was better to create a little lighter script to do it, because 1. a script that uses sh is usable in every system, you can either to install armv5e pkgs, or any armv* pkg, you have just to change some little things; 2. I don't know how to port, and I'm not able to do programming.
If you are interested and know how to do a porting, it could be very useful, because opkg has really lots of functions...
I just did what I could
Click to expand...
Click to collapse
Ahh, okay, I see what you mean. Fair enough; I haven't seen your work so far, I was just concerned you were doing unneeded work. 'Course sometimes it's good to do that for the learning experience.
I don't have a full build setup for Android, so I can't recompile (I do have a full build setup for building Optware packages, but that's not quite the same), but I believe most custom ROMs ship uClibc. I'm not familiar enough with uClibc to know if you need to build against an exact version, though you could copy opkg from your Openmoko phone for the heck of it and see if it runs
olearyp said:
Ahh, okay, I see what you mean. Fair enough; I haven't seen your work so far, I was just concerned you were doing unneeded work. 'Course sometimes it's good to do that for the learning experience.
I don't have a full build setup for Android, so I can't recompile (I do have a full build setup for building Optware packages, but that's not quite the same), but I believe most custom ROMs ship uClibc. I'm not familiar enough with uClibc to know if you need to build against an exact version, though you could copy opkg from your Openmoko phone for the heck of it and see if it runs
Click to expand...
Click to collapse
Ya mean, copy the binary??? If so, it won't work of course, because the architecture of the openmoko processor is armv4t, it wouldn't see my binary
Nethertheless, if someone is interested
PS: please, could someone test my scripts? Thank you dudes
xela92 said:
Ya mean, copy the binary??? If so, it won't work of course, because the architecture of the openmoko processor is armv4t, it wouldn't see my binary
Nethertheless, if someone is interested
PS: please, could someone test my scripts? Thank you dudes
Click to expand...
Click to collapse
Heh, oh, older ARM core. Not paying attention. I will now stop hijacking your thread
olearyp said:
Heh, oh, older ARM core. Not paying attention. I will now stop hijacking your thread
Click to expand...
Click to collapse
No problem, man
No testers?
Please give me a feedback. If u want, I can make some apk2 by debs for armv5... Then I accept hints like "howto manage dependencies", 'cause I've no ideas...
"Tester"
xela92 said:
Please give me a feedback. If u want, I can make some apk2 by debs for armv5... Then I accept hints like "howto manage dependencies", 'cause I've no ideas...
Click to expand...
Click to collapse
Hi I have and HTC Hero from Sprint, I'm not a linux power user but I spent lots of time in my computer running Ubuntu just for 2 big reasons 1 freeware and 2 it has the best an simplest packet manager... I love deb files that installs like any .exe win programs I love that! I'm son not a coder and have little to no skills under Linux shell I use my sudo nautilus commands and so because I need it but I hate to untar or tar gz crap... for me that it old and useless some linux power user may get offended by that comment but hi times changes we love GUI... if you manage to post prints screens or a word open office or PDF documentation dummy proof I'm very up to be a Happy tester... the other thing I'm a Digital Graphic Designer if you need some design for a GUI and can try to help you in making and eye candy app...
Here it the way I will love to see grow this project... finding a way to installed it as an apk file like others in the android market so users can install the app easy then...in top of that a simple GUI to browse to the SD card in order to get the apk2 file... you where talking about not being able to run programs that has GUI that it is sad but still interesting but a lot of work to do without a good community because that means that all GUI may need to be re-design to the different resolution on the phones and be touch friendly...
I'm not sure if I'm helping at all but I love the big picture behind your project...
I'm porting opkg on Android, but i'm can't tell that's a trivial task )))
i also wrote simple howto "building and porting linux apps for android from scratch", but on russian. If needed i can do some translating and put here too.
Also may be we can open project for buildroot-like framework for android and opkg's repository. In my how-to i'm use crosstool-ng + gcc + uClibc.
XVilka said:
I'm porting opkg on Android, but i'm can't tell that's a trivial task )))
i also wrote simple howto "building and porting linux apps for android from scratch", but on russian. If needed i can do some translating and put here too.
Also may be we can open project for buildroot-like framework for android and opkg's repository. In my how-to i'm use crosstool-ng + gcc + uClibc.
Click to expand...
Click to collapse
Wow! Please do some translating!
But, when you finish the porting, how will you manage to port the packages?
Will you use the debian pkgs changing the extension? Would it work?
Thanks a lot!
No, we want to create only android repository of packages, based on opkg (ipkg)
for arm, mips and others platfofms.
Hi:
I've recently started to develop my own comic reader. The problem I've come up with is cbr files, which are esentially rar files. Now I know there are comic readers out there (all of them, I think) that support cbr files. So there is a way of doing this, I just can't find how.
In the rarlabs official page (search google rar addons and it's the first page) there are several options. I would like to know if I download the commandline arm unrar how I could install it on Android (I have a motorola Xoom, it would be for Honeycomb), assuming that is correct.
If this is not an option is there a command line unrar application that I could call from my own? and How would the code be (to call an external application, that is)?
If the above is not possible, what is the way to get to unrar something in android?
The only real option I've seen would be to use junrar (hosted on github)
But it seems complicated and I'm not sure it works very well as I've seen a lot of conflicting reports.
Thanks for any help!
Try http://www.all-freeware.com/results/rar/for/android to unpack rar on Android.
Success,
Senax
Hi:
I'm not exactly sure what you wanted me to try. There is nothing in that page that would allow me to uncompress a rar file on android. Only a bunch of unrar utitilities and some android things but they are not related, that is, there is nothing that says unrar that also works on android.
thanks anyway.
Unrar
great app available here: androidzoom (dot) com/android_applications/tools/unrar_dhpu.html
Cheers,
Romuloxiii
Hi:
It's seems that I didn't make myself clear.
I want to develop an android application that needs to unrar files. Is there a way to call the unrar application from my own code?
If so, can you tell me how?
Otherwise, I appreciate the effort, but I can't use that.
Thank you very much!
You can bring the unrar binary along in the /asset of your app,
on first launch copy it to your apps /file directory, chmod +x it, and use exec("sh") to unrar the files from shell.
oh, I see. I think I get the the idea but I don't understand all the instructions.
What did you mean by importing thebinary on my asset?
If I do the step above why do I need to copy the binary on first launch?
Don't I need root privileges too chmod it? And how do I do it from my source code?
And finally where can I find the command line use of the application? Or is it the same as the Linux version?
I know there are a lot of questions, but please keep in mind that I'm very new at doing this.
Thanks for all the help!
You need to put it as asset to bring it along.
You need to copy it because asset files are not directly accessable.
You don't need root to chmod the file in your own directory.
You do it by using a shell from your code i.e. Process.exec("sh")
And finally you want to program the app not me,
so don't be lazy and invest some time.
Google google google google...
If there are still questions left after that, you may ask again .
Ok, I'll try it and get back to you!
Thanks!
Sorry for my lazyness, but I've been Googling for a good half hour without finding a simple 'unrar' binary executable compiled to run from terminal on rooted ARMx32 device. I don't want bloated GUI APK's or libraries for development implementation, but just the plain command line interface executable. Anyone, please? It's a pity they haven't baked it into Busybox as an applet, IMO.
AndroidSuite 2012
Coded & Tested by:
Tom Dolan (Scriptr)
Joel Duncan (Slethen)
AndroidSuite 2012 what it does
Decodes and encodes Dex files
Decodes and encodes APK files(Previously bugged in APKManager)
Gives a console output
Whats to be added?
Experimental features (currently in testing)
Thread piority
Config editor
Help file
System requirements:
Windows (XP/Vista/7)
1024x768 monitor resolution
512MB free system memory
Java (JRE/JDK 6 prefered)
Android Suite 2012 by Team Scripthen
APKs:
Place the APKs in the directory \apk\
refresh the list,
select from the first list box which one you want to decode then hit
"decode selected" you can then edit the source in "decoded-apks".
to re-encode, refresh the list again, the select from the second list which directory
you'd like to encode hit "encode selected" once the progress bar has stopped you can
then safetly remove the APK from "encoded-apks" directory.
Dex:
place your .dex file in the directory "\repo\Dex" go to the main window and then hit
"Decode Dex", then you can click "Open OUT Directory" to view the source code.
Once finished with the source code you can then hit "Encode Dex" to reencode it to
"classes.dex" which will appear in programs root.
Experimental:
Version 99 they do not work.
However, when they do work, this shall be updated but you are to be careful and
take note it is not our fault if anything goes wrong, as these are critical these
will be throughly tested to ensure the correct configuration is used.
Experimental features added:
Apply update.zip;
Applies an update.zip to the device,
please note:
To apply the update, the archive needs to be in %PROGRAMROOT%\repo\
Reboot;
Send reboot signal to the phone
Boot to fast mode;
Reboot the phone to fast mode
boot.img;
This has NOT been fully tested!!!
To apply the new boot image put it in %PROGRAMROOT%\repo\
It would be extremely helpful if you were to post bugs/errors on this topic so we can find them easier.
http://node2.scriptr.co.uk/Dev/AndroidSuite/
thanks,
Scriptr|Slethen=Scripthen
first of all, thank you for this, it looks great! However, I am unable to encode anything. I get a sound effect as soon as i click encode decoded directory and the progress bar moves at an incredibly slow pace. is it doing what it's supposed to do? I let it sit for 15 minutes and nothing ever happened.
How big is the apk? And whats your cpu speed?
the app size is 5mb and my cpu is an i5 clocked at 2.3ghz. the odd thing to me is that it doesn't seem to try to encode the apk at all. when the decode finishes, a chime goes off. that same chime sounds within half a second of my trying to encode the same app. The decode works perfectly though!
pokedroid said:
the app size is 5mb and my cpu is an i5 clocked at 2.3ghz. the odd thing to me is that it doesn't seem to try to encode the apk at all. when the decode finishes, a chime goes off. that same chime sounds within half a second of my trying to encode the same app. The decode works perfectly though!
Click to expand...
Click to collapse
Does the Console output give you any errors? or could you paste what the error is instead of clogging the chat.
What it sounds is that you dont have java recognised as a program. I will fix that when I log on Windows again.
please use pastie (google I cant use links yet) with the error so we can look into it.
-Tom.
pokedroid said:
the app size is 5mb and my cpu is an i5 clocked at 2.3ghz. the odd thing to me is that it doesn't seem to try to encode the apk at all. when the decode finishes, a chime goes off. that same chime sounds within half a second of my trying to encode the same app. The decode works perfectly though!
Click to expand...
Click to collapse
Updated, your problem might be fixed.
Might be an idea to state in the title or under system requirements whether this is for Linux or Winblows.
Hey, I just downloaded android suite, but seems that the zip is damaged.
The folders from the zip created, but no files and I get errors from winrar like this:
Unknown method in bin\apktool.jar
No files to extract.
I' ll try to download it again, but can you please check it?
EDIT:
Redownload it 5 times, same errors. Archive is damaged, shows that is 36,3MB, but need less than a second to complete download(which is wrong for sure).
unzip it with Winzip, winrar cant extract it.
dancer_69 said:
Hey, I just downloaded android suite, but seems that the zip is damaged.
The folders from the zip created, but no files and I get errors from winrar like this:
Unknown method in bin\apktool.jar
No files to extract.
I' ll try to download it again, but can you please check it?
EDIT:
Redownload it 5 times, same errors. Archive is damaged, shows that is 36,3MB, but need less than a second to complete download(which is wrong for sure).
Click to expand...
Click to collapse
I'll get right on it.
Must of been the compression method, also try with 7-zip.
Right, re-uploaded with 0 compression, the archive shouldnt cause trouble now.
I'm actually unable to even get the download to start. I get an error when I click the link from google saying they can't find the requested link. I've tried 5 times.
Somehow the link had been replaced by "*****"
Here's the direct URL:
http://node2.scriptr.co.uk/Dev/AndroidSuite/AndroidSuite-b112.zip
I will add a downloader soon so hopefully it will be more efficient.
I will integrate that in next release,
sorry for all the trouble so far.
Scribblezzz said:
Somehow the link had been replaced by "*****"
Here's the direct URL:
http://node2.scriptr.co.uk/Dev/AndroidSuite/AndroidSuite-b112.zip
I will add a downloader soon so hopefully it will be more efficient.
I will integrate that in next release,
sorry for all the trouble so far.
Click to expand...
Click to collapse
What exactly is in the archive that requires us to download 113mb? To decompile and recompile and apk all you need is:
Java - Already on my system
aapt.exe - Already on my system
apktool.jar - Already on my system
Command Prompt - Well duh, part of windows.
Could you provide screenshots of the application?
cornelha said:
What exactly is in the archive that requires us to download 113mb? To decompile and recompile and apk all you need is:
Java - Already on my system
aapt.exe - Already on my system
apktool.jar - Already on my system
Command Prompt - Well duh, part of windows.
Could you provide screenshots of the application?
Click to expand...
Click to collapse
It's got the Java binaries in the directory.
as some people dont have the "java.exe" patj, it fails to load it.
I will add some screenshots later, and I shall update it later, I just need to do more testing on Java findings...
personally I'm good to go. A simple scan with an anti-virus is all I need to ensure it's legit. I have a backup so I'll take the OP's word for it. Also, no need to apologize for "problems" IMO, I have no idea how to decompile/recompile or sign an apk so even if there are bugs, you're still doing me (and a lot of others) a favor. Thanks for all of the work you've put in so far!
Screenshot of AndroidSuite2012
so, every time I try to close the .exe, a web browser opens that takes me to ad.fly.... not sure what that's about. I don't know what the link was for, so I closed it and didn't click anything. Also, the utility still doesn't seem to be able to recode the apk. the error message I received is in a .txt file attached to the link below. I didn't want to post this whole thing inline.
http://www.box.com/s/yoaxly1na5mjqhjralca
sorry, double post
I see the problem..
I will start to work on the fix later today...
Also I will test better java detection reducing the archive about 70 or so megabytes...
Sorry for the bulk archive it was just a temporary solution...
Thank you again for posting error log.
-Scribblezzz.
Hi i have read a few posts about editing apk files but most are only about editing the image files. i need to edit the classes.dex file inside the apk i have done this but when i try and install the apk it doesnt work is this possible to do? thanks
this is not to do anything illegal it is simply to make an android app i use equal to the iphone equivalent (there are less servers for the android app) so i basically want to change the url from the apk to the iphone url)
Cheers
morgs640 said:
Hi i have read a few posts about editing apk files but most are only about editing the image files. i need to edit the classes.dex file inside the apk i have done this but when i try and install the apk it doesnt work is this possible to do? thanks
this is not to do anything illegal it is simply to make an android app i use equal to the iphone equivalent (there are less servers for the android app) so i basically want to change the url from the apk to the iphone url)
Cheers
Click to expand...
Click to collapse
Tried signing the file after modding it?
Sent from my GT-S5360 using xda premium
Hi thanks for your reply, yes i have and it still doesnt work unfortunately
Use apktool to extract the APK, you'll get .smali files instead of classes.dex (this is the decompiled version). Edit these files appropriately, then repack the APK with apktool and sign it. Should work.
Does apktool require command line? if so it is too complicated for me
Yes, it does. If command line is too difficult, it's probably unlikely you'll be able to get this working I'm afraid. You could try this: http://forum.xda-developers.com/showthread.php?t=1619473
It's an IDE for editing APKs, might help. But honestly, the command line part is the easy bit
Just never had any luck with any command line stuff for android never works for me and i hate all the extra crap you have to install to use it. Thanks anyway ill see how i go.
morgs640 said:
Just never had any luck with any command line stuff for android never works for me and i hate all the extra crap you have to install to use it. Thanks anyway ill see how i go.
Click to expand...
Click to collapse
If you wanna do basic stuff wid apktool then its a reaaly easy tool.. The commands are really very small!
Apktool d xxxx.apk for decompile
Apktool b xxxx for compiling n ur done!
Even the complex ones arent difficult! Only the installing of apktool takes time and its the hardest thing in the whole procedure
Sent from my GT-S5360 using XDA
in theory apktool is faily simple. but if you compile for android 4.0 better prepare yourself for huge headaches and a couple of white hairs as this thing wont work. i know two solutions, one consists of a really stupid juggling with two versions, one old which you can barely find, and one new, decompile with the old one, compile with the new one. some guy made a mod though and it finally ends the trouble, but i haven't seen it officially pronounced, which made it so damn hard to find it, hidden in some internet forums. another problem was that aapt needs to be present in the same directory, error codes will just spew out a bunch of gibbersish and you will never know whats wrong so all thats left is trying. but once you got it working it is as easy as pie.
molesarecoming said:
some guy made a mod though and it finally ends the trouble, but i haven't seen it officially pronounced, which made it so damn hard to find it, hidden in some internet forums. but once you got it working it is as easy as pie.
Click to expand...
Click to collapse
You mean this: http://forum.xda-developers.com/showthread.php?t=1551236 ? (It was about two threads below this one at the time I posted this )
nice! i made myself little batch files for this. i just go "apkd skype" to decompile skype.apk and apkb skype for building it, zipping it, signing it. didnt even know theres a guy out there now.
SifJar said:
Yes, it does. If command line is too difficult, it's probably unlikely you'll be able to get this working I'm afraid. You could try this: http://forum.xda-developers.com/showthread.php?t=1619473
It's an IDE for editing APKs, might help. But honestly, the command line part is the easy bit
Click to expand...
Click to collapse
This program worked perfectly thank you so much
Like the title says i need a decompiling/compiling ..apktool is just not working for me!
All the other tools I know of are just wrappers around apktool, if it doesn't work nothing will. Instead of trying to find something else, troubleshoot what isn't working about apktool. Does it give some error? At what point in the process? Give as much detail as you can.
SifJar said:
All the other tools I know of are just wrappers around apktool, if it doesn't work nothing will. Instead of trying to find something else, troubleshoot what isn't working about apktool. Does it give some error? At what point in the process? Give as much detail as you can.
Click to expand...
Click to collapse
I placed two apktool files in windows folder.. Installed jre... I navigate to c/windows in cmd.. And I give command apktool if you (file direcory) without quotes...
And it just says that apktool command was not recognised..! These instructions I saw in a tutorial in xda only.. Don't remember where!!
"two apktool files" - did you download these two packages: http://android-apktool.googlecode.com/files/apktool-install-windows-r04-brut1.tar.bz2 and http://android-apktool.googlecode.com/files/apktool1.5.0.tar.bz2 and then unpack both and copy all the contents of both into C:\windows? If so, the "apktool" command WILL be recognised in the command line (from anywhere, not just in C:\Windows).