Teclast M40 Android 12L - XDA-University

Hi! I managed to get Android 12L running on the Teclast M40 by making some changes to the AOSP source code. A build of the modified AOSP source code can be downloaded from here, but I would not suggest trying it on other devices except the Teclast M40.
I will describe the changes I made to the AOSP source code so that you can reproduce this build.
1. change PRODUCT_SHIPPING_API_LEVEL from 30 to 29 in gsi_release.mk, since the Teclast M40 is shipped with Android 10.
Diff:
diff --git a/target/product/gsi_release.mk b/target/product/gsi_release.mk
index a2a29ed0fc..9a75bf8b3b 100644
--- a/target/product/gsi_release.mk
+++ b/target/product/gsi_release.mk
@@ -34,7 +34,7 @@ PRODUCT_ARTIFACT_PATH_REQUIREMENT_ALLOWED_LIST += \
# GSI should always support up-to-date platform features.
# Keep this value at the latest API level to ensure latest build system
# default configs are applied.
-PRODUCT_SHIPPING_API_LEVEL := 30
+PRODUCT_SHIPPING_API_LEVEL := 29
# Enable dynamic partitions to facilitate mixing onto Cuttlefish
PRODUCT_USE_DYNAMIC_PARTITIONS := true
2. change PRODUCT_CHARACTERISTICS from emulator to tablet in emulator_vendor.mk.
Diff:
diff --git a/target/product/emulator_vendor.mk b/target/product/emulator_vendor.mk
index b9f33abb9a..93ad9482b3 100644
--- a/target/product/emulator_vendor.mk
+++ b/target/product/emulator_vendor.mk
@@ -28,7 +28,7 @@ PRODUCT_PACKAGES += \
DEVICE_PACKAGE_OVERLAYS := device/generic/goldfish/overlay
-PRODUCT_CHARACTERISTICS := emulator
+PRODUCT_CHARACTERISTICS := tablet
PRODUCT_FULL_TREBLE_OVERRIDE := true
3. change EngineBase.cpp, so that fix audioserver crash during startup.
Diff:
diff --git a/services/audiopolicy/engine/common/src/EngineBase.cpp b/services/audiopolicy/engine/common/src/EngineBase.cpp
index 150a9a8e4f..9d5dff6d9f 100644
--- a/services/audiopolicy/engine/common/src/EngineBase.cpp
+++ b/services/audiopolicy/engine/common/src/EngineBase.cpp
@@ -165,16 +165,7 @@ engineConfig::ParsingResult EngineBase::loadAudioPolicyEngineConfig()
android::status_t ret = engineConfig::parseLegacyVolumes(config.volumeGroups);
result = {std::make_unique<engineConfig::Config>(config),
static_cast<size_t>(ret == NO_ERROR ? 0 : 1)};
- } else {
- // Append for internal use only volume groups (e.g. rerouting/patch)
- result.parsedConfig->volumeGroups.insert(
- std::end(result.parsedConfig->volumeGroups),
- std::begin(gSystemVolumeGroups), std::end(gSystemVolumeGroups));
}
- // Append for internal use only strategies (e.g. rerouting/patch)
- result.parsedConfig->productStrategies.insert(
- std::end(result.parsedConfig->productStrategies),
- std::begin(gOrderedSystemStrategies), std::end(gOrderedSystemStrategies));
ALOGE_IF(result.nbSkippedElement != 0, "skipped %zu elements", result.nbSkippedElement);
4. change AudioPolicyManager.cpp, so that fix audioserver crash when headset plugs in.
Diff:
diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
index 5a18762967..f3f50f513c 100644
--- a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
+++ b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
@@ -5349,15 +5349,7 @@ status_t AudioPolicyManager::checkOutputsForDevice(const sp<DeviceDescriptor>& d
}
if (state == AUDIO_POLICY_DEVICE_STATE_AVAILABLE) {
- // first call getAudioPort to get the supported attributes from the HAL
- struct audio_port_v7 port = {};
- device->toAudioPort(&port);
- status_t status = mpClientInterface->getAudioPort(&port);
- if (status == NO_ERROR) {
- device->importAudioPort(port);
- }
-
- // then list already open outputs that can be routed to this device
+ // first list already open outputs that can be routed to this device
for (size_t i = 0; i < mOutputs.size(); i++) {
desc = mOutputs.valueAt(i);
if (!desc->isDuplicated() && desc->supportsDevice(device)

Tried this just now, it fixed the headset jack and the audio is now properly routed. Thanks!

Is there a way to apply this fix without building another system.img?

I've installed it on my M40 and it works. Unfortunately, ADB no longer will function with it. Drivers are loaded correctly and it will work with any other GSI rom I put on the tablet. With this one, when performing adb devices, it comes up with a blank list.
Edit: Nevermind. Helps if I read more

Hi, I'm trying to get this working on my M40, but I'm not sure how to install.
My device is rooted using Magisk.
I tried flashing via fastboot:
Bash:
fastboot -S 100M flash system system.img
The process completed, but after booting I was still at Android 10.
Any advice?

SapuSeven said:
Hi, I'm trying to get this working on my M40, but I'm not sure how to install.
My device is rooted using Magisk.
I tried flashing via fastboot:
Bash:
fastboot -S 100M flash system system.img
The process completed, but after booting I was still at Android 10.
Any advice?
Click to expand...
Click to collapse
Flash,then switch your device to recovery mode using volume and power buttons, wipe all data and reboot.
There is no GMS on this system, and Bluetooth audio cannot be used, I would like to know how to solve it, thank you

When using this, is there any way to get Magisk and Gapps installed without twrp? As far as I know there is no twrp for Teclast m40 Pro, but this rom installed great.

HisokaRyodan said:
When using this, is there any way to get Magisk and Gapps installed without twrp? As far as I know there is no twrp for Teclast m40 Pro, but this rom installed great.
Click to expand...
Click to collapse
[For_Tablet]_PixelExperience_Plus_treble_arm64_bgN-12.1-20230514-01002-UNOFFICIAL

Related

[HOWTO][LINUX] Compile 9.png and xml files on the command-line without Eclipse

Developed and tested on Linux. Its a shell script that requires the Android SDK to be installed with the tools directory in the PATH variable.
INTRO
Android Binary Resource Compiler (abrc). This is a command-line
script to compile resources such as NinePatch PNGs and layout XML
files to Android binary format. The compiled resources named in the
command are extracted and saved out into a separate location. This
script was developed as an alternative to using Eclipse and "unzip" to
compile and extract NinePatch PNGs during the creation of custom
Android UI themes.
USAGE
abrc usage
abrc help
abrc [options] compile <project dir> <output dir> <resource file1> <resource file2> ...
abrc [options] setup <project dir>
OPTIONS:
-v Enable verbose output
-o Overwrite files without prompting
Click to expand...
Click to collapse
COMPILE
The compile operation compiles the resources in the <project dir>
location. This can be any Android Eclipse project directory which
contains the resources you wish to compile and extract. You can also
use this script's "setup" syntax to create a minimal project without
using Eclipse. See the SETUP section below for more information.
The named resource files <resource file1> <resource file2>, etc., are
then extracted into the <output directory>. Parent path components in
the resource file names are preserved and also determine the extracted
location within the output directory.
Example:
Consider the following path in "MyProject" which contains, among other
things, the statusbar_background.9.png file. This file is in the format
created by draw9patch program.
MyProject/res/drawable-mdpi/statusbar_background.9.png
The following command compiles the resources in MyProject and writes
the output to the MyTheme/framework-res directory using the leading
path components of the specified resource file(s). I.e., In this
example the resulting output file is
MyTheme/framework-res/res/drawable-mdpi/statusbar_background.9.png
abrc compile MyProject MyTheme/framework-res res/drawable-mdpi/statusbar_background.9.png
Click to expand...
Click to collapse
SETUP
The setup operation is completely optional. It creates a minimal
project skeleton for compiling resources. Eclipse projects can also
be used in the compile step above.
abrc setup MyProject
Click to expand...
Click to collapse
The above command creates the following directory structure/files:
MyProject/res/drawable
MyProject/res/drawable-mdpi
MyProject/res/drawable-hdpi
MyProject/res/layout
MyProject/AndroidManifest.xml
Click to expand...
Click to collapse
Copy your resources into the appropriate location within the project
and then use the compile operation to compile and extract the binary
files.
How does it work? It calls aapt and then unzip compiled resources? It's too small to do this directly.
Yes, that's what it does. It's just a shell script so you can look at it and see. There are some comments in the script that explains things.
It relies on the Android SDK which is assumed to already be installed.
Sent from my FroyoEris using XDA App
Nice! Makes a lot of things easier.
how can we use this script with windows 7?
h_zee13 said:
how can we use this script with windows 7?
Click to expand...
Click to collapse
There's a chance it might work using Cygwin (www.cygwin.com). Be sure to include the zip compression utilities package when installing.
this is great! i hated having to fire up eclipse for this. thanks!
This is a great tool. It was a little confusing at first, I don't think I had my path set up correctly. I've found the easiest way to use this, for me anyway, was to use the setup command and make a new folder with it, I deleted the m and ldpi folders because i'm not using them, copied my .9s into the drawable-hdpi folder, and from inside the "project" directory ran,
abrc compile . done res/drawable-hdpi/*
This compiles all the images in there and places them in the done folder.
Hope i'm not stepping on any toes, just what I found to be the easiest after placing aapt in /usr/tools/ and android.jar in /usr/ as I was kinda confused when I first downloaded it.
abrc for cygwin
h_zee13 said:
how can we use this script with windows 7?
Click to expand...
Click to collapse
I've edited this script and it works on cygwin. go here and download it. -> https ://plus.google.com/118270346235276777406/posts/EJGWifY5kTh
so im trying to get this to work but no luck if someone could help me
first i set paths
Code:
export PATH=${PATH}:/home/suphi/Documents/android-sdk-linux/tools:/home/suphi/Documents/android-sdk-linux/platform-tools:/home/suphi/Documents/android-sdk-linux/apktool
then i run this code
Code:
abrc compile before after res/drawable-hdpi/*
then i get this error
Code:
Using aapt to compile resources to /tmp/resources-82KEfVduDK.zip
W/asset ( 4429): Asset path /home/suphi/Documents/android-sdk-linux/android.jar is neither a directory nor file (type=1).
ERROR: Asset package include '/home/suphi/Documents/android-sdk-linux/android.jar' not found.
i also put the aapt from platform-tools into tools folder as i was getting errors before saying aapt was missing from tools folder
Splder said:
so im trying to get this to work but no luck if someone could help me
<snip>
i also put the aapt from platform-tools into tools folder as i was getting errors before saying aapt was missing from tools folder
Click to expand...
Click to collapse
There are several 'tools' folders. It belongs in the platforms/android-N/tools folder where the 'N' in android-N is a number (API level). Making copies might also cause problems, so I would try and figure out why its missing from the tools directory in the first place.
Ken
no need to use abrc to prepare compiled 9patch pngs, just using aapt in android-sdk is ok, the command line is like this: aapt.exe c -v -S /path/to/project -C /path/to/destination
Hi @kellinwood and ALL
Had being advised by your awesome work by @Modding.MyMind here, I've came to ask for your orientation.
At the moment, AFAIK, we are uncapable to compile xml's without providing all the resources addressed by them.
My objective here is try to compile modded XMLs only. While trying to accomplish this task, I've got to the following Python script that will generate all the /res/values/*.xml's that addresses local resources.
Code:
import os
import shutil
input_folder = '/home/Kdio/apk/Phone'
output_folder = os.path.join(os.path.dirname(os.path.abspath(__file__)), "out")
if not os.path.isdir(output_folder):
os.mkdir(output_folder)
tokens = {}
xmlExist = {}
for root, dirs, files in os.walk(input_folder):
for f in files:
inputFile = os.path.join(root, f)
filename, ext = os.path.splitext(inputFile)
if (ext != '.xml'):
continue
xmlExist[os.path.basename(inputFile)] = 1
with open(inputFile, 'r') as f:
for line in f:
token = ''
read_token = False
for c in line:
if (c == '@'):
read_token = True
continue
if (read_token is True):
if (c == '"'):
read_token = False
tokens[token] = 1
token = ''
else:
token += c
f.close()
xmls = {}
for token in sorted(tokens):
if (token == 'null'):
continue
if (':' in token):
continue
#token = token.split(':')[-1]
head, tail = token.split('/')
if (head == 'anim'):
continue
if ((tail + '.xml') in xmlExist.keys()):
continue
if (not head in xmls.keys()):
xmls[head] = {}
xmls[head][tail] = 1
#for xml in xmls:
# for res in xmls[xml]:
# print(xml + ' -> ' + res)
for xml in xmls:
xmlText = '<?xml version="1.0" encoding="utf-8"?>\n<resources>\n'
for res in xmls[xml]:
if (xml == 'bool'):
xmlText += ' <bool name="' + res + '">false</bool>\n'
if ((xml == 'id') or (xml == 'drawable') or (xml == 'style') or (xml == 'layout')):
xmlText += ' <item type="' + xml + '" name="' + res + '">false</item>\n'
if (xml == 'array'):
xmlText += ' <string-array name="' + res + '">\n <item>array-dummy</item>\n </string-array>\n'
if (xml == 'attr'):
xmlText += ' <attr name="' + res + '" format="string" />\n'
if (xml == 'color'):
xmlText += ' <color name="'+ res + '">#00000000</color>\n'
if (xml == 'dimen'):
xmlText += ' <dimen name="' + res + '">1.0dip</dimen>\n'
if (xml == 'integer'):
xmlText += ' <integer name="' + res + '">1</integer>\n'
if (xml == 'plural'):
xmlText += ' <plurals name="' + res + '">\n <item quantity="other">a</item>\n <item quantity="one">b</item>\n </plurals>\n'
if (xml == 'string'):
xmlText += ' <string name="' + res + '">a</string>\n'
if (xml == 'fraction'):
xmlText += ' <fraction name="' + res + '">1%</fraction>\n'
xmlText += '</resources>\n'
f = open(os.path.join(output_folder, xml + 's.xml'), 'w')
f.write(xmlText)
f.close
Please edit 'input_folder' accordingly.
Then, issuing the below command:
Code:
aapt p -f -M onlyXMLs/AndroidManifest.xml -F onlyXMLs.zip -S onlyXMLs/res -I android.jar
What I get from it now are errors regarding external resources references not being found only.
This is exactly the point where my shallow knowledge ends ...
Could you (and all) someway point me the light (if there is any) how could we 'dummy' external resources as done with local ones?
Thank you all.
Nice regards.
.

[Q] How to enable WifiAP / tethering programmatically from within app on SGS I9000?

I try to activate WifiAP (wifi tethering) via my application code. Since there is no direct API for it, it needs to be done via reflection.
Using the approach as mentioned on StackOverflow.com.
It works fine on Nexus One, HTC Desire, Huawei Ideos (all running 2.2.x), but it doesn't run on the SGS with 2.2.1.
Checking the android.net.wifi.WifiManager class via reflection, I see that Samsung has obviously modified the class and it has 57 instead of 37 methods.
Unfortunately the modified WifiManager class is not open sourced by Samsung and the error messages don't give any details or stack trace.
I am looking for somebody who can enable WifiAP activation programmatically on the SGS, eventually by modifying the underlying system, since I'm myself am an application developer, not working on system level. Also considering contract work!
There are two things I am trying:
1) activate WifiAP directly via reflection:
Code:
WifiManager wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE);
Method[] wmMethods = wifi.getClass().getDeclaredMethods();
Log.d(TAG, "enableMobileAP methods " + wmMethods.length);
for(Method method: wmMethods){
Log.d(TAG, "enableMobileAP method.getName() " + method.getName());
if(method.getName().equals("setWifiApEnabled")) {
WifiConfiguration netConfig = new WifiConfiguration();
netConfig.SSID = "MyWifiAP";
netConfig.allowedAuthAlgorithms.set(WifiConfiguration.AuthAlgorithm.OPEN);
netConfig.allowedProtocols.set(WifiConfiguration.Protocol.RSN);
netConfig.allowedProtocols.set(WifiConfiguration.Protocol.WPA);
netConfig.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE);
try {
Log.d(TAG, "enableMobileAP try: ");
method.invoke(wifi, netConfig, enabled);
if (netConfig.wepKeys!=null && netConfig.wepKeys.length>=1)
Log.d(TAG, "enableMobileAP key : " + netConfig.wepKeys[0]);
Log.d(TAG, "enableMobileAP enabled: ");
mIsWifiEnabled = enabled;
} catch (Exception e) {
Log.e(TAG, "enableMobileAP failed: ", e);
}
}
}
Attached are the logfiles I am getting on Nexus One (success) and SGS (failure).
The noticable part in the SGS log are maybe these lines:
Code:
D/WifiService( 2818): setWifiApEnabled: allowWifiAp: true
E/WifiService( 2818): setWifiApEnabledState 2
E/SoftapController( 2681): Softap already stopped
E/WifiService( 2818): Exception in stopAccessPoint()
E/WifiService( 2818): setWifiApEnabledState 4
D/WifiAp (23523): enableMobileAP key : null
2) another thing I try - since the modified SGS WifiManager (only that one) has a method named 'showApDialog' without any parameter taken, I try to call that method, but this also just gives an 'Error' in the log without further explanation.)
Code:
WifiManager wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE);
Method[] wmMethods = wifi.getClass().getDeclaredMethods();
Log.d(TAG, "enableMobileAP methods " + wmMethods.length);
for(Method method: wmMethods){
Log.d(TAG, "enableMobileAP method.getName() " + method.getName());
if(method.getName().equals("showApDialog")) {
WifiConfiguration netConfig = new WifiConfiguration();
try {
method.invoke(wifi);
} catch (Exception e) {
Log.e("Main", "Can't open ap dialog.", e);
}
}
}
I have been able to enable an existing configuration by passing null as the WifiConfiguration parameter to the setWifiApEnabled method.
I had the same problems as you when I tried to use this function to create a new configuration. I also failed when I tried to pass the existing configuration as a parameter, after invoking getWifiApConfiguration.
I noticed in the Android source code that there is a similar function called setWifiApConfiguration, but calling wifiManager.getClass().getMethod("setWifiApConfiguration") throws NoSuchMethodException when I run it on my SGS.
I also wondered if I can use addNetwork to create a new configuration, but suspect it is only for connecting to APs, rather than creating one.
As I only wanted to toggle the existing configuration, which I have now achieved, I stopped investigating at this point.
Hope that helps,
Good luck...
Yes, I've also got it to work meanwhile but didn't update this thread. You're right, the problem were the configuration, which had to be left empty. Cheers
thank you for sharing this, it really made my day
it seems that (on Android 2.3.4) it only works if you first disable the WiFi (Nexus One).

[DEV] Kernel Injector

I was teaching myself CM7 kernel build process yesterday (more here) and stumbled across AnyKernel. Big thanks to Koush! However whatever I tried I was not able to get rid of segmentation fault error in unpackbootimg. But I liked the AnyKernel idea so much that I cooked up my own version of it. Lets call it Kernel Injector. Whenever you want to deploy your kernel image you don't have to mess around with read-split-merge-write-boot-image procedure any more. This is all done by the update script now:
Code:
ui_print("");
ui_print("Kernel Injector by Aprold");
mount("ext4", "EMMC", "/dev/block/mmcblk0p8", "/system");
ui_print("Extracting files...");
package_extract_file("zImage", "/tmp/zImage");
package_extract_dir("modules", "/system/lib/modules");
package_extract_file("kinjector", "/tmp/kinjector");
set_perm(0, 0, 0777, "/tmp/kinjector");
ui_print("Injecting kernel...");
assert(run_program("/system/bin/dd", "if=/dev/block/mmcblk0p3", "of=/tmp/boot.img")=="0");
assert(run_program("/tmp/kinjector", "/tmp/boot.img", "/tmp/zImage", "/tmp/boot.new")=="0");
assert(run_program("/system/bin/dd", "if=/tmp/boot.new", "of=/dev/block/mmcblk0p3")=="0");
unmount("/system");
ui_print("Done!");
Boot image is read and written using system's own dd. Combining kernel image with existing ramdisk is the job for kinjector:
Code:
/* Kernel Injector by Aprold */
#include <stdio.h>
#include <stdlib.h>
#include <memory.h>
int main(int argc, char **argv) {
FILE *in, *out;
unsigned char *header_buf, *kernel_buf, *ramdisk_buf;
unsigned page_size, *kernel_size, kernel_buf_size, ramdisk_size, ramdisk_buf_size;
if (argc < 3) {
printf("Usage: %s <existing boot image> <new kernel image> [new boot image]\n", argv[0]);
return 1;
}
// open existing boot image for reading header and ramdisk from there
if (in = fopen(argv[1], "rb")) {
// get page size from input file
fseek(in, 36, SEEK_SET);
fread(&page_size, sizeof(page_size), 1, in);
fseek(in, 0, SEEK_SET);
// read header
header_buf = (unsigned char*)malloc(page_size);
fread(header_buf, page_size, 1, in);
// get kernel and ramdisk sizes from header
kernel_size = (unsigned*)header_buf + 2;
ramdisk_size = *((unsigned*)header_buf + 4);
// read ramdisk
ramdisk_buf_size = (ramdisk_size / page_size + 1) * page_size;
ramdisk_buf = (unsigned char*)malloc(ramdisk_buf_size);
fseek(in, (*kernel_size / page_size + 2) * page_size, SEEK_SET);
fread(ramdisk_buf, ramdisk_buf_size, 1, in);
fclose(in);
// open new kernel image
if (in = fopen(argv[2], "rb")) {
// get kernel size
fseek(in, 0, SEEK_END);
*kernel_size = ftell(in);
fseek(in, 0, SEEK_SET);
// read kernel
kernel_buf_size = (*kernel_size / page_size + 1) * page_size;
kernel_buf = (unsigned char*)malloc(kernel_buf_size);
fread(kernel_buf, *kernel_size, 1, in);
memset(kernel_buf + *kernel_size, 0, kernel_buf_size - *kernel_size);
// frite new boot image
out = fopen(argv[argc > 3 ? 3 : 1], "wb");
fwrite(header_buf, page_size, 1, out);
fwrite(kernel_buf, kernel_buf_size, 1, out);
fwrite(ramdisk_buf, ramdisk_buf_size, 1, out);
fclose(out);
free(kernel_buf);
}
else {
printf("Failed to open kernel image %s\n", argv[2]);
return 2;
}
free(header_buf);
free(ramdisk_buf);
}
else {
printf("Failed to open boot image %s\n", argv[1]);
return 1;
}
return 0;
}
Compile it like that:
Code:
/usr/bin/arm-linux-gnueabi-gcc -static -o kinjector kinjector.c
Included is an update.zip which you can use as a reference for your own script. Tested with my phone and I even managed to not brick it.
All comments and suggestions are most welcome!
- Aprold
Nice.
You succeeded where I have failed.
Here was the template I was trying to have working for eMMC devices:
http://dl.dropbox.com/u/13427114/AnyKernel-OB-test.7z
knzo said:
Here was the template I was trying to have working for eMMC devices
Click to expand...
Click to collapse
unpackbootimg from there works just fine. If I had found this working binary before I probably would not have written my own. Still, I'm happy that I did.
Good work dudes!
But the question is... if you want to do changes to ramdisk too? Would Anykernel method be able to get rid of it?
Regards.
Huexxx said:
Would Anykernel method be able to get rid of it?
Click to expand...
Click to collapse
Do you mean replacing kernel and/or ramdisk inside boot image? I must say, I don't know much about ramdisk yet, but it would be simple task to update kinjector to allow both parts replaced. However, then I must change the name of the tool to binjector
Hi,
the question is (I can try by myself, but I've no time ATM), apart from zImage, does the script extract the ramdisk into a folder?
If in the process the ramdisk is extracted, it's possible to make mods to the files with the updater-script.
Regards.
The purpose of AnyKernel (and this kernel injector) is to maximize compatibility by only flashing the zImage and keeping the ramdisk out of it. For this, during the flash process it will unpack boot.img into ramdisk + zImage and replace the latter. But of course, it's possible to change the script to also replace files in the ramdisk (such as init.rc) - at least in AnyKernel - but it somewhat defeats the whole purpose of it.
Huexxx said:
does the script extract the ramdisk into a folder?
Click to expand...
Click to collapse
Yes, unpackbootimg does. But inside extracted compressed ramdisk file there is a ramdisk image. I don't see how you can modify this with update-script.

[RECOVERY][v500] TWRP 2.8.6.0 - No loki needed

Team Win Recovery Project 2.x, or twrp2 for short, is a custom recovery built with ease of use and customization in mind. Its a fully touch driven user interface no more volume rocker or power buttons to mash. The GUI is also fully XML driven and completely theme-able. You can change just about every aspect of the look and feel.
TWRP 2.8.6.0 Changelog: http://teamw.in/site/update/2015/03/26/twrp-2.8.6.0-released.html
Why another thread of TWRP?
This build of TWRP doesn't need loki to bypass the bootloader, and it works with both 4.2 and 4.4 bootloaders. It also has the advantage that when you boot the device into recovery it doesn't show that nasty bootloader warning. The kernel in this build is based on cm-12.1 official, but it has the backlight adapted for 4.4 bootloader. You can also use it with a 4.2 bootloader, but you'll probably have brightness issues.
Image: https://www.androidfilehost.com/?fid=95916177934551824
Flashable zip: https://www.androidfilehost.com/?fid=95916177934551825
Install instructions: flash the zip from recovery or install the image using THIS APP (needs root).
XDA:DevDB Information
TWRP v500, Tool/Utility for the LG G Pad 8.3
Contributors
jsevi83
Source Code: https://github.com/awifi-dev/twrp_device_lge_v500
Version Information
Status: Stable
Created 2015-04-07
Last Updated 2015-04-30
Thanks! Working so far...
This is very cool. How does Bump work? Is Bump a utility, similar to loki?
Are you using Open Bump?
http://forum.xda-developers.com/lg-g2/orig-development/tool-bump-sign-boot-images-t2950595
Deltadroid said:
This is very cool. How does Bump work? Is Bump a utility, similar to loki?
Are you using Open Bump?
http://forum.xda-developers.com/lg-g2/orig-development/tool-bump-sign-boot-images-t2950595
Click to expand...
Click to collapse
Open Bump. It's just a python script. As you can see, it's very easy to implement, I think every custom rom/recovery should be using this.
This is how I added it to my recovery repo: https://github.com/awifi-dev/twrp_device_lge_v500/commit/090f1930fe5b0feaada35b6ba1abc5cbd05a8f72
This is how I added it to my cm repo: https://github.com/awifi-dev/androi...mmit/7a8418e656cbc0862a23e3a95ece02cd3c6c277d
That is awesome. I see that python script has some magic signing key from lg embedded in it. Does Open Bump require any modifications to work with our device images?
It would be super cool if there was c based version so that I could create a flashable script to remove loki from the boot image and sign with bump to remove that ugly boot loader error message on boot up.
Something I could flash after applying a nightly update. Just like the script I just made for setting the kernel into permissive mode.
I can't seem to flash roms with this.
E: Errror executing updater binary in zip xxxx
@jsevi83
Do you have more commits for v500 to change the cm kernel update system to remove the loki stuff? Great work!
---------- Post added at 12:25 PM ---------- Previous post was at 12:22 PM ----------
Everyone flashing this should realize that your aboot must still be loki exploitable because of the way cm installs it's kernel. I believe that the cm install script calls loki to install the boot.img.
So, this works on stock 20d version with root (Towelroot) and Flashify? I didn't get TWRP with the tons of the methods found here on xda, and also softbricked the tablet.
I will not try again unless this method really works!
Flashify will try to use loki. Don't use that. Use the command line with the dd command.
---------- Post added at 12:30 PM ---------- Previous post was at 12:27 PM ----------
Btw, stock 20d won't work on cm without an exploitable aboot.
ASW1 said:
E: Errror executing updater binary in zip
Click to expand...
Click to collapse
I keep getting this error no matter what ROM I try to flash.
I am basically stuck now with a tablet that will only boot into TWRP 2.8.6, I messed up the system so TWRP is all I have now.
Any suggestions about what to do?
Should I maybe use TWRP to flash CMW and try that instead?
edit: tried flashing CMW but it won't work; even then I get the same error message.
So all I have now is TWRP that fails to flash anything....
ASW1 said:
I keep getting this error no matter what ROM I try to flash.
I am basically stuck now with a tablet that will only boot into TWRP 2.8.6, I messed up the system so TWRP is all I have now.
Any suggestions about what to do?
Should I maybe use TWRP to flash CMW and try that instead?
edit: tried flashing CMW but it won't work; even then I get the same error message.
So all I have now is TWRP that fails to flash anything....
Click to expand...
Click to collapse
See this
http://forum.xda-developers.com/showthread.php?p=48942830
When I softbricked my tablet this solved my problem.
I can confirm that this method works beautifully. Many many thanks to the OP.
I just wanted to also confirm that the current state of the Open Bump project requires the following patch to work properly with v500 kernel parameters.
Code:
--- open_bump.py 2014-11-23 21:56:00.000000000 +0100
+++ open_bump.v500.py 2015-04-08 21:28:17.098864000 +0200
@@ -27,6 +27,10 @@
# Proof of Concept
POC = False
+if POC:
+ from Crypto.Cipher import AES
+ import hashlib
+
usage = """\
Usage: open_bump.py [-ha] "<image_file>" "<output_image>"
@@ -35,22 +39,29 @@
-a/--apend image_file - <required> if in append mode, the <image_file> is appended rather than <output_file> being generated\
"""
+lg_key = "b5e7fc2010c4a82d6d597ba040816da7832e0a5679c81475a0438447b711140f"
+lg_iv = "[email protected]|[email protected]"
lg_magic = "41a9e467744d1d1ba429f2ecea655279"
+lg_dec_magic = "696e6877612e77651000000047116667"
-def get_kernel_size(image_name):
- page_size = get_page_size(image_name)
- f_image = open(image_name, 'a+b')
- paged_kernel_size = get_size_from_kernel(f_image, page_size, 8)
- paged_ramdisk_size = get_size_from_kernel(f_image, page_size, 16)
- paged_second_size = get_size_from_kernel(f_image, page_size, 24)
- if paged_second_size <= 0:
- paged_second_size = 0
- paged_dt_size = get_size_from_kernel(f_image, page_size, 40)
- if paged_dt_size <= 0:
- paged_dt_size = 0
- f_image.close()
- return page_size + paged_kernel_size + paged_ramdisk_size + paged_second_size + paged_dt_size
+def generate_signature(image_hash):
+ # the iv and key were extracted from the lg g2 aboot.img. I can explain how to find it on request.
+ iv = lg_iv
+ key = binascii.unhexlify(lg_key)
+ # this "magic" number was found after decrypting the bumped images
+ # Without codefire, this would not have been possible as I can find no reference in
+ # the images of the g2 or the g3
+ magic = binascii.unhexlify(lg_magic)
+ image_hash = binascii.unhexlify(image_hash) # insert your hash here
+ # the structure of the signature in bump starts with a magic number, then seemingly random
+ # bytes. 2 zeros follow, then the hash of the image, then 6 zeros, then 512 bytes of random data again
+ data = magic + os.urandom(16) + '\x00'*2 + image_hash + '\x00'*6 + os.urandom(512)
+ # this is then padded to fill the needed 1024 bytes
+ padded_data = data + '\x00'*(1024-len(data))
+ # AES-256 is then used to encrypt the above data
+ cipher = AES.new(key, AES.MODE_CBC, iv)
+ return cipher.encrypt(padded_data)
def bumped(image_data):
@@ -80,10 +91,18 @@
image_size = os.path.getsize(image_name)
num_pages = image_size / page_size
- calculated_size = get_kernel_size(image_name)
-
f_image = open(image_name, 'a+b')
+ paged_kernel_size = get_size_from_kernel(f_image, page_size, 8)
+ paged_ramdisk_size = get_size_from_kernel(f_image, page_size, 16)
+ paged_second_size = get_size_from_kernel(f_image, page_size, 24)
+ if paged_second_size <= 0:
+ paged_second_size = 0
+ paged_dt_size = get_size_from_kernel(f_image, page_size, 40)
+ if paged_dt_size <= 0:
+ paged_dt_size = 0
+ calculated_size = page_size + paged_kernel_size + paged_ramdisk_size + paged_second_size + paged_dt_size
+
if calculated_size > image_size:
print("Invalid image: %s: calculated size greater than actual size" % image_name)
f_image.close()
@@ -91,8 +110,7 @@
if image_size > calculated_size:
difference = image_size - calculated_size
if difference not in [page_size, page_size*2]:
- if difference not in [1024, page_size + 1024, 2 * page_size + 1024,
- 16, page_size + 16, 2 * page_size + 16]:
+ if difference not in [1024, page_size + 1024, 2 * page_size + 1024]:
print("Image already padded. Attempting to remove padding...")
print("Beware: this may invalidate your image.")
i = num_pages - 1
@@ -128,7 +146,11 @@
print("Image already bumped")
finish(out_image)
pad_image(out_image)
- magic = binascii.unhexlify(lg_magic)
+ if POC:
+ sha1sum = get_sha1(out_image)
+ magic = generate_signature(sha1sum)
+ else:
+ magic = binascii.unhexlify(lg_magic)
with open(out_image, 'a+b') as f_out_image:
f_out_image.write(magic)
finish(out_image)
ASW1 said:
I keep getting this error no matter what ROM I try to flash.
I am basically stuck now with a tablet that will only boot into TWRP 2.8.6, I messed up the system so TWRP is all I have now.
Click to expand...
Click to collapse
Something else I noticed after a failed flash:
"assert failed: run_program("/tmp/loki/sh") == 0
(I did use flashify to install 2.8.6.0)
Fyi for those new to bump... (I have a g3, been with it from the beginning). Bump rom flashing requires the rom zip boot (kernel) to be bumped. All rom developers will need to adopt this if we are going to switch from loki to bump. All current lp builds for other lg devices do not have "bumpable" bootloaders due to bump being open sourced (cooperation with lg failed with its open release and they patched it), so once the lp updates become standard, the jb boots may cause problems for aosp while the kk one is working, so this will likely be the preferred method for us down the road, but all new roms will need to be updated accordingly. I can already see this is going to get messy for many that aren't up to speed, and some new guides will need to be made once we get the methods working.
annoyingduck said:
Fyi for those new to bump... (I have a g3, been with it from the beginning). Bump rom flashing requires the rom zip boot (kernel) to be bumped. All rom developers will need to adopt this if we are going to switch from loki to bump. All current lp builds for other lg devices do not have "bumpable" bootloaders due to bump being open sourced (cooperation with lg failed with its open release and they patched it), so once the lp updates become standard, the jb boots may cause problems for aosp while the kk one is working, so this will likely be the preferred method for us down the road, but all new roms will need to be updated accordingly. I can already see this is going to get messy for many that aren't up to speed, and some new guides will need to be made once we get the methods working.
Click to expand...
Click to collapse
Officially, cm will never adopt this method because of the keys that it contains. But, my goal is to make a flashable zip that will automatically convert a loki kernel to a bumped kernel.
We just need to convert this python script to a standalone c application so that I can package it.
---------- Post added at 10:45 AM ---------- Previous post was at 10:30 AM ----------
ASW1 said:
Something else I noticed after a failed flash:
"assert failed: run_program("/tmp/loki/sh") == 0
(I did use flashify to install 2.8.6.0)
Click to expand...
Click to collapse
You still need to have a loki exploitable aboot to install official CyanogenMod.
@Deltadroid: you told us to not use flashify to update twrp... so best method is flash twrp-(bump edition) inside twrp (loki edition)?
and then flash only bump compliant rom? (like euphoria-os, sure other dev will convert their rom to this new method, except CM official build as you mentioned earlier)
odjinan said:
@Deltadroid: you told us to not use flashify to update twrp... so best method is flash twrp-(bump edition) inside twrp (loki edition)?
and then flash only bump compliant rom? (like euphoria-os, sure other dev will convert their rom to this new method, except CM official build as you mentioned earlier)
Click to expand...
Click to collapse
If you already have a custom recovery installed, then the safest method is to use the flashable zip to install the bumped version of twrp. Just flash it in your recovery to install the new bumped recovery.
If you don't have a custom recovery installed yet, but you have root, then you can use the dd command to flash the boot image to your boot partition.
---------- Post added at 02:12 PM ---------- Previous post was at 01:21 PM ----------
The ROMs you flash don't need to be "bump compliant" if you have a loki exploitable aboot.
thank for the quick reply!
I flashed the zip version from OP and it working well. No more alert on boot screen~
annoyingduck said:
Fyi for those new to bump... (I have a g3, been with it from the beginning). Bump rom flashing requires the rom zip boot (kernel) to be bumped. All rom developers will need to adopt this if we are going to switch from loki to bump. All current lp builds for other lg devices do not have "bumpable" bootloaders due to bump being open sourced (cooperation with lg failed with its open release and they patched it), so once the lp updates become standard, the jb boots may cause problems for aosp while the kk one is working, so this will likely be the preferred method for us down the road, but all new roms will need to be updated accordingly. I can already see this is going to get messy for many that aren't up to speed, and some new guides will need to be made once we get the methods working.
Click to expand...
Click to collapse
The best option would be to use kitkat bootloader and bump for all custom roms and recoveries. It's very easy, I already shared the commits needed to implement this, and I could make a flashable zip with kitkat bootloader so everyone can easily install it.
Deltadroid said:
Officially, cm will never adopt this method because of the keys that it contains. But, my goal is to make a flashable zip that will automatically convert a loki kernel to a bumped kernel.
We just need to convert this python script to a standalone c application so that I can package it.
---------- Post added at 10:45 AM ---------- Previous post was at 10:30 AM ----------
You still need to have a loki exploitable aboot to install official CyanogenMod.
Click to expand...
Click to collapse
That's not true, some LG devices like v400 already use bump in CyanogenMod (officially), check this:
https://github.com/CyanogenMod/andr...mmit/6a647d5664df1bada7d1a36abe8faad79e0096cb
If they have it we could also get it.
Deltadroid said:
I can confirm that this method works beautifully. Many many thanks to the OP.
I just wanted to also confirm that the current state of the Open Bump project requires the following patch to work properly with v500 kernel parameters.
Code:
--- open_bump.py 2014-11-23 21:56:00.000000000 +0100
+++ open_bump.v500.py 2015-04-08 21:28:17.098864000 +0200
@@ -27,6 +27,10 @@
# Proof of Concept
POC = False
+if POC:
+ from Crypto.Cipher import AES
+ import hashlib
+
usage = """\
Usage: open_bump.py [-ha] "<image_file>" "<output_image>"
@@ -35,22 +39,29 @@
-a/--apend image_file - <required> if in append mode, the <image_file> is appended rather than <output_file> being generated\
"""
+lg_key = "b5e7fc2010c4a82d6d597ba040816da7832e0a5679c81475a0438447b711140f"
+lg_iv = "[email protected]|[email protected]"
lg_magic = "41a9e467744d1d1ba429f2ecea655279"
+lg_dec_magic = "696e6877612e77651000000047116667"
-def get_kernel_size(image_name):
- page_size = get_page_size(image_name)
- f_image = open(image_name, 'a+b')
- paged_kernel_size = get_size_from_kernel(f_image, page_size, 8)
- paged_ramdisk_size = get_size_from_kernel(f_image, page_size, 16)
- paged_second_size = get_size_from_kernel(f_image, page_size, 24)
- if paged_second_size <= 0:
- paged_second_size = 0
- paged_dt_size = get_size_from_kernel(f_image, page_size, 40)
- if paged_dt_size <= 0:
- paged_dt_size = 0
- f_image.close()
- return page_size + paged_kernel_size + paged_ramdisk_size + paged_second_size + paged_dt_size
+def generate_signature(image_hash):
+ # the iv and key were extracted from the lg g2 aboot.img. I can explain how to find it on request.
+ iv = lg_iv
+ key = binascii.unhexlify(lg_key)
+ # this "magic" number was found after decrypting the bumped images
+ # Without codefire, this would not have been possible as I can find no reference in
+ # the images of the g2 or the g3
+ magic = binascii.unhexlify(lg_magic)
+ image_hash = binascii.unhexlify(image_hash) # insert your hash here
+ # the structure of the signature in bump starts with a magic number, then seemingly random
+ # bytes. 2 zeros follow, then the hash of the image, then 6 zeros, then 512 bytes of random data again
+ data = magic + os.urandom(16) + '\x00'*2 + image_hash + '\x00'*6 + os.urandom(512)
+ # this is then padded to fill the needed 1024 bytes
+ padded_data = data + '\x00'*(1024-len(data))
+ # AES-256 is then used to encrypt the above data
+ cipher = AES.new(key, AES.MODE_CBC, iv)
+ return cipher.encrypt(padded_data)
def bumped(image_data):
@@ -80,10 +91,18 @@
image_size = os.path.getsize(image_name)
num_pages = image_size / page_size
- calculated_size = get_kernel_size(image_name)
-
f_image = open(image_name, 'a+b')
+ paged_kernel_size = get_size_from_kernel(f_image, page_size, 8)
+ paged_ramdisk_size = get_size_from_kernel(f_image, page_size, 16)
+ paged_second_size = get_size_from_kernel(f_image, page_size, 24)
+ if paged_second_size <= 0:
+ paged_second_size = 0
+ paged_dt_size = get_size_from_kernel(f_image, page_size, 40)
+ if paged_dt_size <= 0:
+ paged_dt_size = 0
+ calculated_size = page_size + paged_kernel_size + paged_ramdisk_size + paged_second_size + paged_dt_size
+
if calculated_size > image_size:
print("Invalid image: %s: calculated size greater than actual size" % image_name)
f_image.close()
@@ -91,8 +110,7 @@
if image_size > calculated_size:
difference = image_size - calculated_size
if difference not in [page_size, page_size*2]:
- if difference not in [1024, page_size + 1024, 2 * page_size + 1024,
- 16, page_size + 16, 2 * page_size + 16]:
+ if difference not in [1024, page_size + 1024, 2 * page_size + 1024]:
print("Image already padded. Attempting to remove padding...")
print("Beware: this may invalidate your image.")
i = num_pages - 1
@@ -128,7 +146,11 @@
print("Image already bumped")
finish(out_image)
pad_image(out_image)
- magic = binascii.unhexlify(lg_magic)
+ if POC:
+ sha1sum = get_sha1(out_image)
+ magic = generate_signature(sha1sum)
+ else:
+ magic = binascii.unhexlify(lg_magic)
with open(out_image, 'a+b') as f_out_image:
f_out_image.write(magic)
finish(out_image)
Click to expand...
Click to collapse
so for a bumped kernel to work we need to use your modified version of the script?
i still dont get the concept

[ROM][UNOFFICIAL] LineageOS-18.1 [mako]

HTML:
#include "std_disclaimer.h"
/*
* Your warranty is now void.
*
* I am not responsible for bricked devices, dead SD cards,
* thermonuclear war, or you getting fired because the alarm app failed. Please
* do some research if you have any concerns about features included in this ROM
* before flashing it! YOU are choosing to make these modifications, and if
* you point the finger at me for messing up your device, I will laugh at you.
*/
IMPORTANT: You need to have a /system partition at least 1272 MB size to flash this ROM.
A few options to repartition the device:
https://forum.xda-developers.com/nexus-4/general/guide-increase-nexus-4s-partition-space-t3800264
https://forum.xda-developers.com/nexus-4/orig-development/repartition-nexus-4-repartition-t3844383
Also quick and easy repartitioning script for flashing on stock partition table only: https://drive.google.com/file/d/1GNbxlqG78WYOeXBxgmfGgMmsf02KMVOX/view?usp=sharing
Use at your own risk.
Any repartitioning is done at your own risk.
Works:
- WiFi
- Bluetooth
- RIL
- Camera
- GPS
- Sensors
- Audio
- NFC
Doesn't work:
- L1 Widevine DRM
- Slimport
Flashing Instruction:
1. Backup all your data (Important)
2. Wipe system, data and cache.
3. Flash the ROM and Gapps.
4. Reboot.
Downloads:
ROM: https://drive.google.com/open?id=1e-mO4qaEP1y0wrBbbPwsISdJuW_TeLQo
Gapps: https://opengapps.org/
Sources:
Device: https://github.com/voron00/android_device_lge_mako
Kernel: https://github.com/voron00/android_kernel_lge_mako
Vendor: https://github.com/voron00/proprietary_vendor_lge
Credits:
- LineageOS team.
- @Ziyan for his great work on camera and other things.
- @Clamor repartitioning scripts.
- If i forgot someone, please tell me.
Contributors
voron00
Source Code: https://github.com/LineageOS
Reserved.
This looks great so far, enough that I am extremely tempted to switch over from CRDroid (but alas, I do not have the time).
Do you think that you may be able to take care of the GPS issue (although GPS works fine on CRDroid (perhaps you may want to take a look at whatever changes they had done in the matter from LOS).
By the way, do you have any idea why GLONASS does not work properly for me?
My phone detects GLONASS satellites, however it fails to connect to them.
This may help you out with your build of LOS15.1.
Thanks Man! You bring back the legend (Nexus 4) phone new life
Btw can you give more detail to install Gapps on this ROM? because I've still got a problem Error #70 Insufficient Space Available in System Partition even with Pico and Gapps-Config. Thanks, Man!
Awesome work, thank you! I've successfully flashed the ROM and Pico GApps (excluding the Google Text-to-Speech as I never did, never will use it anyway) using the following config
Code:
Include
CalSync
DialerFramework
PackageInstallerGoogle
Copy this in your txt editor and save it as gapps-config.txt to the same folder as GApps zip file.
is there a "One-hand' mode?
Latest TWRP, Bootloader & Radio - Full wipe, from within TWRP and/or by manually erasing/formatting partitions using Fastboot.
Using latest OpenGapps Aroma installer, and selecting nothing from any of the lists in the installer, so that it only installs the core files required to add a Google account to the device.
Google Services Framework crash-loop - never goes away, "keeps stopping".
Tried manually installing the latest APK from APK Mirror, and it does get farther by asking me if I want to restore from a cloud, copy from iPhone or setup as new, but all three options result in the same crash.
Tried rooting with Magisk 16, and without rooting, obviously a clean flash between, and result remains unchanged.
Wiltron said:
Latest TWRP, Bootloader & Radio - Full wipe, from within TWRP and/or by manually erasing/formatting partitions using Fastboot.
Using latest OpenGapps Aroma installer, and selecting nothing from any of the lists in the installer, so that it only installs the core files required to add a Google account to the device.
Google Services Framework crash-loop - never goes away, "keeps stopping".
Tried manually installing the latest APK from APK Mirror, and it does get farther by asking me if I want to restore from a cloud, copy from iPhone or setup as new, but all three options result in the same crash.
Tried rooting with Magisk 16, and without rooting, obviously a clean flash between, and result remains unchanged.
Click to expand...
Click to collapse
No such issue here with opengapps nano + gapps-config posted above, maybe you should try that way and see if it works.
Update:
HTML:
2018-03-07:
- March security patch.
- Ancient mako kernel that came way back from cyanogenmod days has been rebased off the AOSP upstream (3.4.113).
- Enabled F2FS support (untested).
- Fixed power hal, stuff like touch and interation boosts, low power mode freq limit works properly now.
- Very efficient interactive governor from franco kernel (works much better than ondemand, also modern devices use interactive as their default governor)
Video recording is fixed, but i made some other changes i want to test before releasing a new build, but that won't take too long i guess.
voron00 said:
Video recording is fixed, but i made some other changes i want to test before releasing a new build, but that won't take too long i guess.
Click to expand...
Click to collapse
is that means, stable build coming soon?
nefescalanadam said:
is that means, stable build coming soon?
Click to expand...
Click to collapse
Not 100% stable, there are still some minor bugs. Also enabling hardware encoder broke the built in screen recorder app so i had to temporary remove it from the build for now.
Anyway, update is up:
HTML:
2018-03-10:
- Synced lastest LineageOS sources.
- Fixed video recording.
- Minor kernel tweaks to improve overall performance.
Do you think that call recording will work properly here?
Since it does not work perfectly on CRDroid (the other side is heavily muffled in the recording).
Impressive work! 5 years already and N4 still keeps going and going...
Sent from Xiaomi Mi Mix 2 @ LineageOS 15.1
Tried to build this from the source in OP (there are some aesthetic changes I need to build with and use), got cut short:
Code:
device/lge/mako/camera/QCameraHWI_Record.cpp:354:11: error: member access into incomplete type 'android::media
_metadata_buffer' (aka 'android::encoder_nativehandle_buffer_type')
packet->meta_handle = mNativeHandle[frame->video.video.idx];
^
device/lge/mako/camera/QCameraHWI_Record.cpp:32:18: note: forward declaration of 'android::encoder_nativehandl
e_buffer_type'
typedef struct encoder_nativehandle_buffer_type media_metadata_buffer;
^
device/lge/mako/camera/QCameraHWI_Record.cpp:355:11: error: member access into incomplete type 'android::media
_metadata_buffer' (aka 'android::encoder_nativehandle_buffer_type')
packet->buffer_type = kMetadataBufferTypeNativeHandleSource;
^
device/lge/mako/camera/QCameraHWI_Record.cpp:32:18: note: forward declaration of 'android::encoder_nativehandl
e_buffer_type'
typedef struct encoder_nativehandle_buffer_type media_metadata_buffer;
^
device/lge/mako/camera/QCameraHWI_Record.cpp:480:41: error: invalid application of 'sizeof' to an incomplete t
ype 'android::media_metadata_buffer' (aka 'android::encoder_nativehandle_buffer_type')
mHalCamCtrl->mGetMemory(-1, sizeof(media_metadata_buffer), 1,
^ ~~~~~~~~~~~~~~~~~~~~~~~
device/lge/mako/camera/QCameraHWI_Record.cpp:32:18: note: forward declaration of 'android::encoder_nativehandl
e_buffer_type'
typedef struct encoder_nativehandle_buffer_type media_metadata_buffer;
^
device/lge/mako/camera/QCameraHWI_Record.cpp:484:15: error: member access into incomplete type 'android::media_metadata_buffer' (aka 'android::encoder_nativehandle_buffer_type')
packet->meta_handle = mNativeHandle[cnt];
^
device/lge/mako/camera/QCameraHWI_Record.cpp:32:18: note: forward declaration of 'android::encoder_nativehandle_buffer_type'
typedef struct encoder_nativehandle_buffer_type media_metadata_buffer;
^
device/lge/mako/camera/QCameraHWI_Record.cpp:486:15: error: member access into incomplete type 'android::media_metadata_buffer' (aka 'android::encoder_nativehandle_buffer_type')
packet->buffer_type = kMetadataBufferTypeNativeHandleSource;
^
device/lge/mako/camera/QCameraHWI_Record.cpp:32:18: note: forward declaration of 'android::encoder_nativehandle_buffer_type'
typedef struct encoder_nativehandle_buffer_type media_metadata_buffer;
^
device/lge/mako/camera/QCameraHWI_Record.cpp:560:33: error: member access into incomplete type 'android::media_metadata_buffer' (aka 'android::encoder_nativehandle_buffer_type')
if (packet && packet->buffer_type == kMetadataBufferTypeNativeHandleSource) {
^
device/lge/mako/camera/QCameraHWI_Record.cpp:32:18: note: forward declaration of 'android::encoder_nativehandle_buffer_type'
typedef struct encoder_nativehandle_buffer_type media_metadata_buffer;
^
device/lge/mako/camera/QCameraHWI_Record.cpp:561:73: error: member access into incomplete type 'android::media_metadata_buffer' (aka 'android::encoder_nativehandle_buffer_type')
native_handle_t *nh = const_cast<native_handle_t *>(packet->meta_handle);
^
device/lge/mako/camera/QCameraHWI_Record.cpp:32:18: note: forward declaration of 'android::encoder_nativehandle_buffer_type'
typedef struct encoder_nativehandle_buffer_type media_metadata_buffer;
^
device/lge/mako/camera/QCameraHWI_Record.cpp:561:75: error: expected ')'
native_handle_t *nh = const_cast<native_handle_t *>(packet->meta_handle);
^
device/lge/mako/camera/QCameraHWI_Record.cpp:561:66: note: to match this '('
native_handle_t *nh = const_cast<native_handle_t *>(packet->meta_handle);
^
8 errors generated.
Am I missing something?
AndyYan said:
Tried to build this from the source in OP (there are some aesthetic changes I need to build with and use), got cut short:
Code:
device/lge/mako/camera/QCameraHWI_Record.cpp:354:11: error: member access into incomplete type 'android::media
_metadata_buffer' (aka 'android::encoder_nativehandle_buffer_type')
packet->meta_handle = mNativeHandle[frame->video.video.idx];
^
device/lge/mako/camera/QCameraHWI_Record.cpp:32:18: note: forward declaration of 'android::encoder_nativehandl
e_buffer_type'
typedef struct encoder_nativehandle_buffer_type media_metadata_buffer;
^
device/lge/mako/camera/QCameraHWI_Record.cpp:355:11: error: member access into incomplete type 'android::media
_metadata_buffer' (aka 'android::encoder_nativehandle_buffer_type')
packet->buffer_type = kMetadataBufferTypeNativeHandleSource;
^
device/lge/mako/camera/QCameraHWI_Record.cpp:32:18: note: forward declaration of 'android::encoder_nativehandl
e_buffer_type'
typedef struct encoder_nativehandle_buffer_type media_metadata_buffer;
^
device/lge/mako/camera/QCameraHWI_Record.cpp:480:41: error: invalid application of 'sizeof' to an incomplete t
ype 'android::media_metadata_buffer' (aka 'android::encoder_nativehandle_buffer_type')
mHalCamCtrl->mGetMemory(-1, sizeof(media_metadata_buffer), 1,
^ ~~~~~~~~~~~~~~~~~~~~~~~
device/lge/mako/camera/QCameraHWI_Record.cpp:32:18: note: forward declaration of 'android::encoder_nativehandl
e_buffer_type'
typedef struct encoder_nativehandle_buffer_type media_metadata_buffer;
^
device/lge/mako/camera/QCameraHWI_Record.cpp:484:15: error: member access into incomplete type 'android::media_metadata_buffer' (aka 'android::encoder_nativehandle_buffer_type')
packet->meta_handle = mNativeHandle[cnt];
^
device/lge/mako/camera/QCameraHWI_Record.cpp:32:18: note: forward declaration of 'android::encoder_nativehandle_buffer_type'
typedef struct encoder_nativehandle_buffer_type media_metadata_buffer;
^
device/lge/mako/camera/QCameraHWI_Record.cpp:486:15: error: member access into incomplete type 'android::media_metadata_buffer' (aka 'android::encoder_nativehandle_buffer_type')
packet->buffer_type = kMetadataBufferTypeNativeHandleSource;
^
device/lge/mako/camera/QCameraHWI_Record.cpp:32:18: note: forward declaration of 'android::encoder_nativehandle_buffer_type'
typedef struct encoder_nativehandle_buffer_type media_metadata_buffer;
^
device/lge/mako/camera/QCameraHWI_Record.cpp:560:33: error: member access into incomplete type 'android::media_metadata_buffer' (aka 'android::encoder_nativehandle_buffer_type')
if (packet && packet->buffer_type == kMetadataBufferTypeNativeHandleSource) {
^
device/lge/mako/camera/QCameraHWI_Record.cpp:32:18: note: forward declaration of 'android::encoder_nativehandle_buffer_type'
typedef struct encoder_nativehandle_buffer_type media_metadata_buffer;
^
device/lge/mako/camera/QCameraHWI_Record.cpp:561:73: error: member access into incomplete type 'android::media_metadata_buffer' (aka 'android::encoder_nativehandle_buffer_type')
native_handle_t *nh = const_cast<native_handle_t *>(packet->meta_handle);
^
device/lge/mako/camera/QCameraHWI_Record.cpp:32:18: note: forward declaration of 'android::encoder_nativehandle_buffer_type'
typedef struct encoder_nativehandle_buffer_type media_metadata_buffer;
^
device/lge/mako/camera/QCameraHWI_Record.cpp:561:75: error: expected ')'
native_handle_t *nh = const_cast<native_handle_t *>(packet->meta_handle);
^
device/lge/mako/camera/QCameraHWI_Record.cpp:561:66: note: to match this '('
native_handle_t *nh = const_cast<native_handle_t *>(packet->meta_handle);
^
8 errors generated.
Am I missing something?
Click to expand...
Click to collapse
You have to pick hal1 patches to hardware/qcom/media stack before building:
HTML:
cd hardware/qcom/media
git fetch https://github.com/Unlegacy-Android/android_hardware_qcom_media aosp-8.1
git cherry-pick ee3524b0c8fc84e478a3b5af6859e99be9a0cc77
git cherry-pick 6e1e771b60535deae8e6dac6f35193ca40c7dfd3
git cherry-pick fb6c95a7f31f8612171f88c92e6899627e4319d7
git cherry-pick c7202d9283cf78b6f1d5356be918d107887aa3e5
git cherry-pick 748e30c9b79a4b716df6de3067887f997774c783
git cherry-pick 77e62c0fc5b1804ccbd8a433b7b5f91056a23f29
git cherry-pick adfa23dadc4f959e5f5049f4f9b952ec363e3a58
I had some issues with AOSP oreo builds, in nitrogen and unlegacy roms that not fixed till now, i don't know if you can fix it or not, i'll copy and paste what i reported before so you can check again if it's able to fix or not.
" Sometimes i can't end a call, i keep pressing end call and the call screen is not responding, also had another issue, sometimes when i'm in the middle of the call and want to use the phone to check another number for someone, the screen is still off and i have to press power button to get the screen back on. "
And @Karan.S reported the same issue :
" I had reported the same issue a few weeks back. Same happens with me too. As long as the call is active, it is as if the proximity sensor doesn't work. Have to use the power button to wake the screen up. It works when the call is being dialed and after the call has ended. Just to make sure the proximity sensor isn't the cause I rolled back to Nitrogen 7.1.2, on there the dialer works just as intended. Using Google Phone app if that matters. Not sure what is wrong. "
This issue was reported in nitrogen os thread, and when i wanted to check if it's rom issue i've flashed unlegacy rom and it's present too, never faced it in nougat or marshmallow.
The other one is the focus issue in google camera and it's present since nougat and still there in oreo, the focus i think sets to continuous not auto and when using flash, it keeps on for 4 seconds or 5 before capturing the photo.
Thanks in advance
voron00 said:
You have to pick hal1 patches to hardware/qcom/media stack before building:
Click to expand...
Click to collapse
Worked - thanks for the prompt response!
Thank you for this great rom, the rom will much stable when it gets mature.
Islam Looca said:
I had some issues with AOSP oreo builds, in nitrogen and unlegacy roms that not fixed till now, i don't know if you can fix it or not, i'll copy and paste what i reported before so you can check again if it's able to fix or not.
" Sometimes i can't end a call, i keep pressing end call and the call screen is not responding, also had another issue, sometimes when i'm in the middle of the call and want to use the phone to check another number for someone, the screen is still off and i have to press power button to get the screen back on. "
And @Karan.S reported the same issue :
" I had reported the same issue a few weeks back. Same happens with me too. As long as the call is active, it is as if the proximity sensor doesn't work. Have to use the power button to wake the screen up. It works when the call is being dialed and after the call has ended. Just to make sure the proximity sensor isn't the cause I rolled back to Nitrogen 7.1.2, on there the dialer works just as intended. Using Google Phone app if that matters. Not sure what is wrong. "
This issue was reported in nitrogen os thread, and when i wanted to check if it's rom issue i've flashed unlegacy rom and it's present too, never faced it in nougat or marshmallow.
The other one is the focus issue in google camera and it's present since nougat and still there in oreo, the focus i think sets to continuous not auto and when using flash, it keeps on for 4 seconds or 5 before capturing the photo.
Thanks in advance
Click to expand...
Click to collapse
This is issue with your device's proximity sensor. I do not see any other reason for it not to work.
Regarding camera - we need to understand that this device is 6 years old and the camera original blobs are updated since long. We should be thankful that at least we have fully working camera
Nitin

Categories

Resources