Giter Site home page Giter Site logo

ca-combos-editor's Introduction

ca-combos-editor

A combo editor for NV ITEM 00028874 (RFNV_LTE_CA_BW_CLASS_COMBO_I)

Dislaimer

The file generated by this tool may brick your device. Make a backup of your EFS before doing anything else.
I suggest you to always keep QRCT open, NSG closed and test your file as follows:

  1. Open a root terminal on your phone: dmesg -w | grep failure and keep it running. This will show all the modem errors that may happen if your file is invalid.
  2. Use QRCT and EFS Explorer to upload your file and synchronize the EFS. If your modem bootloops, just put the phone in FTM (it will stop it from bootlooping) and restore the original 00028874 file / try a new one.

Setup

  1. Clone this repo
  2. Execute the following (in the repo's root)
go get github.com/denysvitali/ca-combos-editor/cmd
go run cmd/main.go -h

Usage

Parse 00028874's content

  1. Extract it:
zlib-flate --uncompress < 00028874 > extracted.bin
  1. Parse it:
go run cmd/main.go parse extracted.bin

Create a 00028874 file based on a band file

  1. Provide a bands.txt file in the format shown in test/resources/2019-10-17/bands.txt (one combo per line)
  2. go run cmd/main.go create bands.txt 00028874_uncompressed
  3. Compress it: ./compress.sh 00028874_uncompressed
  4. Write the new 00028874 file to your modem

Create a 00028874 file based on a Downlink file and an Uplink file

Given two files, downlink.txt and uplink.txt, containing a list of downlink bands and uplink bands as follows:

downlink.txt

1C
1A-1A
3C
3A-1A

uplink.txt

1A
1A
3A
1A, 3A

The following records will be created:

DL: 1C                                       
UL: 1A                                       
                                             
DL: 1A-1A                                    
UL: 1A                                       
                                             
DL: 3C                                       
UL: 3A                                       
                                             
DL: 3A-1A                                    
UL: 1A                                       
UL: 3A               

The command to parse such files is the following:

./ca-combos-editor create_dlul downlink.txt uplink.txt output

A new file output will be generated. Compress it with ./compress.sh output and you'll get the 00028874 file.

FAQ

My 00028874 file doesn't get applied and I'm using a Oneplus / Oppo device

Oneplus does rewrite the NV Item files via its "NV Backup". Use a patched /vendor/bin/rmt_storage to avoid that (extract it from any other device with an identical chipset). You can find the one I'm using on my OP5T on Android 9 (Oxygen OS 9.0.9) in resources/rmt_storage_patch/op5t/oos/9.0.9/rmt_storage (see its checksum below).
This will completely disable the NV Backup and will allow you to rewrite any NV item file without having it rewritten at every reboot. If the patch succeeds you'll have the following output when you go to the dialer pad, write *#268# (2NV) and click "NV parameters":

NV Backup UI shows Partition Verify: Failed

2ebd9ab966f395f387c888c9c591c8a2b5720204abc2ba2619d2c10d6cc38506  rmt_storage (patched)
d02daf4725be98999a98b240010dabc0ab231b46e47c3d6824c4625d7cb5a87b  rmt_storage (original)

ca-combos-editor's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ca-combos-editor's Issues

Errors creating file 00028874

Hi Denys,

First to all thank you for your excellent job with this tool!

I was playing with the tool trying to generate mi own 00028874 and after a long way (I'm not familiar with Linux or C++) I was able to make a file with just a few CA combinations on it.

But when I tried to use the original file that came with my Samsung S10e with those few combinations added it was not created.
Please see below the error I got and you can see attached the file with all combinations. The last four are my additions.
Is there any wrong with file ? Thank you in advance for any help you can provide.

C:\Compile\ca-combos-editor-master>go run cmd/main.go create newS10eEdi.txt sali
panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
github.com/denysvitali/ca-combos-editor/pkg/types.UlArr.Less(...)
C:/Compile/ca-combos-editor-master/pkg/types/ulentry.go:42
sort.insertionSort(0xef0d80, 0xc0002199e0, 0x0, 0x2)
c:/go/src/sort/sort.go:27 +0xcc
sort.quickSort(0xef0d80, 0xc0002199e0, 0x0, 0x2, 0x4)
c:/go/src/sort/sort.go:209 +0x21d
sort.Sort(0xef0d80, 0xc0002199e0)
c:/go/src/sort/sort.go:218 +0x85
github.com/denysvitali/ca-combos-editor/pkg.ParseBandFile(0xc0000a2080, 0x8, 0x0, 0x0, 0x0)
C:/Compile/ca-combos-editor-master/pkg/bandparser.go:201 +0x7b6
main.main()
C:/Compile/ca-combos-editor-master/cmd/main.go:52 +0x354
exit status 2

newS10eEdi.zip

New 00028874 file does not work

Hi,

I'm trying to use this tool to make new 00028874 file,
but it seems zlib-flate does not support compression level set,
I only can use zlib-flate -compress < $1 > 00028874 instead of zlib-flate -compress=6 < $1 > 00028874 on your script.

But it seems the output file does not work, the modem shows an error.
Then I tried to use 28874Decoder (https://github.com/HandyMenny/28874Decoder) to decode the new file,
the program returns many error messages.

Incorrect format: incorrect descriptor type 6515 (137, 138, 201, 202, 333 or 334 expected). File offset=4.
Incorrect format: incorrect descriptor type 24030 (137, 138, 201, 202, 333 or 334 expected). File offset=6.
Incorrect format: incorrect descriptor type 768 (137, 138, 201, 202, 333 or 334 expected). File offset=8.
Incorrect format: incorrect descriptor type 22189 (137, 138, 201, 202, 333 or 334 expected). File offset=a.
Incorrect format: incorrect descriptor type 3649 (137, 138, 201, 202, 333 or 334 expected). File offset=c.
Incorrect format: incorrect descriptor type 12419 (137, 138, 201, 202, 333 or 334 expected). File offset=e.
Incorrect format: incorrect descriptor type 19212 (137, 138, 201, 202, 333 or 334 expected). File offset=10.
Incorrect format: incorrect descriptor type 41417 (137, 138, 201, 202, 333 or 334 expected). File offset=12.
Incorrect format: incorrect descriptor type 32828 (137, 138, 201, 202, 333 or 334 expected). File offset=14.
Incorrect format: incorrect descriptor type 34595 (137, 138, 201, 202, 333 or 334 expected). File offset=16.
Incorrect format: incorrect descriptor type 4253 (137, 138, 201, 202, 333 or 334 expected). File offset=18.
Incorrect format: incorrect descriptor type 25951 (137, 138, 201, 202, 333 or 334 expected). File offset=1a.
Incorrect format: incorrect descriptor type 55743 (137, 138, 201, 202, 333 or 334 expected). File offset=1c.

It seems there is something wrong on the new file.

mimo 4x4 and uplink 2xCA not supported for sdx24 (wave 4) above

hello bro. I've used this tool, and it works on sdx24 (wave 4) modem. but there are several obstacles:

  1. Mimo only reads 2x2, not 4x4
  2. Uplink cannot be 2xCA combo

Can you do some coding modifications so that the Mimo can be 4x4 and the uplink up to 2xCA can be implemented on SDX24 (wave 4) modems and above?
because I think this tool can only be used for SDX20 (Wave 3) modems and below so that it can be 4x4 MIMO and 2xCA combo uplink.

here i attach 00028874 original and edited nv file
00028874.zip

thanks a lot, this tool is very useful

photo_2023-09-14_17-03-36
photo_2023-11-26_23-44-20

About rmt_storage patch

Hi,

I'm trying to patch rmt_storage for my OP7Pro now.
I tried many rmt_storage files from other phones with SDM855 chipset.
But the modem won't boot.

I also have an OP5T phone, and I used the file that you provided, it works without any issue.
Which device's file you extracted for OP5T?

I think I can try the file from that vendor's SDM855 device.

Thank you.

Type 201 / 202

Today I received the following email:

Добрый день , мы тут всем форумом 4pda бьемся , что бы создать файл агрегаций на note10 snapdragon . Файл агрегаций для s10 snapdragon у нас есть и он уже переделан под наших операторов, но если его поставить на note 10 то пропадает сеть , видимо где-то есть загвоздка , к сожалению моих знаний не хватает на редактирование этого файла , если есть возможно поправить файл с s10 под note 10 было бы отлично .

Which translates to:

Good afternoon, we're all over the 4pda forum fighting to create an aggregation file on note10 snapdragon.
We have the aggregation file for s10 snapdragon and it is already rebuilt for our operators, but if you put it on note 10 then the network disappears, probably somewhere there is a hurdle, unfortunately my knowledge is not enough to edit this file, if there is a possibility to fix the file with s10 to note 10 would be great.

Attachment: 00028874.zip

This issue covers the resolution and parsing of this new type (201 and 202)

4x4 MIMO not parsed correctly

Hi, Denys
I'm trying to use this tool to make new 00028874 file,
Seems the program converted all 4x4 combo to 2x2

go run cmd/main.go create bands.txt 00028874_uncompressed

DEBU[0000] comboString: 1A4A-1A4
DEBU[0000] => [1A-1A 1A]
DEBU[0000] comboString: 1A4A-3A4
DEBU[0000] => [3A-1A 1A]
DEBU[0000] comboString: 1A4A-8A4
DEBU[0000] => [8A-1A 1A]
DEBU[0000] comboString: 3A4A-3A4
DEBU[0000] => [3A-3A 3A]
DEBU[0000] comboString: 3A4A-8A4
DEBU[0000] => [8A-3A 3A]
DEBU[0000] comboString: 8A4A-8A4
DEBU[0000] => [8A-8A 8A]
DEBU[0000] comboString: 41A4A-41A4
DEBU[0000] => [41A-41A 41A]
INFO[0000] Writing 14 entries...

./src/28874Decoder 00028874_uncompressed

Input file size: 284 bytes
Format verson: 0
Number of descriptors: 14
1A2A-1A2 4
1A2A-3A2 4
1A2A-8A2 4
3A2A-3A2 4
3A2A-8A2 4
8A2A-8A2 4
41A2A-41A2 4

Number of combos: 7
Max streams per combo: 4

Another thing is that it seems zlib-flate does not support compression level set,
I only can use "zlib-flate -compress < 00028874_uncompressed > 00028874" instead of "zlib-flate -compress=6 < $1 > 00028874" on your script.

Rmt storage path doesn't work

I tried to apply rmt storage path for my OP5T (OOS 9.0.9) but modem does not start with this file; MD5 in instruction and in file have differences.

Outputfile not being decoded corectly

Denys, thank you for your prompt solution.
I think there is still something to do or maybe the decoder need a tunne. After creting my own file or using the one you sent on 00028874 decoder I got a error mesage:
Incorrect format: no any downlink carrier in combo
And it stops decoding..

Hello Sig2018,

I'm sorry for the bug that you encountered, unfortunately I didn't consider that the class E was possible too, therefore your 2A2A-46E2-48C2 combo was being interpreted only as 2A2A causing a strange behavior. I have now fixed the issue, attached you can find the file generated (even though it's better if you create your own by pulling the new commits and running the software again).
output.zip

Originally posted by @denysvitali in #7 (comment)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.