Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I'm trying to add an overlay for Sony pdx213 (xperia 10 III), and could use a few pointers #412

Closed
pepijndevos opened this issue Nov 14, 2021 · 3 comments

Comments

@pepijndevos
Copy link

I recently got my xperia 10 III and right away loaded a PHH-trebble based ROM on it. Works great except for a few tiny things such as auto brightness.
I'm kinda new to Android hacking stuff but know my way around software development so figured I'd try to help out.

Over at XDA ada12 mentioned it's a matter of adding some overlay values.
Looking around the repo I found that @j4ger recently added an overlay for another Sony device, so that gives a starting point but is a bit more than ada12 made it out to be. Which method did you use to obtain these files?

Looking at https://github.com/sonyxperiadev/device-sony-pdx213 I see files that seem quite related, but no mention of config_autoBrightnessLcdBacklightValues that ada12 was talking about, and which is indeed present in the pdx206 folder.
Does that get assembled from other places, or does it simply not have the right stuff? The only mention of brightness in that repo is commented out.

Another issue had someone asking for an overlay, which got pointed to this thread:
https://forum.xda-developers.com/t/guide-how-to-make-gsis-overlay-file-for-your-phone.3878974/
I'd be happy to try to follow that, but A) if the official Sony repo has the right stuff that seems a lot easier. B) I already flashed a new ROM so I don't have access to the stock ROM anymore to try this.

I did download the official firmware using XperiFirm, are the files in question in there somewhere? Not sure if you can just unzip and mount these images somehow.

@phhusson
Copy link
Owner

phhusson commented Nov 14, 2021 via email

@j4ger
Copy link
Contributor

j4ger commented Nov 15, 2021

I get your frustrations buddy, I've been there before. Being such a niche product family, little resource and community can be found for this device, making further development somewhat tricky. Sony is kind enough to provide the SODP repos but I couldn't find too much useful config out of it (you could probably make use of power_config.xml but I wasn't able to see the difference before and after applying it).
Anyways I searched around and was able to get in touch with a previous maintainer of the device who shared his version of the device tree, which took a lot of testing and porting to create (it was initially a fork of the device tree for a Oneplus device and I believe they tested out the appropriate configurations for the current device). I used the values in that tree and made the overlay. A lot of other config items were applied but wasn't necessary for auto-brightness.
Unfortunately I searched Github and had no luck finding a existing open device tree repo for pdx213 (except for the one by Sony) which means you'll have to either make your own tree or try to find existing but private ones. I see Sjll (on xda and github) has been releasing roms for pdx213, see if you can contact him and get some help.
Another choice that sits somewhere in the middle is to find existing configs for device with similiar display panel (I doubt there's any device with the exact same panel) or its siblings (maybe even start with values from my overlay) and tweak it to an appropriate set. This could involve a lot of flashing and testing so be prepared.
As for unpacking Sony roms, you can easily see the partitions in .sin files and you need to further unpack those. Go search for a tool named UnSin on xda and follow the guide there. You'll probably need more tools such as lpunpack, ext2rd, etc, depending on which partiton you want to check out. I was able to extract framework-res.apk from system partition but found no configs related to brightness values so good luck with that.

@pepijndevos
Copy link
Author

I have indeed found that unsin will allow me to mount the firmware image, but as you said it only seems to contain the power config and not the config file that controls the stuff of interest like auto brightness.

At first glance it looks like Sony also did not provide the relevant config on their github but ada12 pointed out that the bulk of the config lives in https://github.com/sonyxperiadev/device-sony-common/blob/master/overlay/frameworks/base/core/res/res/values/config.xml with only device-specific extension in https://github.com/sonyxperiadev/device-sony-pdx213/blob/master/overlay/frameworks/base/core/res/res/values/config.xml so that's the route I'm trying to take. Let's see if it actually works.

Current progress is in #413

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants