yashsingh1/xdaforums huggingface dataset:
[Xperia Z5 General] threader:
I see its in prebuilt compiler also.

But maybe?

external/protobuf/src/google/protobuf/io/coded_stream.cc :
Los 14.1
bool CodedInputStream::ReadVarint32Fallback(uint32* value) {
if (BufferSize() >= kMaxVarintBytes ||
// Optimization: We're also safe if the buffer is non-empty and it ends
// with a byte that would terminate a varint.
(buffer_end_ > buffer_ && !(buffer_end_[-1] & 0x80))) {
const uint8* end = ReadVarint32FromArray(buffer_, value);
if (end == NULL) return false;
buffer_ = end;
return true;
} else {
// Really slow case: we will incur the cost of an extra function call here,
// but moving this out of line reduces the size of this function, which
// improves the common case. In micro benchmarks, this is worth about 10-15%
return ReadVarint32Slow(value);
}
}
Los.15.1
int64 CodedInputStream::ReadVarint32Fallback(uint32 first_byte_or_zero) {
if (BufferSize() >= kMaxVarintBytes ||
// Optimization: We're also safe if the buffer is non-empty and it ends
// with a byte that would terminate a varint.
(buffer_end_ > buffer_ && !(buffer_end_[-1] & 0x80))) {
GOOGLE_DCHECK_NE(first_byte_or_zero, 0)
<< "Caller should provide us with *buffer_ when buffer is non-empty";
uint32 temp;
::std::pair<bool, const uint8*> p =
ReadVarint32FromArray(first_byte_or_zero, buffer_, &temp);
if (!p.first) return -1;
buffer_ = p.second;
return temp;
} else {
// Really slow case: we will incur the cost of an extra function call here,
// but moving this out of line reduces the size of this function, which
// improves the common case. In micro benchmarks, this is worth about 10-15%
uint32 temp;
return ReadVarint32Slow(&temp) ? static_cast<int64>(temp) : -1;
}
}

The function ReadVarint32Fallback is used in the following libraries :

vendor/sony/kitakami-common/proprietary/vendor/lib64/libsettings.so

vendor/sony/kitakami-common/proprietary/vendor/lib64/libcneapiclient.so

vendor/sony/kitakami-common/proprietary/vendor/lib/libsettings.so

vendor/sony/kitakami-common/proprietary/vendor/lib/libcneapiclient.so

vendor/sony/kitakami-common/proprietary/vendor/lib/mediadrm/libwvdrmengine.so
[Xperia Z5 General] threader:
So i rolled back the functions required by the libraries in external/protobuf/src/google/protobuf/io/coded_stream.h, external/protobuf/src/google/protobuf/io/coded_stream.cc, attached a patch to get a bit farther .

I get the following error now.

520 F DEBUG : Abort message: 'CANNOT LINK EXECUTABLE "/system/bin/netmgrd": cannot locate symbol "_ZN6google8protobuf8internal14WireFormatLite10ReadStringEPNS0_2io16CodedInputStreamEPNSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEE" referenced by "/system/vendor/lib64/libcneapiclient.so"...'

I think the correct thing to do now is call ReadStringEPNS0_2io16CodedInputStreamEPNSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEE
[Xperia Z5 General] H3ADROOM:
I see that there is some progress ? I think I have much more hope for my device now)
[Xperia Z5 General] threader:
I'm a bit stuck, i can not alter the size of the library or the offset addresses in the file will be messed up, so simply changing the call isn't "simply". I had hoped that if I insert an empty value the same size as removed somewhere within vicinity of the altered call I'd get away with it, but so far I've broken the layout in the library.
[Xperia Z5 General] Berni-0815:
Have you seen my thread for z5c and pie?
[Xperia Z5 General] threader:
Heya Berni,

I read about your endeavours, one thread was linked to earlier. I used the sony-msm8994 kernel to get this far while I'm busy breaking an xperiadev kernel to do what i want. There is a later xperiadev kernel i wish to use. I also wanted to say it'll be about 14 days before I have calm in my life to look at this, as some bits of life get in the way of any serious concentration. Also I'm still wondering what to do about the speculative execution bugs, https://developer.arm.com/support/arm-security-updates/speculative-processor-vulnerability Can we update this Trusted Firmware or are we stuck with a kernel patch.
[Xperia Z5 General] Berni-0815:
I really don't know what to do with that...
[Xperia Z5 General] threader:
CopperheadOS had part of the patch applied for branch prediction hardening for our cpu, but since reverted as they probably updated the arm trusted firmware I suppose. I spotted it and used it along with hardening from msm-3.18 and backported bits of 4.18.10 as this has a different version of branch hardening, I'm still putting it together but cpu_errata.c and cpufeature.c from 3.18 seems to be ported along with the required functions in arm64/entry.S, though not yet applied. I think the 3.18 bits gets us up to spectre v3. I just need to plug it in correctly hopefully. I'm still struggling with this kernel, something is not fully compatible with Los 15.1, so this kernel isn't ready to be used, https://github.com/threader/kernel .
[Xperia Z5 General] dim.on:
This sounds very promissing.

It might be usefull to look at the commits of same soc devices with los 16 support - like the op2. Also you can contact the device maintainers directly, they are usually very helpfull e.g. if there are issues with outdated blobs.
[Xperia Z5 General] threader:
I'ts a backport frenzy i suppose, I've implemented some hardening from CopperheadOS, stack hardedning at least, and Harden Usercopy.

The Onepluss (https://github.com/LineageOS/android_kernel_oneplus_msm8996) is a good candidate, though there are many changes between versions. I've tried implementing all changes from Lineage 14.1 to 15.1 from Sony_msm8994 in my xperiadev project, i was quite certain this would work, until it didn't. It's tempting to port the device code to that Onepluss kernel.

Edit:

I've committed the patch for branch prediction hardening that i am currently working on getting booted, I committed it and reverted the patch, for anyone interested as i might be AWOLed by life movement at any time and dont know how long it will take before I'm back. https://github.com/threader/kernel/commit/24fb22faf82429214e38d30c0267431da6a5fb5f Branch prediction hardening almost done.

The problem is probably over implementation of the hardening. To work with it, just revert commit 95315599b21595f900a0b3538f0f04ecf46ae604
[Xperia Z5 General] threader:
I screwed up and left the phone somewhere while moving, I hope it turns up within 15 days but the situation sucks, I will have to work on a z1 with a dosgy usb the next few days if i have time, I was rather dedicated to arm64 at the moment so my ocd is rather annoyed with me ;)
[Xperia Z5 General] threader:
I've located the phone, but also found a bug in Arm32 that's really bothering me, I wrote a long post but lost it due a crash after a critical battery hibernation.

We desperately need some luck, we need to figure out where the "Arm Trusted Firmware" lives, It's an unacceptable situation not to be patched for these critical flaws.

I'm posting a build for people to experiment, maybe we can find a compatible libcneapiclient?

The system image is a few weeks old, the boot.img is Sony-msm8994 and not my hardened kernel, as it's not ready. Even the first charging animation you see when plugging in the phone while off is run by the boot.img kernel, so there is is a slight responsibility not to catch fire. That said I take no responsibility for critical flaws in the posted files.

https://drive.google.com/drive/folders/1d8FNiFlMN6Bey6xD606pBomqBgSiZ-MO?usp=sharing
[Xperia Z5 General] hemre2:
Somebody help this guy please. He is fighting for us. Support him..
[Xperia Z5 General] threader:
Thank you hemre2. I like the device, It's more than capable enough, to throw it away just because we can't get it running quite sanely should be an environmental crime, not to facilitate operations it's "natural" life I'd say, when it dies due to corrosion or so. I started out working on Qualcomm kernels and feel "at home" working on the code within, back when I started on a 2.6.32.14 I managed updating to .61, later 2.6.35 and was on my way to a 3.0.8 kernel before it died and got stuffed in a drawer and forgotten (i think i could have fixed it hadn't my soldering station been stolen), and my chronic obsession had to find something else to do. But on that device there were an ordinary framebuffer to run a terminal. I've not succeeded in bringing up a terminal on Z1 or Z5, but on the Z1 I think I can spew the output trough a "simple framebuffer" directly to the memory region the splash should be, the Z5 handles this differently. This might help me figure out some errors for both devices at this point where I'm debugging a kernel update and not arch. specific hardening. The correct thing to do would be to attach a UART cable (https://developer.sony.com/develop/open-devices/guides/access-uart-ports), though the Z1 _will_ get the UART treatment, as I've opened it up to change the screen and touch once already, I'm thinking breakout the pins so I can connect when needed, It came with an extra lid cover so i might cut a hole and try fitting it. The Z5 I'd like to keep.... not as shabby as the Z1 turned out after replacing the touch and screen, the screen and touch I got was apparently not put together correctly, probably the wrong pressure was used when assembling the two parts, my touches affect the screen, not that touch works on the z1 as a tiny tiny capacitor like half the size of a needle tip came off, yaaay .
[Xperia Z5 General] dim.on:
Since you've asked about the selinux deniels.

You can disable selinux or set it to permisive via an boot parameter. This is useful for development.
[Xperia Z5 General] Berni-0815:
I really don't know a single bit about the things he is talking about; so, I can't help him! Sorry... :(
[Xperia Z5 General] threader:
Ah, I'll check that out, also maybe try selinux from 3.18 maybe.
[Xperia Z5 General] n.pikota:
Hi. You can share your device tree?
[Xperia Z5 General] threader:
It's all available but I'm struggling to bring the kernel back up on the device so I have nothing to announce. I've been trying to implement the simple-framebuffer on a Z1, the Z5 disables the framebuffer due to a bug apparently. My idea was to stick a framebuffer on the mdss_fb0 qcom,memblock-reserve, but I am seriously missing something. And I'm growing desperate for the logs, I'm working the problem backwards testing on a pre-patch kernel. So this also ruins the day.

&mdss_fb0 {
linux,contiguous-region = <&fb_mem>;

/* Kernel splash configuration */
qcom,memblock-reserve = <0x03401000 0x2200000>;
qcom,memory-reservation-size = <0x1000000>; /* size: 16MB */

/* Temporarily disable the Framebuffer splash for no-boot bug
* on dual-dsi split panel devices. Moreover, this doesn't
* work (but kernel boots) on single-dsi panels.
*/
/*
qcom,mdss-fb-splash-logo-enabled;
qcom,cont-splash-memory {
linux,contiguous-region = <&cont_splash_mem>;
};
*/
};

This is a simple-framebuffer on a Samsung: https://github.com/drebrez/linux/commit/2ffc0f0164cf5d8dea92def74490274c2b27e1c0

But then there is this, llcon, this is on a Sony kernel and verifies the approach by using the qcom,memblock-reserve ( https://habr.com/ru/post/310886/&prev=search ): https://github.com/jsr-d10/android_kernel_jsr_msm8228_1.3.3/commits/d10-test4 ,

I publish code to this project, https://github.com/threader/kernel , I've not made any changes to the Z5 device tree. But i believe this can be coaxed into working.

chosen {
#address-cells = <0x1>;
#size-cells = <0x1>;
ranges;

framebuffer {
compatible = "simple-framebuffer";
reg = <0x03401000 (1920 * 1080 * 2)>;
width = <1920>;
height = <1080>;
stride = <(1920*3)>;
format = "b8g8r8";
//clocks = "<&clk_mdss_mdp_clk>";
//status = "enable";
//display = "<&mdss_fb0">;
};

};

I've also added the same video mode as the splash image uses to simple-fb https://github.com/threader/kernel/commit/ea3cc54583454201487268c6d4e2d37b733defde

Edit:

This is also an option https://gitlab.com/postmarketOS/pmaports/issues/175#third-phase-dump-kernel-logs
[Xperia Z5 General] n.pikota:
Thank you. I will give it a try. Although I am not a developer either. But I want to learn
[Xperia Z5 General] threader:
I'm not a professional developer myself either, It's more a hobby , albeit one i take rather seriously, but with the right information and the right code and tools, logic tends to reveal itself. Get to know the project and spend some time with the code and even a novice can do incredible things, back in 2013 I found a bug that I also had spotted affected the HP Tenderlion (i believe it was called) , the failed HP tablet, trough observing different versions of the code, with a pinch of doubt, and experimentation with my own device. Arguably the fact that I found the bug for a separate device spread a lot more joy for that than my project at the time.
[Xperia Z5 General] n.pikota:
Hello. I tried to build with your kernel but I get error compiling the kernel. I used the device tree of Los 14.1 and changed to work on los 16. But I didn't get a complete build. Is it possible to share your device tree? To enter what I'm doing wrong. Thank you
[Xperia Z5 General] threader:
Right... If you google "trust zone qualcomm" these hacks are the first thing you reach... https://www.blackhat.com/docs/us-17/wednesday/us-17-Bazhaniuk-BluePill-For-Your-Phone.pdf https://blog.quarkslab.com/attacking-the-arms-trustzone.html , it's apparently a freaking walkabout, now unless we can persuade Sony to release an update to the trust zone with the wokarounds for spectre/meltdown, things get tricky. I believe there was an early kernel fix for v1 though.
[Xperia Z5 General] threader:
I've readied a local_manifest (https://github.com/threader/local_manifests) to be put in /aosp/.repo, with devices some pulled from the Msm8994 project some from Remim7 for Anami (z2(?)), the repositories I've made changes and device I have are hosted on my github, Sumire and Honami. For sumire I have adopted a slight change from from Xperiadev aosp and minor corrections as well as the latest Bluetooth fw that had two bytes difference, and config from Sony .

It will require commenting out single line parts of Lineage manifests as of now, though I believe if I correctly add it to untracked.xml it might become more userfriendly, I've made the final commit to my kernel project for booting Android/Los 8.1/15.1 it seems like 9/16.1 will work though I have not tested this personally yet. This will get you started compiling and have reference code to bring up devices.
[Xperia Z5 General] n.pikota:
Thank you for your work. I gave up, it's a very advanced job to my knowledge. It is not the same as building with functional sources.
[Xperia Z5 General] threader:
Right, i got past my last sticking point by extending the protobuf ABI with the old functions and renaming the affected, I'm now stuck at the following symbol, that does not seem to be as easy to fix as at first glance ( external/protobuf/src/google/protobuf/repeated_field.* ). Perhaps it's not used and can be safely removed? If this patch and binary will at all want to work is another matter entirely. Other vendor libs also reference some of the functions that have changed though I've not addressed these yet.

Abort message: 'CANNOT LINK EXECUTABLE "/system/bin/netmgrd": cannot locate symbol "_ZN6google8protobuf8internal20RepeatedPtrFieldBase4SwapEPS2_" referenced by "/system/vendor/lib64/libcneapiclient.so"...'
[Xperia Z5 General] BluestreamGP:
Any new progress?
[Xperia Z5 General] threader:
I made a dash for the camera, no cigar, and I tried changing the compiler to linaro and snapdragon llvm, as I encountered some code that seems to need it, somehow I killed the build system during these past few days. It seems best to stick with Google's gcc, the linaro toolchain did not have stack protection and resulted in problems building the kernel during the build, I build it separately with linaro gcc 6.5.. Also life is caving in on me again, so im at a inconvenient juncture, I won't be able to work much more on this in a few weeks, for some weeks.
[Xperia Z5 General] Berni-0815:
I tried to compile lineageOS with llvm as well but I've never managed it to work... :(

I think it's useless...
[Xperia Z5 General] threader:
What is the latest firmware for the Z5? I'm wondering because i have some weird issues with qseecom, I'm beginning to think I'm on the wrong version of trust zone or something.
[Xperia Z5 General] mahbod.es.1996:
You mean the android version of the stock rom?
[Xperia Z5 General] threader:
Stock, i found it,32.4.a.1.54, made a flashable file with flashtool and xperiafirm excluding system, kernel and fota, strangely the Sony flashtool lists 32.4.a.0.160 as the latest available firmware. Seems I had it though...
[Xperia Z5 General] mahbod.es.1996:
Good.

However, what stage the project is in? Is it going well? Is there a hope for Xperia Z5 to run Lineage OS 16? It looks like nobody else in the world is likely to develop a Pie custom ROM for this forgotten device. I'm running the Official Lineage OS 14.1 right now which is got discontinued from Lineage team and I'm hoping to have 16 instead.

Also I want to say thanks and I want you to know that I can't wait for this project to be accomplished, I really appreciate you and your team.

With luck. ❤️
[Xperia Z5 General] threader:
I have seen others have managed to get mobile working for 15.1 etc, however I have not received any response when I asked how, so it's not in the realm of impossibility, if my approach will work in the end is another matter, I'm thinking the incomplete patch to protobuf will need further adjustment to the functions calls I've exposed. I much appreciate your kind message, so far though my team is just me basically doing as I did in 2013, update the kernel and fighting aosp source, I'm a lot wiser then in 2013 and not moving as quickly. I could certainly use some help and guidance from another dev. That said I'm hell bent on making this happen, 15.1 first, though at this speed 15.1 will be deprecated by the time i get there.
[Xperia Z5 General] Berni-0815:
Why aren't you using my LineageOS 14.1 port? It has always the latest security patches, if available...

---------- Post added at 13:43 ---------- Previous post was at 13:39 ----------

Me too. There are people who managed the camera to work; but they didn't tell me how! :eek: It's so frustrating...

Mobile is partially working, not stable and not always; but with a workaround you can make phone calls (in and out); described in this thread.
[Xperia Z5 General] mahbod.es.1996:
Wish the bests for you and hope you approach what you are working on.
[Xperia Z5 General] threader:
Interesting, I've seen people updating Los 13 for older devices, but this would be new to me, I've contemplated trying to update 14.1, maybe our collective efforts ought focus om that, I would certainly like to use my phone again. Even though i have to reflash trust zone etc. from time to time due to hacks i would like to actually use it.
[Xperia Z5 General] Berni-0815:
You haven't known about that? :confused:

I'm building LineageOS 14.1 (fully working and still WIP), 15.1 (partially working; any develeopment stopped!) and 16.0 (not booting; any develeopment stopped!) for Suzuran... (and 14.1 for Satsuki) :angel:
[Xperia Z5 General] threader:
I think I will focus on 15.1 and 16 for now, it's also my pass time work when i get bored, I need something to work against. I bet the kernel will need further updates for 16, right now the kernel I'm working on complies with 15.1 and carry all patches from the Sony-msm8994 project, I use their binder that seemed to be in good shape and qseecom that I wish to update but currently breaks if I breathe in it's general vicinity. There is still more work to be done with the kernel, I'm missing the pagetable isolation patches but I will focus on that once life calms down again, moving and parting ways with the gf, I wanted some more results in bringing up 15.1 before I enduldge in more kernel work.
[Xperia Z5 General] Berni-0815:
I don't know what you're talking about. What binder? :confused:

What's the problem? What's qseecom for?

I don't know much about the inside of android; so I have to ask such questions... :angel:
[Xperia Z5 General] threader:
https://elinux.org/Android_Binder - needs to be updated every Android release.

https://lineageos.org/engineering/Qualcomm-Firmware/Qseecom is for communicating with the cpus trust zone. It needs to speak the same language as android keystore/keymanagment
[Xperia Z5 General] Berni-0815:
Thanks!

This link is dead: 404 Not Found nginx/1.17.1

But I've found the right link. Unfortunately it's not answering my questions! Maybe it's due to the fact that I don't know enough of android development...
[Xperia Z5 General] threader:
Odd, this works though, seems like a good info page on the subject as well. https://lineageos.org/engineering/Qualcomm-Firmware/
[Xperia Z5 General] simbanono:
Hello

is there any way I can help, Im a newbie though, but im willing to help.
[Sony Xperia XZ Premium Questions & Answers] Z3X:
Hello,

My charging port started playing up so I changed it out this morning. I could initially get some current through the original port depending on which position the cable sat.

After changing the USB connector flex im now not getting any charging. Even when I go back to the old port.

Has anyone had this problem before?

The phone is dead but showing an very quick blink of the LED every 10 seconds. Think its green in colour but not sure (Colour Blind).

Double and triple checked connections and they all seems to be fine with no broken flexes.
[Sony Xperia XZ Premium Questions & Answers] islandtechboy:
Maybe connections are not making clean connection are you using a magnifying lens to see if they are and have you tried using a different plug.
[Sony Xperia XZ Premium Questions & Answers] Zayn46:
Check out this thread I hope you get yours fixed cheers. link: https://xdaforums.com/xz-premium/how-to/charging-problem-t3919700#post79610395
[Tilt, TyTN II, MDA Vario III Windows Mobile ROM De] jamiethomas:
I have a Att Tilt Unlocked with [Apr 29]Dutty's WM6.1 Hybrid v2 5.2.19716/5.2.19700 and MobiTv says Expired i push the buy tab and it takes me to mobitv website i clik on free trial and it says phone not supported i have mobitv reseter also not working installed is there a registry mod i have to make for mobitv to know i have a tilt on the att network.
[Tilt, TyTN II, MDA Vario III Windows Mobile ROM De] -haze-:
The MobiTV resetter doesn't work anymore. They caught onto it.

That's all I'm going to say as this skims across the line of what is and isn't allowed at this site.
[Tilt, TyTN II, MDA Vario III Windows Mobile ROM De] xmoo:
Damnnn noooooooooooooooooooo. I loved watching it!
[Tilt, TyTN II, MDA Vario III Windows Mobile ROM De] borromini:
Same problem here. Why does ATT offer MobiTV in the menu after you buy the Tilt and then informs you after the free trial that the phone is incompatible? Figures.
[Tilt, TyTN II, MDA Vario III Windows Mobile ROM De] scotchua:
Did you try going into kaisertweaks and changing the IE phone identification from tytn II to at&t tilt? i mean i don't use mobiTv, but that is how to fix that issue sometimes.
[Tilt, TyTN II, MDA Vario III Windows Mobile ROM De] xmoo:
gonna try this soon!
[Tilt, TyTN II, MDA Vario III Windows Mobile ROM De] phat_red:
BET!!!!!!!!!!!!!!
[Tilt, TyTN II, MDA Vario III Windows Mobile ROM De] id242:
Attached are two of the latest versions of the software you are looking for. they both have been tried and work just fine on the 8525 and 8925 - But they are the "3-Day Trial" editions.

A previous discussion of which this topic is starting to boarder upon, is located at http://xdaforums.com/showthread.php?t=309844 (now a closed thread)
[Tilt, TyTN II, MDA Vario III Windows Mobile ROM De] kidnamedAlbert:
nevermind....
[Tilt, TyTN II, MDA Vario III Windows Mobile ROM De] id242:
I don't understand why it is a "bad idea" to post CABs of the **TRIAL** software that comes freely with your new ATT PPC-Phone?
[Tilt, TyTN II, MDA Vario III Windows Mobile ROM De] kidnamedAlbert:
well the whole "3-day trial" thing confused me because i once posted the endles "3-day trial"cab and got banned for a day