[MOD][SU.D SCRIPT] Use Decrypted device and have working mobile network

Search This thread

Captain_Throwback

Recognized Developer
UPDATE: Thanks to @squid2's insight, there's a better method that should work for everyone. Just download the attached script, remove the .txt extension, and drop into your su.d folder with proper permissions. For more information, see here and here.

------------------------------

This is all thanks to @nkk71, btw. Right now the fix is very hacky but I'm sure ROM devs will find a more appropriate fix soon.

I'm not sure if I want to reveal the fix publicly in case HTC's spies are monitoring the thread, lol....probably better safe than sorry. But go visit nkk71's profile and buy him many beers for figuring this out. And also find some posts by him and click "Thanks."

:)

WARNING: Dragons ahead! Anything you flash to your device is done at your own risk!

EDIT: Alright, I'll publish a flashable zip here based on the 1.53.617.5 US Unlocked Edition. I've been testing the mod/hack for a few days now and have seen no ill effects. It should work fine on ROMs using that base.

I have NO IDEA if it'll work on ROMs using an International/Europe base or on CDMA. If you really want to try it, make sure you make a backup first! You will need to "Format Data" in TWRP and flash the standard SuperSU zip to remove forced encryption (or do it manually, if you know how).

Let the bricking begin! :eek:

P.S. Thanks of course also go to @Chainfire for SuperSU and su.d!
 

Attachments

  • Screenshot_20160604-155023.png
    Screenshot_20160604-155023.png
    124.6 KB · Views: 2,383
  • 000ril_fix.sh.txt
    136 bytes · Views: 904
Last edited:

nkk71

Inactive Recognized Developer / Contributor
May 26, 2010
8,741
7,571
53
Beirut
I don't really find it hacky, just another workaround ;)

Unfortunately, due to personal reasons, I have personally decided not to share this.
(I know you above all others will understand)

It is not a secret, I have a certainly made it public (or so I thought) enough.

Unfortunately the controversy, I'm not willing to deal with... An innocent "share", turned ugly

I fully endorse this method, though I only had 7 mins of testing, before things got very ugly, a very very very very very very very very very very unfortunate incident.
So be it.

The method is still sound, and anybody who wishes to use it, I have neither any objections, just please test it.
Thanks
nkk71



Sent from my HTC 10 using Tapatalk
 

Captain_Throwback

Recognized Developer
I don't really find it hacky, just another workaround ;)

Unfortunately, due to personal reasons, I have personally decided not to share this.
(I know you above all others will understand)

It is not a secret, I have a certainly made it public (or so I thought) enough.

Unfortunately the controversy, I'm not willing to deal with... An innocent "share", turned ugly

I fully endorse this method, though I only had 7 mins of testing, before things got very ugly, a very very very very very very very very very very unfortunate incident.
So be it.

The method is still sound, and anybody who wishes to use it, I have neither any objections, just please test it.
Thanks
nkk71
You think I should post it? Or do you think HTC might find it and try and change their method?
 
  • Like
Reactions: Kisakuku

nkk71

Inactive Recognized Developer / Contributor
May 26, 2010
8,741
7,571
53
Beirut
You think I should post it? Or do you think HTC might find it and try and change their method?
In my humble opinion, go for it

I doubt HTC will change the code, and it is a workaround [emoji2]

Unless something is being changed... Elsewhere (doubt it) , I Personally, have briefly tested and accept it

Sent from my HTC 10 using Tapatalk
 
  • Like
Reactions: jbm76 and silvercat

squid2

Recognized Developer
Mar 9, 2015
1,722
10,983
Ontario
Looking at the logic in the HTC RIL library, in Pythonic pseudocode, it goes something like this:
Code:
if property_get("ro.crypto.state") != "encrypted":
    if property_get("persist.radio.current.cnv", default="-1") == "-1":
        if htcril_db_property_get("current.cnv") != "-1":
            htcril_db_property_set("current.cnv", "-1")

Other libraries then query the htcril DB via the library, and behave differently if the current.cnv property is set in the DB. Based off this, I would guess that doing the following would have a similar effect without needing to hack the library:
Code:
setprop persist.radio.current.cnv 0

I haven't tried this, but I'm curious if restoring the stock libhtcril_db.so and setting this property would work.
 

Captain_Throwback

Recognized Developer
Looking at the logic in the HTC RIL library, in Pythonic pseudocode, it goes something like this:


Other libraries then query the htcril DB via the library, and behave differently if the current.cnv property is set in the DB. Based off this, I would guess that doing the following would have a similar effect without needing to hack the library:


I haven't tried this, but I'm curious if restoring the stock libhtcril_db.so and setting this property would work.
Brilliant! That works! Much easier/cleaner solution than hacking the lib :)

EDIT: Posted script in the OP. Bedtime!
 
Last edited:

nkk71

Inactive Recognized Developer / Contributor
May 26, 2010
8,741
7,571
53
Beirut
Looking at the logic in the HTC RIL library, in Pythonic pseudocode, it goes something like this:
Code:
if property_get("ro.crypto.state") != "encrypted":
    if property_get("persist.radio.current.cnv", default="-1") == "-1":
        if htcril_db_property_get("current.cnv") != "-1":
            htcril_db_property_set("current.cnv", "-1")

Other libraries then query the htcril DB via the library, and behave differently if the current.cnv property is set in the DB. Based off this, I would guess that doing the following would have a similar effect without needing to hack the library:
Code:
setprop persist.radio.current.cnv 0

I haven't tried this, but I'm curious if restoring the stock libhtcril_db.so and setting this property would work.

Brilliant! That works! Much easier/cleaner solution than hacking the lib :)

EDIT: Posted script in the OP. Bedtime!

Nice :good:

Strangely enough, I couldn't get the property to stick, but I edited the init.rc directly, didnt use the su.d... maybe I put it in the wrong place :eek:
 

Captain_Throwback

Recognized Developer
So boot into TWRP, format data and flash regular SuperSu? What are the permissions for the Script ?
Permissions for su.d scripts are 0700. If you want to put the script there while in recovery and you're using systemless root, you can use @osm0sis SUmount zip to mount the su.img and then the TWRP File Manager to copy the script over and change perms. Flash the SUmount zip again to unmount su.img, and then reboot.
 
  • Like
Reactions: osm0sis

SacredDeviL666

Retired Senior Moderator - May You Rest in Peace -
Sep 11, 2008
7,385
8,313
¤No Man's Land¤
Permissions for su.d scripts are 0700. If you want to put the script there while in recovery and you're using systemless root, you can use @osm0sis SUmount zip to mount the su.img and then the TWRP File Manager to copy the script over and change perms. Flash the SUmount zip again to unmount su.img, and then reboot.

the flashable zip if i want to try on international rom...

i boot into twrp formata data to remove encryption flash super 2.65 stable flash your script and boot will that do?
 

Captain_Throwback

Recognized Developer
the flashable zip if i want to try on international rom...

i boot into twrp formata data to remove encryption flash super 2.65 stable flash your script and boot will that do?
Don't use the zip. That's the old hack. Use the script. You have to manually place it.

And use the latest SuperSU Beta, not the stable.
 
  • Like
Reactions: SacredDeviL666

SacredDeviL666

Retired Senior Moderator - May You Rest in Peace -
Sep 11, 2008
7,385
8,313
¤No Man's Land¤
Don't use the zip. That's the old hack. Use the script. You have to manually place it.

And use the latest SuperSU Beta, not the stable.

okay thank you so i would use the latest supersu 2.74beta zip from recovery.

the script isn't downloading for me when i click on it just opens a page with below message
#!/system/bin/sh

# Allow mobile network while decrypted
# thanks @squid2 from XDA for the easy fix!
setprop persist.radio.current.cnv 0

... from pc i am..
 
Last edited:

Captain_Throwback

Recognized Developer
okay thank you so i would use the latest supersu 2.75beta zip from recovery.

the script isn't downloading for me when i click on it just opens a page with below message
#!/system/bin/sh

# Allow mobile network while decrypted
# thanks @squid2 from XDA for the easy fix!
setprop persist.radio.current.cnv 0

... from pc i am..
Right-click and Save As....
 
  • Like
Reactions: SacredDeviL666

SacredDeviL666

Retired Senior Moderator - May You Rest in Peace -
Sep 11, 2008
7,385
8,313
¤No Man's Land¤
Right-click and Save As....

thanks got it!!!

place the script in system/su.d folder with the permissions/boot to recovery format data/flash latest supersu beta 2.74 and the let boot finish.....

at htc green logo now...fingers crossed... by the way i was on system mode su prior to trying this mod.

now optimizing the apps...lee's r82 international

---------- Post added at 01:38 PM ---------- Previous post was at 01:16 PM ----------

@Captain_Throwback

came back as encryped only....

the script permission i gave was rwx r-x r-x

Screenshot_20160608_173709.png
 
Last edited:
  • Like
Reactions: Jm@n

Top Liked Posts

  • There are no posts matching your filters.
  • 21
    UPDATE: Thanks to @squid2's insight, there's a better method that should work for everyone. Just download the attached script, remove the .txt extension, and drop into your su.d folder with proper permissions. For more information, see here and here.

    ------------------------------

    This is all thanks to @nkk71, btw. Right now the fix is very hacky but I'm sure ROM devs will find a more appropriate fix soon.

    I'm not sure if I want to reveal the fix publicly in case HTC's spies are monitoring the thread, lol....probably better safe than sorry. But go visit nkk71's profile and buy him many beers for figuring this out. And also find some posts by him and click "Thanks."

    :)

    WARNING: Dragons ahead! Anything you flash to your device is done at your own risk!

    EDIT: Alright, I'll publish a flashable zip here based on the 1.53.617.5 US Unlocked Edition. I've been testing the mod/hack for a few days now and have seen no ill effects. It should work fine on ROMs using that base.

    I have NO IDEA if it'll work on ROMs using an International/Europe base or on CDMA. If you really want to try it, make sure you make a backup first! You will need to "Format Data" in TWRP and flash the standard SuperSU zip to remove forced encryption (or do it manually, if you know how).

    Let the bricking begin! :eek:

    P.S. Thanks of course also go to @Chainfire for SuperSU and su.d!
    14
    I don't really find it hacky, just another workaround ;)

    Unfortunately, due to personal reasons, I have personally decided not to share this.
    (I know you above all others will understand)

    It is not a secret, I have a certainly made it public (or so I thought) enough.

    Unfortunately the controversy, I'm not willing to deal with... An innocent "share", turned ugly

    I fully endorse this method, though I only had 7 mins of testing, before things got very ugly, a very very very very very very very very very very unfortunate incident.
    So be it.

    The method is still sound, and anybody who wishes to use it, I have neither any objections, just please test it.
    Thanks
    nkk71



    Sent from my HTC 10 using Tapatalk
    13
    Looking at the logic in the HTC RIL library, in Pythonic pseudocode, it goes something like this:
    Code:
    if property_get("ro.crypto.state") != "encrypted":
        if property_get("persist.radio.current.cnv", default="-1") == "-1":
            if htcril_db_property_get("current.cnv") != "-1":
                htcril_db_property_set("current.cnv", "-1")

    Other libraries then query the htcril DB via the library, and behave differently if the current.cnv property is set in the DB. Based off this, I would guess that doing the following would have a similar effect without needing to hack the library:
    Code:
    setprop persist.radio.current.cnv 0

    I haven't tried this, but I'm curious if restoring the stock libhtcril_db.so and setting this property would work.
    5
    Here is the flashable zip to automatically place the script into /su and set correct permissions.
    @Captain_Throwback, you can add this to the OP.
    3
    In my humble opinion, go for it

    I doubt HTC will change the code, and it is a workaround [emoji2]

    Unless something is being changed... Elsewhere (doubt it) , I Personally, have briefly tested and accept it
    Done.

    This should be fun, lol. Let the brickings begin!