[Q] Android Sycall Interception - Android Q&A, Help & Troubleshooting

Hi,
Could someone please tell me how I could intercept all the syscalls while the phone is running?
I build the kernel from source code, and load it on the Nexus S 4G device, and I have already compiled a syscall interception module for Ubuntu. But, I do not know how a syscall interception LKM would look like for android, and how it could be incorporated into the kernel's source code to be compiled automatically when the kernel is built.
Would someone please help?
::Saman

Please use the Q&A Forum for questions Thanks
Moving to Q&A

Related

[Q] Native ARM Compiler

Hello every xda members,
I have some little questions,
Is there anyone who have a working native toolchain (binutils, gcc, newlib) that I can run under my Android Phone to build binaries directly under the phone using a terminal ?
Is there any other way to program/compile applications/binaries directly on the phone ?
I want to develop on the phone without any computer.
Thanks for your help
I was wondering the same. Found this:
specificimpulses.blogspot.com/2011/01/my-android-speaks-fortran-yours-can-too.html for building fortran natively, I think. Shouldn't be much different. Gcc is a bear to compile, at least as of 3.3.1(last time I built a cross compiler)
Here you go....
First one is ndk r23b aarch64 I built paralloid and its static busybox using this(after modifying paraloids build script a bit) I have only used it within a debian chroot, so I know it works outside termux environment. also has x86_64 toolchain alongside aarch64
GitHub - lzhiyong/termux-ndk: android-ndk for termux
android-ndk for termux. Contribute to lzhiyong/termux-ndk development by creating an account on GitHub.
github.com
I have never used this one, but It may be relevent, its the r21e ndk(r23b has bugs, this may work around)
EDIT:This r21e ndk just built the static busybox for aarch64 where r23b would only build armv7a also this one seems to have the 4.9 binaries in all archs!
GitHub - zaharchenko-main/termux-ndk: android-ndk for termux
android-ndk for termux. Contribute to zaharchenko-main/termux-ndk development by creating an account on GitHub.
github.com
Just noticed I answered this a decade late.
Leaving more native devel tools for my future reference...
Building arm64-v8a ndk toolchain to run on device
Now I know I've done this before. But I think I had to make an entire Application.mk file. I am trying to use either the Windows or Linux NDKr19 to build a standalone toolchain that contains ONLY the arm64 executable binaries. (essentially...
forum.xda-developers.com
Androw said:
Hello every xda members,
I have some little questions,
Is there anyone who have a working native toolchain (binutils, gcc, newlib) that I can run under my Android Phone to build binaries directly under the phone using a terminal ?
Is there any other way to program/compile applications/binaries directly on the phone ?
I want to develop on the phone without any computer.
Thanks for your help
Click to expand...
Click to collapse
@Androw
Prior to your next posting please read the guidances that are stuck on top of every forum like
[ATTN] : Read before posting - Any questions posted here will be MOVED or CLOSED
Please read the below before posting. Any questions not development related will be moved or closed. Forum Searching | Posting | The Basics: (Make sure you've read them before starting a new thread) Forum Rules Forum Search Google Forum...
forum.xda-developers.com
I've moved the thread to Q&A.
Regards
Oswald Boelcke
Senior Moderator

[Q] how to compile tun.ko?

can anybody tell me how to compile tun.ko for any rom? what would i need to download/install etc? any help would be appreciated. thanks!
get the kernel soruce and check config file for tun
in .config file search for "TUN" keyword, change Y to M, run make menuconfig, save, compile.
slow down guys absolute noob here. how/where do i run makeconfig? what software would i need? sorry if stupid questions :c
Sent from my GT540 using XDA App
daggerxXxsin said:
slow down guys absolute noob here. how/where do i run makeconfig? what software would i need? sorry if stupid questions :c
Sent from my GT540 using XDA App
Click to expand...
Click to collapse
First, you need the kernel source code for your device. The Linux GPL requires that OEMs provide the kernel source so you should be able to find it.
You'll need a linux machine with a development environment. You'll also need the Android NDK for the ARM toolchain.
Once you've got all that lined out, you'll need a kernel config. You can usually get this from your device's proc directory as /proc/config.gz.
Now gunzip the config.gz in your kernel source directory, rename it to ".config" and run "make oldconfig". If it is from an identical source tree, then it should run without prompting.
Now run make menuconfig and drill down to the tun options and enable it as a module. Now you can "make" your kernel and "make modules" for the modules.
okay so first thing is to setup a build environment. gotcha. will work on that.
Sent from my GT540 using XDA App
Gene Poole said:
First, you need the kernel source code for your device. The Linux GPL requires that OEMs provide the kernel source so you should be able to find it.
You'll need a linux machine with a development environment. You'll also need the Android NDK for the ARM toolchain.
Once you've got all that lined out, you'll need a kernel config. You can usually get this from your device's proc directory as /proc/config.gz.
Now gunzip the config.gz in your kernel source directory, rename it to ".config" and run "make oldconfig". If it is from an identical source tree, then it should run without prompting.
Now run make menuconfig and drill down to the tun options and enable it as a module. Now you can "make" your kernel and "make modules" for the modules.
Click to expand...
Click to collapse
Hi Gene, i want to ask, if we cannot find the config.gz file from the device, is it imposibble to get the tun.ko working?
Or if it possible, can you tell me how to gain some configuration, that used by the tun.ko, so we can set the config from menuconfig correctly?
I`ve tried to compile tun.ko for a device, the insmod working fine, but when the vpn try to use the tun, it is crash, it raise segmentation fault.

Mixing-in neon in armv6 builds

I build for regular armeabi with -march=armv6, but in my project I have some neon optimized code and I enable that code at run-time after checking if the cpu supports neon. The app obviously has to run on older devices as well.
So, how the hell am I supposed to do that simple task with android crappy build?
I can't specify extra c-flags for some files. To build for neon with this crapware you absolutely have to enable armeabi-7a which means that compiler if free to generate armv6t2 or armv7 instructions, which means that binary might sigill on older devices. The only way for me do that simple task is to build neon asm manually and use the static lib in the main armeabi project.
Seriously, is android build one more example of ridiculous crapware made from regular makefiles so that you can't actually do normal makefiles anymore? Is there official android forum, where I could ask that question from them, or it's also disfunctional?
thanks
Please use the Q&A Forum for questions &
Read the Forum Rules Ref Posting
Moving to Q&A

[Guide][CM]Where did it go? Android compile differences from ROMs.

UNDER CONSTRUCTION
I present you, the guide to locations in Android source in comparison to compiled ROMs.
You can of course also look this up in makefiles
I've tried to divide it into easy categories.
folders/apps
frameworks/base/core --> /system/framework/framework-res.apk
frameworks/base/policy --> /system/framework/policy.jar
frameworks/base/packages/System-UI --> /system/priv-app/SystemUI.apk
packages --> most of system/app
excluded from that: Development.apk, DocumentsUI.apk, PacProcessor.apk, PicoTts.apk, Term.apk, ThemeChooser.apk, WAPPushManager.apk, WhisperPush.apk
files
Changes to the setup
files in here are imported and used along the files your device tree specifies. Changes for all devices can therefor best be made to:
vendor/cm/config
You can change toolchains in envsetup.sh which is in build.
This commit changes the inline kernel toolchain to the 4.7 GCC Linaro toolchain.
https://github.com/TeamFun/android_build/commit/73b914051a03afd81ad8ccaf39058aa6ae5af4ea
Toolchains used for compiling ROM components are supposed to be in "prebuilts/gcc/linux-x86/arm"
If you want to contribute to this, put the info in here:
https://docs.google.com/document/d/1zun26nTWR7p54-SAP0Ol5oPX8bC4QjL9z3tm-Gz7UF8/edit?usp=sharing
Shoot me a PM and I'll make sure to put it in the guide.
You know you can write as "OP in Construction" so that there will not be any useless replies or questions
You know as this is the original Development section
Users do go mad over incomplete threads.
Just thought I do help you
Venomous Viper 119 said:
@ OP : Just PM to eagleeye uncle . He'll move it for you
Sent from my GT-S5830 using xda premium
Click to expand...
Click to collapse
That wouldn't get you anywhere as he isn't a moderator for Samsung forums.
You should PM either myself, andyharney or efrant as we are the most active moderators for Samsung International forums. Or use the report button and whichever one if us is online will deal with it.

[Q] Compiling android source code

Hi guys so I'm compiling android from source. After compilation I have following output:
Please see attachment for output mesaage. (could not post it here)
Did it compile? I suspect not. So, Why?
Thanks Vic
Up
Up

Categories

Resources