• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[IIIII] CROSS - Custom ROM Scripted Setup

Search This thread

k23m

Senior Member
Jan 3, 2016
926
529
Nexus 7'13 CROSS - Custom ROM Scripted Setup (c)2020-2021 k23m


CROSS works on PC with Windows, or WinPE if you do not have Windows installed, or VirtualBox with a Windows guest.

Currently supported ROMs:

- Android 10 LineageOS 17.1
- Android 11 LineageOS 18.1
- Android 11 LineageOS 18.1-flox

Previously supported ROMs:

- Android 7 LineageOS 14.1
- Android 7 LineageOS 14.1-microG
- Android 10 LineageOS 17.1-flox


FEATURES

- automatic scan of developer's website for the latest ROM version
- automatic download of all required components
- automatic single-click installation
- optional components like root or special kernel
- all you have to do is select yes/no during the installation
- both flo and deb are supported

PREREQUISITES

- unlocked device
- installed N7 USB drivers
- original eMMC partition layout may be required

All of the above are ensured with RESTOCK - also a scripted tool, available here:


---------------------
lineage-install-2.bat
---------------------

This script installs and/or offers the following optional components:

- Android 10 LineageOS 17.1 UNOFFICIAL maintained by ripee https://forum.xda-developers.com/nexus-7-2013/development/rom-lineageos-17-1-t4038425
- TWRP (optional, no need to reflash it if exists already)
- repartition: sysrepart-max.zip by k23m (optional, no need if already repartitioned)
- root: Magisk (optional)
- GApps: pico (optional)


---------------------
lineage-install-3.bat
---------------------

This script installs and/or offers the following optional components:

- Android 11 LineageOS 18.1 UNOFFICIAL maintained by followmsi https://forum.xda-developers.com/t/rom-flo-deb-unofficial-lineageos-18-1-2021-04-07.3569067/
- TWRP (optional, no need to reflash it if exists already)
- repartition: sysrepart-ultimate.zip by k23m (optional, no need if already repartitioned)
- root: Magisk (optional)
- GApps: pico (optional)

NOTE: automatic scan of the developer's website is not possible.
Please download the ROM from: https://drive.google.com/drive/fold...HZThGTnM?resourcekey=0-0BunAmDBWluYPghT0Fs6CA
Save it in CROSS' folder and drag-and-drop it on lineage-install-3.bat to start the installation.


--------------------------
lineage-install-3-flox.bat
--------------------------

This script installs and/or offers the following optional components:

- Android 11 LineageOS 18.1-flox OFFICIAL maintained by npjohnson https://forum.xda-developers.com/t/...s-7-2013-wi-fi-repartition-only-flox.4255325/
- TWRP-flox (optional, no need to reflash it if exists already)
- repartition: sysrepart-ultimate.zip (flox compatible) by k23m (optional, no need if already flox-repartitioned)
- root: Magisk (optional)
- GApps: pico unofficial by ipdev (optional)


------------------------
getlog.bat and relog.bat
------------------------

If you see errors, copy and report them. Run getlog.bat and include "getlog.log" in your post. If possible, also run relog.bat and attach "relog-xxxxxx.zip" to your post.


----------
fstrim.bat
----------

Improve performance of your eMMC.


---------------
repartition.bat
---------------

If sysrepart repartition is impossible due to TWRP or GPT issues, run the repartition.bat script.


SUPPORT


If you select the local file option, CROSS will scan the data folder and offer the newest found file for installation. If nothing is found, you can type/paste a specific file name to install. You can drop anything you like to the data folder - CROSS is now a basic universal ROM installer.


SAMPLE OUTPUT

Code:
Nexus 7'13 LineageOS 17.1 Install v1.3 @2020 k23m

SUPPORT - http://bit.ly/2C35sLZ

This script assumes that USB drivers are already installed.
If not, then run RESTOCK first or install them manually.

Enter device name (flo=WiFi; deb=LTE) - [flo/deb]: flo

Use local ROM file? (no if unsure) [y/n]:
--2020-05-15 06:17:53--  https://lineageos.wickenberg.nu/flo/
Resolving lineageos.wickenberg.nu... 88.129.42.110
Connecting to lineageos.wickenberg.nu|88.129.42.110|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: 'tmp1'

tmp1                              [ <=>                                              ]   6.32K  --.-KB/s    in 0.001s

2020-05-15 06:17:57 (5.33 MB/s) - 'tmp1' saved [6473]

Found for download: lineage-17.1-20200515-UNOFFICIAL-flo.zip

Use local TWRP file? (no if unsure) [y/n]:

Press any key to continue . . .

Downloading installation files.

--2020-05-15 06:19:02--  https://dl.twrp.me/flo/twrp-3.3.1-0-flo.img
Resolving dl.twrp.me... 45.249.91.154
Connecting to dl.twrp.me|45.249.91.154|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 9271296 (8.8M) [application/octet-stream]
Saving to: 'twrp-3.3.1-0-flo.img'

twrp-3.3.1-0-flo.img          100%[=================================================>]   8.84M   945KB/s    in 11s

2020-05-15 06:19:15 (788 KB/s) - 'twrp-3.3.1-0-flo.img' saved [9271296/9271296]

--2020-05-15 06:19:15--  https://lineageos.wickenberg.nu/flo/lineage-17.1-20200515-UNOFFICIAL-flo.zip
Resolving lineageos.wickenberg.nu... 88.129.42.110
Connecting to lineageos.wickenberg.nu|88.129.42.110|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 413523888 (394M) [application/zip]
Saving to: 'lineage-17.1-20200515-UNOFFICIAL-flo.zip'

lineage-17.1-20200515-UNOFFIC 100%[=================================================>] 394.37M  2.71MB/s    in 3m 17s

2020-05-15 06:22:34 (2.01 MB/s) - 'lineage-17.1-20200515-UNOFFICIAL-flo.zip' saved [413523888/413523888]

--2020-05-15 06:22:34--  https://jaist.dl.sourceforge.net/project/opengapps/arm/20200515/open_gapps-arm-10.0-pico-202005
15.zip
Resolving jaist.dl.sourceforge.net... 150.65.7.130
Connecting to jaist.dl.sourceforge.net|150.65.7.130|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 101519489 (97M) [application/octet-stream]
Saving to: 'open_gapps-arm-10.0-pico-20200515.zip'

open_gapps-arm-10.0-pico-2020 100%[=================================================>]  96.82M  3.25MB/s    in 36s

2020-05-15 06:23:11 (2.73 MB/s) - 'open_gapps-arm-10.0-pico-20200515.zip' saved [101519489/101519489]

--2020-05-15 06:23:11--  https://github.com/topjohnwu/Magisk/releases/download/v20.4/Magisk-v20.4.zip
Resolving github.com... 52.64.108.95
Connecting to github.com|52.64.108.95|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://github-production-release-asset-2e65be.s3.amazonaws.com/67702184/81204200-6ca5-11ea-8f19-3a5b8341b6e2?
X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20200515%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-
Date=20200515T072529Z&X-Amz-Expires=300&X-Amz-Signature=681f649c20ad2b0eabf80411650867d6db9144197a42a639a13162209f0fff91
&X-Amz-SignedHeaders=host&actor_id=0&repo_id=67702184&response-content-disposition=attachment%3B%20filename%3DMagisk-v20
.4.zip&response-content-type=application%2Foctet-stream [following]
--2020-05-15 06:23:11--  https://github-production-release-asset-2e65be.s3.amazonaws.com/67702184/81204200-6ca5-11ea-8f1
9-3a5b8341b6e2?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20200515%2Fus-east-1%2Fs3%2Faws4
_request&X-Amz-Date=20200515T072529Z&X-Amz-Expires=300&X-Amz-Signature=681f649c20ad2b0eabf80411650867d6db9144197a42a639a
13162209f0fff91&X-Amz-SignedHeaders=host&actor_id=0&repo_id=67702184&response-content-disposition=attachment%3B%20filena
me%3DMagisk-v20.4.zip&response-content-type=application%2Foctet-stream
Resolving github-production-release-asset-2e65be.s3.amazonaws.com... 52.216.134.219
Connecting to github-production-release-asset-2e65be.s3.amazonaws.com|52.216.134.219|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5942417 (5.7M) [application/octet-stream]
Saving to: 'Magisk-v20.4.zip'

Magisk-v20.4.zip              100%[=================================================>]   5.67M  2.30MB/s    in 2.5s

2020-05-15 06:23:15 (2.30 MB/s) - 'Magisk-v20.4.zip' saved [5942417/5942417]

--2020-05-15 06:23:15--  https://forum.xda-developers.com/attachment.php?attachmentid=4480528
Resolving forum.xda-developers.com... 104.18.19.88, 104.18.18.88
Connecting to forum.xda-developers.com|104.18.19.88|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://dl.xda-cdn.com/4/4/8/0/5/2/8/sysrepart.zip?key=Wwfo1oqhImScVpTSzXTlzA&ts=1589527594 [following]
--2020-05-15 06:23:16--  https://dl.xda-cdn.com/4/4/8/0/5/2/8/sysrepart.zip?key=Wwfo1oqhImScVpTSzXTlzA&ts=1589527594
Resolving dl.xda-cdn.com... 104.27.191.76, 104.27.190.76
Connecting to dl.xda-cdn.com|104.27.191.76|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 782958 (765K) [application/zip]
Saving to: 'sysrepart.zip'

sysrepart.zip                 100%[=================================================>] 764.61K   591KB/s    in 1.3s

2020-05-15 06:23:20 (591 KB/s) - 'sysrepart.zip' saved [782958/782958]

Press any key to continue . . .

1. boot the Nexus in fastboot mode: when OFF press POWER + VOLUME DOWN
2. when in the bootloader menu, connect it to your PC
3. wait a few seconds, then...
Press any key to continue . . .
Verify...
Lock status...
Flash TWRP? [y/n]: y
sending 'recovery' (9054 KB)...
OKAY [  0.297s]
writing 'recovery'...
OKAY [  0.516s]
finished. total time: 0.812s


1. on N7 select "Recovery mode" with volume button
2. on N7 press power button to boot Recovery
3. when you see TWRP main menu press any key to continue

Wait...
*
Installing...
*****
Repartition? (no if already repartitioned) [y/n]: y
Transferring: 782958/782958 (100%)
2575 KB/s (782958 bytes in 0.296s)
***
Wait...
Installing zip file '/sdcard/sysrepart.zip'
Checking for Digest file...
###############################
# k23m Nexus 7'13 Repartition #
###############################
Creating log and gpt backup
Removing partitions
Creating new partitions
Formatting new partitions
###############################
Operation completed. Copy backup gpt and log files from internal storage to PC before rebooting.
###############################
Done processing script file
***

...REBOOTING
When you see TWRP main menu press any key to continue...

*****
Proceed only if you really see TWRP main menu
Press any key to continue . . .
Do dirty flash? (no if unsure) [y/n]: n
Wiping data without wiping /data/media ...
Done.
Formatting Cache using make_ext4fs...
Done processing script file
Formatting System using make_ext4fs...
Done processing script file
Wiping Cache & Dalvik...
-- Dalvik Cache Directories Wipe Complete!
Done processing script file
Formatting cache using make_ext4fs...
Done processing script file
***
Transferring: 413523888/413523888 (100%)
3649 KB/s (413523888 bytes in 110.640s)
***
Wait...
Installing zip file '/sdcard/lineage-17.1-20200515-UNOFFICIAL-flo.zip'
Checking for Digest file...
Warning: No file_contextsTarget: google/razor/flo:6.0.1/MOB30X/3036618:user/release-keysPatching system image unconditio
nally...script succeeded: result was [1.000000]Done processing script file
Install root? [y/n]: y
Transferring: 5942417/5942417 (100%)
3868 KB/s (5942417 bytes in 1.500s)
***
Wait...
Installing zip file '/sdcard/Magisk-v20.4.zip'
Checking for Digest file...
***********************
Magisk 20.4 Installer
***********************
- Mounting /system
- Device is system-as-root
- Mounting /apex/com.android.conscrypt
- Mounting /apex/com.android.media
- Mounting /apex/com.android.media.swcodec
- Mounting /apex/com.android.resolv
- Mounting /apex/com.android.runtime
- Mounting /apex/com.android.tzdata
- System-as-root, keep dm/avb-verity
- Target image: /dev/block/mmcblk0p14
- Device platform: arm
- Constructing environment
- Adding addon.d survival script
- Unpacking boot image
- Checking ramdisk status
- Stock boot image detected
- Patching ramdisk
- Repacking boot image
- Flashing new boot image
- Unmounting partitions
- Done
Done processing script file
Install GApps? [y/n]: y
Transferring: 101519489/101519489 (100%)
3623 KB/s (101519489 bytes in 27.359s)
***
Wait...
Installing zip file '/sdcard/open_gapps-arm-10.0-pico-20200515.zip'
Checking for Digest file...

##############################
  _____   _____   ___   ____
/  _  \ |  __ \ / _ \ |  _ \
|  / \  || |__) | |_| || | \ \
| |   | ||  ___/|  __/ | | | |
|  \ /  || |    \ |__  | | | |
\_/ \_/ |_|     \___| |_| |_|
       ___   _   ___ ___  ___
      / __| /_\ | _ \ _ \/ __|
     | (_ |/ _ \|  _/  _/\__ \
      \___/_/ \_\_| |_|  |___/
##############################

Open GApps pico 10.0 - 20200515

- Mounting partitions

- Gathering device & ROM information

- Performing system space calculations

- Removing existing/obsolete Apps

- Installing core GApps

- Installing swypelibs
- Installing calsync
- Installing googletts
- Installing packageinstallergoogle

- Miscellaneous tasks

- Copying Log to /sdcard

- Installation complete!

- Unmounting partitions

Done processing script file
***

Done.

Press any key to continue . . .

SUPPORT - http://bit.ly/2C35sLZ

Press any key to exit...

_____________________________________________________
REPARTITION

sysrepart.zip - 1.1GB system, data is not wiped

sysrepart-max.zip - 1.3GB system, data is not wiped, automatically downloaded by LOS 17.1 script

sysrepart-flox.zip - 1.5GB system, data is wiped, 'vendor' partition is added, automatically downloaded by LOS 17.1-flox script

sysrepart-ultimate.zip - 4GB system, data is wiped, 'vendor' partition is added, 'recovery' is enlarged to 64MB in-place and your current TWRP continues to function, flox compatible, automatically downloaded by LOS 18.1-flox script

sysrepart-stock.zip - data is wiped, original partitions are restored

  • reboot immediately after repartition!
  • sysrepart-ultimate/stock work on any previous repartitions
  • sysrepart/max/flox work reliably only on original partitions
  • to install GApps larger than pico/nano you need sysrepart-ultimate
  • sysrepart-ultimate supports custom, oversized TWRP builds
To recover from other repartition attempts, simply install sysrepart-ultimate if you intend to use LOS17+ or sysrepart-stock if you have other plans. If direct sysrepart installation is impossible due to TWRP or GPT issues, run the repartition.bat script. On rare occasions you may have to run RESTOCK and "Restore original partitions" with it.

_____________________________________________________
UPDATE version 2.5 changes:
- update components' URLs
- update relog.bat
- remove installation scripts of no longer available ROMs
- add update.bat cleanup script (run it once)
- add repartition.bat script for repartition-only
- add lineage-install-3.bat script

Download CROSS2.zip and unzip it then download cross-update-XXX.zip and unzip it to the CROSS folder, overwrite existing files.

:cool:(y)
____________________________________________________
NOTE - most of the attached files are meant for direct script download. Except for CROSS and its updates do not download them manually unless you know what you are doing.
 

Attachments

  • sysrepart-max.zip
    764.6 KB · Views: 1,052
  • ElementalX-N7-6.17.zip
    6.9 MB · Views: 796
  • CROSS2.zip
    2.5 MB · Views: 1,355
  • sysrepart-flox.zip
    170 KB · Views: 806
  • twrp-3.4.0-0-flox.img
    7.9 MB · Views: 1,111
  • sysrepart-stock.zip
    170.1 KB · Views: 394
  • sysrepart-ultimate.zip
    170.1 KB · Views: 994
  • cross-update-v2.5.zip
    20.2 KB · Views: 104
Last edited:

prorokrak

Senior Member
Sep 24, 2014
62
15
Hi, thank you very much for this useful tool.
I wonder whether your script could be updated to support dirty flash also. Now it seems to always make a clean flash. But it is not very convenient to set up the device after each security update.
I am not very experienced in making batch files but I was thinking about adjusting your script like follows. From:
Code:
:adbd
ping -n 3 127.0.0.1 >nul
set /p =*<nul
adb devices >tmp0 2>&1
find /i "recovery" tmp0 >nul
if not %errorlevel% == 0  goto adbd
[COLOR="Red"]echo.

echo Installing...
call:wait 5
adb shell twrp wipe /data[/COLOR]
adb shell twrp wipe /system
adb shell twrp wipe dalvik
adb shell twrp wipe cache
call:wait 3
adb push -p %LNZN% /sdcard/
call:wait 3
echo Wait...
adb shell twrp install /sdcard/%LNZN%

To:
Code:
:adbd
ping -n 3 127.0.0.1 >nul
set /p =*<nul
adb devices >tmp0 2>&1
find /i "recovery" tmp0 >nul
if not %errorlevel% == 0  goto adbd
[COLOR="red"]echo.

set /p FLASHTYPE=Do you want to make clean flash or dirty flash? Clean flash will erase all data (except the files in the internal storage) [clean/dirty]: || set FLASHTYPE=null

echo Installing...
call:wait 5

if /i %FLASHTYPE%==dirty (
echo Skipping wiping data...
echo Performing dirty flash...
goto dirty)

if /i %FLASHTYPE%==clean (
adb shell twrp wipe /data
)
:dirty[/COLOR]
adb shell twrp wipe /system
adb shell twrp wipe dalvik
adb shell twrp wipe cache
call:wait 3
adb push -p %LNZN% /sdcard/
call:wait 3
echo Wait...
adb shell twrp install /sdcard/%LNZN%

Any comment on this? Would this worked correctly?
 

maamdroid

Senior Member
Jun 6, 2013
242
38
I just gave this script a try. This is quite slick and saves a bunch of time! Thanks for this. :good:
 

k23m

Senior Member
Jan 3, 2016
926
529
CROSS 2 release


CROSS version 2.0

- new log script
- new fstrim script
- updated components' URLs
- removed LOS microG as it is no longer available

Both LineageOS 14.1 and LineageOS 17.1 install flawlessly. There may be temporary download issues. If so, retry later. LOS17 server errors...

Code:
Resolving lineageos.wickenberg.nu... 83.209.185.118
Connecting to lineageos.wickenberg.nu|83.209.185.118|:443... connected.
HTTP request sent, awaiting response... 500 Internal Server Error
2020-10-11 10:13:40 ERROR 500: Internal Server Error.


:highfive:
 
Last edited:

jelles01

Member
Aug 4, 2017
7
0
Hello I came here from my topic where you suggested me using this. When I fire up lineage-installer2.bat, it can't connect to the server. It asks if I want to use a local file, which I answered yes to. When i gave the name of the file ( "lineage-17.1-20201007-UNOFFICIAL-flo.zip" which I placed inside the CROSS folder, it gave me an error and exited.. What's the deal there?
 

k23m

Senior Member
Jan 3, 2016
926
529
Hello I came here from my topic where you suggested me using this. When I fire up lineage-installer2.bat, it can't connect to the server. It asks if I want to use a local file, which I answered yes to. When i gave the name of the file ( "lineage-17.1-20201007-UNOFFICIAL-flo.zip" which I placed inside the CROSS folder, it gave me an error and exited.. What's the deal there?
Hi again, first copy eg "lineage-17.1-20201009-UNOFFICIAL-flo.zip" to "CROSS\data" folder, then answer [y] to the question...
Code:
Nexus 7'13 LineageOS 17.1 Install v2.0 @2020 k23m
SUPPORT - http://bit.ly/2C35sLZ
This script assumes that USB drivers are already installed.
If not, then run RESTOCK first or install them manually.
Enter device name (flo=WiFi; deb=LTE) - [flo/deb]: flo
Use local ROM file? (no if unsure) [y/n]: y
Found local file: lineage-17.1-20201009-UNOFFICIAL-flo.zip
As you can see it is found automatically without entering a file name. If nothing is found, you could type any file name but the file must be located in the data folder.
 

jelles01

Member
Aug 4, 2017
7
0
It has worked! The install and setup was buttery smooth, thank you so much for this tool. Amazing!
 

GeekyTanuj

Senior Member
Oct 21, 2015
140
28
A little help.

I am about to receive my refurbished unit in a couple of days. chances are that it will likely be on the last stock software. I have a general knowledge about rooting and installing custom ROMs on a variety of devices but nexus 7 seems different to work it. Will this script automatically root and install the TWRP apart from the designated flavor of lineageOS?

Also, will I need to go through the prerequisites (i.e. RESTOCK) procedures even if I am on stock ROM and partition by default? Will I need to repartition every time when switching ROMs after this? Can the CROSS be used again if i had to switch from say LOS 17.1 to 14.1?

Thanks in advance!:highfive:
 

k23m

Senior Member
Jan 3, 2016
926
529
I am about to receive my refurbished unit in a couple of days. chances are that it will likely be on the last stock software. I have a general knowledge about rooting and installing custom ROMs on a variety of devices but nexus 7 seems different to work it. Will this script automatically root and install the TWRP apart from the designated flavor of lineageOS?
Also, will I need to go through the prerequisites (i.e. RESTOCK) procedures even if I am on stock ROM and partition by default? Will I need to repartition every time when switching ROMs after this? Can the CROSS be used again if i had to switch from say LOS 17.1 to 14.1? Thanks in advance!:highfive:
Refurbished N7s usually come with old KitKat stock and it is advisable to run RESTOCK first to update the bootloader before flashing LineageOS. Also RESTOCK will unlock it and install N7 USB drivers on your Windows.

Yes, CROSS can be used multiple times, and will root and install TWRP. Repartition is required only once.

Pro tip: for LineageOS updates answer [y] to the "Do dirty flash?" question to retain your OS settings and apps. But being "dirty", it may not work properly after major OS changes.

Should there be LOS17 server download issues, get lineage-17.1-20201017-UNOFFICIAL-flo.zip from an alternative server and drop it into CROSS' data folder as described in this post.

Cheers
:highfive:
 

GeekyTanuj

Senior Member
Oct 21, 2015
140
28
You are a lifesaver!

Refurbished N7s usually come with old KitKat stock and it is advisable to run RESTOCK first to update the bootloader before flashing LineageOS. Also RESTOCK will unlock it and install N7 USB drivers on your Windows.

Yes, CROSS can be used multiple times, and will root and install TWRP. Repartition is required only once.

Pro tip: for LineageOS updates answer [y] to the "Do dirty flash?" question to retain your OS settings and apps. But being "dirty", it may not work properly after major OS changes.

Should there be LOS17 server download issues, get lineage-17.1-20201017-UNOFFICIAL-flo.zip from an alternative server and drop it into CROSS' data folder as described in this post.

Cheers
:highfive:

Thank you so much for developing this, RESTOCK as well as stock MM debloat script. it literally saved hours and hours of hassle that one has to face while getting to different versions of android! Running 10 with latest updates. feels so good!
 

GeekyTanuj

Senior Member
Oct 21, 2015
140
28
kernel Configuration.

While Android 10 seems tempting and it actually is, it isn't just offering the kind of experience I am looking for and hinders my daily experience in one or the other way.

Looks like you might be using LOS 14.1 with the ElementalX kernel. Can you recommend the best settings for video playbacks and light gaming? Please share your configuration as well.

Thanks and cheers!:highfive:
 

k23m

Senior Member
Jan 3, 2016
926
529
While Android 10 seems tempting and it actually is, it isn't just offering the kind of experience I am looking for and hinders my daily experience in one or the other way.
Looks like you might be using LOS 14.1 with the ElementalX kernel. Can you recommend the best settings for video playbacks and light gaming? Please share your configuration as well.
Thanks and cheers!:highfive:
For video and games LOS17 seems optimal, check these benchmarks.

Personally I use LOS14 without Gapps and with EX kernel including a modification to the battery life extender. I lowered max battery charge to 4.00V which is equivalent to 75% (under)charge resulting in 8x increase of battery life. Furthermore, the mod allows for constant external power connection and no battery overcharging nor overheating/swelling. I edited "buildconfig.sh" in EX zip:
Code:
replace
   echo "write /sys/devices/i2c-0/0-006a/float_voltage 4200" >> $CONFIGFILE
with
   echo "write /sys/devices/i2c-0/0-006a/float_voltage 4000" >> $CONFIGFILE

:good:
 

iforget

Member
Nov 3, 2008
6
0
You gave my Nexus 7 (2013) a new lease on life! Woo-hoo!

I was running a years-old version of the vanilla stock FW and it was soooo slow. Somebody in some comment section somewhere mentioned RESTOCK & CROSS, so I tried out RESTOCK2 and it worked flawlessly.

Then I tried installing 17.1 via CROSS2 without repartitioning (as I believed RESTOCK did that). I got an error that I did not save, hoping it wasn't a big deal. I got stuck on the Google loading screen, so I ran CROSS again. I was going to try 14.1, but wasn't given the option again (bonus? 17.1 looks beautiful and it didn't make me redownload anything, which was smart coding on your part).

I think I should have run the logging programs when I first saw errors, because I'm afraid they were cleared by the reinstallation. I did send what I could after running the loggers post-successful installation, just in case.

Now, 17.1 is working so smoothly with a quick Netflix sideload (no GApps here, used APKMirror + the APKMirror Installer) - which certainly is only working thanks to Magisk. How long did it take me to figure out how to put app icons on the homescreen (swipe up, of course!) I don't think I want to reveal :)

I think the only thing I'm missing is DoubleTap2Wake which I installed with RESTOCK but see now it wasn't an option with 17.1 via CROSS. Apparently somebody has it goin' on LOS17.1 or 18 but this was so easy, not sure I want to try messing with a custom kernel just yet until I get a little bored.

Thank you so much--it's unbelievable there aren't 8 million comments on this thread, it's SO well done. If you made this for a modern/uber-popular tablet surely there would be though. Thank you thank you thank you!
 

ipdev

Recognized Contributor
Feb 14, 2016
1,609
1
2,155
Google Nexus 10
Nexus 7 (2013)
I think the only thing I'm missing is DoubleTap2Wake which I installed with RESTOCK but see now it wasn't an option with 17.1 via CROSS. Apparently somebody has it goin' on LOS17.1 or 18 but this was so easy, not sure I want to try messing with a custom kernel just yet until I get a little bored.

Thank you so much--it's unbelievable there aren't 8 million comments on this thread, it's SO well done. If you made this for a modern/uber-popular tablet surely there would be though. Thank you thank you thank you!
If the Lineage build is using followmsi's sources, then you do not need to change kernels.
You just need to activate DT2W.

See this post on how to activate using a kernel manager.
The thread with the ever changing name. xda thread - Link

If you want something simple, I use a magisk module that enables it on boot.
DT2W GitHub - Link

Cheers. 🤠

PS.
Sorry for a bit of OT.
PPS.
The Lineage 17.1 build is using followmsi's sources.
 
Last edited:

gibnexus

New member
Dec 2, 2020
4
0
hi
I have issue with otg on my N7, i used cross2 without problems : i installed twrp, lineageos 14, root the nexus and installed elementalx and googleapp
my usb otg cable with a usb key is never detected , i can mount the usbstick with twrp (sometime i can see it sometime not in twrp) but after few minutes it diseppear
someone can help me ?
it's a kernel issue?
any app works

thx
 

k23m

Senior Member
Jan 3, 2016
926
529
my usb otg cable with a usb key is never detected , i can mount the usbstick with twrp (sometime i can see it sometime not in twrp) but after few minutes it diseppear
someone can help me ? it's a kernel issue?
LOS14+EX kernel OTG is OK. Use the built-in file manager.
There could be a hardware issue - pin #4 may have a dry joint and work intermittently.
 

gibnexus

New member
Dec 2, 2020
4
0
LOS14+EX kernel OTG is OK. Use the built-in file manager.
There could be a hardware issue - pin #4 may have a dry joint and work intermittently.
Hi man 🤟
thanks for your answer 👍 but it’s not a pin 4 issues , I have just changed the daughter board, and this evening I used restock2 , I restocked, install twrp, used the fix 30 and root but don’t install elementalx
I used the app usb otg helper and everything is ok
I can see my usb stick..
Help me please .. 🙏 I like s2w and 2tw to turn on my screen
I would have the both otg and gesture to awake and used a better android system like lineageos 😁
Thx
 

gibnexus

New member
Dec 2, 2020
4
0
Hi man 🤟
thanks for your answer 👍 but it’s not a pin 4 issues , I have just changed the daughter board, and this evening I used restock2 , I restocked, install twrp, used the fix 30 and root but don’t install elementalx
I used the app usb otg helper and everything is ok
I can see my usb stick..
Help me please .. 🙏 I like s2w and 2tw to turn on my screen
I would have the both otg and gesture to awake and used a better android system like lineageos 😁
Thx
Hi
I begin to believe it’s my otg cable who has some trouble
I will buy a new one and see ...
Just a last question elementalx and los 14 support otg without nothing else ? ( no app or addons ? )
So thx to you for your work 🙏🙏 my old nexus was sleeping in a corner and now it’s relive
Thx for all 🤟
 

k23m

Senior Member
Jan 3, 2016
926
529
Hi
I begin to believe it’s my otg cable who has some trouble
I will buy a new one and see ...
Just a last question elementalx and los 14 support otg without nothing else ? ( no app or addons ? )
So thx to you for your work 🙏🙏 my old nexus was sleeping in a corner and now it’s relive
Thx for all 🤟
I can assure you that straight LOS14+EX OTG works fine.

You must have enabled the "USB OTG + charge mode" option which is meant for car use or externally powered OTG devices. It is NOT NEEDED for normal, N7-powered OTG storage.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 14
    Nexus 7'13 CROSS - Custom ROM Scripted Setup (c)2020-2021 k23m


    CROSS works on PC with Windows, or WinPE if you do not have Windows installed, or VirtualBox with a Windows guest.

    Currently supported ROMs:

    - Android 10 LineageOS 17.1
    - Android 11 LineageOS 18.1
    - Android 11 LineageOS 18.1-flox

    Previously supported ROMs:

    - Android 7 LineageOS 14.1
    - Android 7 LineageOS 14.1-microG
    - Android 10 LineageOS 17.1-flox


    FEATURES

    - automatic scan of developer's website for the latest ROM version
    - automatic download of all required components
    - automatic single-click installation
    - optional components like root or special kernel
    - all you have to do is select yes/no during the installation
    - both flo and deb are supported

    PREREQUISITES

    - unlocked device
    - installed N7 USB drivers
    - original eMMC partition layout may be required

    All of the above are ensured with RESTOCK - also a scripted tool, available here:


    ---------------------
    lineage-install-2.bat
    ---------------------

    This script installs and/or offers the following optional components:

    - Android 10 LineageOS 17.1 UNOFFICIAL maintained by ripee https://forum.xda-developers.com/nexus-7-2013/development/rom-lineageos-17-1-t4038425
    - TWRP (optional, no need to reflash it if exists already)
    - repartition: sysrepart-max.zip by k23m (optional, no need if already repartitioned)
    - root: Magisk (optional)
    - GApps: pico (optional)


    ---------------------
    lineage-install-3.bat
    ---------------------

    This script installs and/or offers the following optional components:

    - Android 11 LineageOS 18.1 UNOFFICIAL maintained by followmsi https://forum.xda-developers.com/t/rom-flo-deb-unofficial-lineageos-18-1-2021-04-07.3569067/
    - TWRP (optional, no need to reflash it if exists already)
    - repartition: sysrepart-ultimate.zip by k23m (optional, no need if already repartitioned)
    - root: Magisk (optional)
    - GApps: pico (optional)

    NOTE: automatic scan of the developer's website is not possible.
    Please download the ROM from: https://drive.google.com/drive/fold...HZThGTnM?resourcekey=0-0BunAmDBWluYPghT0Fs6CA
    Save it in CROSS' folder and drag-and-drop it on lineage-install-3.bat to start the installation.


    --------------------------
    lineage-install-3-flox.bat
    --------------------------

    This script installs and/or offers the following optional components:

    - Android 11 LineageOS 18.1-flox OFFICIAL maintained by npjohnson https://forum.xda-developers.com/t/...s-7-2013-wi-fi-repartition-only-flox.4255325/
    - TWRP-flox (optional, no need to reflash it if exists already)
    - repartition: sysrepart-ultimate.zip (flox compatible) by k23m (optional, no need if already flox-repartitioned)
    - root: Magisk (optional)
    - GApps: pico unofficial by ipdev (optional)


    ------------------------
    getlog.bat and relog.bat
    ------------------------

    If you see errors, copy and report them. Run getlog.bat and include "getlog.log" in your post. If possible, also run relog.bat and attach "relog-xxxxxx.zip" to your post.


    ----------
    fstrim.bat
    ----------

    Improve performance of your eMMC.


    ---------------
    repartition.bat
    ---------------

    If sysrepart repartition is impossible due to TWRP or GPT issues, run the repartition.bat script.


    SUPPORT


    If you select the local file option, CROSS will scan the data folder and offer the newest found file for installation. If nothing is found, you can type/paste a specific file name to install. You can drop anything you like to the data folder - CROSS is now a basic universal ROM installer.


    SAMPLE OUTPUT

    Code:
    Nexus 7'13 LineageOS 17.1 Install v1.3 @2020 k23m
    
    SUPPORT - http://bit.ly/2C35sLZ
    
    This script assumes that USB drivers are already installed.
    If not, then run RESTOCK first or install them manually.
    
    Enter device name (flo=WiFi; deb=LTE) - [flo/deb]: flo
    
    Use local ROM file? (no if unsure) [y/n]:
    --2020-05-15 06:17:53--  https://lineageos.wickenberg.nu/flo/
    Resolving lineageos.wickenberg.nu... 88.129.42.110
    Connecting to lineageos.wickenberg.nu|88.129.42.110|:443... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: unspecified [text/html]
    Saving to: 'tmp1'
    
    tmp1                              [ <=>                                              ]   6.32K  --.-KB/s    in 0.001s
    
    2020-05-15 06:17:57 (5.33 MB/s) - 'tmp1' saved [6473]
    
    Found for download: lineage-17.1-20200515-UNOFFICIAL-flo.zip
    
    Use local TWRP file? (no if unsure) [y/n]:
    
    Press any key to continue . . .
    
    Downloading installation files.
    
    --2020-05-15 06:19:02--  https://dl.twrp.me/flo/twrp-3.3.1-0-flo.img
    Resolving dl.twrp.me... 45.249.91.154
    Connecting to dl.twrp.me|45.249.91.154|:443... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 9271296 (8.8M) [application/octet-stream]
    Saving to: 'twrp-3.3.1-0-flo.img'
    
    twrp-3.3.1-0-flo.img          100%[=================================================>]   8.84M   945KB/s    in 11s
    
    2020-05-15 06:19:15 (788 KB/s) - 'twrp-3.3.1-0-flo.img' saved [9271296/9271296]
    
    --2020-05-15 06:19:15--  https://lineageos.wickenberg.nu/flo/lineage-17.1-20200515-UNOFFICIAL-flo.zip
    Resolving lineageos.wickenberg.nu... 88.129.42.110
    Connecting to lineageos.wickenberg.nu|88.129.42.110|:443... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 413523888 (394M) [application/zip]
    Saving to: 'lineage-17.1-20200515-UNOFFICIAL-flo.zip'
    
    lineage-17.1-20200515-UNOFFIC 100%[=================================================>] 394.37M  2.71MB/s    in 3m 17s
    
    2020-05-15 06:22:34 (2.01 MB/s) - 'lineage-17.1-20200515-UNOFFICIAL-flo.zip' saved [413523888/413523888]
    
    --2020-05-15 06:22:34--  https://jaist.dl.sourceforge.net/project/opengapps/arm/20200515/open_gapps-arm-10.0-pico-202005
    15.zip
    Resolving jaist.dl.sourceforge.net... 150.65.7.130
    Connecting to jaist.dl.sourceforge.net|150.65.7.130|:443... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 101519489 (97M) [application/octet-stream]
    Saving to: 'open_gapps-arm-10.0-pico-20200515.zip'
    
    open_gapps-arm-10.0-pico-2020 100%[=================================================>]  96.82M  3.25MB/s    in 36s
    
    2020-05-15 06:23:11 (2.73 MB/s) - 'open_gapps-arm-10.0-pico-20200515.zip' saved [101519489/101519489]
    
    --2020-05-15 06:23:11--  https://github.com/topjohnwu/Magisk/releases/download/v20.4/Magisk-v20.4.zip
    Resolving github.com... 52.64.108.95
    Connecting to github.com|52.64.108.95|:443... connected.
    HTTP request sent, awaiting response... 302 Found
    Location: https://github-production-release-asset-2e65be.s3.amazonaws.com/67702184/81204200-6ca5-11ea-8f19-3a5b8341b6e2?
    X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20200515%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-
    Date=20200515T072529Z&X-Amz-Expires=300&X-Amz-Signature=681f649c20ad2b0eabf80411650867d6db9144197a42a639a13162209f0fff91
    &X-Amz-SignedHeaders=host&actor_id=0&repo_id=67702184&response-content-disposition=attachment%3B%20filename%3DMagisk-v20
    .4.zip&response-content-type=application%2Foctet-stream [following]
    --2020-05-15 06:23:11--  https://github-production-release-asset-2e65be.s3.amazonaws.com/67702184/81204200-6ca5-11ea-8f1
    9-3a5b8341b6e2?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20200515%2Fus-east-1%2Fs3%2Faws4
    _request&X-Amz-Date=20200515T072529Z&X-Amz-Expires=300&X-Amz-Signature=681f649c20ad2b0eabf80411650867d6db9144197a42a639a
    13162209f0fff91&X-Amz-SignedHeaders=host&actor_id=0&repo_id=67702184&response-content-disposition=attachment%3B%20filena
    me%3DMagisk-v20.4.zip&response-content-type=application%2Foctet-stream
    Resolving github-production-release-asset-2e65be.s3.amazonaws.com... 52.216.134.219
    Connecting to github-production-release-asset-2e65be.s3.amazonaws.com|52.216.134.219|:443... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 5942417 (5.7M) [application/octet-stream]
    Saving to: 'Magisk-v20.4.zip'
    
    Magisk-v20.4.zip              100%[=================================================>]   5.67M  2.30MB/s    in 2.5s
    
    2020-05-15 06:23:15 (2.30 MB/s) - 'Magisk-v20.4.zip' saved [5942417/5942417]
    
    --2020-05-15 06:23:15--  https://forum.xda-developers.com/attachment.php?attachmentid=4480528
    Resolving forum.xda-developers.com... 104.18.19.88, 104.18.18.88
    Connecting to forum.xda-developers.com|104.18.19.88|:443... connected.
    HTTP request sent, awaiting response... 302 Moved Temporarily
    Location: https://dl.xda-cdn.com/4/4/8/0/5/2/8/sysrepart.zip?key=Wwfo1oqhImScVpTSzXTlzA&ts=1589527594 [following]
    --2020-05-15 06:23:16--  https://dl.xda-cdn.com/4/4/8/0/5/2/8/sysrepart.zip?key=Wwfo1oqhImScVpTSzXTlzA&ts=1589527594
    Resolving dl.xda-cdn.com... 104.27.191.76, 104.27.190.76
    Connecting to dl.xda-cdn.com|104.27.191.76|:443... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 782958 (765K) [application/zip]
    Saving to: 'sysrepart.zip'
    
    sysrepart.zip                 100%[=================================================>] 764.61K   591KB/s    in 1.3s
    
    2020-05-15 06:23:20 (591 KB/s) - 'sysrepart.zip' saved [782958/782958]
    
    Press any key to continue . . .
    
    1. boot the Nexus in fastboot mode: when OFF press POWER + VOLUME DOWN
    2. when in the bootloader menu, connect it to your PC
    3. wait a few seconds, then...
    Press any key to continue . . .
    Verify...
    Lock status...
    Flash TWRP? [y/n]: y
    sending 'recovery' (9054 KB)...
    OKAY [  0.297s]
    writing 'recovery'...
    OKAY [  0.516s]
    finished. total time: 0.812s
    
    
    1. on N7 select "Recovery mode" with volume button
    2. on N7 press power button to boot Recovery
    3. when you see TWRP main menu press any key to continue
    
    Wait...
    *
    Installing...
    *****
    Repartition? (no if already repartitioned) [y/n]: y
    Transferring: 782958/782958 (100%)
    2575 KB/s (782958 bytes in 0.296s)
    ***
    Wait...
    Installing zip file '/sdcard/sysrepart.zip'
    Checking for Digest file...
    ###############################
    # k23m Nexus 7'13 Repartition #
    ###############################
    Creating log and gpt backup
    Removing partitions
    Creating new partitions
    Formatting new partitions
    ###############################
    Operation completed. Copy backup gpt and log files from internal storage to PC before rebooting.
    ###############################
    Done processing script file
    ***
    
    ...REBOOTING
    When you see TWRP main menu press any key to continue...
    
    *****
    Proceed only if you really see TWRP main menu
    Press any key to continue . . .
    Do dirty flash? (no if unsure) [y/n]: n
    Wiping data without wiping /data/media ...
    Done.
    Formatting Cache using make_ext4fs...
    Done processing script file
    Formatting System using make_ext4fs...
    Done processing script file
    Wiping Cache & Dalvik...
    -- Dalvik Cache Directories Wipe Complete!
    Done processing script file
    Formatting cache using make_ext4fs...
    Done processing script file
    ***
    Transferring: 413523888/413523888 (100%)
    3649 KB/s (413523888 bytes in 110.640s)
    ***
    Wait...
    Installing zip file '/sdcard/lineage-17.1-20200515-UNOFFICIAL-flo.zip'
    Checking for Digest file...
    Warning: No file_contextsTarget: google/razor/flo:6.0.1/MOB30X/3036618:user/release-keysPatching system image unconditio
    nally...script succeeded: result was [1.000000]Done processing script file
    Install root? [y/n]: y
    Transferring: 5942417/5942417 (100%)
    3868 KB/s (5942417 bytes in 1.500s)
    ***
    Wait...
    Installing zip file '/sdcard/Magisk-v20.4.zip'
    Checking for Digest file...
    ***********************
    Magisk 20.4 Installer
    ***********************
    - Mounting /system
    - Device is system-as-root
    - Mounting /apex/com.android.conscrypt
    - Mounting /apex/com.android.media
    - Mounting /apex/com.android.media.swcodec
    - Mounting /apex/com.android.resolv
    - Mounting /apex/com.android.runtime
    - Mounting /apex/com.android.tzdata
    - System-as-root, keep dm/avb-verity
    - Target image: /dev/block/mmcblk0p14
    - Device platform: arm
    - Constructing environment
    - Adding addon.d survival script
    - Unpacking boot image
    - Checking ramdisk status
    - Stock boot image detected
    - Patching ramdisk
    - Repacking boot image
    - Flashing new boot image
    - Unmounting partitions
    - Done
    Done processing script file
    Install GApps? [y/n]: y
    Transferring: 101519489/101519489 (100%)
    3623 KB/s (101519489 bytes in 27.359s)
    ***
    Wait...
    Installing zip file '/sdcard/open_gapps-arm-10.0-pico-20200515.zip'
    Checking for Digest file...
    
    ##############################
      _____   _____   ___   ____
    /  _  \ |  __ \ / _ \ |  _ \
    |  / \  || |__) | |_| || | \ \
    | |   | ||  ___/|  __/ | | | |
    |  \ /  || |    \ |__  | | | |
    \_/ \_/ |_|     \___| |_| |_|
           ___   _   ___ ___  ___
          / __| /_\ | _ \ _ \/ __|
         | (_ |/ _ \|  _/  _/\__ \
          \___/_/ \_\_| |_|  |___/
    ##############################
    
    Open GApps pico 10.0 - 20200515
    
    - Mounting partitions
    
    - Gathering device & ROM information
    
    - Performing system space calculations
    
    - Removing existing/obsolete Apps
    
    - Installing core GApps
    
    - Installing swypelibs
    - Installing calsync
    - Installing googletts
    - Installing packageinstallergoogle
    
    - Miscellaneous tasks
    
    - Copying Log to /sdcard
    
    - Installation complete!
    
    - Unmounting partitions
    
    Done processing script file
    ***
    
    Done.
    
    Press any key to continue . . .
    
    SUPPORT - http://bit.ly/2C35sLZ
    
    Press any key to exit...

    _____________________________________________________
    REPARTITION

    sysrepart.zip - 1.1GB system, data is not wiped

    sysrepart-max.zip - 1.3GB system, data is not wiped, automatically downloaded by LOS 17.1 script

    sysrepart-flox.zip - 1.5GB system, data is wiped, 'vendor' partition is added, automatically downloaded by LOS 17.1-flox script

    sysrepart-ultimate.zip - 4GB system, data is wiped, 'vendor' partition is added, 'recovery' is enlarged to 64MB in-place and your current TWRP continues to function, flox compatible, automatically downloaded by LOS 18.1-flox script

    sysrepart-stock.zip - data is wiped, original partitions are restored

    • reboot immediately after repartition!
    • sysrepart-ultimate/stock work on any previous repartitions
    • sysrepart/max/flox work reliably only on original partitions
    • to install GApps larger than pico/nano you need sysrepart-ultimate
    • sysrepart-ultimate supports custom, oversized TWRP builds
    To recover from other repartition attempts, simply install sysrepart-ultimate if you intend to use LOS17+ or sysrepart-stock if you have other plans. If direct sysrepart installation is impossible due to TWRP or GPT issues, run the repartition.bat script. On rare occasions you may have to run RESTOCK and "Restore original partitions" with it.

    _____________________________________________________
    UPDATE version 2.5 changes:
    - update components' URLs
    - update relog.bat
    - remove installation scripts of no longer available ROMs
    - add update.bat cleanup script (run it once)
    - add repartition.bat script for repartition-only
    - add lineage-install-3.bat script

    Download CROSS2.zip and unzip it then download cross-update-XXX.zip and unzip it to the CROSS folder, overwrite existing files.

    :cool:(y)
    ____________________________________________________
    NOTE - most of the attached files are meant for direct script download. Except for CROSS and its updates do not download them manually unless you know what you are doing.
    3
    The 18.1 installation works well from a N7 that has been returned to original stock configuration. Restock->Cross worked fine. The opengapps you are downloading comes up as invalid or corrupt. I found it and applied it myself. Not a big deal, but I thought you should be aware that its broken in that regard. The rest is a snap. Thanks.
    Thank you for your feedback. I updated the GApps' URL in v2.4
    2
    ....Any comment on this? Would this worked correctly?
    Thanks for the suggestion. This code can be abbreviated, same as the other optional items:
    Code:
    set /p ANS=Do dirty flash? (no if unsure) [y/n]: || set ANS=n
    if /i !ANS!==n (
    adb shell twrp wipe /data
    )
    I added it to the v1.2 update.
    2
    The 18.1 installation works well from a N7 that has been returned to original stock configuration. Restock->Cross worked fine. The opengapps you are downloading comes up as invalid or corrupt. I found it and applied it myself. Not a big deal, but I thought you should be aware that its broken in that regard. The rest is a snap. Thanks.
    1
    Thank you for the great script, CROSS2 - worked perfect! What a help!