[ROM][I777][5.1.1][OFFICIAL] CyanogenMod 12.1 Nightly Builds

Cooldato

Senior Member
Jul 29, 2013
87
26
0
Tbilisi
Mobile Odin will flash tar files or img files. I think I used a jellybean kernel that I extracted from the zip ROM file. I just copied the boot. Img file over to the root directory on my phone and use mobile Odin to flash that kernel, and from there I could flash other kernels or regular zip files or restore my backup files.
Thank you for your reply :3 I will try to flash JB Kernel via Mobile Odin :x
 

rogersb11

Senior Member
Nov 18, 2013
3,345
6,888
0
Indianapolis
@rogersb11, @Lysergic Acid, @Lanchon, @cyril279

Sup guys, spent some time looking into the outgoing call bug with the i777 this weekend and patched up a fix. This is a total hack (and not even an efficient one at that) - it modifies core android behavior and doesn't address whatever the underlying issue in the device specific code is. At least it gets us a little bit closer. Tested it on my device and it works great, although on outgoing calls there is no audible "ring" which is not stock behavior. See below. I also attached a few logs of the issue (before the patch).
1) Log spanning from immediately before an incoming call to immediately after connection.
2) Log spanning from immediately before an outgoing call to immediately after connection.
3) Log spanning from after an outgoing call connection, immediately before the speaker is toggled on, off, and on again.

Code:
In this file: /android/system/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java

Add code to the end of this method:

private void setCallState(Call call, int newState)

...

Log.i(this, "i777 hack: toggle speakerphone on/off");
if (CallState.toString(oldState).equals("DIALING") && CallState.toString(newState).equals("ACTIVE")) {
  mCallAudioManager.i777hack();
}


In this file: /android/system/packages/services/Telecomm/src/com/android/server/telecom/CallAudioManager.java

Add a method to this class:

final class CallAudioManager

...

public void i777hack() {
  int oRoute=mAudioState.getRoute();
  int oMask=mAudioState.getSupportedRouteMask();
  setSystemAudioState(false, AudioState.ROUTE_SPEAKER, oMask);
  setSystemAudioState(false, oRoute, oMask);
}
Hack or not, this is a nice job man. Very well done, without a device I never got this far into debugging so wanted to be sure to say VERY well done!!!! I will look into this further once I release my final Lollipop builds for Cyanide and see if I can adapt to not "hack" status and submit to cm without breaking stuff for anyone else. If so I will contact you so I can give you proper credits. Again very very well done, you should be proud
 

pg1980

Member
Oct 4, 2014
17
5
0
New Delhi
Hi @dimoochka,
I tried this Rom but this fix is not working for me. I still have to toggle speaker on outgoing calls. I also tried replacing telecom.apk but I'm getting error when trying to call "No app exist...
 
Last edited:

dimoochka

Senior Member
Oct 9, 2014
137
104
0
Hi @dimoochka,
I tried this Rom but this fix is not working for me. I still have to toggle speaker on outgoing calls. I also tried replacing telecom.apk but I'm getting error when trying to call "No app exist...
Yeah I wasn't able to test the Telecom.apk thing out yet. Did you install the ROM from the link in my post? That is the one I tested. I don't think it's been incorporated into the OP post yet.
 

dimoochka

Senior Member
Oct 9, 2014
137
104
0
Yes, I'm using the one you have posted, but still having issue with outgoing call.
Give me a week - I'll recompile and retest on my device. What device are you using? i777?

Also - can you please post a logcat from the time that you press the call button to the time the call connects?
 
Last edited:

pg1980

Member
Oct 4, 2014
17
5
0
New Delhi
Give me a week - I'll recompile and retest on my device. What device are you using? i777?

Also - can you please post a logcat from the time that you press the call button to the time the call connects?
Yes, i777. Will try to post logcat later today or tomorrow. Thanks Much.

Log attached.
 

Attachments

Last edited:
  • Like
Reactions: cyril279

dimoochka

Senior Member
Oct 9, 2014
137
104
0
@rogersb11, @Lysergic Acid, @Lanchon, @cyril279

Hello gentlemen, I have been working on this all weekend. My eyes are bleeding and I still can't figure out what's causing the bug. I'm about to give up and just stick with the stupid hack fix (UPDATED setCallState code below to make it work better). I am trying to debug this thing with gdbclient - any of you guys have any idea what process name I need to attach to in order to debug the CallAudioManager class (is that even possible)? I tried to attach to system_server but gdb wouldn't recongize the filename or method I was looking for.

Compiled, fixed Telecom.apk is attached (installation instructions below).

Code:
In this file: /android/system/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java

Add code to the end of this method:

private void setCallState(Call call, int newState)

...
        // i777 hack
        if (oldState==CallState.CONNECTING && newState==CallState.DIALING) {
          mCallAudioManager.i777hack();
        }


In this file: /android/system/packages/services/Telecomm/src/com/android/server/telecom/CallAudioManager.java

Add a method to this class:

final class CallAudioManager

...

public void i777hack() {
  int oRoute=mAudioState.getRoute();
  int oMask=mAudioState.getSupportedRouteMask();
  setSystemAudioState(false, AudioState.ROUTE_SPEAKER, oMask);
  setSystemAudioState(false, oRoute, oMask);
}
Instructions (works on latest CM12.1 i777 nightly - I have not tested this on any other ROM)
1) Reboot into recovery.
2) mount /system
3) Make a backup of your existing /system/priv-app/Telecom/Telecom.apk - then replace it with attached file.
4) chmod 644 /system/priv-app/Telecom/Telecom.apk
5) umount /system
6) Reboot, profit.
 

Attachments

stefano91av

Senior Member
Jul 13, 2014
273
75
48
Hello, I installed through crosskernel for I9100T the 12.1 cm for i9100. Everything perfect except the network of the SIM card. In a nutshell it comes and goes. Sometimes you have to turn off the phone and so does the network again. then back down. how to solve?

Inviato dal mio ZP998 utilizzando Tapatalk
 

dimoochka

Senior Member
Oct 9, 2014
137
104
0
Encryption

@rogersb11, @Lysergic Acid, @Lanchon, @cyril279

Hello again friends. I have been working on device encryption for a while since this device (as well as others) only encrypts the /data partition and leave /storage/sdcard0 open for the world to see. I've figured out a universal workaround that I've been using as my daily driver for over a year that has no noticeable performance impact**. I use cryptsetup to build a LUKS volume on /storage/sdcard0 that fills most of the space on the partition, and then automount it via a startup script. The decryption key is located in plaintext on the /data partition (/data partition must first be decrypted/mounted by Android via startup passphrase, so the keyfile is secure despite the fact that it's stored in plaintext). The real advantage of this setup is that the LUKS volume can be mounted in any recovery (!!) using the cryptsetup binary. As far as I know recoveries cannot mount AOSP encrypted volumes yet (which makes offline backups/file retrieval a pain in the a$$).

So - two questions.
1) Do you guys know of any recovery (I'm still on TWRP 2.7) that's capable of mounting AOSP encrypted volumes? If so - I'll get to work on figuring out how to get Android to natively encrypt sdcard0.
2) If not - does anyone want my source for integration into your ROMs/kernels?

With love,
dimoochka

**There is probably a write-performance impact because the mmc blocks occupied by the LUKS volume cannot be FSTRIM'ed (xoxo @Lanchon) despite the fact that the LUKS volume is not actually full.
 

Lanchon

Senior Member
Jun 19, 2011
2,703
4,455
0
@rogersb11, @Lysergic Acid, @Lanchon, @cyril279

Hello again friends. I have been working on device encryption for a while since this device (as well as others) only encrypts the /data partition and leave /storage/sdcard0 open for the world to see. I've figured out a universal workaround that I've been using as my daily driver for over a year that has no noticeable performance impact**. I use cryptsetup to build a LUKS volume on /storage/sdcard0 that fills most of the space on the partition, and then automount it via a startup script. The decryption key is located in plaintext on the /data partition (/data partition must first be decrypted/mounted by Android via startup passphrase, so the keyfile is secure despite the fact that it's stored in plaintext). The real advantage of this setup is that the LUKS volume can be mounted in any recovery (!!) using the cryptsetup binary. As far as I know recoveries cannot mount AOSP encrypted volumes yet (which makes offline backups/file retrieval a pain in the a$$).

So - two questions.
1) Do you guys know of any recovery (I'm still on TWRP 2.7) that's capable of mounting AOSP encrypted volumes? If so - I'll get to work on figuring out how to get Android to natively encrypt sdcard0.
2) If not - does anyone want my source for integration into your ROMs/kernels?

With love,
dimoochka

**There is probably a write-performance impact because the mmc blocks occupied by the LUKS volume cannot be FSTRIM'ed (xoxo @Lanchon) despite the fact that the LUKS volume is not actually full.
hi,

afaik latest twrp mounts aosp encryption. but there are some limitations, such as if using patterns, only 3x3 are supported.

LUKS optionally support trim pass-thru, with some (very small) loss of privacy. IMHO, in general you need to either accept this loss or over-provision your ssd (just another cost of encryption); simply ignoring the need for trim is not a viable option. however sdcard0 is usually fat, and our kernels cannot trim it, so this is a non-issue unless you switched to ext4.

yours is a good solution. i would have probably made a /data/media rom for myself instead, but your solution is more versatile. just beware that if you ever wipe data, you'll effectively wipe sdcard too!
 

dimoochka

Senior Member
Oct 9, 2014
137
104
0
afaik latest twrp mounts aosp encryption. but there are some limitations, such as if using patterns, only 3x3 are supported.
No way - did someone compile this for the i777? I've scoured XDA for this forever... where do I get it?

LUKS optionally support trim pass-thru, with some (very small) loss of privacy. IMHO, in general you need to either accept this loss or over-provision your ssd (just another cost of encryption); simply ignoring the need for trim is not a viable option. however sdcard0 is usually fat, and our kernels cannot trim it, so this is a non-issue unless you switched to ext4.
Done and done. There's about 500MB of unprovisioned space on the card so maybe I am not incurring as much of a performance penalty as I thought. Also - good point - I did format the sdcard0 to ext4 specifically so I could TRIM it (the LUKS volume is formatted as vfat to stay compatible with the ROM). I'll have to look into how TRIM would work through LUKS.

yours is a good solution. i would have probably made a /data/media rom for myself instead, but your solution is more versatile. just beware that if you ever wipe data, you'll effectively wipe sdcard too!
The best part of LUKS is the ability to use multiple keys. So I actually use a remembered passphrase (key #2) when I mount the volume in recovery. /data went spontaneously corrupt on me once in the past so this (and backing up) is a must :D
 

Lanchon

Senior Member
Jun 19, 2011
2,703
4,455
0
No way - did someone compile this for the i777? I've scoured XDA for this forever... where do I get it?



Done and done. There's about 500MB of unprovisioned space on the card so maybe I am not incurring as much of a performance penalty as I thought. Also - good point - I did format the sdcard0 to ext4 specifically so I could TRIM it (the LUKS volume is formatted as vfat to stay compatible with the ROM). I'll have to look into how TRIM would work through LUKS.



The best part of LUKS is the ability to use multiple keys. So I actually use a remembered passphrase (key #2) when I mount the volume in recovery. /data went spontaneously corrupt on me once in the past so this (and backing up) is a must :D

well LA builds twrp for the i9100, maybe the same kernel works, if only to flash it temporarily.

your LUKS vol is fat, so no trim will be generated by the file system; so enabling the pass thru wont add any value in your setup.
 

dimoochka

Senior Member
Oct 9, 2014
137
104
0
I just got TWRP working with device encryption (!!). Will post in a bit. Can you walk me through the /data/media solution you were suggesting? Not too familiar how that's handled between fstab.smdk... and vold
 

Lysergic Acid

Inactive Recognized Developer
Nov 14, 2014
1,086
12,381
0
Ponta Grossa
*** CLICK HERE for updated code and compiled fix.

@rogersb11, @Lysergic Acid, @Lanchon, @cyril279

Sup guys, spent some time looking into the outgoing call bug with the i777 this weekend and patched up a fix. This is a total hack (and not even an efficient one at that) - it modifies core android behavior and doesn't address whatever the underlying issue in the device specific code is. At least it gets us a little bit closer. Tested it on my device and it works great, although on outgoing calls there is no audible "ring" which is not stock behavior. See below. I also attached a few logs of the issue (before the patch).
1) Log spanning from immediately before an incoming call to immediately after connection.
2) Log spanning from immediately before an outgoing call to immediately after connection.
3) Log spanning from after an outgoing call connection, immediately before the speaker is toggled on, off, and on again.

Code:
In this file: /android/system/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java

Add code to the end of this method:

private void setCallState(Call call, int newState)

...

Log.i(this, "i777 hack: toggle speakerphone on/off");
if (CallState.toString(oldState).equals("DIALING") && CallState.toString(newState).equals("ACTIVE")) {
  mCallAudioManager.i777hack();
}


In this file: /android/system/packages/services/Telecomm/src/com/android/server/telecom/CallAudioManager.java

Add a method to this class:

final class CallAudioManager

...

public void i777hack() {
  int oRoute=mAudioState.getRoute();
  int oMask=mAudioState.getSupportedRouteMask();
  setSystemAudioState(false, AudioState.ROUTE_SPEAKER, oMask);
  setSystemAudioState(false, oRoute, oMask);
}
I still wonder if this couldn't be implemented in our audio blob instead of changing core android, that's the main reason a open source replica was made. Nice job anyway, maybe sometime we figure out how to do that in the device tree
 

TeutonJon78

Senior Member
Jul 24, 2010
574
283
0
Blick, I hate the Cyanogen Recovery. Is there a way to wipe the system partition using it (to make sure to wipe any GAPPS packages).
 
Last edited:

fairmount97

Member
Feb 25, 2015
16
0
0
@rogersb11, @Lysergic Acid, @Lanchon, @cyril279

Hello gentlemen, I have been working on this all weekend. My eyes are bleeding and I still can't figure out what's causing the bug. I'm about to give up and just stick with the stupid hack fix (UPDATED setCallState code below to make it work better). I am trying to debug this thing with gdbclient - any of you guys have any idea what process name I need to attach to in order to debug the CallAudioManager class (is that even possible)? I tried to attach to system_server but gdb wouldn't recongize the filename or method I was looking for.

Compiled, fixed Telecom.apk is attached (installation instructions below).

Code:
In this file: /android/system/packages/services/Telecomm/src/com/android/server/telecom/CallsManager.java

Add code to the end of this method:

private void setCallState(Call call, int newState)

...
        // i777 hack
        if (oldState==CallState.CONNECTING && newState==CallState.DIALING) {
          mCallAudioManager.i777hack();
        }


In this file: /android/system/packages/services/Telecomm/src/com/android/server/telecom/CallAudioManager.java

Add a method to this class:

final class CallAudioManager

...

public void i777hack() {
  int oRoute=mAudioState.getRoute();
  int oMask=mAudioState.getSupportedRouteMask();
  setSystemAudioState(false, AudioState.ROUTE_SPEAKER, oMask);
  setSystemAudioState(false, oRoute, oMask);
}
Instructions (works on latest CM12.1 i777 nightly - I have not tested this on any other ROM)
1) Reboot into recovery.
2) mount /system
3) Make a backup of your existing /system/priv-app/Telecom/Telecom.apk - then replace it with attached file.
4) chmod 644 /system/priv-app/Telecom/Telecom.apk
5) umount /system
6) Reboot, profit.
which kernel we should use for this instructions? can i just replace telecom.apk to /system? i didnt understand how to mount /system on recovery?
 
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone