yashsingh1/xdaforums huggingface dataset:
[Xperia Z1 Compact Android Development] munjeni:
Disclaimer:

* You flash this ROM at your own risk and responsibility.

* This ROM is provided without ANY WARRANTY WHATSOEVER, not even the warranty that it works.

* None of the developers of this ROM will be held accountable for any damages, complaints or anything.

Hello! I have stopped all android related work year ago, last month I decided to try @SuperLamic device trees from Z1 forum, but I wasn't abble to boot CM kernel and I decided to use stock kernel and try boot it, done. Had some touch screen isues and some more but after some days of working on it finally made kernel fully functional. I have contacted SuperLamic and got his permission and want to share build backported from his Z1 but its a bit diferent because I'm using different kernel -

patched stock kernel, here is build and changelog , almost fully working! I have opened this thread mainly bacause I want to try help SuperLamic and hope we get clear rom on booth devices. I will share working stock kernel on git hope at a weekend! At a weekend I will solder uart on my seccond z1c and dump bootloop log and provide it to SuperLamic since he was unable to debug an CVE clean kernel which have bootloop because of his broken Z1, hope we switch soon to that kernel on booth devices. One more diferencie my build is selinux enforce, I will try to make a diff file and provide patch for Z1 guys. Curently done this using my PoC which curenly have updated selinux stufs, but I will need to decompile booth sepolicy and make an diff file which we can use to easy implement into Z1 and Z1C device tree.

If you need twrp:

- read this https://xdaforums.com/showpost.php?p=73586527&postcount=169

Credits which I need to put on this is:

1. ofcorse full credits goes to @SuperLamic since I have used his device tree from Z1

2. special thanks to guys who worked on camera libshims: tomascus, nailyk, rcstar6696, xkeita, special thanks to @tomascus guy who worked with me 1 year ago when we got stock kernel working on nougat and done some initial work to stock camera hals, just to remind you this is a thread https://xdaforums.com/crossdevice-dev/sony/discussion-development-custom-rom-t3479108

Kernel source code:

- https://github.com/SuperLamic/android_kernel_sony_msm8974 branch cm-14.1
[Xperia Z1 Compact Android Development] munjeni:
If you notice any bug please report, need to know to be able to make list of bugs and asign fixing priority!
[Xperia Z1 Compact Android Development] levone1:
Here's what I found -

* default screen dpi = 480. Not a problem to change, but it's pretty funny looking

* 'mtp host has stopped' message, whenever certain activity chooser functions are called on. Doesn't cause any problems, just press 'ok' and it goes away.
[Xperia Z1 Compact Android Development] munjeni:
I forgot to change dpi to 320, next build will get that change. About mtp host stopped working, solution (temporary) is to disable mtp app in setting so it will no more cause those popups, I didn't noticed anything aftected by disabling that app, have no idea what is usage of these app. When I get more free time will look into source code to get idea whats going on with that app. Thanks for reporting!
[Xperia Z1 Compact Android Development] munjeni:
I'm curently on stock rom since my battery is almost dead, need replacement battery :( Anybody recommend me an good battery for z1c?
[Xperia Z1 Compact Android Development] p@to:
Hi [MENTION=1234407]mujeni[/MENTION]i!!

You did it!!¡

Congratulations!?!!
[Xperia Z1 Compact Android Development] munjeni:
Hi mate, thanks! I just spent some days on it but I can't say I did it, guys from z1 forum is responsible for our almost stable and great rom!
[Xperia Z1 Compact Android Development] MozkoZrout:
That Full stock camera hal means that the camera will be as good as in stock sony roms ? It would be dream come true since camera is huge thing for me on this phone
[Xperia Z1 Compact Android Development] munjeni:
Yes man camera is almost the same, in my opinion better than stock one! Fast response and fast focus :)
[Xperia Z1 Compact Android Development] munjeni:
Some screen shoots
[Xperia Z1 Compact Android Development] MozkoZrout:
Wow awesome i need to try it than, you shall be praised as god if you really made this possible
[Xperia Z1 Compact Android Development] AreusShow:
Hello,sorry for my blindness)) but where is the link to the download? throw off me please..
[Xperia Z1 Compact Android Development] levone1:
Post 1... 'build and changelog'
[Xperia Z1 Compact Android Development] AreusShow:
Fanks
[Xperia Z1 Compact Android Development] audioactive303:
Thank you for the great job! Gonna flash it today and report!! :svetius::good::svetius::good:
[Xperia Z1 Compact Android Development] heorung:
Hello [MENTION=4120742]munjeni[/MENTION] , is Real Recovery required for this rom?
[Xperia Z1 Compact Android Development] AreusShow:
cam not working

i instal this rom>cam not work
[Xperia Z1 Compact Android Development] levone1:
Make sure to full wipe, (data, caches, and system). Rom and camera working fine.
[Xperia Z1 Compact Android Development] munjeni:
Read carefully my site instructions and chance for bad installation is minimal. I'm on our rom for about 3 days, apsolutly my favorite rom! Camera apsolutly work!
[Xperia Z1 Compact Android Development] munjeni:
If somebody need wallpapper and the same look like my screenshoots use walpapper from http://orig00.deviantart.net/d43e/f...llpaper_red_034_by_charlie_henson-daa22ts.png and weather from

https://play.google.com/store/apps/details?id=mobi.lockdown.weather
[Xperia Z1 Compact Android Development] levone1:
There's a few different ones shown in screenshot. I'm on my other phone at the moment, so can't remember exactly, but try :

https://play.google.com/store/apps/...roc&pcampaignid=APPU_1_ZvmmWdyYDcvZjwSBqZPADg

https://play.google.com/store/apps/...eme&pcampaignid=APPU_1_3_mmWYq0HYOwjwSf8on4Ag

https://play.google.com/store/apps/...eme&pcampaignid=APPU_1_K_qmWaHzJojRjwTsj5-YDA

I think I remember using at least those 3.
[Xperia Z1 Compact Android Development] BEDAMATI MAHANAND:
thank you

---------- Post added at 04:20 AM ---------- Previous post was at 04:13 AM ----------

i installed it but it says "substratum not found".

anything i missed?

---------- Post added at 04:24 AM ---------- Previous post was at 04:20 AM ----------

sorry i missed the theme engine. :laugh: :laugh:
[Xperia Z1 Compact Android Development] next.creature:
Hi,

I just flashed CWM, installed the image zip (2017-08-31), SuperSu zip and OpneGapps zip files to my Z1C, all seemed to be OK.

After reboot i got stuck on a screen: Encryption Unsuccessful, Factory Reset your Phone.

I pressed Reset Phone but still end up with the same screen after reboot.

Tried to install all zip files again and finished with a Factory Reset before rebooting the first time. Still this encryption message.

(Also tried the image from 28th August)

Did i miss an installation step? Any other solution?
[Xperia Z1 Compact Android Development] mrbun9l3:
I have just installed this rom and I have got problem with wi-fi connection - phone cannot find my home router network. Name of the network is not listed when I search for wi-fi connection.
[Xperia Z1 Compact Android Development] Frunzdoedel:
Very good rom but the loss on battery during my work caused by doze mode from google drives me crazy.

If i enable aggressive doze and disable motion detection, a very good app called gravity screen stops working.

I want my phones screen switch on when i pull it out. I am afraid my phone has to stay on lollipop. ?
[Xperia Z1 Compact Android Development] alex88510:
For years I'm using your good old 4.4 kitkat custom rom, now it seems there is a good excuse to update it.

You mentioned the battery life(despite the dmesg hdmi thingy) was very good, around 5% overnight.

Is it with the help of the doze mode?

I just hope that the doze mode is somewhat equivalent with the Sony stamina mode.

My 3yr old phone battery is draining fast without it, even with stamina mode is draining faster than it used to.
[Xperia Z1 Compact Android Development] mkdmc:
Bugs I could notice:

1. When I turn on the phone, I see Sony logo, then a black screen and then lineageos logo.

2. There is a problem with giving permission to apps for the first time. For example I want to download something by Chrome. Chrome asks me permission for accessing storage. I accept but it still can't save the file. I need to close Chrome and open it again to work properly.(Same problem with other apps like MX player, Open camera & ...)

However your rom is really great. Kernel is the best one I have ever seen:DI hope you continue working on it:D

Good Luck:)
[Xperia Z1 Compact Android Development] vildevilde:
I tried this on my spare phone, works very good, but I would like this rom microG enabled.

I did try a installation without the gapps, then installed Tingle from here and then microG. With F-Droid and Yalp Store, that made me able to use my bank apps without ever logging in to any G00gle account.

Don't ask me how I did this because I don't know more than you can read on the linked sites above, in fact I have nearly no idea what I'm doing ;)

On my every day phone I use LineageOS 12.1 for Z1c with current Sec.Patches that already is microG enabled. Whats the difference between that rom and this rom regarding security patches, I'm asking because you are using stock kernel and stock camera?
[Xperia Z1 Compact Android Development] blickpunk:
Hi [MENTION=4120742]munjeni[/MENTION],

thank you so much for your great work! I was looking for a Nougat-based ROM without restrictions for our brilliant camera. AICP discharged my battery within two hours, but your ROM seemed to make my wishes come true. WiFi and mobile network are stable, reboots and power-off-loading are fixed, camera is perfect. On wednesday the system suddenly shut down at about 50% battery twice, but it could be a hardware problem and till now it didn't happen again.

There's only one important wish left: Even if the sd card as internal storage is slow, it would resolve my permanent storage problems. I use nearly 100 apps regularly and I have an extensive messenger history, so I would like to format the sd card as internal storage anyway. In the version from 28th the formatting-process cancels with a java-exception and at the same day you announced to remove this option. Is it just because it's to slow in your opinion or would it be difficult to fix this?
[Xperia Z1 Compact Android Development] munjeni:
Hi, I have told about "wipe data icluding internal storage", you must folow it! That step fully wipes userdata partition! If that can't help flash userdata.img from any rom and you are done
[Xperia Z1 Compact Android Development] munjeni:
Hi, to be honest I never tried, but if I'm not wrong I saw some posts in diferent forums about bricked sdcards by using sdcard as internal storage, realy don't know if that is true, use on your own risk
[Xperia Z1 Compact Android Development] munjeni:
Hi, did you tried to look for wifi using your seccond phone to be sure your router showing wifi network?
[Xperia Z1 Compact Android Development] munjeni:
Hi, I have noticed the some similar problems like when I enable wifi my bluetooth powering up without any reason, later I found that it is related to gapps! You can try many more diferent gapps including oldest one! I will look for it when I receive replacement battery soon, I'm on stock rom right now
[Xperia Z1 Compact Android Development] munjeni:
Might be selinux isue since our rom curently runing in enforce mode! When that happen please post your dmesg!
[Xperia Z1 Compact Android Development] munjeni:
Hi, thanks, we are on selinux enforce mode, I need more dmesg to collect all denials and add into next update, it would be great if you somehow collect many diferent dmesgs so I can merge it and use my tool to produce selinux patch!
[Xperia Z1 Compact Android Development] munjeni:
Our kernel is stock kernel latest one from sony for z1c so it doesn't have any security patch, to be honest I don't care about it since we have all latest security patxhes in rom itself and we have selinux enforce, I think thats good enought.
[Xperia Z1 Compact Android Development] vildevilde:
Thank you, as I wrote I don't know very much about this things so if you think it's safe enough that's ok for me. :)
[Xperia Z1 Compact Android Development] munjeni:
I had no time yestersay to post on xda, just to tell you new build from yesterday exist! 20170831 Before you report isue or anything please tell us which version you using!
[Xperia Z1 Compact Android Development] sugnuf:
I got this soft with microg running, but i changed SELinux to permissive (via hex edit kernel).
[Xperia Z1 Compact Android Development] mrbun9l3:
now I found information https://jira.lineageos.org/browse/REGRESSION-676 that lineageos doesn't support 12 and 13 wi-fi channels. my router has fixed channel and I dont have access to its configuration - i cant change it :/

is it possible to add support for this channels in your rom ?
[Xperia Z1 Compact Android Development] munjeni:
It can be working in enforce mode but I need dmesg i nthat case
[Xperia Z1 Compact Android Development] munjeni:
Did you tried to connect to wifi by using another phone? Just to be sure!
[Xperia Z1 Compact Android Development] mrbun9l3:
Yes

Wysłane z mojego D5503 przy użyciu Tapatalka
[Xperia Z1 Compact Android Development] munjeni:
Ok but without your dmesg it will stay in permisive mode, I can't fix enforce in your mod since I do not using these mods. If you need that in enforce working please provide dmesg!
[Xperia Z1 Compact Android Development] munjeni:
Ok I will add it to the bug list, thanks! Anybody confirm bug?
[Xperia Z1 Compact Android Development] munjeni:
Can you try this https://xdaforums.com/showpost.php?p=30029433&postcount=634

Edit:

There is many thing which I found now on net, for example you can try add to system.prop:

ro.boot.wificountrycode XX

where XX is two leter country code e.g. US or EU, EU, JP, TW ...etc, EU version have channels range 1-11 so you will need to research more about cauntry code
[Xperia Z1 Compact Android Development] munjeni:
Found now, you can change wifi region code in advance wifi menu!
[Xperia Z1 Compact Android Development] sugnuf:
This could be problematic, since microG need patch (binary - jar files) for signature spoofing. Enforce would work, but patch should be applied on sources and as I remeber You dont want modify LOS sources.

---------- Post added at 08:06 PM ---------- Previous post was at 08:02 PM ----------

Don't know if this work (universally), since there are few different bin patches. It's better to implement SigSpoof on source level. If You still want this dmesg log, i'll boot rom with enforce mode.
[Xperia Z1 Compact Android Development] munjeni:
In selinux enforcing mode I need to see your dmesg in order to try fix that. Without your dmesg I can do nothing since I'm not using that mod. So if you need that working in selinux enforce mode you can send dmesg. I apsolutly not going to put security hole into rom by enabling signature spofing, the same with selinux, not going to grant untrusted apps or unlabeled files chance to easilly modify things :)
[Xperia Z1 Compact Android Development] Spartan42:
Maybe you should use Magisk and the Modules from here:

https://xdaforums.com/apps/magisk/module-nanomod-5-0-20170405-microg-t3584928

(NanoMod-MicroG and NanoMod-Patcher).

That's the way i use MicroG with spoofed signature.
[Xperia Z1 Compact Android Development] sugnuf:
I don't ask for You to do that (btw. there is patch that add option in settings/developer section which control SigSpoof ). And I don't care about SELinux, but i just tested normal kernel/enforce mode and this time microG works ok (sry don't have free time for clean flash/deeper testing) - with modded /system/services.jar - no denies in dmesg.

Well, there are few other, but not related:

[ 18.795002] type=1400 audit(1504295095.339:4): avc: denied { open } for pid=830 comm="packagescan-4" name=587065726961204B6579626F6172642E61706B dev="mmcblk0p23" ino=31476 scontext=u:r:system_server:s0 tcontext=u:object_r
:media_rw_data_file:s0 tclass=file permissive=0 ppid=320 pcomm="main" tgid=786 tgcomm="system_server"

[ 36.654508] type=1400 audit(1504295112.713:5): avc: denied { getattr } for pid=2126 comm=".hb.dialer.free" path="/data/user_de/0/com.android.server.telecom" dev="mmcblk0p25" ino=121814 scontext=u:r:untrusted_app:s0:c512,c
768 tcontext=u:object_r:system_app_data_file:s0 tclass=dir permissive=0 ppid=320 pcomm="main" tgid=320 tgcomm="main"

[ 42.016780] type=1400 audit(1504295118.082:6): avc: denied { read } for pid=2824 comm="IntentService[W" name="wakeup_sources" dev="debugfs" ino=17 scontext=u:r:priv_app:s0:c512,c768 tcontext=u:object_r:debugfs:s0 tclass=f
ile permissive=0 ppid=320 pcomm="main" tgid=2787 tgcomm="tats_xdaedition"

[ 91.868680] type=1400 audit(1504295167.932:9): avc: denied { read } for pid=3520 comm="RenderThread" name="gpuclk" dev="sysfs" ino=18397 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:sysfs:s0 tclass=file per
missive=0 ppid=320 pcomm="main" tgid=3494 tgcomm="firewall.donate"

Last one is problematic for me since FW (AFWall+) can't assign rules. was caused by lack of supersu - just forgot to reflash after kernel change ;/ sry.

Also some more denies caused by adb plugin for TotalCMD (win version) while browsing fs on phone. Only few examples, all with "ls" command:

[ 1205.367525] type=1400 audit(1504296281.432:10): avc: denied { getattr } for pid=3927 comm="ls" path="/lta-label" dev="mmcblk0p18" ino=2 scontext=u:r:shell:s0 tcontext=u:object_r:unlabeled:s0 tclass=dir permissive=0 ppid=3
925 pcomm="sh" tgid=3925 tgcomm="sh"
[ 1205.372816] type=1400 audit(1504296281.432:11): avc: denied { getattr } for pid=3927 comm="ls" path="/idd" dev="tmpfs" ino=6661 scontext=u:r:shell:s0 tcontext=u:object_r:iddd_file:s0 tclass=dir permissive=0 ppid=3925 pcom
m="sh" tgid=3925 tgcomm="sh"
[ 1205.377166] type=1400 audit(1504296281.432:12): avc: denied { getattr } for pid=3927 comm="ls" path="/init" dev="rootfs" ino=5387 scontext=u:r:shell:s0 tcontext=u:object_r:init_exec:s0 tclass=file permissive=0 ppid=3925 p
comm="sh" tgid=3925 tgcomm="sh"
[ 1205.377549] type=1400 audit(1504296281.432:13): avc: denied { getattr } for pid=3927 comm="ls" path="/boot.txt" dev="rootfs" ino=7169 scontext=u:r:shell:s0 tcontext=u:object_r:rootfs:s0 tclass=file permissive=0 ppid=3925
pcomm="sh" tgid=3925 tgcomm="sh"

Rom from 20170828.

---------- Post added at 10:14 PM ---------- Previous post was at 10:11 PM ----------

Yeah, i know about this, but don't like to use Magisk.
[Xperia Z1 Compact Android Development] mrbun9l3:
Manual changes in advanced settings menu do nothing - country symbol is changed but network is not visible.

On Lollipop I had 'PL', here I dont have this option.

Changes through adb or terminal are too difficult for me :D
[Xperia Z1 Compact Android Development] munjeni:
Well, I have tried right now stock rom WCNSS firmare and also stock rom prima vlan config and firmware, kernel have apsolut stock prima module, the final result is:

amami:/ # iw list
iw list
Wiphy phy0
Band 1:
Capabilities: 0x9030
HT20
Static SM Power Save
RX Greenfield
RX HT20 SGI
No RX STBC
Max AMSDU length: 3839 bytes
DSSS/CCK HT40
L-SIG TXOP protection
Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
Minimum RX AMPDU time spacing: 16 usec (0x07)
HT Max RX data rate: 72 Mbps
HT TX/RX MCS rate indexes supported: 0-7
Frequencies:
* 2412 MHz [1] (20.0 dBm)
* 2417 MHz [2] (20.0 dBm)
* 2422 MHz [3] (20.0 dBm)
* 2427 MHz [4] (20.0 dBm)
* 2432 MHz [5] (20.0 dBm)
* 2437 MHz [6] (20.0 dBm)
* 2442 MHz [7] (20.0 dBm)
* 2447 MHz [8] (20.0 dBm)
* 2452 MHz [9] (20.0 dBm)
* 2457 MHz [10] (20.0 dBm)
* 2462 MHz [11] (20.0 dBm)
[COLOR="Red"] * 2467 MHz [12] (disabled)
* 2472 MHz [13] (disabled)
* 2484 MHz [14] (disabled)[/COLOR]
Bitrates (non-HT):

Channels 12,13,14 is by default non working on stock rom too??? Let me confirm please, I no want to waste my time testing this if that is not working on stock rom too! Also do in mind changing bands, frequencies and etc is not allowed in some countries, do it on your own risk!
[Xperia Z1 Compact Android Development] mrbun9l3:
On this stock rom D5503_14.6.A.1.236_CE1_1280-7864_Davka_PreRooted is working. I can connect with CH 13 network.
[Xperia Z1 Compact Android Development] munjeni:
Is this rom you have using? http://dev.davka.info/download/D5503_14.6.A.1.236_CE1_1280-7864_Davka_PreRooted.zip
[Xperia Z1 Compact Android Development] mrbun9l3:
Yes
[Xperia Z1 Compact Android Development] alex88510:
First day on this rom.

The 3G and LTE did switching between themselves very often even after I set it to 3G.

The camera is OK but somehow feel there's a little bit more noise than when I was in stock rom. (Not sure if this is my imagination:p)

I'm thinking, since this is unlocked bootloader, under stock rom, it will disable Sony proprietary algorithms for camera processing.

Do we need to use something like the DRM function restoration?

Oh, and I noticed some text bug in the apps permission.

If you changed the settings for those without the slider, it will display digit instead of text.

Allowed -> 0
Ignored -> 1
Always Ask -> 2

Not sure if it will cause any issue to the privacy guard but so far it seems to be just cosmetic issue.

Thanks for the good rom:good:
[Xperia Z1 Compact Android Development] alex88510:
double posted... pls ignore this
[Xperia Z1 Compact Android Development] munjeni:
But some peoples reported that changing to 3g is working, there is few random switches from lte to 3g before 3g start working! Is 3g working on your phone, or you just tested it for about 5 secconds? Please deeply test that! Please make sure you are not in the dark room where 3g signal is poor! For me 3g is working, and more peoples reported that everything with mobile network is ok.

About camera, I'm using SuperLamic device tree, and I realy have no idea which libs is on his device tree, maybe it is patched but also maybe not. Probably, having TA PoC in our kernel makes camera much better, but again somebody need to test that. :)
[Xperia Z1 Compact Android Development] munjeni:
Things which I found now, we do not have CRDA service in ramdisk and binary in system is missing, thats probably reason why we can't enable channel 12,13,14 on wifi. I will research about this. I allready tried crda binary and also tried crda service in ramdisk but still unable to get it working, probably libnetlink and many more need to be used from stock rom. If you have idea let me know!

Seems we have the same bug like this one https://bugs.launchpad.net/ubuntu/+source/system-image/+bug/1126751 , Z1 users is afected and I'm believing whole z1 - z5 line?
[Xperia Z1 Compact Android Development] alex88510:
Where I'm from, if the 3G signal is poor, the LTE signal should be worse...:D

Anyway, will let you know again after 1 or 2 days of testing.

About the camera, is it possible to ask SuperLamic about it?

And how to test it?:)
[Xperia Z1 Compact Android Development] munjeni:
Simple patch boot.img using my poc https://xdaforums.com/crossdevice-dev/sony/poc-real-trim-instead-drm-fix-t3552893
[Xperia Z1 Compact Android Development] alex88510:
Wow, never noticed that thread before.

In that post, you mentioned don't mix that with the DRM fix.

What would happened IF this kernel is already DRM fixed? bootloop?

I might try it at next weekend, need a stable rom for my daily usage on weekdays...

This is my one and only phone:D

EDIT: it seems your PoC will check for old drm fix and it doesn't show any output, which might suggest that the drm fix is not included in this kernel?
[Xperia Z1 Compact Android Development] munjeni:
Yes PoC will detect and delete old drmfix!