[MOD] [HACK] Modifying stock Mms.apk to change user-agent - Nexus One Android Development

I have been reading around on the net about people previously modifying stock Mms apps on different Android based devices to change the user-agent used when sending MMS.
I can extract all the files, modify them and recompile and push back to my phone. But the strings I'm editing currently are having no effect on the messaging, or they're just causing the Mms app to FC when you add an image to the message.
Is there anyone out there that could help me with this as I'm sure a lot of people would benefit from this.
I can provide the Mms.apk extracted with the contents of classes.dex extracted too if anyone requires them.
So far I've edited the following files:
/com/android/mms/transaction/HttpUtils.smali
/com/android/mms/MmsConfig.smali
But literally only made small changes to various strings.
I hope there's someone who can help me out.

You do know the source of mms.apk is available right?

This is why I'm asking for help.
Last time I asked about the source someone told me that the latest stuff wasn't available.

This has already been done and the source is here, and the commit that added user agent selection is here.
If you want to see the code for the true stuck Mms, that can be found here.
Compiled for you and attached. There's also a whole bunch of extra bits that aren't in the stock Mms.apk like black background, customizable notifications, and other features that have been added in.

ChainsDD said:
This has already been done and the source is here, and the commit that added user agent selection is here.
If you want to see the code for the true stuck Mms, that can be found here.
Compiled for you and attached. There's also a whole bunch of extra bits that aren't in the stock Mms.apk like black background, customizable notifications, and other features that have been added in.
Click to expand...
Click to collapse
Awesome work! Works great on my Liquid.

appreciate posting the question and the Mms.apk. looks and works great on my N1.

ChainsDD said:
This has already been done and the source is here, and the commit that added user agent selection is here.
If you want to see the code for the true stuck Mms, that can be found here.
Compiled for you and attached. There's also a whole bunch of extra bits that aren't in the stock Mms.apk like black background, customizable notifications, and other features that have been added in.
Click to expand...
Click to collapse
Thanks for the info, I had seen one previously modified but it wasn't for the nexus one. I'll give this a try later.
Can I ask how you compile a single app from the git repo? I was having trouble doing it earlier and found the only way it would work successfully is if I compiled the entire OS image and took out the app I wanted. I'm clearly doing something wrong
Using ubuntu 32bit, I have the git repo already sync'd.

As far as I know, the only way to compile a single app is to compile the whole OS. Once you've compiled it all, you can just type 'make (app you want to compile)', for example 'make Mms', or 'make Launcher2', from the root directory of the source. Capitalization is critical, the apps are located in packages/apps and the folder name is what you use to make each. Once an app is compiled, it'll be located in out/target/product/passion/system/app.

ChainsDD said:
As far as I know, the only way to compile a single app is to compile the whole OS. Once you've compiled it all, you can just type 'make (app you want to compile)', for example 'make Mms', or 'make Launcher2', from the root directory of the source. Capitalization is critical, the apps are located in packages/apps and the folder name is what you use to make each. Once an app is compiled, it'll be located in out/target/product/passion/system/app.
Click to expand...
Click to collapse
Thanks, I'll try that on this current build I just compiled and see what happens.
Are there any adverse effects of compiling the stock OS and recompiling an app to then copy to a different version of the OS? I obviously don't run stock OS on my device, I run Cyanogens ROM.
Just want to make sure I could compile on 2.1-update1 and run on Cyanogens.

Often times there's no problem with that, but it's usually best to use a build environment that matches your run environment. You can download the full CM source from his github much the same was you did the stock android source, full instructions here. The only thing those instructions leave out is that after you've synced up, you need to plug your N1 in and from the source root run
Code:
cd vendor/google/passion
./extract-files.sh
That pulls in the required binaries that aren't open sourced yet.

does this work on non-rooted phones?

No. And it's implemented in just about all the custom ROMs now.

i'm about to root my phone, does this app resize pix and stuff like Handcent?

Any words for MMS mod for sense rom?
Hey there, i am just wondering weather you finally succeeded to modify your mms.apk
I am on htc with sense rom, updated to latest one. after update mod mms from cm keeps giving me FC...no longer able to use mms... i want to mod the mms.apk. any help will be very useful.
Thanks!

Related

[Q] How to add recent apps back into notification

I was hoping someone would provide a quick step by step for adding recent apps back in. I am on Bamf Sense 3.0 rc 2. I know that there have been patches for this with many ROMS, but not all ROMS. So, rather than hoping for patches from the devs, I would like to know what has to be edited so that I might be able to make the mod myself on any ROM. I have no dev experience, but I can follow instructions very well. I assume that it merely requires an edit of some sort to the build.prop, but would not know where.
Bump, bump
lawtalking said:
I was hoping someone would provide a quick step by step for adding recent apps back in. I am on Bamf Sense 3.0 rc 2. I know that there have been patches for this with many ROMS, but not all ROMS. So, rather than hoping for patches from the devs, I would like to know what has to be edited so that I might be able to make the mod myself on any ROM. I have no dev experience, but I can follow instructions very well. I assume that it merely requires an edit of some sort to the build.prop, but would not know where.
Click to expand...
Click to collapse
I think adding recent apps requires more than just a build.prop edit, I would guess more along the lines of framework editing, which is, as far as I know, written in both XML and Java. However, long-pressing your home button will display your 8 most recent apps, and BAMF Remix has a flashable patch for restoring your recent apps to the notification pull-down, so your best bet would be to try flashing that (since both ROMs are BAMF-created, despite their differences) to see what happens. It may not work, it may blow up China, but just make a nandroid and go for it, worst case scenario restore your backup and crack open a coding book
BUMP!!... so many developers in this community and none wants to help!!
Unfortunately, the know-how for this is not anywhere online either.. I've googled for over a day for this.
I think it involves editing a smali file in SystemUI.apk.. (or SystemUI.odex if you are running an odexed rom).. just not sure which particular file and what particular colde needs to be changed to what.

[Q] Building Torch

Ok I am trying to build a Torch APK from git sources from Wayland_Ace. I went to repository and downloaded them as a zip. I've set up ADT and have Eclipse running. I chose to create a project with existing sources and chose the folder I extracted from the zip.
Now, I want to make some edits to this and I already know how and what I am going to, but I figured I would make sure the app would build before I made any changes and it won't. I get four "TORCH_STATE cannot be resolved or is not a field" errors and few warnings about some imports never being used.
I have a feeling this is because it's importing the settings from stock Android and not CM10.1. Can anyone help me fix this so I can build a Torch APK. I've Googled and fooled around with this for hours and have not had any success and am getting a bit frustrated.
admiralspeedy said:
Ok I am trying to build a Torch APK from git sources from Wayland_Ace. I went to repository and downloaded them as a zip. I've set up ADT and have Eclipse running. I chose to create a project with existing sources and chose the folder I extracted from the zip.
Now, I want to make some edits to this and I already know how and what I am going to, but I figured I would make sure the app would build before I made any changes and it won't. I get four "TORCH_STATE cannot be resolved or is not a field" errors and few warnings about some imports never being used.
I have a feeling this is because it's importing the settings from stock Android and not CM10.1. Can anyone help me fix this so I can build a Torch APK. I've Googled and fooled around with this for hours and have not had any success and am getting a bit frustrated.
Click to expand...
Click to collapse
How are you trying to build the apk? Through eclipse or through the android sdk?
fairct said:
How are you trying to build the apk? Through eclipse or through the android sdk?
Click to expand...
Click to collapse
Eclipse.
admiralspeedy said:
Eclipse.
Click to expand...
Click to collapse
I took a look at the source (CMs, not the one you pulled), and it is indeed because you don't have the CM SettingsProvider. It may sound foolish, and I'm not sure what will happen, but you could try commenting it out. I think that's just updating a system var so that things like the power widget can update appropriately. Worst case scenario you get a force-quit, or your LED won't turn off, forcing a battery pull
fairct said:
I took a look at the source (CMs, not the one you pulled), and it is indeed because you don't have the CM SettingsProvider. It may sound foolish, and I'm not sure what will happen, but you could try commenting it out. I think that's just updating a system var so that things like the power widget can update appropriately. Worst case scenario you get a force-quit, or your LED won't turn off, forcing a battery pull
Click to expand...
Click to collapse
I'm not going to do that, however your answer is extremely helpful now that I know it's caused by settings provider. Do you know how I could use a different settings provider in Eclipse? I could take the CM10.1 from the git of the ROM I'm using and somehow use it in Eclipse.
I really find it strange that I can only find a couple other people asking the same question as I. Do people not edit a single app from Cyanogenmod or some other ROM like AOKP without rebuilding the entire source? Upon doing some more Googling, it seems I need an Android.jar from Cyanogenmod.
Hoew I get this, I'm not sure.
admiralspeedy said:
I really find it strange that I can only find a couple other people asking the same question as I. Do people not edit a single app from Cyanogenmod or some other ROM like AOKP without rebuilding the entire source? Upon doing some more Googling, it seems I need an Android.jar from Cyanogenmod.
Hoew I get this, I'm not sure.
Click to expand...
Click to collapse
Well, I think they generally pull whatever APK they want, and then modify it to make it work. In some instances, that means changing other apks due to interdependency. Maybe someone who's familiar with building in eclipse could point you in a better direction...
I did it. I followed a guide to build a custom Android.jar from my phones framework.jar and Eclipse wouldn't build after because of it, so instead I only replaced the class files for settingprovider and my app had no errors after. I then saved the class files I edited, decompiled the classes.dex from the existing Torch APK and replaced the classes in it with my edited ones, recompiled that into a new classes.dex and put that in the Torch APK and it worked!

[Q] Build CM10 Mod - Ford Sync

I am currently using the HTC EVO 4G LTE. I have found with more updated roms using jellybean that the MAP profiles work and allow SMS to my Ford Mustang. There are a couple of complications though. When calling someone or receiving a call the caller id on car dash shows "Unknown" and when I receive a SMS the car thinks I sent it so when you reply it replies back to your self. I found while searching all over the internet that someone had found a way to edit a MapUtils.java file to make it work correctly. I have downloaded the source code on my ubuntu machine for CM10.0 and edited this file and built it successfully. When installed on my phone it would not get past the boot animation. Only way I got it to boot was to "fastboot" flash a boot.img file from another working CM10.0 rom. After this process the issue was resolved but It wound up breaking "Message Notification" in the Ford Sync system. Is there something I am missing about what is being changed in this file or why my original build would not boot? I would really like to use a SENSE rom but can not figure out where to build it from source (if you can) and where that file would even sit. I would appreciate it if someone could help me out with this.
Car - 2013 Ford Mustang with standard Stereo
Original Post Bellow
"Once you've got your build environment setup with CM7, CM9, or CM10, open up
packages/apps/Bluetooth/src/com/android/bluetooth/map/MapUtils/MapUtils.java and find this line (It's on line 539 as of today):
sb.append("TEL:").append(bmsg.recipient_vcard_phon e_number)
Replace it with this line:
sb.append("TEL:").append(bmsg.originator_vcard_pho ne_number)"
wilhar0046 said:
I am currently using the HTC EVO 4G LTE. I have found with more updated roms using jellybean that the MAP profiles work and allow SMS to my Ford Mustang. There are a couple of complications though. When calling someone or receiving a call the caller id on car dash shows "Unknown" and when I receive a SMS the car thinks I sent it so when you reply it replies back to your self. I found while searching all over the internet that someone had found a way to edit a MapUtils.java file to make it work correctly. I have downloaded the source code on my ubuntu machine for CM10.0 and edited this file and built it successfully. When installed on my phone it would not get past the boot animation. Only way I got it to boot was to "fastboot" flash a boot.img file from another working CM10.0 rom. After this process the issue was resolved but It wound up breaking "Message Notification" in the Ford Sync system. Is there something I am missing about what is being changed in this file or why my original build would not boot? I would really like to use a SENSE rom but can not figure out where to build it from source (if you can) and where that file would even sit. I would appreciate it if someone could help me out with this.
Car - 2013 Ford Mustang with standard Stereo
Original Post Bellow
"Once you've got your build environment setup with CM7, CM9, or CM10, open up
packages/apps/Bluetooth/src/com/android/bluetooth/map/MapUtils/MapUtils.java and find this line (It's on line 539 as of today):
sb.append("TEL:").append(bmsg.recipient_vcard_phon e_number)
Replace it with this line:
sb.append("TEL:").append(bmsg.originator_vcard_pho ne_number)"
Click to expand...
Click to collapse
Cannot build from Sense ROM source. You'd have to smali edit if you're experienced with byte code.
However looking at the code posted, seems like whatever you quoted is adding a space in phone_number (phon e_number).
Make sure when you replace the code you take out the space to read:
Code:
sb.append("TEL:").append(bmsg.originator_vcard_phone_number)
exSD said:
Cannot build from Sense ROM source. You'd have to smali edit if you're experienced with byte code.
However looking at the code posted, seems like whatever you quoted is adding a space in phone_number (phon e_number).
Make sure when you replace the code you take out the space to read:
Code:
sb.append("TEL:").append(bmsg.originator_vcard_phone_number)
Click to expand...
Click to collapse
Thank you for your response. I did make sure that the space was taken out of that line. The author of the original post must have done it by accident. Not sure if I would get the same rests if I tried to build a aokp ROM instead of CM. The build worked just would not boot with originally boot.img file. I fixed the main issue that I was attempting but broke other things that were already working.
wilhar0046 said:
Thank you for your response. I did make sure that the space was taken out of that line. The author of the original post must have done it by accident. Not sure if I would get the same rests if I tried to build a aokp ROM instead of CM. The build worked just would not boot with originally boot.img file. I fixed the main issue that I was attempting but broke other things that were already working.
Click to expand...
Click to collapse
Are you signing the apk once you recompile it?
Post a snapshot of your code or I can run a join.me session with you to look at it with you.
exSD said:
Are you signing the apk once you recompile it?
Post a snapshot of your code or I can run a join.me session with you to look at it with you.
Click to expand...
Click to collapse
I am creating a ROM not a application. I am building CM from source and compiling it. I end up with a flashabe zip of the ROM I can flash with TWRP or CWM recoveries.
wilhar0046 said:
I am creating a ROM not a application. I am building CM from source and compiling it. I end up with a flashabe zip of the ROM I can flash with TWRP or CWM recoveries.
Click to expand...
Click to collapse
You are compiling a ROM and editing the Maps application.
Link me to the git/source you're editing the java code from.
exSD said:
You are compiling a ROM and editing the Maps application.
Link me to the git/source you're editing the java code from.
Click to expand...
Click to collapse
Here is the code I used to get the source
repo init -u git://github.com/CyanogenMod/android.git -b jellybean
exSD said:
You are compiling a ROM and editing the Maps application.
Link me to the git/source you're editing the java code from.
Click to expand...
Click to collapse
BTW MAP is referring to Message Access Profile/Protocol ..not sure which p it is lol. It allows Bluetooth devices to access certain messages on your phone such as Text messages. The car can receive them and read them aloud. The hole point in editing the java file is so that the text appears to come from the correct sender instead of me. I could not make my original build work. Something is wrong with the boot.IMG file. When I flash a working boot.IMG over my existing build it boots and fixes the initial problem but winds up breaking other things that were originally workong., such as message notifications.

[Q] Cooking ROMs... I still don't get it

Hello,
I'm willing to try and build a custom rom, but I've been diving through the site for a few days and I still don't get it. I believe I do have the required background to do this: programming, linux, etc. and I have wide experience as a phone user, etc. It's just that either I'm not reading what I need or the way I want it. The problem, I believe, is that all I find are guides telling me to install this and those tools and then open this and that and voila! you got your rom. But they're not explaining WHAT exactly goes into those roms, or what is expected to go there, what's the purpose of those contents, etc., and I can't really catch with that. I feel at a loss and hate wasting my time turning around for nothing.
1. I don't understand the difference between a flashable rom and one that is meant to be installed through recovery, although I can see they're different. Do they both models contain the same kind of data? Is there any restriction to what one model can contain over the other one? If so, how would I convert from one to the other? But please, don't tell me to use this or that tool. I just need the theory behind it. Something of sorts like: "You need to extract this or that from this tarball, then mount this image, then the directory tree there goes in that directory over the other model of rom"
2. update-binary: Okay I guess this is run when installing from recovery, and this takes care of installing the rom, right?wrong?. Is this a per-rom thing, per-device thing? generic? If it's per-rom, how to generate it? do I need to compile something? Is there any generic source code that can be used as a start?
3. Although I have a basic understanding of how the Linux directory tree works, I know Android works on top of a heavily modified Linux. So can you explain briefly how the directory tree works? For instance, I believe /data/data is where Android apps install to, in /system/bin or xbin I can find busybox binaries/symlinks if present. /dev and /proc look the same as in Linux. I don't know about /sys. Also how are both rom models deployed to this tree? What is basically being copied?
4. If I were to compile a kernel, where do I find the Android kernel sources? or is it just a generic Linux kernel? where can i get a basic config for the device? Last time I checked my device hadn't /proc/config.gz but maybe I could get it from another rom with it enabled or something. What toolchain and where to get it? Oh and if you know of a native arm version of gcc or whatsnot, I'd prefer that. Setting up IDEs or toolchains is a nightmare. I don't like crosscompiling. But crosscompiling or not, a directory with all needed binaries without needing to set up system variables nor other stuff, would be amazing.
I surely have a lot more questions that I can't get from the back of my mind now, and I'll have yet more as you explain. But the point of my questions was mainly trying to explain the degree of the loss I'm at, so you can assist me better.
If it looks like a foolish petition, well, that's because I'm quite stubborn and can't catch things that don't go my way. I really need to understand the basics before I can move into actually doing something. I want to build a rom for the right reasons(to me). It's not just about packing a set of apps or themes with it, but about learning and doing other stuff like trying to fix things that are not supposed to work for the device in that Android version, etc.
If you can't help, congrats for reading through here anyways But any help is greatly appreciated :good:
oxiroxt said:
Hello,
I'm willing to try and build a custom rom, but I've been diving through the site for a few days and I still don't get it. I believe I do have the required background to do this: programming, linux, etc. and I have wide experience as a phone user, etc. It's just that either I'm not reading what I need or the way I want it. The problem, I believe, is that all I find are guides telling me to install this and those tools and then open this and that and voila! you got your rom. But they're not explaining WHAT exactly goes into those roms, or what is expected to go there, what's the purpose of those contents, etc., and I can't really catch with that. I feel at a loss and hate wasting my time turning around for nothing.
1. I don't understand the difference between a flashable rom and one that is meant to be installed through recovery, although I can see they're different. Do they both models contain the same kind of data? Is there any restriction to what one model can contain over the other one? If so, how would I convert from one to the other? But please, don't tell me to use this or that tool. I just need the theory behind it. Something of sorts like: "You need to extract this or that from this tarball, then mount this image, then the directory tree there goes in that directory over the other model of rom"
2. update-binary: Okay I guess this is run when installing from recovery, and this takes care of installing the rom, right?wrong?. Is this a per-rom thing, per-device thing? generic? If it's per-rom, how to generate it? do I need to compile something? Is there any generic source code that can be used as a start?
3. Although I have a basic understanding of how the Linux directory tree works, I know Android works on top of a heavily modified Linux. So can you explain briefly how the directory tree works? For instance, I believe /data/data is where Android apps install to, in /system/bin or xbin I can find busybox binaries/symlinks if present. /dev and /proc look the same as in Linux. I don't know about /sys. Also how are both rom models deployed to this tree? What is basically being copied?
4. If I were to compile a kernel, where do I find the Android kernel sources? or is it just a generic Linux kernel? where can i get a basic config for the device? Last time I checked my device hadn't /proc/config.gz but maybe I could get it from another rom with it enabled or something. What toolchain and where to get it? Oh and if you know of a native arm version of gcc or whatsnot, I'd prefer that. Setting up IDEs or toolchains is a nightmare. I don't like crosscompiling. But crosscompiling or not, a directory with all needed binaries without needing to set up system variables nor other stuff, would be amazing.
I surely have a lot more questions that I can't get from the back of my mind now, and I'll have yet more as you explain. But the point of my questions was mainly trying to explain the degree of the loss I'm at, so you can assist me better.
If it looks like a foolish petition, well, that's because I'm quite stubborn and can't catch things that don't go my way. I really need to understand the basics before I can move into actually doing something. I want to build a rom for the right reasons(to me). It's not just about packing a set of apps or themes with it, but about learning and doing other stuff like trying to fix things that are not supposed to work for the device in that Android version, etc.
If you can't help, congrats for reading through here anyways But any help is greatly appreciated :good:
Click to expand...
Click to collapse
I am not terribly knowledgeable about all of this, but I will take a crack at it. Others can feel free to correct me.
1. "Flashing" is usually done through the recovery from a zip with an update script inside. That script is in a language called "edify". Read more about Edify Here and Here.
The only other common way that I know of installing a ROM is through fastboot in the bootloader, but that is normally only used with official factory images. Also, I think Samsung ROMs are often flashed with a proprietary program called Odin.
2. I think that the update-binary is standard across all recent devices. I think it is just an interpreter for the Edify scripting language. Old versions of android used a somewhat different scripting language and required a different file. You can probably pull the binary out of another recent zip and use that. The main thing you have to worry about is the update script (instructions for what the zip does) and the folder structure of the zip.
3. I am not confident to explain much here, but the apps and their data are stored in different places. User apps are stored in /data/app with app data stored in /data/data, I think. System apps are installed in /system/app. There is more files stored on the "sdcard" partition which can be internal or external, depending on the device.
4. Kernel sources are usually provided in the source code from whatever repo you are using. Different ROMs use different bases. Here is some info about grabbing the AOSP kernel sources with git: http://source.android.com/source/building-kernels.html
Many of the more popular ROMS have specific build instructions on their individual github pages (Cyanogen, Paranoid Android, etc), so you might what to look at those, too. Also, depending on the individual devices, there might be proprietary binaries sourced from the device or hardware manufacturers for things like camera drivers, graphics chips, etc.
If you want a walk through of the basic build process google has a tutorial. The last time I checked there seemed to be some outdated info, but it might give you a general idea of the build process. http://source.android.com/source/initializing.html
Hopefully someone more knowledgeable can give you more info, but that is all I got
synesthete said:
I am not terribly knowledgeable about all of this, but I will take a crack at it. Others can feel free to correct me.
1. "Flashing" is usually done through the recovery from a zip with an update script inside. That script is in a language called "edify". Read more about Edify Here and Here.
The only other common way that I know of installing a ROM is through fastboot in the bootloader, but that is normally only used with official factory images. Also, I think Samsung ROMs are often flashed with a proprietary program called Odin.
2. I think that the update-binary is standard across all recent devices. I think it is just an interpreter for the Edify scripting language. Old versions of android used a somewhat different scripting language and required a different file. You can probably pull the binary out of another recent zip and use that. The main thing you have to worry about is the update script (instructions for what the zip does) and the folder structure of the zip.
3. I am not confident to explain much here, but the apps and their data are stored in different places. User apps are stored in /data/app with app data stored in /data/data, I think. System apps are installed in /system/app. There is more files stored on the "sdcard" partition which can be internal or external, depending on the device.
4. Kernel sources are usually provided in the source code from whatever repo you are using. Different ROMs use different bases. Here is some info about grabbing the AOSP kernel sources with git: http://source.android.com/source/building-kernels.html
Many of the more popular ROMS have specific build instructions on their individual github pages (Cyanogen, Paranoid Android, etc), so you might what to look at those, too. Also, depending on the individual devices, there might be proprietary binaries sourced from the device or hardware manufacturers for things like camera drivers, graphics chips, etc.
If you want a walk through of the basic build process google has a tutorial. The last time I checked there seemed to be some outdated info, but it might give you a general idea of the build process. http://source.android.com/source/initializing.html
Hopefully someone more knowledgeable can give you more info, but that is all I got
Click to expand...
Click to collapse
OMG Finally some light! THANK YOU, THANK YOU, THANK YOU for all the info. I didn't get much right now, I'll need to read through your post a few times before I get it all, haha. I'll be sure to check the links too. Thank you!

[H918]Anyone that wants the 10j kernel source (that actually compiles)... Here it is

So LG released build 10j, with accompanying kernel source for the 10j update.
However, their source includes a lot of "typos" and silly little mishaps and doesn't compile.
Things that had to be fixed (note, not every file type mentioned were fixed, just specific ones) :
Makefile(s)
Kconfig(s)
.c sources
.h headers
The package I am providing stems from @jcadduono initial release (found here). I then replaced all files from the 10j source from LG (found here).
I then compiled with one thread and went error by error. Yes, it took me much longer than it should have, but I've never done anything like this, and the longest part was actually learning on how to figure out what was causing issues. I suppose in the future, it will be much faster for me.
Anyway, it flashes fine, here it is.
No changes to the defconfig, nor was anything customized inside (just fixed). It is stock, and builds Image.lz4 as well as the accompanying modules. This is all thanks to @jcadduono 's beautiful build.sh script, as well as his menuconfig.sh.
To build :
set toolchain in menuconfig.sh as well as build.sh
cd /path_to_dir
./menuconfig (do your changes, exit, follow prompts to save changes)
./build.sh h918
You want /path_to_dir/build/lib/modules and /path_to_dir/build/arch/arm64/boot
Save those things before running menuconfig and/or build.sh again, as they are automatically cleaned per config or build.
Remember you still have to disable verity, and force-encrypt.
Also, here is a full stock, flashable 10j boot.img (with kernel built from source packed inside), with verity and force-encrypt disabled. Also, it flashes the newly-compiled modules, as well as SuperSU2.79-SR3. Stock RAMdisk used as well.
When you do end up customizing the kernel, will you be putting that out as a stand alone custom kernel?
Thanks for all the hard work. Take a week off.
Cheers!
Update
Hey @Tilde88 seems the dreaded no sound on call after switching from wifi calling to data call is active again
I also have another branch going here: https://github.com/jcadduono/android_kernel_lge_msm8996/commits/android-7.0_2
which is 10j with LG's stuff separated from other commits.
I can't seem to figure out why it doesn't want to boot though. For whatever odd reason, seems the bootloader isn't even reading the Image.lz4-dtb and going straight to blank screen -> power off. Makes it darn hard to investigate when you can't get a pstore.
Update: I just realized that lz4 binary changed so all I had to do was change -lz16 to -lz9
Update 2: Nope still doesn't boot, I'm outta ideas.
jcadduono said:
I also have another branch going here: https://github.com/jcadduono/android_kernel_lge_msm8996/commits/android-7.0_2
which is 10j with LG's stuff separated from other commits.
I can't seem to figure out why it doesn't want to boot though. For whatever odd reason, seems the bootloader isn't even reading the Image.lz4-dtb and going straight to blank screen -> power off. Makes it darn hard to investigate when you can't get a pstore.
Update: I just realized that lz4 binary changed so all I had to do was change -lz16 to -lz9
Update 2: Nope still doesn't boot, I'm outta ideas.
Click to expand...
Click to collapse
Is that for 10j? From the H918 source, the Kconfig and Makefile for the DTB image were broken. It would automatically remove the lines from defconfig anytime you did a menuconfig. I'm sure you already picked up on that though
Other than that, I have nothing to offer... I am no expert like yourself
kelvin216 said:
Hey @Tilde88 seems the dreaded no sound on call after switching from wifi calling to data call is active again
Click to expand...
Click to collapse
I'm still on 10d with my 5.5 rom+kernel. Going to make a v6 test rom+kernel and try it out live tomorrow.
I used 5.5 with VoLTE and WiFi calling in the last few days... But I have gotten no issues, even though I'm actually trying to get them to occur.
I was actually in a building for some time with 0.0% radio signal. So I hopped on wifi, and made my calls to the office that way.
When I left the building, WiFi disconnected due to range, 4G came up and I called my office, no issue at all.
When you say "again", do you mean it is occurring again as it once did, or as it recently has? (On what kernel are you having this issue - NSS 5.5 for H918 is fully stable). Other than a few people having high CPU usage (which I also can't replicate), there are no issues on the 5.5 kernel. I suspect the CPU usage thing to be due to me enabling C-States blindly in defconfig; but that has nothing to do with what we are on about.
Thanks for the info.
10j
Hey @Tilde88 it happen it on your new 10j kernal while i was testing didnt have any high Cpu or overheating issue with kernal, just on calls when switching from wifi calling to data, calls can be made and receive but no one can hear me unless i reboot phone and then everything is fine till the switch again from wifi calling and data and vice versa, glad i can help, will get a log when it happens again but the kernal is great for my needs on a 10j base rom
So no ones working on h918 kernel for 10j?
lightninbug said:
So no ones working on h918 kernel for 10j?
Click to expand...
Click to collapse
It's fine the way it is imo. Just get root and tare apart the bloats
Sent from my zeroltetmo using XDA Labs
twidledee said:
It's fine the way it is imo. Just get root and tare apart the bloats
Click to expand...
Click to collapse
That comes NO WHERE close to comparing to tweaks at a kernel level.
Tilde88 said:
Is that for 10j? From the H918 source, the Kconfig and Makefile for the DTB image were broken. It would automatically remove the lines from defconfig anytime you did a menuconfig. I'm sure you already picked up on that though
Other than that, I have nothing to offer... I am no expert like yourself
Click to expand...
Click to collapse
what tools do you guys recommend? Im was going to do some things with my own in regards to ovrclocking and anything else the tools i found on the app store.
I've already downloaded tje files and im going to work it. So if you wouldn't mind suggesting some tools I can go from there. I did some scripting and coding a ling time ago and couriered for several eu topsides in the well. I dual booted NT pro server and Red Hat early a 90s. I cam put together a Lan and maintain the integrity of the network locally or remotely. When ICQ was just a bunch of rooms where allot of hoxor groups tested each others skills. I was good enough track a dos attacker through telnet and a few other scripts that I and And another put together just for such occasion- through 6 proxies...
then i became a truck driver. Got married and had kids.
Kids all grown now... I want to play with some old toys.
twidledee said:
what tools do you guys recommend? Im was going to do some things with my own in regards to ovrclocking and anything else the tools i found on the app store.
I've already downloaded tje files and im going to work it. So if you wouldn't mind suggesting some tools I can go from there. I did some scripting and coding a ling time ago and couriered for several eu topsides in the well. I dual booted NT pro server and Red Hat early a 90s. I cam put together a Lan and maintain the integrity of the network locally or remotely. When ICQ was just a bunch of rooms where allot of hoxor groups tested each others skills. I was good enough track a dos attacker through telnet and a few other scripts that I and And another put together just for such occasion- through 6 proxies...
then i became a truck driver. Got married and had kids.
Kids all grown now... I want to play with some old toys.
Click to expand...
Click to collapse
The only tool you will need on top of this source, is a cross compiler.
There are a few to choose from, but mainly, you might want to use Linaro.
This is the version I use gcc-linaro-6.2.1-2016.11-x86_64_aarch64-linux-gnu.
Once you have that, set it's path within the 2 files build.sh and menuconfig.sh.
Next step is to do ./menuconfig , do your changes, then do ./build.sh h918
To add features, you have to add source files (.c and .h files, and reference them accordingly in their respective Makefile and Kconfig files.
Thanks to @jcadduono for the realest build scripts. build.sh and menuconfig.sh are epic.
Tilde88 said:
The only tool you will need on top of this source, is a cross compiler.
There are a few to choose from, but mainly, you might want to use Linaro.
This is the version I use gcc-linaro-6.2.1-2016.11-x86_64_aarch64-linux-gnu.
Once you have that, set it's path within the 2 files build.sh and menuconfig.sh.
Next step is to do ./menuconfig , do your changes, then do ./build.sh h918
To add features, you have to add source files (.c and .h files, and reference them accordingly in their respective Makefile and Kconfig files.
Thanks to @jcadduono for the realest build scripts. build.sh and menuconfig.sh are epic.
Click to expand...
Click to collapse
Hi.
The boot file you linked. I decompressed it and itt produced many double copies. I assume that I have originals + a copy (1) some are identical in size others not so.... What do I do?
twidledee said:
Hi.
The boot file you linked. I decompressed it and itt produced many double copies. I assume that I have originals + a copy (1) some are identical in size others not so.... What do I do?
Click to expand...
Click to collapse
None of the words you just said make sense.
What are you trying to do, and with what.
Be precise.
If what you did was get the boot.img file and decompressed it, you exposed the RAMdisk. This will not help you in any way. This is also not the way in which you create a kernel. boot.img contains the kernel (zImage).
?
Tilde88 said:
None of the words you just said make sense.
What are you trying to do, and with what.
Be precise.
If what you did was get the boot.img file and decompressed it, you exposed the RAMdisk. This will not help you in any way. This is also not the way in which you create a kernel. boot.img contains the kernel (zImage).
?
Click to expand...
Click to collapse
It's my first time. I wanted to see what the package consisted of outside of the tar.zip so I unpacked it. As it was unpacking it was periodically halting due to an existing file already there. So I wasn't sure what to do so I let it rename. I wanted to see what the duplicate file was.
I'm not at the desk at the moment but when i looked at replicas the few I read were Readme and Linux guides.
As far as I can tell they weren't crucial files. I was just curious what made that happen since I haven't seen that with other packages. Then again I haven't embarked on this sort of project before either.
I hope that makes some sense.
Sent from my zeroltetmo using XDA Labs
Bump
twidledee said:
Bump
Click to expand...
Click to collapse
You are doing it wrong.
twidledee said:
It's my first time. I wanted to see what the package consisted of outside of the tar.zip so I unpacked it. As it was unpacking it was periodically halting due to an existing file already there. So I wasn't sure what to do so I let it rename. I wanted to see what the duplicate file was.
I'm not at the desk at the moment but when i looked at replicas the few I read were Readme and Linux guides.
As far as I can tell they weren't crucial files. I was just curious what made that happen since I haven't seen that with other packages. Then again I haven't embarked on this sort of project before either.
I hope that makes some sense.
Sent from my zeroltetmo using XDA Labs
Click to expand...
Click to collapse
Did you ever figure it out?
Not sure which you are using, the source, or the compiled boot.img.
If you want to make a custom kernel, I am more than happy to help. When extracting the source, or anything really, you will not get those errors, unless you already have files/folders that match identically to the structure in which you are extracting to... That would mean that you can have the same folder twice within a compressed file, which, you can't.
So, take the tarball, extract it (I just did it myself right now, there are no duplicates --because impossible), modify menuconfig.sh and build.sh to point them to your cross compiler (i recommend Linaro 6.1.1 for aarch64).
Now, within the source, you WILL find multiple files that are named the same, but they are in different locations, and contain different lines of code (almost usually). But these are NOT to be de-duped. Extract and use as-is.
Once you have set your toolchain in the 2 .sh files that jcadduono has made (and are awesome as can be), open up a terminal (i really hope you are on a Linux environment by this point, because if not, none of the steps in this paragraph will work ). Do not use root, just plain old userspace. Once in the terminal, cd to your source directory.
Type ./menuconfig.sh and hit enter.
Make your edits, save the file, and confirm you want to save.
Now you are back in your terminal session.
Type ./build.sh h918
Wait or watch as it compiles.
When it finishes, you will need 2 things. The kernel (found in your /sourcefolder/build/arch/arm64/boot directory), and the modules (found in your /sourcefolder/build/lib/modules/yourkernelname/kernel. This directory will be wiped the next time you do menuconfig or build, so get your files now. There will be like 20ish or so modules, and they have the .ko extension. Search the folder, and copy all these modules to a new folder, along with your zImage (file called Image.lz4-dtb).
You can either flash the zImage , or pack it into a boot.img with an existing RAMdisk, and flash the boot.img.
Also, all the modules you just compiled, need to go in your ROM. So when you make the flashable zip, make it delete /system/lib/modules, and then extract the new /modules dir into /system/lib.
Congrats, you just compiled your first custom kernel.
Hello
I thank you and @jcadduono for doing this.
Though I myself am not a developer, I will be getting this phone soon and I appreciate the activity on XDA that could potentially make it more fun to own this LG device.
I do know some basic Linux stuff, and I have compiled a few kernels with success so maybe I'll look into it someday, but hopefully there will be many veteran Linux hackers doing it instead the results would be better I think.
Btw, I looked on lg opensource site and found this: "LGH918_Android_Nougat_v10n.zip" I have not seen it mentioned anywhere in the forums yet, it must be very new.
askermk2000 said:
Btw, I looked on lg opensource site and found this: "LGH918_Android_Nougat_v10n.zip" I have not seen it mentioned anywhere in the forums yet, it must be very new.
Click to expand...
Click to collapse
https://forum.xda-developers.com/v20/how-to/h918-10k-kernel-source-potential-10n-t3631920
Plus @Mentalmuso has released a kernel using the 10N source.

Categories

Resources