flat assembler
Message board for the users of flat assembler.

Index > Non-x86 architectures > Fasm ARM how create apk for androide ?

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 835
Roman
Fasm ARM how create apk for androide version 9.0 ?
Post 16 Aug 2019, 08:20
View user's profile Send private message Reply with quote
ProMiNick



Joined: 24 Mar 2012
Posts: 600
Location: Russian Federation, Sochi
ProMiNick
APK is not executable format.
However it(package apk) contains binary (DVM - Dalvic Virtual Machine code) it has absolutely no relation to ARM native architecture code.
So for dalvic thou should look for example of fasmg with creating java class.
dalvic is child of java (in some approximation).

But not all is lost
Dalvik allowed to use in it native code(written in C++ or assembly(fasmARM for ex.)).
So dalvic could be in same role as MZ format for PE format - it incapsulate this and delegating control to PE.

But until now Dalvic-stub isn`t exist.
If someone will create it - it will open way of assemblers to android.
Post 16 Aug 2019, 10:42
View user's profile Send private message Send e-mail Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17719
Location: In your JS exploiting you and your system
revolution
I think the APK file is just a ZIP. So once you have all the necessary asset and code files ready you just ZIP them together and name it APK.

Of course the hard part is generating the asset and code files. Razz
Post 16 Aug 2019, 11:37
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 835
Roman
Post 16 Aug 2019, 15:52
View user's profile Send private message Reply with quote
ProMiNick



Joined: 24 Mar 2012
Posts: 600
Location: Russian Federation, Sochi
ProMiNick
By thour link described creation of ELF (not APK) - and way how to copy that elf with rights for execute it, and than execute it.
In fasmg instruction set AARCH64 looks that inside there is a example that will work on phone, the way how to copy it to android thou post thouself.

But I think ELF will not run on android without ROOT rights.
Post 16 Aug 2019, 18:58
View user's profile Send private message Send e-mail Reply with quote
MazeGen



Joined: 06 Oct 2003
Posts: 977
Location: Czechoslovakia
MazeGen
Try:

1. Android Studio: create project and add C++ sources. The IDE has menu option for that and it even generates simple C++ function for you.
2. Call the function from Java
3. Build your FASMARM code as a shared library (.so); export the same symbol from your code as the C++ code does
4. Unpack the APK and replace the .so file with yours
5. Pack it all to a new APK file and sign it
Post 04 Jan 2020, 12:35
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.