[Android Q&A, Help & Troubleshooting] Jason_25:
So I decided to make changes to get it to compile further.

su.h old:

struct su_initiator {

pid_t pid;

unsigned uid;

char bin[PATH_MAX];

char args[4096];

};

su.h new:

struct su_initiator{

unsigned pid_t;

unsigned pid;

unsigned uid;

char bin[PATH_MAX];

char args[4096];

};

That gets past the first error.

Then I get:

error: 'PATH_MAX' undeclared here (not in a function)

su.h old:

struct su_initiator{

unsigned pid_t;

unsigned pid;

unsigned uid;

char bin[PATH_MAX];

char args[4096];

};

su.h new:

struct su_initiator{

unsigned pid_t;

unsigned pid;

unsigned uid;

char bin[4096];

char args[4096];

};

Now I get a linker error:

/tmp/cckee4ip.o: In function `socket_create_temp':
su.c:(.text.socket_create_temp+0x114): warning: warning: mktemp() possibly used unsafely; consider using mkstemp()
/tmp/cciiLW0A.o: In function `send_intent':
activity.cpp:(.text.send_intent+0xb8): undefined reference to `android::defaultServiceManager()'
activity.cpp:(.text.send_intent+0x12c): undefined reference to `android::Parcel::Parcel()'
activity.cpp:(.text.send_intent+0x138): undefined reference to `android::Parcel::Parcel()'
activity.cpp:(.text.send_intent+0x168): undefined reference to `android::Parcel::writeInterfaceToken(android::String16 const&)'
activity.cpp:(.text.send_intent+0x1a4): undefined reference to `android::Parcel::writeStrongBinder(android::sp<android::IBinder> const&)'
activity.cpp:(.text.send_intent+0x1f8): undefined reference to `android::Parcel::writeString16(android::String16 const&)'
activity.cpp:(.text.send_intent+0x238): undefined reference to `android::Parcel::writeString16(android::String16 const&)'
activity.cpp:(.text.send_intent+0x254): undefined reference to `android::Parcel::writeInt32(int)'
activity.cpp:(.text.send_intent+0x268): undefined reference to `android::Parcel::writeString16(unsigned short const*, unsigned int)'
activity.cpp:(.text.send_intent+0x278): undefined reference to `android::Parcel::writeInt32(int)'
activity.cpp:(.text.send_intent+0x298): undefined reference to `android::Parcel::writeString16(unsigned short const*, unsigned int)'
activity.cpp:(.text.send_intent+0x2ac): undefined reference to `android::Parcel::writeString16(unsigned short const*, unsigned int)'
activity.cpp:(.text.send_intent+0x2bc): undefined reference to `android::Parcel::writeInt32(int)'
activity.cpp:(.text.send_intent+0x2d8): undefined reference to `android::Parcel::writeInt32(int)'
activity.cpp:(.text.send_intent+0x2e8): undefined reference to `android::Parcel::writeInt32(int)'
activity.cpp:(.text.send_intent+0x2f4): undefined reference to `android::Parcel::dataPosition() const'
activity.cpp:(.text.send_intent+0x30c): undefined reference to `android::Parcel::writeInt32(int)'
activity.cpp:(.text.send_intent+0x31c): undefined reference to `android::Parcel::writeInt32(int)'
activity.cpp:(.text.send_intent+0x32c): undefined reference to `android::Parcel::writeInt32(int)'
activity.cpp:(.text.send_intent+0x35c): undefined reference to `android::Parcel::writeString16(android::String16 const&)'
activity.cpp:(.text.send_intent+0x378): undefined reference to `android::Parcel::writeInt32(int)'
activity.cpp:(.text.send_intent+0x394): undefined reference to `android::Parcel::writeInt32(int)'
activity.cpp:(.text.send_intent+0x3a4): undefined reference to `android::Parcel::writeInt32(int)'
activity.cpp:(.text.send_intent+0x3d4): undefined reference to `android::Parcel::writeString16(android::String16 const&)'
activity.cpp:(.text.send_intent+0x3f0): undefined reference to `android::Parcel::writeInt32(int)'
activity.cpp:(.text.send_intent+0x41c): undefined reference to `android::Parcel::writeString16(android::String16 const&)'
activity.cpp:(.text.send_intent+0x438): undefined reference to `android::Parcel::writeInt32(int)'
activity.cpp:(.text.send_intent+0x468): undefined reference to `android::Parcel::writeString16(android::String16 const&)'
activity.cpp:(.text.send_intent+0x484): undefined reference to `android::Parcel::writeInt32(int)'
activity.cpp:(.text.send_intent+0x4a0): undefined reference to `android::Parcel::writeInt32(int)'
activity.cpp:(.text.send_intent+0x4b0): undefined reference to `android::Parcel::writeInt32(int)'
activity.cpp:(.text.send_intent+0x4e0): undefined reference to `android::Parcel::writeString16(android::String16 const&)'
activity.cpp:(.text.send_intent+0x4fc): undefined reference to `android::Parcel::writeInt32(int)'
activity.cpp:(.text.send_intent+0x528): undefined reference to `android::Parcel::writeString16(android::String16 const&)'
activity.cpp:(.text.send_intent+0x544): undefined reference to `android::Parcel::writeInt32(int)'
activity.cpp:(.text.send_intent+0x574): undefined reference to `android::Parcel::writeString16(android::String16 const&)'
activity.cpp:(.text.send_intent+0x590): undefined reference to `android::Parcel::writeInt32(int)'
activity.cpp:(.text.send_intent+0x5b4): undefined reference to `android::Parcel::writeString16(android::String16 const&)'
activity.cpp:(.text.send_intent+0x5d0): undefined reference to `android::Parcel::writeInt32(int)'
activity.cpp:(.text.send_intent+0x600): undefined reference to `android::Parcel::writeString16(android::String16 const&)'
activity.cpp:(.text.send_intent+0x61c): undefined reference to `android::Parcel::writeInt32(int)'
activity.cpp:(.text.send_intent+0x62c): undefined reference to `android::Parcel::writeInt32(int)'
activity.cpp:(.text.send_intent+0x63c): undefined reference to `android::Parcel::writeInt32(int)'
activity.cpp:(.text.send_intent+0x66c): undefined reference to `android::Parcel::writeString16(android::String16 const&)'
activity.cpp:(.text.send_intent+0x688): undefined reference to `android::Parcel::writeInt32(int)'
activity.cpp:(.text.send_intent+0x698): undefined reference to `android::Parcel::writeInt32(int)'
activity.cpp:(.text.send_intent+0x6a4): undefined reference to `android::Parcel::dataPosition() const'
activity.cpp:(.text.send_intent+0x6c8): undefined reference to `android::Parcel::setDataPosition(unsigned int) const'
activity.cpp:(.text.send_intent+0x6e4): undefined reference to `android::Parcel::writeInt32(int)'
activity.cpp:(.text.send_intent+0x6f8): undefined reference to `android::Parcel::setDataPosition(unsigned int) const'
activity.cpp:(.text.send_intent+0x70c): undefined reference to `android::Parcel::writeString16(unsigned short const*, unsigned int)'
activity.cpp:(.text.send_intent+0x71c): undefined reference to `android::Parcel::writeInt32(int)'
activity.cpp:(.text.send_intent+0x74c): undefined reference to `android::Parcel::writeStrongBinder(android::sp<android::IBinder> const&)'
activity.cpp:(.text.send_intent+0x774): undefined reference to `android::Parcel::writeInt32(int)'
activity.cpp:(.text.send_intent+0x788): undefined reference to `android::Parcel::writeString16(unsigned short const*, unsigned int)'
activity.cpp:(.text.send_intent+0x798): undefined reference to `android::Parcel::writeInt32(int)'
activity.cpp:(.text.send_intent+0x7c8): undefined reference to `android::Parcel::writeString16(android::String16 const&)'
activity.cpp:(.text.send_intent+0x7e4): undefined reference to `android::Parcel::writeInt32(int)'
activity.cpp:(.text.send_intent+0x7f4): undefined reference to `android::Parcel::writeInt32(int)'
activity.cpp:(.text.send_intent+0x804): undefined reference to `android::Parcel::writeInt32(int)'
activity.cpp:(.text.send_intent+0x888): undefined reference to `android::Parcel::~Parcel()'
activity.cpp:(.text.send_intent+0x894): undefined reference to `android::Parcel::~Parcel()'
collect2: ld returned 1 exit status

I have tried editing the includes in activity.cpp but still with the same errors. Where to go from here?