May 31, 2020

Custom ROMs: Installing via TWRP (e.g. Prometheus ROM)

After installing TWRP and installing some ROMs via adb sideload, (or this story with my old Nexus 7) i learned that there is another way for installing Custom ROMs:

  • Boot in to recovery (Samsung: Home Button + Power + Volume Up)
  • Copy the ROM.zip to the SD card of the smartphone
  • and then follow this screenshots
Click on "Install"

Click "Select Storage"

Select your SD card

Select the ROM you want to install:

Swipe to the right

Then some of the ROMs (like Prometheus) will guide you through an installation wizard, where you can chose some options.

If you want to try Prometheus you can download it here.

May 18, 2020

Building my own Recovery ROM for a Samsung J5 2017 (j5y17lte, TWRP)

After several hours of sideloading a custom ROM and flashing a TWRP recovery image i thought the next step is to build a TWRP recovery image on my own.


So how to do that?

My startpoint was
(just search github for your device with TWRP)

But this is not the way to begin.
First you have to follow this page:
and do
repo init -u git://github.com/minimal-manifest-twrp/platform_manifest_twrp_omni.git -b twrp-7.1
and
repo sync
Then add the j5y17lte.xml to .repo/local_manifests. After that the repo sync works but the
$ lunch omni_j5y17lte-eng
ends up with a warning:

WARNING: device/samsung/j5y17lte/omni.dependencies file not found
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=7.1.2
TARGET_PRODUCT=omni_j5y17lte
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=cortex-a53
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv7-a-neon
TARGET_2ND_CPU_VARIANT=cortex-a53
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-4.15.0-88-generic-x86_64-with-Ubuntu-18.04-bionic
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=NJH47F
OUT_DIR=/media/schroff/895337b7-c4eb-44a4-9063-00f629e5149f/omni/out
============================================

The good point: just ignore this warning and do the mka recoveryimage.

Here i got two errors:

/bin/bash -c "prebuilts/misc/linux-x86/flex/flex-2.5.39 -oout/target/product/generic/obj/STATIC_LIBRARIES/libedify_intermediates/lexer.cpp bootable/recovery/edify/lexer.ll"
flex-2.5.39: loadlocale.c:130: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed.
Aborted (core dumped)

Here i followed this hint:
https://groups.google.com/forum/?hl=tr#!topic/android-building/0kzPnw3akxg
and copied the provided flex to "prebuilts/misc/linux-x86"
   cp ~/Downloads/build/flex flex-2.5.39
You have to change the name from flex to flex-2.5.39 and you have to rerun source build/envsetup.sh again.

Then i got the following errors:

bootable/recovery/gui/../twrp-functions.hpp:24:10: fatal error: 'ext4_utils/ext4_crypt.h' file not found
bootable/recovery/gui/../twrp-functions.hpp:24:10: error: 'ext4_utils/ext4_crypt.h' file not found with <angled> include; use "quotes" instead
bootable/recovery/twrp.cpp:49:10: fatal error: 'base/strings.h' file not found
This i could resolve with:

cd bootable/recovery
ln -s ../../system/extras/ext4_utils
vi twrp-functions.hpp # add the quotes!
ln -s ../../system/core/base/include/android-base base

After that the build went through and i got a TWRP image:
-rw-rw-r--  1 schroff schroff 26937344 Mai 17 23:40 recovery.img
This ran without a problem on my J5 after a
heimdall flash --RECOVERY recovery.img



May 16, 2020

Samsung J5 2017 (aka j5y17lte) installing STOCK ROM

After installing a custom ROM (s. here) i wanted to flash the STOCK  ROM onto my smartphone again.
So what to do?

First: Download a ROM (e.g. sammobile.com)

and you will get something like
J530FXXU6CSK9_J530FDBT6CSL1_DBT.zip
this zip cannot be sideloaded. So you have to unzip and the you have:
AP_J530FXXU6CSK9_CL16642474_QB27583084_REV00_user_low_ship_meta_OS9.tar.md5
BL_J530FXXU6CSK9_CL16642474_QB27583084_REV00_user_low_ship.tar.md5
CP_J530FXXU6CSK9_CP14486297_CL16642474_QB27583084_REV00_user_low_ship.tar.md5
CSC_DBT_J530FDBT6CSL1_CL17419960_QB27658856_REV00_user_low_ship.tar.md5
HOME_CSC_DBT_J530FDBT6CSL1_CL17419960_QB27658856_REV00_user_low_ship.tar.md5
Within this you have to do a:
 for a in *md5; do echo $a;  tar -xvf $a; done
and the result should be:
boot.img   cm.bin      modem.bin  recovery.img  system.img
cache.img  hidden.img  param.bin  sboot.bin     userdata.img
or just type:

~/bin/heimdall flash --BOOT boot.img --SYSTEM system.img --CACHE cache.img --HIDDEN hidden.img --PARAM param.bin --CM cm.bin --USERDATA userdata.img --RADIO modem.bin --BOOTLOADER sboot.bin --RECOVERY recovery.img
and after nearly 10 minutes of anxious waiting you J5 boots up with the STOCK ROM again.

May 9, 2020

Corona-Homeoffice: second monitor for my laptop - portable!

After several weeks working in homeoffice and my children in homeschooling i had to increase my efficieny. And the best thing is to get a second monitor running which meets the following requirements:
  • Single Plug (for signal and power)
  • Easy movable from living room to workspace and back
  • Touchscreen would be nice
 So i decided to buy a wimaxit 15.6" portable monitor and today it arrived:




The second screen is only connected (and charged) via USB-C.
Even connecting my smartphone just works out of the box - really cool! 

May 2, 2020

My Samsung Galaxy J5 (2017) aka j5y17lte with lineage os

In the last weeks i did some tests with installing custom ROMs to my old devices:
and
The next step was to try this with my Samsung J5:
root@zerberus:~/bin# ./heimdall print-pit
Heimdall v1.4.2

Copyright (c) 2010-2017 Benjamin Dobell, Glass Echidna
http://www.glassechidna.com.au/

This software is provided free of charge. Copying and redistribution is
encouraged.

If you appreciate this software and you would like to support future
development please consider donating:
http://www.glassechidna.com.au/donate/

Initialising connection...
Detecting device...
Claiming interface...
Setting up interface...

Initialising protocol...
Protocol initialisation successful.

Beginning session...

Some devices may take up to 2 minutes to respond.
Please be patient!

Session begun.

Downloading device's PIT file...
PIT file download successful.

Entry Count: 29
Unknown 1: 1598902083
Unknown 2: 844251476
[.....]
File Size (Obsolete): 0
Partition Name: USERDATA
Flash Filename: userdata.img
FOTA Filename: remained

Ending session...
Rebooting device...
Releasing device interface...
But for the next step (flashing the boatloader with TWRP) i got the follwoing error:
root@zerberus:~/bin# ./heimdall flash --RECOVERY ../Downloads/twrp-3.3.1-1-j5nlte.img --no-reboot
Heimdall v1.4.2

Copyright (c) 2010-2017 Benjamin Dobell, Glass Echidna
http://www.glassechidna.com.au/

This software is provided free of charge. Copying and redistribution is
encouraged.

If you appreciate this software and you would like to support future
development please consider donating:
http://www.glassechidna.com.au/donate/

Initialising connection...
Detecting device...
Claiming interface...
Setting up interface...

Initialising protocol...
Protocol initialisation successful.

Beginning session...

Some devices may take up to 2 minutes to respond.
Please be patient!

Session begun.

Downloading device's PIT file...
PIT file download successful.

Uploading RECOVERY
100%
RECOVERY upload successful

Ending session...
ERROR: Failed to receive session end confirmation!
Releasing device interface...
The smartphone showed this:
  
RMM STATE: Prenormal
KG STATE: Checking
Only official released binaries are allowed to be flashed(RECOVERY)
KG = Knox Guard
RMM = Remote Monitoring and Management
(https://chimeratool.com/fr/docs/samsung-knox-guard-kg-and-remote-monitoring-and-management-rmm-unlock-functions)

I found a solution for this problem (https://www.android-hilfe.de/forum/root-custom-roms-modding-fuer-samsung-galaxy-s9-s9.3273/s9-sm-g960f-nach-android-9-kein-installieren-von-custom-recoverys-moeglich.898725.html): It just says: wait 7 days...

Grrrrr!!!!!!!

And after 7 days:
And then:

 /bin# ./heimdall flash --RECOVERY ../AndroidDevices/TWRP-3.2.3-TwrpBuilder-j5y17lte-2018-09-13_15-34.img  --no-reboot

Heimdall v1.4.2
Copyright (c) 2010-2017 Benjamin Dobell, Glass Echidna
http://www.glassechidna.com.au/

This software is provided free of charge. Copying and redistribution is
encouraged.

If you appreciate this software and you would like to support future
development please consider donating:
http://www.glassechidna.com.au/donate/

Initialising connection...
Detecting device...
Claiming interface...
Setting up interface...

Initialising protocol...
Protocol initialisation successful.

Beginning session...

Some devices may take up to 2 minutes to respond.
Please be patient!

Session begun.

Downloading device's PIT file...
PIT file download successful.

Uploading RECOVERY
100%
RECOVERY upload successful

Ending session...
Releasing device interface...

And after that i was able to install the lineage os plus the Google playstore:

adb sideload ../Downloads/lineage-15.1-20180510-UNOFFICIAL-j5y17lte.zip
adb sideload open_gapps-arm-8.1-j5y17lte-pico-20200418.zip
The only problem:
Only an unofficial lineage version 15.1 was available for the Samsung J5 2017 aka "j5y17lte". I found one build with version 16 but there the WLAN was broken...

So this was a step back from Android 9 to Android 8.1 - but system space moved from 800MB free to 7GB free ;-)