yashsingh1/xdaforums huggingface dataset:
[Xperia Z1 Compact Android Development] MSe1969:
Sure, will do
[Xperia Z1 Compact Android Development] MSe1969:
FYI: LineageOS has merged the 'O_asb_2019-02' topic and I have updated the forks in our repository.
[Xperia Z1 Compact Android Development] demona18:
Short question concerning root rights fo rthe microG build.

Only ADB seen in the menu, would like to get it for Apps. Lineage SU installed or not? Any issues for Magisk known? Just want to test it a little bit before going to my daily phone.

Thx a lot!
[Xperia Z1 Compact Android Development] MSe1969:
Root is not baked in the build, same as official LineageOS. The build is "userdebug" flavor, also same as official LineageOS, so you can enable only 'adb root'.

If you want root acces for apps, you have three possibilities:

1. Flash the LineageOS root add-on

2. Flash Magisk (I have no experience for THIS ROM, but I don't see a reason, why it shouldn't work)

3. Any other 3rd party root solution (SuperSU may still be okay, but I advise to keep off from any other stuff...)
[Xperia Z1 Compact Android Development] demona18:
Thx for the fast answer.

The three options are more then enough ;) I will give Magisk a try to earn some experience in it. So far I only used the other two options.
[Xperia Z1 Compact Android Development] foresto:
WLAN channels above 48 do not work

Confirming. This ROM's WLAN doesn't work with 802.11ac 5GHz above channel 48. (Tested with channels 100 and 52.) The same channels work fine with Lineage 12.1.
[Xperia Z1 Compact Android Development] beetlebau:
Had the same problem with a Z1 compact of a friend of mine. [MENTION=9694593]Ferr1s[/MENTION] gave me the hint to try the Sony Flash Tool. After that (and using fastboot to "install" TWRP again) TWRP started in recovery mode and I was able to install Lineage. Thank god I had my windows workstation still around. Maybe you could add this to the install procedure as a hint?

Additionally I was not able to install GApps due to github.com/TeamWin/Team-Win-Recovery-Project/issues/1070 (not able to post outside links yet ...) The recommondation was to go back to TWRP 3.0.x But that didn't boot in recovery at all ...
[Xperia Z1 Compact Android Development] MSe1969:
Might be a little OT, but actually, there is no reason to keep Windoze just for the sake of flashing Sony Xperia or Samsung devices. :)

I used e.g. http://www.flashtool.net/index.php for Linux when I had to unbrick a donated Z1c. And for Samsung devices, instead of Odin, there is Heimdall 1.4.2

Will update the instructions soon.

Thanks for the hint, I'll build a new TWRP. Will you volunteer to test it for me, once I provide a DL link?

EDIT:

Which TWRP did you use? The one in "my" cm-12.1 thread or the one built by [MENTION=8036586]115ek[/MENTION] in his old thread preceding this one?

If you used 115ek's TWRP, please try using the one in the cm-12.1 thread.
[Xperia Z1 Compact Android Development] foresto:
I second that suggestion. The Z1 Compact's boot loader won't correctly load TWRP from the recovery/fotakernel partition until your device's firmware is updated to enable it. (People seem to forget this because they already did a Sony firmware update at some point in the past.) Given that TWRP is suggested in this ROM's instructions, a note about this update requirement really should be there as well.

Beetlebau, I suggest keeping your Windows installation (or a VM with USB support, or a friend with Windows) until you have verified that the open source tools reliably succeed with tasks like this. I had already tried Androxyde flashtool and munjeni's newflasher when I ran in to the same recovery boot failure that you described. It didn't start working until I used Sony's tool (emma) to flash a Sony firmware image that was released after they announced that booting from the recovery partition was possible. (Also, last time I checked, Androxyde's flashtool did not provide a way to retrieve stock ROMs from Sony, so unless that has changed, it's not a sufficient replacement for Sony's tool.)
[Xperia Z1 Compact Android Development] esemef:
FYI I have been using the twrp 3.2.3 from your cm12.1 thread for about a month and not had any problems installing opengapps.

I upgraded from munjeni's cm14.1 with encryption enabled, it was a bit of a rough ride as I didn't wipe data (which I believe is recommended). It lost all text messages and call logs & half the apps ended up crashing because they weren't granted network access for some reason. I assume the encryption is still fine, to be honest I have no idea if it's encrypted as you kinda just trust it.
[Xperia Z1 Compact Android Development] beetlebau:
I'd love to but my friend was just here for a visit and I won't get hold of the phone for a few month :(

I used the one from the 12.1 thread (as linked in the first post).
[Xperia Z1 Compact Android Development] MSe1969:
OK, just to make sure, that I understand correctly and put the right statement into the OP:

After unlocking the bootloader and flashing TWRP, people may face the situation, that it is neither possible to boot TWRP via the key combinations nor to enter TWRP via "fastboot boot TWRP.img". In such a case, they may have a very old Stock ROM version and need to first flash a Sony Stock ROM update, because this update will also perform an update of the bootloader. And only 'newer' bootloaders support booting from the FOTAKernel partition - Correct?

I used Androxyde's flashtool some weeks back with the mentioned bricked Z1c - I had already a Stock Sony LP firmware image on my hard drive, which I obtained two years ago, but I don't know anymore, from where I got it - btw, flashtool.net also offers a download section for firmwares. The way, I read your statement is, that Sony's Emma tool offers an option to directly download firmware images from Sony. To also understand your point here: Only the Sony flashtool (Emma) provided you with a suitable firmware image for download? Or was Emma necessary to flash the same firmware image, which you have tried to flash with the open source tool already, to update the bootloader?
[Xperia Z1 Compact Android Development] beetlebau:
This is correct (for me). But I can't tell if the last sentence is correct.
[Xperia Z1 Compact Android Development] Ferr1s:
Hey guys,

I would like to understand more the structure of an android system.

Is there a graphical or other simple explanation which elements are included like Kernel, Bootloader etc.

In many posts when ppl have some problems there are often answer like: wipe this or that,

downgrade kernel or whatever... I d like to understand how this all works together and which dependencies there are.

Is that too much for this thread?

I d like to know what I am doing when I flash or unlock the bootloader or boot into recovery :D

As I flashed my old Z1C and followed the guide, I had this backlight error and only by coincidence I solved it (as beetlebau wrote above)

Next time when I flash my Mi8 I d like to know what the single files or names are used for :)
[Xperia Z1 Compact Android Development] MSe1969:
The linked TWRP issue only affects TWRP builts done on a Nougat or Oreo build tree - the TWRP from the cm-12.1 thread has been built on an LP build tree, therefore - the ZIP executable is not missing and there shouldn't be any issues.

Yes, the encryption is fine. In your case indeed, you should have wiped data (and used e.g. Titanium backup to backup your apps)

General info: If you are on a different version (cm-12.1 or lineage-15.1) and you want to temporarily use cm-14.1 for the encryption, these are the steps to be performed:

Make a 'nandroid' backup in TWRP (and backup boot, data and system)

Wipe data and system

If your device has already been encrypted in cm-12.1 or lineage-15.1, you even need to format the data partition and reboot TWRP. In that case, you must also backup your internal memory, as this will also be formatted (it is part of the data partition)

flash the temp cm-14.1 and perform the encryption

boot TWRP and restore your previously taken backup(s)
[Xperia Z1 Compact Android Development] MSe1969:
The linked TWRP issue only affects TWRP builts done on a Nougat or Oreo build tree - the TWRP from the cm-12.1 thread has been built on an LP build tree, therefore - the ZIP executable is not missing and there shouldn't be any issues . . . (Wondering what would be the problem . . .)
[Xperia Z1 Compact Android Development] 115ek:
Short question: Is there someone out who has got abilities to test special bluetooth audio codecs (LDAC, aptx, aptxHD)?

I don't own a device supporting it but thought about including these codecs.

Edit: And if so: is this someone willing to test it?
[Xperia Z1 Compact Android Development] MSe1969:
I have updated the instructions in the OP. Feedback welcome :)
[Xperia Z1 Compact Android Development] beetlebau:
Hmmm, strange. I had exactly that error message. Otherwise I wouldn't have found the TWRP bug report ...

---------- Post added at 07:45 PM ---------- Previous post was at 07:43 PM ----------

Sounds good. Would have helped me to solve my problem!
[Xperia Z1 Compact Android Development] foresto:
The problem exists even for people who do not have a very old stock ROM. I was running a very recent Lineage 12.1 with current security patches, which is neither stock nor old, yet the problem appeared. The requirement for correct operation is that they must at some point have flashed an official Sony image that was released after Sony's May 2015 "recovery mode now available" announcement. (Sadly, the original announcement page no longer exists.) If they have never done that, launching TWRP from the recovery partition may not work.

It has been some time since I last tried "fastboot boot image-file", so I can't say for sure whether that method is affected, and there is no way for me to test it now that my device has already been updated. I suppose that might work without Sony's recovery partition update, since it presumably doesn't use the recovery partition at all.

Anyway, thanks for updating the first post. I suggest changing "your Stock ROM has got a too old bootloader" to "the firmware you previously used included an outdated boot loader." This way people who aren't using a stock ROM (and people who think of the "ROM" and "boot loader" as separate things) will be more likely to think it applies to them.

No, I don't think Emma allows you to download firmware images as files for use by another program. I'm making two points here.

First point: Flashing a bootloader update image with Androxyde's flashtool didn't solve the recovery partition problem for me. Perhaps it would have worked if I had used a different image, perhaps not, but it clearly does not work in all cases.

That brings me to my second point: The version of Androxyde's flashtool that I tried did not appear to have a feature for downloading firmware directly from Sony, and I am not aware of that functionality being added in new versions. Therefore, if flashtool is the only tool you have, then you have no trustworthy way to get the required Sony image. Maybe a firmware image downloaded from Androxyde or some other non-Sony website would fix the bootloader, maybe not... but installing such an image is risky. Someone could easily have tampered with it, so I certainly would not recommend that people do this.

I vaguely remember a free tool a few years ago that could download firmware image files directly from Sony, and it might have been open source so you could verify that it wasn't doing anything sneaky. I believe it was a Windows-only tool, though. So, regardless of whether [MENTION=9750659]beetlebau[/MENTION] used that tool or Sony's Emma, he would still need Windows (or maybe Wine) to get the job done.
[Xperia Z1 Compact Android Development] MSe1969:
Well, the short answer to the question "Is that too much for this thread?" is YES! :)

I assume that you have already searched yourself around XDA and/or consulted the search engine of your choice before asking this question here. . .

Such a guide for sure would be nice and helpful, but it would also be comprehensive and not just throwing five lines containing some buzzwords.

(Many people tend to kind of a "TL;DR attitude" and barely read the existing installation instructions properly)

I have already thought about the idea to write something like that, but I don't really have the time and mood to do so right now.
[Xperia Z1 Compact Android Development] MSe1969:
First of all, thanks for your comprehensive answer and the web-archive link. I indeed see two points here, which should not be mixed up - please correct me, if I still have misunderstood your point (my intention is not to be "picky", but to really learn and understand this and gain further knowledge):

Sony has in 2015 pushed bootloader updates to allow booting custom recoveries as part of their regular Stock ROM updates. Although the announcement explicitly states to use the Flash tool, I was able in 2016 to simply flash and use TWRP on my Z1c, which was used with Stock KitKat and later LP since 2014 and never was connected to Sony's Flash tool. In short: There is a potential issue with having a too old bootloader in case someone has a Z1c with original Stock firmware and wants to flash a Custom ROM.

You have had an issue using cm-12.1, which was flashed via TWRP. This means, that TWRP was working before and also booting TWRP, correct? The reason why it started to trouble is unknown, but if people experience this issue, Sony's Flashtool is, according to your experience, the only way to fix it. As I haven't been in that situation, I can't object - all I can say is, that I was able to unbrick a different Z1c (which had a working TWRP before) using Androxyde's flashtool.

Thanks for the suggestion, will do.

Understood, thanks.

What I meant: Different from e.g. Androxyde's flashtool, where you have to "organize" the image yourself, Sony's flashtool can pull firmware from Sony and apply. Correct?

I think we both agree here.

100% correct, see my comment above.

You are right. Maybe - I don't remember though - I have used Androxyde's flashtool before flashing TWRP, to export the Stock image from my own device to my hard drive . . . ?

This is OT, but never-ever use Wine for stuff, which is supposed to be "low-level": Wine basically translates and redirects regular calls intended for the Windows system to Linux. So a Windows app's UI commands or a print request etc. But definitely no proprietary USB commands like flashing, which - different from Linux - require specific USB driver installations under Windows to work . . . :) - when it comes to flashing, either use a native Linux tool or indeed, use a Windows PC.
[Xperia Z1 Compact Android Development] lm089:
Are you by any means referring to Sony's Xperia Companion tool? That indeed only exists for Win and OSX.

Interesting discussion btw., though I never had any probs in this area (lucky me... ;)).
[Xperia Z1 Compact Android Development] MSe1969:
Let me rephrase / explain:

The patch linked in the Issue, you have linked, only even applies / is executed during the build process, if the build tree to build TWRP is at least on Android 6 (aka Marshmallow, aka Platform SDK version 23). The change is an insert into the below IF statement, which checks for the build tree being at least Android 6:

ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 23; echo $$?),0)

This means, when building TWRP within the cm-12.1 tree (Android 5.1 aka SDK version 22), as it is the case with the TWRP linked in our thread, this patch has no impact at all.

So even if I apply the specific patch and build TWRP again, the result will be the same, as nothing will change in that case.

When I was asking, whether you may have e.g. used the TWRP built by [MENTION=8036586]115ek[/MENTION] in his previous thread, which is built within the lineage-15.1 tree (and which right now has difficulties with encryption, which both of us weren't able to solve, yet), applying that patch definitely would make a difference, because Android 8.1 (Lineage 15.1) is SDK version 27, which is what the patch deals with.

If you experience this issue, then the root cause must be a different one, which may require a further research. Other people have reported, that they did not have that issue.

Are you able to provide further details?
[Xperia Z1 Compact Android Development] beetlebau:
Ok. Got it. I can just tell you that I got to that thread by searching the web for the error message ("error 64 : Wrong architecture to set-up Open GApps' pre-bundled busybox") I got provided by TWRP when installing the GApps zip. So I can't really tell you what the real root cause is.

Unfortunately not as I don't have (physical) access to the phone any more (my friend left on sunday evening) :(

Thank you for your support and will to solve the problem!
[Xperia Z1 Compact Android Development] MSe1969:
I have downloaded the open_gapps-arm-8.1-pico-20190209.zip and had a look into the file META-INF/com/google/android/update-binary within, where this error is raised in case the unpacked file /tmp/busybox-arm would not exist. As you can see from the below code snippets, the only reason for the file not having been unpacked would be either, that the file busybox-arm wasn't part of the ZIP file (it however is), or the unzip command wasn't available (it is, I rebooted into recovery and launched a terminal session to check by entering the 'unzip' command)

<. . .>
export TMP="/tmp"
case "$(uname -m)" in
*86*) export BINARCH="x86";; # e.g. Zenfone is i686
*ar*) export BINARCH="arm";; # i.e. armv7l and aarch64
esac
bb="$TMP/busybox-$BINARCH"
l="$TMP/bin"
setenforce 0
for f in app_densities.txt app_sizes.txt bkup_tail.sh gapps-remove.txt g.prop installer.sh busybox-arm tar-arm unzip-arm zip-arm; do
unzip -o "$OPENGAZIP" "$f" -d "$TMP";
done
<. . .>
if [ -e "$bb" ]; then
<. . .>
else
echo "ui_print ERROR 64: Wrong architecture to set-up Open GApps' pre-bundled busybox" > "$OUTFD"
echo "ui_print" > "$OUTFD"
exit 1
fi

Bear with me that I don't want to backup & wipe & flash everything just for the sake of testing it now. . .
[Xperia Z1 Compact Android Development] beetlebau:
Please don't add additional effort as I can't verify anything at the moment. I can't even tell if we downloaded the correct architecture. I didn't checked as my friend did it ... I'm really sorry that I can't provide any more information. But as long as nobody else is complaining it might be a layer 8 problem.
[Xperia Z1 Compact Android Development] funiewski:
It is now many years ago I upgraded bootloader on my z1c(and z3c too I think), as I remember I used Emma for this task.
[Xperia Z1 Compact Android Development] lm089:
That's exactly my experince: though I tried several times to install munjeni's bootloader patch (don't have a link at hand but I guess most of you know what I'm referring to) I obviously never managed to create a real Real Recovery partition. The most reliable way I found to handle situations where my z1c wouldn't boot anymore is following the install instructions on the LineageOS.org for my Xperia Tablet Z. This has been working multiple times for both my tablet and mit z1c. Basic idea is to first flash TWRP to the boot partition, then boot the device into recovery which at that moment is the only bootable system available. From there I can then install a 2nd instance of TWRP to the FOTAKernel partition, and after that I'm able to boot into recovery using the usual hard-key options. BTW: this sequence is working both from Windows and Linux. Lucky me I never had a situation where this didn't work. Of course I acknowledge that I only have experience with one particular Z1c which afaik has been produced at the end of 2014. I'm aware that there may be differences between devices.

No that's different, my mistake. Never heard of an Emma version for OSX.
[Xperia Z1 Compact Android Development] esemef:
Is there a way to find out what version of the bootloader you have on a phone?

And what is the latest?
[Xperia Z1 Compact Android Development] MSe1969:
fastboot getvar version

delivers 0.5 on my main Z1c. Will try and see my 2nd device tomorrow and report here.

EDIT: Same result with my 2nd device.

So no idea, what this in fact means...
[Xperia Z1 Compact Android Development] sithantonio:
Proximity sensor calibration

Hello, I installed the normal version of the ROM but the proximity sensor does not work, is there any way to calibrate it?

Thanks for this hard work.:good:
[Xperia Z1 Compact Android Development] 115ek:
This is a problem we've not heard of until now.

Why do you think it doesn't work? Can you describe how to reproduce your problem and provide a log?

Did you changed your protective foil recently?

By the way: There is no calibration needed.
[Xperia Z1 Compact Android Development] sithantonio:
Hello, Some apps like "Phone check and test" or "Sensor Box for Android" do not recognize the sensor, or directly the sensor appears as "close". Maybe it's hardware error, I'll keep trying. Thanks.
[Xperia Z1 Compact Android Development] MSe1969:
New builds with March 2019 ASB available

Hi all,

new builds are available for download with security level 2019-03-05:

Standard flavor

https://www.androidfilehost.com/?fid=1395089523397913044

- System Webview updated to 72.0.3626.121 (includes CVE-2019-5786)

microG build flavor

https://androidfilehost.com/?fid=1395089523397913020

- Bromite System Webview updated to 73.0.3683.70 (includes CVE-2019-5786)

- Prebuilt microG DroidGuard helper app to pass SafetyNet attestation -

carefully read comments in OP!

(switch off if not needed!)

Happy flashing,

regards, M.
[Xperia Z1 Compact Android Development] ParanoiaMan:
Hi,

I always use aicp on this great phone, but i have always love lineage OS from times of cyanogenmod. In the last 3 weeks i see on xda this custom ROM, but i usually don't trust by unofficial custom ROM. However, for the comment of people and for microg version, i decide to try it.

My conclusion is this: THE BEST ROM THAT I HAVE TRY, it's better then official los of my old nexus 4, have unlimited battery and is mutch smooth then aicp and other ROM that i have installed on this phone and in other.

Now my questions are: it's this custom ROM open source? If anyone would, it's possibile see the code? What are the difference between this ROM, aicp and official los? What mean that unofficial or official custom ROM is signed?

Sorry for all this question, but i have always paranoia for spyware, keylogger, or other malware.

I know that from xda developer we can trust on 99% of case, it's just a curiosity for say if it is possibile know if a custom ROM it's safe.

Thanks for this great custom ROM, sorry for my very bad english and sorry for time that you have lose for read my message.

Bye
[Xperia Z1 Compact Android Development] 115ek:
Hey. Great to hear you like it - many people made this possible.

Concerning your questions:

Of course it's open source! We use the "normal" lineage sources and some additions for the microg build (F-droid, microg itself, etc...). The used kernel has to be open source, too. And even the device tree you'll find at github. If you're interested check the manifests.

Differences between AICP and lineage: AICP is based on lineage but enhanced with further features / customizations from other projects like Omnirom. Given that we use the device tree and kernel maintained by [MENTION=6425591]SpiritCroc[/MENTION] (AICP team) there are no differences in terms of hardware functionality.

Official lineage is an other story: you need a lot of effort to bring up a device officially. Just have a look here. We decided not to do this - it consumes even more time than it does with an unofficial one. And it's just a hobby ;)

Concerning signing [MENTION=7929484]MSe1969[/MENTION] already gave a good insight

You will never be sure there's a backdoor or unknown vulnerabilities, but if the source is open the chance will be much smaller compared to closed source software/firmware.

If you're really paranoid and don't even trust us (it's okay) or you're just interested you can build your own version and sign it with your own key. You'll find everything in the OP.