yashsingh1/xdaforums huggingface dataset:
[Magisk] exocetdj:
Hi all

Firstly - I am trying to add Samsung's extra CSC features to my rom module

1 - So I have got my Rom-Module's install.sh to a point where I am able to determine my Samsung device's CSC. (AUT in my firmware's case)

2 - Following this I have added the various CSC folders (where Samsung add various features to .xml folders depending on carrier/location? there's about 90 in total) to my ROM Module - This is with a line of code for each folder which is suppose to copy the xml somewhere and amend it depending on the results of point 1 above. The selection of the line of code to use is successful looking at my debug.log - I get the following error on the log when installation is run

+ echo 'CSC code AUT found in rom zip'

+ ui_print 'Identifying CSC completed'

+ true

+ echo 'Identifying CSC completed'

+ ui_print ' '

+ true

+ echo ' '

+ ui_print ' '

+ true

+ echo ' '

+ ui_print 'duplicating relevant CSCfeatures.xml'

+ true

+ echo 'duplicating relevant CSCfeatures.xml'

+ '[[' AUT '==' ACR ]]

+ '[[' AUT '==' AFG ]]

+ '[[' AUT '==' AFR ]]

+ '[[' AUT '==' ATO ]]

+ '[[' AUT '==' AUT ]]

+ ui_print 'Installing AUT CSC...'

+ true

+ echo 'Installing AUT CSC...'

+ cp -rf /data/adb/modules_update/420rom-MAGISK/common/420/product/omc/AUT/conf/cscfeatures.xml /dev/tmp/product/omc/AUT/conf/.

cp: can't stat '/data/adb/modules_update/420rom-MAGISK/common/420/product/omc/AUT/conf/cscfeatures.xml': No such file or directory

+ '[[' AUT '==' BGL ]]

+ '[[' AUT '==' BNG ]]

My script successfully identifies the CSC and points to the correct lines of code but I cannot seem to get the xmls to go to where they need to go for modding (is this a temp folder somewhere?) - I have tried several different paths (i.e from modpath/product or from modpath/common/420/product) - Can anyone help with this?

3- So after the above, in theory, once the xml is where it needs to be, I need to inject the code into the xmls. I have been given a script that does this which contains the necessary sed commands and should work - again my install script calls the "injection" script successfully but - I'm assuming I'm getting the error below due to my issues above...……….

sed: can't create temp file '/product/omc/SEB/conf/cscfeature.xmlNr7tPK': Read-only file system

sed: can't create temp file '/product/omc/AUT/conf/cscfeature.xml4gS8cK': Read-only file system

etc

etc

I have been trawling the wiki's for answers but as I'm fairly new to this I'm a bit stumped. If anyone can help ill buy you a few beers or whatever if we get this sorted. (I'm on me knees lol)

My install script and last log are attached. I will post a link to my module also if there's any experts with time and if it's needed

Hopefully this is everything needed for someone to assist and that this isn't a non-descript query . :D

TIA all and stay safe :cool:
[Magisk] shadowstep:
[MENTION=4366077]exocetdj[/MENTION] I had a look at your install script, you're using MMT-Ex, yes? Basically, what you're trying to achieve is if the csc_id variable has been identified as, for example, ACR, then you want to copy the cscfeatures.xml present in /common/420/product/omc/ACR/conf location of your module zip to the main module for Magisk to mount, correct? If that's the case, why are you using $TMPDIR variable as the destination? Just do the following:

cp_ch $MODPATH/common/420/product/omc/ACR/conf/cscfeatures.xml [B]$MODPATH/system[/B]/product/omc/ACR/conf

Some of the observations you might make reading my command above -

cp_ch is a function that's present in MMT-Ex and is super handy. It differs from the regular cp function in the way that the regular function will fail if the destination directory doesn't exist, which means in your module, you'll also have to make sure the destination directory (/system/product/omc/ACR/conf) exists in your module zip or that you use the mkdir command to create it. By using cp_ch, you don't have to worry about the destination directory not existing and all of that because it creates the same too if it is not found. You can read more about the function here.

You shouldn't place stuff directly in the /product folder in the root of your module zip, the path should always be /system/product if you want to place something in the product partition (even if the partition is separate). Magisk takes care of that, so you don't have to.

You can now use your script to modify the copied xml(s) in $MODPATH/system/product/omc/ACR/conf

Hopefully the above helps. :)
[Magisk] exocetdj:
Firstly thanks for the response mate :) - please ignore the TMPDIR as that was this morning's brainfart - I like the command above however will this work in install.sh? cp commands turn blue but cp_ch didn't, will that work still?

your observations make perfect sense. I am going to try a version of my install.sh someone has just amended with similar focus to yours then I will give this my focus.... :D:D BRB
[Magisk] exocetdj:
just looking at this now - my friend is trying to functionalise al that stuff so in the meantime Im looking at this

looking at the cp_ch stuff should it be

cp_ch -r $MODPATH/common/420/product/omc/ACR/conf/cscfeatures.xml $MODPATH/system/product/omc/ACR/conf 0755

adding in the recursive and the permissions
[Magisk] exocetdj:
so this brings me to a new issue

I had to put an install.sh with the installation script in /common in as the VKSEL commands rely on the Volume Key Selector add on to work.

ch_cp doesn't work on install.sh apparently as it's customize.sh that's linked to the updater functions.

so I need to put the CSC features code on customize.sh but I haven't got a clue where as its not picking up the script during flash (just the replace command)

EDIT

I think the copying over worked!!! :D

+ echo 'Installing AUT CSC...'

+ cp_ch -r /data/adb/modules_update/420rom-MAGISK/common/420/product/omc/AUT/conf/cscfeatures.xml /data/adb/modules_update/420rom-MAGISK/system/product/omc/AUT/conf 0755

+ getopt -o inr -- -r /data/adb/modules_update/420rom-MAGISK/common/420/product/omc/AUT/conf/cscfeatures.xml /data/adb/modules_update/420rom-MAGISK/system/product/omc/AUT/conf 0755

+ local 'OPT= -r -- '"'"'/data/adb/modules_update/420rom-MAGISK/common/420/product/omc/AUT/conf/cscfeatures.xml'"'"' '"'"'/data/adb/modules_update/420rom-MAGISK/system/product/omc/AUT/conf'"'"' '"'"'0755'"'" 'BAK=true' 'UBAK=true' 'FOL=false'

+ eval set -- ' -r -- '"'"'/data/adb/modules_update/420rom-MAGISK/common/420/product/omc/AUT/conf/cscfeatures.xml'"'"' '"'"'/data/adb/modules_update/420rom-MAGISK/system/product/omc/AUT/conf'"'"' '"'"'0755'"'"

+ set -- -r -- /data/adb/modules_update/420rom-MAGISK/common/420/product/omc/AUT/conf/cscfeatures.xml /data/adb/modules_update/420rom-MAGISK/system/product/omc/AUT/conf 0755

+ true

however the sed command didn't appear to - all files and folders are in correct place in module

sed: can't create temp file '/product/omc/AUT/conf/cscfeature.xmlJiSkA1': Read-only file system

sed: can't create temp file '/product/omc/SMP/conf/cscfeature.xmlVDCUdy': Read-only file system
[Magisk] exocetdj:
[MENTION=5893314]shadowstep[/MENTION]

I have, with the help of a friend managed to tidy everything up and add a function that shortens the install script dramatically

from the debug.log it now looks that everything is mostly working but for some reason the csc features are not present.

those cp_ch commands do indeed work on install.sh it seems to be copying the file and the sh commands are not erroring (apart from 2 ill remove anyway)

I have attached the log, my install script and the latest module with all changes suggested made.

if you or someone could possibly take a look and ill buy you a few beers for your time when i'm paid when this is working lol :good:

many thanks all really hoping someone can make me shut up and f### off with a working module zip lol:laugh::D my brain is mushed

https://mega.nz/file/yNsXSaiB#2BTNAWFALssPWn78aauv6XLtffXFQyU3cCs_IoLLGoQ
[Magisk] exocetdj:
Just the nightly plea for some help lol

so does anyone know where I would need to get my install.sh to copy an xml to edit it prior to installation?

I have tried cp_ch -r $MODPATH/common/420/product/omc/…. $MODPATH/system/product/…… 0755

these cp_ch's aren't working in my install.sh as advertised (I had this issue when trying to implement them whilst doing the vksel additions choices in my script)

the sh commands are not working (did echo on them to evidence this) as the copy command for the csc.features.xml is not working. so

csc is being identified

correct line of code is being selected for "AUT" in my case

file is not being selected and flashed

sh commands to change xmls are running but not working due to copying issue.

the copy paths in my script causing the errors are

cp_ch -r $MODPATH/common/420/product/omc/###($1)/conf/cscfeatures.xml $MODPATH/system/product/omc/###($1)/conf/

interestingly did this in place of the above in the function and same result

mkdir -p $MODPATH/system/product/omc/$1/conf/

chmod -R 0755 $MODPATH/system/product/omc/$1/conf/

cp -rf $MODPATH/common/420/product/omc/$1/conf/cscfeatures.xml $MODPATH/system/product/omc/$1/conf/.
[Magisk] exocetdj:
The script is now working,

The XML is being copied over to a temp folder

I can see the changes have now been made to the xml file and by the odd (very scarce account here) ...

$MODPATH/system/product/omc/"AUT"/conf

Is the right place to go for it as magisk "transparently handles" replacements in both /product and /vendor if placed after $MODPATH/system

the cscfeatures programmed into the XML files replaced under replace in customize.sh work

The CSC features programmed under the sh commands that physically make thier way into the cscfeatures.xml that then is installed successfully, do not

Wtf Is going on?
[Magisk] exocetdj:
Cripes not all at once ????
[Magisk] Didgeridoohan:
You have been quite lonely in this thread, haven't you? :D

I've been following your adventures, but unfortunately haven't had much input to add.

Not sure exactly what the current issue is, but if you haven't done this already I'd like to come with a troubleshooting suggestion.

Whenever I have these kind of issues I put a bunch of troubleshooting code in the scripts that print info to a temporary file. Example:

echo $DIRVAR/whatever.txt >> /cache/tmpfile

If that prints the full path to the tmpfile I know that it should work, if it only prints "/whatever.txt" I know that the variable isn't set properly. Placing similar echo commands inside if-else statements help determine if the correct code gets executed, or if it gets executed at all. Etc...

I do hope you figure it out.
[Magisk] exocetdj:
Houston we have contact hehe!

Thanks for the response!

Yes these echoes have been very valuable.

Using these I have been able to:

-diagnose and fix the copying issues I had

-diagnose and fix the code injection issues

SO.......my script has been tested and tested and does seem to work.

The module takes cscfeatures.xml from the module , copys to tmp successfully and successfully adds the code. (This has been double checked)

This is exactly what I want it to do.

So I guess the update on the issue is.......

In my previous version, I made a generic CSCFEATURES.XML with as many features I could think of then used that to replace the one in system using the replace function in the MMTs customize.sh script - these copied over and the extra functions were reflected in the menus in settings on reboot after installing the module. THIS CAUSES ISSUES WITH MISSING FEATURES :crying:

For whatever reason the cscfeature.xml that is successfully modified then replaced using cp_ch commands does not seem to be reflected in the menus in settings after install and reboot.

Hopefully you can see how agonisingly close I am.

[MENTION=3989587]~clumsy~[/MENTION] has been a god send and I have been lucky to have an expert like him helping me with my script but we both agree that we need some magisk expert input lol. Hes got us this far without knowing anything r.e magisk!

We really have tested this to death.

Can anyone please take a look if I provide the latest zip/script, or suggest why the above may be happening?
[Magisk] exocetdj:
Here's proof the codes injected- cscfeatures.xml lifted from device post module installation.

I have been told that this indenting shouldn't matter either
[Magisk] exocetdj:
Here's the most up to date zip which is "working" but where the CSC features aren't "sticking"

https://mega.nz/file/uA0S3YjJ#6vi8KeCjXJgJ38N87kwsXuS26cLEswOgyQwJ7ny0f6c

Install.sh is in /common
[Magisk] Didgeridoohan:
I might be able to take a quick look tonight (maybe I'll be able to spot something). No promises though...
[Magisk] exocetdj:
Thanks very much mate. I really appreciate even this ?

I'm updating to oneui2.1 later to give my head a bit of a break from this so take the time you need and if you can't no probs ?
[Magisk] shadowstep:
Sorry, I've been busy with work (I do supply chain management for various pharmaceutical manufacturers, and at a time like this, my focus has been there most of the time).

Anyway, after installing the module are rebooting, can you check the xml under /data/adb/modules/420rom-MAGISK/...(wherever the xml is supposed to be)... and make sure it's the correct (edited) one? If it is, also check the permissions (they should be 0644, i.e. rw--r--r-- ideally).

Also, a couple of other side notes, one is that the versioncode mentioned in your module.prop is not an integer (it should be, as per the documentation), maybe change that to just 063; and the second one is that there is an unused (incomplete?) prop at the end of your system.prop file (net.ipl) which has no value specified, you should complete that or remove that altogether.
[Magisk] exocetdj:
Hey thanks for getting back and respect for doing what you're doing in what must be an absolutely mental time for ya! Thanks for getting back ?

I'll apologise hugely for all the posting as iv been actively on this for about a week solid lol. Normally I'd quit and move on to something else with my project but the amount I have learned and how far iv got necessitate completion ??

Also despite the constant trial and error, this projects been great for my mental health by keeping me away from the news etc (wife isn't too pleased though ha!)

I noted my module.prop had gone a lil weird so thanks as I can now sort that (these cscfeatures have been a thorn in my existence since starting my project lol).

The incomplete prop I'll remove or maybe I can get that off my tester.

We've also since confirmed, by using those steps above, the script is modifying and installing the file

It's in root/product, root/product/ system and the one under data/adb........ amended as per the shell command's script ?

Im up Schitt's creek without a paddle at this time my friend ??
[Magisk] Didgeridoohan:
I've only taken a very quick look at the module, but based on what you write here I have some other observations. If you say that the files are placed in the correct path in the module directory (/data/adb/modules/420rom-MAGISK/system/...), with the correct permissions, and that they do show up in their correct location under /product (and with the expected contents from the module) then it sounds like there is something else going on. Are you absolutely sure that the files are edited correctly? Sounds to me like that could be the weak link in this chain.

Have you tested taking one of these files, edited as the install script would, and use it in place of the genereic xml you say succesfully installed on an earlier version of the module? If that still doesn't work it is very likely there is some issue with the files rather than how the files are copied or mounted by Magisk.

Apart from what [MENTION=5893314]shadowstep[/MENTION] outlined above I also noted that you're not quite using the REPLACE variable as you should. It is only for directories, don't put the path to files in there. Any files you have in your module will automatically replace the corresponding file on the device.

I'm likely not gonna be much more help than this kind of general troubleshooting since I have no way of testing the module. I don't do Samsung...
[Magisk] exocetdj:
this is excellent feedback mate...

1, If you say that the files are placed in the correct path in the module directory (/data/adb/modules/420rom-MAGISK/system/...), with the correct permissions, and that they do show up in their correct location under /product (and with the expected contents from the module) then it sounds like there is something else going on. Are you absolutely sure that the files are edited correctly? Sounds to me like that could be the weak link in this chain. - yep the files have the code in them, I did notice that the inserted code was not indented like the rest was - However this does not matter apparently as xml parsers don't look out for the indents - furthemore I edited and reinstalled the xml with the correct (however I will defo double check) permissions and nothing, clumsy suggested this also

2, Apart from what [MENTION=5893314]shadowstep[/MENTION] outlined above I also noted that you're not quite using the REPLACE variable as you should. It is only for directories, don't put the path to files in there. Any files you have in your module will automatically replace the corresponding file on the device.- cool thanks for pointing that out - theres some sales.code.dat files and other xmls that need to come over from omc, perhaps my simpleton like implementation caused some issues there lol.

huge thanks for this, ill try these then we really need someone with MMT & Samsung specilised inside out knowledge (that's a mouthful!) if this doesn't work(if/when time permits)
[Magisk] exocetdj:
Ok so this was unsuccessful (whelp, I didn't realise 2 months ago when I started it was going to be this epic!)

so its either something specific to MMT I have missed (perhaps unlikely now?) or maybe there's something in a prop that's screwing things up

when I had a clone of the product/omc folder full of the generic and identical xmls, each one would be replaced therefore the code would just work.

i'm wondering if the CSC is also programmed in somewhere else and i'm missing it as it appears now the zip is working script wise and the phone thinks it's something else (shouldn't be a major fix but it's finding out what, if anything)
[Magisk] exocetdj:
Starbucks 2010 confirmed I'm looking in the wrong folder for my CSC. (They're his scripts I'm calling with my install.sh)

The CSC info I should be calling is in another partition.

Whilst everything's working, the features probably not being applied as the firmware fools the mod into thinking the firmware CSC is the main csc and edits the wrong file.

So there ya go! (Potentially) lol
[Magisk] Didgeridoohan:
Ok. So it is the files that aren't quite right...

Looking forward to hearing if this is the last piece of the puzzle.
[Magisk] exocetdj:
Or more specifically the wrong CSCFEATURES.XML is being used - calling it from the place I am in theory is correct unless you're under a multi CSC like I am (BTU is actually my carrier ID, as AUT and BTU are both OXM firmware, BTU overrides the change in CSC and blah blah blah)

Got 2 options, call CSC from somewhere else or inject the code into all 120 cscfeatures.xml docs lol

PROBABLY THE LAST THING I NEED TO KNOW HERE.....(phew) ?

Can you confirm that magisk is not patching these xmls too late for the system to read those changes?
[Magisk] Didgeridoohan:
Calling CSC from somewhere else sounds much nicer...

You're only patching the files at install, so after that it's just a matter of Magisk to magic mount the files. It is of course possible that this happens too late, but since you have previously been successful I would say this is not the case.
[Magisk] exocetdj:
Quality stuff!

I'll let you know how I get on.

I hope I sort this, major new base has just landed and releasing a update with these features on a new base will be awesome!
[Magisk] exocetdj:
Success!

Pointing to the other CSC source worked and features are now present!

Thanks for your help and [MENTION=5893314]shadowstep[/MENTION]
[Magisk] Didgeridoohan:
Awesome! I'm glad you got things working. Sorry that you had to spend all that time troubleshooting the wrong thing.

I'm picturing someone repeatedly trying to push open a door, just to suddenly realise you open it by pulling... :laugh: Been there done that, I know the feeling well. :good:
[Magisk] exocetdj:
haha!! cheers dude!!

yeah its defo like that, certainly! as i'm one of those people that "loses" something and then spends a day searching for it, only to realise its in my hand anyway:laugh::laugh: that's ADHD for ya!!! :laugh:
[Magisk] shadowstep:
Glad you got it figured out eventually! Have a couple of extra beers tonight. ;) Also, always happy to help! :good:

I agree, persistent son of a gun, lol. Good on him though!
[Magisk] exocetdj:
hehehe! Cheers chap!! I will do :) (and probably something else too hehe!)
[Magisk] shadowstep:
The name of your ROM doesn't leave me guessing, I know what you mean. ;)
[Redmi Note 8 Questions & Answers] the_weird_aquarian:
not available yet...the once that are available aren't working already tested...so either visit service center or wait for unknown periods of weeks/months/years.
[Redmi Note 8 Questions & Answers] .excalibur:
Did you found any authorized account?
[Redmi Note 8 Questions & Answers] strongst:
Thread cleaned

Please do not advertise or discuss remote unlock services as it violates the FORUM RULES especially those:

13. Advertising and Income Generation

Commercial advertising, advertising referral links, pay-per-click links, all forms of crypto-mining and other income generating methods are forbidden. Do not use XDA-Developers as a means to make money.

Thank you for everyones understanding and have a nice day!

strongst

Forum Moderator
[LineageOS Questions & Answers] allanx2000:
What the title says but here's the backstory for me...

Back in January, I upgraded my OP6 to OxygenOS 10/Android 10... And had flash a patched boot img with Magisk and maybe sideload boot into TWRP to install it. Ended up soft-bricking my phone :crying: but managed to reflash OOS 9 via native/bios bootloader? Lost all data though.... And probably spent a whole day trying to fix it and hoping I didn't have to buy a new phone...

Also TWRP did say back on January it's hard for them to support Android 10 because of some boot order change? (Maybe I did end up flashing it but when I tried to boot into recovery, it didn't load... Loaded the default OP recovery instead.)

But I basically want to make sure I can avoid all this again or at least have all steps when I flash LOS 17.1 instead of trial and error... And probably screwing up again...
[LineageOS Questions & Answers] kurtn:
Follow your guide

https://wiki.lineageos.org/devices/enchilada/

And ask in irc/discord #lineageos if something fails
[LineageOS Questions & Answers] allanx2000:
Thanks but the guide doesn't mention installing TWRP, Magisk, or OpenGApps. The last 2 always need to be flash from Recovery or can you do that with Lineage Recovery now?

Was thinking asking here would be better as others will/have wondered the same thing. (Can't add the TWRP blog link)

But thanks for the Discord, guess will try there and just post a guide when I do do it... which won't be until all this Covid gets fixed and I can go back to my apt...
[LineageOS Questions & Answers] kurtn:
Read you guide:

Optionally): If you want to install any additional add-ons, click Advanced, then Reboot to Recovery, then when your device reboots, click Apply Update, then Apply from ADB, then adb sideload filename.zip those packages in sequence.

info_outline

Note: If you want Google Apps on your device, you must follow this step before booting into LineageOS for the first time!

/end quote

Magisk can be flashed in a later session

In discord the first thing they will ask is: "did you follow the guide?"