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: 1766
Roman 16 Aug 2019, 08:20
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: 798
Location: Russian Federation, Sochi
ProMiNick 16 Aug 2019, 10:42
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: 20298
Location: In your JS exploiting you and your system
revolution 16 Aug 2019, 11:37
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: 1766
Roman 16 Aug 2019, 15:52
Post 16 Aug 2019, 15:52
View user's profile Send private message Reply with quote
ProMiNick



Joined: 24 Mar 2012
Posts: 798
Location: Russian Federation, Sochi
ProMiNick 16 Aug 2019, 18:58
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 04 Jan 2020, 12:35
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
Seenkao



Joined: 20 Aug 2022
Posts: 1
Seenkao 20 Aug 2022, 12:17
Для создания APK желательно использовать различные среды, работающие с Java-кодом.
Android Studio, Eclipse (последние Android не поддерживаются) и подобные. Так же можно использовать Ant, Gradle напрямую.

Вы должны создать *.so библиотеку из своего кода. Загрузить эту библиотеку посредством Java-кода и использовать посредством JNI.

Прочтите Retabouil "Android NDK" (есть книжка на русском). Она рассказывает достаточно немало подробностей.

Взгляните как работают с NDK ЯВУ (FPC/Lazarus, C/C++). Примеры есть в самом NDK.

Я использую данный вариант через ZenGL (FPC/Lazarus). Есть так же примеры использования Gradle с помощью LAWM (FPC/Lazarus).

***************************************************************
Google translate:
To create an APK, it is desirable to use various environments that work with Java code.
Android Studio, Eclipse (latest Android not supported) and the like. You can also use Ant, Gradle directly.

You must create *.so library from your code. Download this library via Java code and use via JNI.

Read Retabouil "Android NDK" (there is a book in Russian). She tells quite a lot of details.

Take a look at how they work with the Java NDK (FPC/Lazarus, C/C++). There are examples in the NDK itself.

I use this option through ZenGL (FPC/Lazarus). There are also examples of using Gradle with LAWM (FPC/Lazarus).

Collect "Hello World" to understand how this is done, and then it will be easier.
Соберите "Hello World" для понимания, как это делается, а дальше будет проще.

_________________
ZenGL
Post 20 Aug 2022, 12:17
View user's profile Send private message Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 12736
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 0010456
sleepsleep 17 Mar 2023, 09:06
Post 17 Mar 2023, 09:06
View user's profile Send private message 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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.