![]() |
[Tutorial] Creating a deb for apks to be used in conjunction with apkenv
1 Attachment(s)
So you may have seen this thing called apkenv, which allows a very "small" set of Android apks to be run inside Harmattan.
If you follow me on Twitter, you would have seen I have been doing some experimental packaging, make these apks appear to be fully fledged apps (launcher icon, app mgr info, tap>hold>uninstall, etc). NOTE:This method still requires you to install apkenv+libraries before you can use the apps you make. It also will work assuming you followed the original tutorial EXACTLY! I also assume you use linux (I use ubuntu VM ). Obviously, I do not condone publishing apks for those you do not have the right to use, so I will simply post a tutorial using a skeleton archive (attached) to help. First up, extract the archive to the desktop. Rename the folder to whatever you wish to call the app. (Will call it foobar from here-in). Inside foobar there is a debian folder, opt folder and foobar.desktop. First, we will modify the opt folder. In the opt folder, you should have a sub directory foobar. This is where you store your .apk, icon.png (80x80), and execution script. The execution script isn't too important if you are confident at running command using the foobar.desktop file. However, I still suggest using this method, as it has greater control over tasks in my opinion. Once you have opt/ all sorted, it is time to move on to the debian directory. Inside this we have postinst , changelog, control, foobar.install, mainfest.aegis, readme and rules. The only files you need to edit are postinst, changelog, control and foobar.install. Open foobar.install in a text editor, changing the paths used to suit the /opt of your app. Same goes for postinst, simply adjust the paths to suit your package. Changelog simply change foobar and the author information. In control, change the Description, Maintainer, source, package and x-Maemo-Display-Name fields. Everything Else can stay the same. Finally, edit the foobar.desktop file. Here, we control what the user sees on the launcher page. The icon and exec fields simply need to have their paths altered. Change Name= to the name you want displayed. P.S: I simply re-use the same structure for all my packaging (due to my app's being scripts and not QML/GUI based) so you may see out of place names eg. Harmoji, ABSapce etc. If so, I apologise, I have triple checked everything but I could have missed something. I trust if you're skilled enough to be doing this sort of thing, you will have the logic to change them accordingly. Next, is compiling the deb. To compile, I suggest you take a look at this guide. It is extensive, and helped me out once. http://talk.maemo.org/showthread.php?t=80908 Huge thanks to NovaG for being the first to teach me how to package .deb files. |
Re: [Tutorial] Creating a deb for apks to be used in conjunction with apkenv
Is that _MACOSX folder is necessary in the package?
|
Re: [Tutorial] Creating a deb for apks to be used in conjunction with apkenv
Quote:
|
Re: [Tutorial] Creating a deb for apks to be used in conjunction with apkenv
There is something wrong with the archive. (May be not.) I had to do two things to make a successful deb.
1) When I tried with exact similar archive it showed dependency error. With modified control file in the archive I got installation interrupted error. (Then I tried your angry birds control elements with modification.) 2) desktop file moved to /usr/share/applications BTW I tried deb packaging on N9 not Pc. PS: there is a hidden unwanted DSstore file too in that archive may be from your system. Easy to confuse people like me. :) |
Re: [Tutorial] Creating a deb for apks to be used in conjunction with apkenv
Yes DSstore is not required too...
Maybe you want to post what you have done? |
Re: [Tutorial] Creating a deb for apks to be used in conjunction with apkenv
Yup sure. Wait a little. Writing... Now saved game datas are working seperate for each games. You can reboot/play another game without fear of losing saved datas.
|
Re: [Tutorial] Creating a deb for apks to be used in conjunction with apkenv
2 Attachment(s)
All right. Here is it. Wrote it with people like me in mind. You might know most of the part. Still have a read. I don't have an N900 but I think the steps are working for N900 too.
Install apkenv and binaries from apkenv wiki page or from here. Strongly recommend you to put apkenv and binaries in /home/user/apkenv. With apkenv you can run android games on your N9/N900. You will lose game datas after every boot or you will lose previously played game's datas when you try another game. To run an apk execute Code:
cd /home/user/apkenv Now download scripts.zip and extract. It contains apkenvwrp.sh and make-deb.sh. Open terminal or filebox. Create a folder .apkenvwrp in /home/user/ and copy apkenvwrp.sh to the folder created. Code:
mkdir -p /home/user/.apkenvwrp To run apk files with apkenvwrp script. Execute it like Code:
cd /home/user/.apkenvwrp TUTORIAL: Deb Packaging Let's do some necessary things first. Hope you still have the downloaded scripts.zip file. Extract it and get make-deb.sh Code:
devel-su Extract foobar.zip. You will get a foobar directory. Inside are 3 sub folders named DEBIAN, opt and usr. Inside DEBIAN you have a control file and postinst file. Inside opt there is a foobar folder and inside it you have an 80x80 icon file, and an apk file. Inside /usr/share/applications/ you will find foobar.desktop. Steps for Deb Packaging 1) Copy the foobar directory to /home/user/ Code:
cp -r /path/to/foobar /home/user/ 2) Give read and execute permission to DEBIAN and content inside it. Code:
chmod 755 /home/user/foobar/DEBIAN/ Code:
make-deb /home/user/foobar Code:
cp -r /home/user/foobar_0.1.deb /home/user/MyDocs/ If you have any confusion feel free to ask. All the informations are taken from various TMO threads. Credits go to the respective authors with my respect. Credits apkenv: thp apkenvwrp.sh: PIDk deb packaging: ammyt, Zas make-deb script: Zas apk to deb tutorial: MFaroTusino |
Re: [Tutorial] Creating a deb for apks to be used in conjunction with apkenv
1 Attachment(s)
For you people who said Angry Birds Seasons is not working. Try it with apkenvwrp.sh script described above. It will work!
cd /home/user/.apkenvwrp sh apkenvwrp.sh /path/to/angrybirdsseasons.apk And for those who want an icon in launcher view but don't want to do deb packaging or don't want to lose some storage sapce just make a desktop file with path to icon and exec=sh /home/user/.apkenvwrp/apkenvwrp.sh /path/to/your/apk EDIT: Incase of extreme laziness, I have attached a sample desktop file. Edit it and place it in /usr/share/applications to launch your apk. devel-su password cp -r /path/to/your/desktop /usr/share/applications |
Re: [Tutorial] Creating a deb for apks to be used in conjunction with apkenv
what about N900 ? Will this guide work for it also or just harmattan ?
|
Re: [Tutorial] Creating a deb for apks to be used in conjunction with apkenv
Quote:
Atleast I can say apkenvwrp part is working for both N9 and N900 for sure. You can read this thread for complete deb packing on N900. |
All times are GMT. The time now is 18:04. |
vBulletin® Version 3.8.8