How flash Android11(AOSP11) A/B OTA .zip file into target - android-source

Followed below steps :
Compiled the source code
$mkdir dist_output
$make dist DIST_DIR=dist_output
$./out/target/product/rk3399_ROCKPI4B_Android11/otatools/releasetools/ota_from_target_files dist_output/rk3399_ROCKPI4B_Android11-target_files-eng.test1-test.zip update1.zip
2022-05-27 15:43:16 - common.py - WARNING : Failed to read SYSTEM/etc/build.prop
2022-05-27 15:43:16 - common.py - WARNING : Failed to read VENDOR/etc/build.prop
2022-05-27 15:43:16 - common.py - WARNING : Failed to read PRODUCT/etc/build.prop
2022-05-27 15:43:16 - common.py - WARNING : Failed to read SYSTEM_EXT/etc/build.prop
2022-05-27 15:43:38 - common.py - WARNING : Failed to read SYSTEM/etc/build.prop
2022-05-27 15:43:38 - common.py - WARNING : Failed to read VENDOR/etc/build.prop
2022-05-27 15:43:38 - common.py - WARNING : Failed to read PRODUCT/etc/build.prop
2022-05-27 15:43:38 - common.py - WARNING : Failed to read SYSTEM_EXT/etc/build.prop
2022-05-27 15:43:38 - common.py - WARNING : Failed to read SYSTEM/etc/build.prop
2022-05-27 15:43:38 - common.py - WARNING : Failed to read VENDOR/etc/build.prop
2022-05-27 15:43:38 - common.py - WARNING : Failed to read PRODUCT/etc/build.prop
2022-05-27 15:43:38 - common.py - WARNING : Failed to read SYSTEM_EXT/etc/build.prop
2022-05-27 15:43:38 - common.py - WARNING : Failed to read SYSTEM/etc/build.prop
2022-05-27 15:43:38 - common.py - WARNING : Failed to read VENDOR/etc/build.prop
2022-05-27 15:43:38 - common.py - WARNING : Failed to read PRODUCT/etc/build.prop
2022-05-27 15:43:38 - common.py - WARNING : Failed to read SYSTEM_EXT/etc/build.prop
2022-05-27 15:43:39 - ota_from_target_files - WARNING : Duplicate block difference found. Device specific block diff for partition 'system_ext' overrides the one in generic script.
2022-05-27 15:43:39 - ota_from_target_files - WARNING : Duplicate block difference found.
Device specific block diff for partition 'product' overrides the one in generic script.
2022-05-27 15:43:39 - ota_from_target_files - WARNING : Duplicate block difference found. Device specific block diff for partition 'odm' overrides the one in generic script.
Compressing system.new.dat with brotli
Compressing vendor.new.dat with brotli
Compressing product.new.dat with brotli
Compressing odm.new.dat with brotli
Compressing system_ext.new.dat with brotli
write trust now...
write uboot now...
warning: no vbmeta.img in input target_files; not flashing vbmeta
wirte dtbo now...
no charge img; ignore it.
info: no resource image; ignore it.
no RKLoader.bin, ignore it.
info: no vendor_boot.img in input target_files; ignore it
info: no logo image; ignore it.
Update1.zip file is created. Is those process is proper , I need to do any more changes and How to flash A/B OTA .zip file into target device
Ref links :
https://source.android.com/devices/tech/ota/tools
Unable to create AB OTA zip file in AOSP 11

Related

Pipeline failed if scanning scala files

I created Gitlab CI which sends all files in project folder to scan in SonarQube, and it's working perfect with python files, but if I add scala files it's failed. My Gitlab CI:
image: testimage
variables:
SONARQUBE_URL: https://sonarqube.com
stages:
- PyLint
pylint:
stage: PyLint
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
script:
- apt-get install scala -y
- cd project
- scalac *.scala
- ls
- cd ..
- sed -i 's/PROJECT-NAME/'"$CI_PROJECT_NAME"'/g' sonar-project.properties
- sonar-scanner -Dsonar.login=$SONAR_TOKEN -Dsonar.qualitygate.wait=true -Dsonar.projectVersion=${CI_PIPELINE_ID}
- echo 'Repository Link:' "$SONARQUBE_URL${CI_PROJECT_NAME}"
Some lines from logs:
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 13.545s
INFO: Final Memory: 16M/136M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution
java.lang.IllegalStateException: Can not execute Findbugs
at org.sonarsource.scanner.cli.Main.main(Main.java:61)
Caused by: java.lang.IllegalStateException: One (sub)project contains Java source files that are not compiled (/builds/scala/myrepo).
Property sonar.java.binaries was not set, it is required to locate the compiled .class files. For instance set the property to: sonar.java.binaries=target/classes
Sonar JavaResourceLocator.classpath was empty
Sonar JavaResourceLocator.classFilesToAnalyze was empty
at org.sonar.plugins.findbugs.FindbugsConfiguration.buildMissingCompiledCodeException(FindbugsConfiguration.java:154)
at org.sonar.plugins.findbugs.FindbugsConfiguration.initializeFindbugsProject(FindbugsConfiguration.java:124)
at org.sonar.plugins.findbugs.FindbugsExecutor.execute(FindbugsExecutor.java:117)
... 31 more
ERROR:
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
Cleaning up file based variables
00:01
ERROR: Job failed: command terminated with exit code 1
My solution was to add this line in sonar-project.properties file:
sonar.java.binaries=.

A library can't opt out of null safety by default when compile flutter apk with gradle

When I compile flutter android apk using gradle like this:
fastlane android beta
shows this error:
/source/cruise-open/android/gradlew clean assembleRelease -p .' was 1 instead of 0. (FastlaneCore::Interface::FastlaneShellError)
> Task :clean
> Task :app:clean UP-TO-DATE
> Task :flutter_secure_storage:clean UP-TO-DATE
> Task :fluttertoast:clean UP-TO-DATE
> Task :package_info:clean UP-TO-DATE
> Task :path_provider:clean UP-TO-DATE
> Task :share:clean UP-TO-DATE
> Task :shared_preferences:clean UP-TO-DATE
> Task :uni_links:clean UP-TO-DATE
> Task :url_launcher:clean UP-TO-DATE
> Task :video_player:clean UP-TO-DATE
> Task :wakelock:clean UP-TO-DATE
> Task :webview_flutter:clean UP-TO-DATE
> Task :app:compileFlutterBuildRelease
../../.pub-cache/hosted/pub.flutter-io.cn/video_player_platform_interface-2.2.0/lib/messages.dart:4:1: Error: A library can't opt out of null safety by default, when using sound null safety.
// #dart = 2.8
^^^^^^^^^^^^^^
../../.pub-cache/hosted/pub.flutter-io.cn/wakelock_platform_interface-0.1.0+1/lib/messages.dart:4:1: Error: A library can't opt out of null safety by default, when using sound null safety.
// #dart = 2.8
^^^^^^^^^^^^^^
Error: Cannot run with sound null safety, because the following dependencies
don't support null safety:
- package:hive
- package:hive_flutter
- package:state_notifier
- package:fish_redux
- package:crypto
- package:path_provider
- package:convert
- package:pull_to_refresh
- package:flutter_icons
- package:flutter_slidable
- package:http
- package:logger
- package:dio
- package:flutter_html
- package:http_parser
- package:webview_flutter
- package:csslib
- package:html
- package:flutter_layout_grid
- package:chewie
- package:chewie_audio
- package:video_player
- package:video_player_platform_interface
- package:quiver
- package:wakelock
- package:shimmer
- package:wakelock_platform_interface
For solutions, see https://dart.dev/go/unsound-null-safety
> Task :app:compileFlutterBuildRelease FAILED
*********************************************************
WARNING: This version of path_provider will break your Android build if it or its dependencies aren't compatible with AndroidX.
See for more information on the problem and how to fix it.
This warning prints for all Android build failures. The real root cause of the error may be unrelated.
*********************************************************
FAILURE: Build failed with an exception.
* Where:
Script '/Users/dolphin/apps/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 991
* What went wrong:
Execution failed for task ':app:compileFlutterBuildRelease'.
> Process 'command '/Users/dolphin/apps/flutter/bin/flutter'' finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 23s
14 actionable tasks: 2 executed, 12 up-to-date
what should I do to pass --no-sound-null-safety when compile android apk? And this is my Fastline setting:
default_platform(:android)
platform :android do
desc "Runs all the tests"
lane :test do
gradle(task: "test")
end
desc "Submit a new Beta Build to Crashlytics Beta"
lane :beta do
gradle(task: "clean assembleRelease")
crashlytics
# sh "your_script.sh"
# You can also use other beta testing services here
end
desc "Deploy a new version to the Google Play"
lane :deploy do
gradle(task: "clean assembleRelease")
pgyer(
api_key: ENV['PGY_API_KEY'],
user_key: ENV['PGY_USER_KEY']
)
end
end

Install vscode extension through vsix file without CLI command

I'm trying to install vscode extension vsix file by double clicking it without using CLI command as mentioned here - code --install-extension my-extension-0.0.1.vsix
The extension is not yet published and in development mode that we'd like to share for preview.
But I'm getting the following error:-
03-03-2021 13:06:46 - Microsoft VSIX Installer
03-03-2021 13:06:46 - -------------------------------------------
03-03-2021 13:06:46 - vsixinstaller.exe version:
03-03-2021 13:06:46 - 16.8.3036
03-03-2021 13:06:46 - -------------------------------------------
03-03-2021 13:06:46 - Command line parameters:
03-03-2021 13:06:46 - C:\Program Files (x86)\Microsoft Visual Studio\Installer\resources\app\ServiceHub\Services\Microsoft.VisualStudio.Setup.Service\VSIXInstaller.exe,C:\Users\jmadhu\Desktop\dev\CloudNativeTest\vscode-azureloadtest\vscode-azureloadtest-0.1.0.vsix
03-03-2021 13:06:46 - -------------------------------------------
03-03-2021 13:06:46 - Microsoft VSIX Installer
03-03-2021 13:06:46 - -------------------------------------------
03-03-2021 13:06:47 - Initializing Install...
03-03-2021 13:06:47 - Extension Details...
03-03-2021 13:06:47 - Identifier : vscode-azureloadtest
03-03-2021 13:06:47 - Name : Azure Load Test
03-03-2021 13:06:47 - Author : ms-azureloadtest
03-03-2021 13:06:47 - Version : 0.1.0
03-03-2021 13:06:47 - Description : Manage your Azure Cloud Native Load Tests and Resources
03-03-2021 13:06:47 - Locale : en-US
03-03-2021 13:06:47 - MoreInfoURL :
03-03-2021 13:06:47 - InstalledByMSI : False
03-03-2021 13:06:47 - SupportedFrameworkVersionRange : [0.0,2147483647.2147483647]
03-03-2021 13:06:47 -
03-03-2021 13:06:47 - SignatureState : Unsigned
03-03-2021 13:06:47 - Supported Products :
03-03-2021 13:06:47 - Microsoft.VisualStudio.Code
03-03-2021 13:06:47 - Version :
03-03-2021 13:06:47 -
03-03-2021 13:06:47 - References :
03-03-2021 13:06:47 - Signature Details...
03-03-2021 13:06:47 - Extension is not signed.
03-03-2021 13:06:47 -
03-03-2021 13:06:47 - Searching for applicable products...
03-03-2021 13:06:47 - Found installed product - Global Location
03-03-2021 13:06:47 - Found installed product - Visual Studio Professional 2019
03-03-2021 13:06:47 - VSIXInstaller.NoApplicableSKUsException: One or more extensions are for Visual Studio Code. Try installing them in Visual Studio Code.
at VSIXInstaller.ExtensionService.GetInstallableDataImpl(IInstallableExtension extension, String extensionPackParentName, Boolean isRepairSupported, IStateData stateData, IEnumerable`1& skuData)
at VSIXInstaller.ExtensionService.GetInstallableData(String vsixPath, String extensionPackParentName, Boolean isRepairSupported, IStateData stateData, IEnumerable`1& skuData)
at VSIXInstaller.ExtensionPackService.IsExtensionPack(IStateData stateData, Boolean isRepairSupported)
at VSIXInstaller.ExtensionPackService.ExpandExtensionPackToInstall(IStateData stateData, Boolean isRepairSupported)
at VSIXInstaller.App.Initialize(Boolean isRepairSupported)
at VSIXInstaller.App.Initialize()
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
Ques: Can we install vsix file (unpublished extension) without using CLI command? If yes, what are the possible ways?
You can only install via menu items,
"You can manually install a VS Code extension packaged in a .vsix
file. Using the Install from VSIX command in the Extensions view
command drop-down, or the Extensions: Install from VSIX command in the
Command Palette, point to the .vsix file."
from https://code.visualstudio.com/docs/editor/extension-gallery#_install-from-a-vsix
You cannot double click such files to install in Windows Explorer, because Visual Studio registers another tool (aka Microsoft VSIX Installer) there, which won't work for VSCode.

How to solution the following error when build EmulatorPkg ?

when I run build -p EmulatorPkg\EmulatorPkg.dsc -t VS2019 -a X64, it show the following error
LINK : warning LNK4108:ָ /ALIGN ûָ /DRIVERӳܲ
LINK : warning LNK4001: δָļʹÿ
LINK : warning LNK4068: δָ /MACHINEĬΪ X86
LINK : error LNK2001: ޷ⲿ _ModuleEntryPoint
d:\edk2\edk2\Build\EmulatorX64\DEBUG_VS2019\X64\WinHost.lib : fatal error LNK1120: 1 ޷ⲿ
NMAKE : fatal error U1077: "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\
MSVC\14.25.28610\bin\Hostx86\x64\link.exe": ش롰0x460
Stop.
Building ... d:\edk2\edk2\EmulatorPkg\BootModePei\BootModePei.inf [X64]
build.py...
: error 7000: Failed to execute command
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.25.28610\bin
\Hostx86\x86\nmake.exe /nologo tbuild [d:\edk2\edk2\Build\EmulatorX64\DEBUG_VS2019\X64\EmulatorPkg\Win
\Host\WinHost]
build.py...
: error F002: Failed to build module
d:\edk2\edk2\EmulatorPkg\Win\Host\WinHost.inf [X64, VS2019, DEBUG]
- Failed -
Build end time: 22:18:35, Apr.07 2020
Build total time: 00:00:13
but when build MdeModulePkg/MdeModulePkg.dsc, it not have any error.
The error was caused by missing support for VS2019 in this module.
Support was added upstream in commit 998d4c98b7c6 ("EmulatorPkg/WinHost: Add link flags for VS2019 tool chains.").

How can I alter a Chocolatey package's $url for install

TLDR version: I need to be able to append to the end of the URL that a chocolatey package specifies for its download source.
I'm trying to use Chocolatey to install the Android-SDK package and am having an issue with my filtering proxy (the functionality and provision of which, I have no control over). The proxy is detected properly but it will block URLs that contain certain patterns and issue a 403 return (in this case it's because the URL is to a .exe). So running choco install -y android-sdk causes the following error.
2015-03-12 15:14:47,639 [INFO ] - ============================================================
2015-03-12 15:14:47,664 [INFO ] - Chocolatey v0.9.9.2
2015-03-12 15:14:47,730 [INFO ] - Installing the following packages:
2015-03-12 15:14:47,753 [INFO ] - android-sdk
2015-03-12 15:14:47,754 [INFO ] - By installing you accept licenses for the packages.
2015-03-12 15:14:49,221 [INFO ] -
android-sdk v24.0.2
2015-03-12 15:14:50,525 [INFO ] - Using this proxyserver: xxx.xxx.xxx.xxx:xxxxx
2015-03-12 15:14:52,175 [INFO ] - Attempt to get headers for http://dl.google.com/android/installer_r24.0.2-windows.exe failed.
2015-03-12 15:14:52,175 [INFO ] - Exception calling "GetResponse" with "0" argument(s): "The remote server returned an error: (403) Forbidden."
2015-03-12 15:14:52,180 [INFO ] - Downloading android-sdk 32 bit
2015-03-12 15:14:52,180 [INFO ] - from 'http://dl.google.com/android/installer_r24.0.2-windows.exe'
2015-03-12 15:14:52,213 [INFO ] - Using this proxyserver: xxx.xxx.xxx.xxx:xxxxx
2015-03-12 15:14:52,329 [ERROR] - Exception calling "GetResponse" with "0" argument(s): "The remote server returned an error: (403) Forbidden."
2015-03-12 15:14:52,330 [ERROR] - At C:\ProgramData\chocolatey\helpers\functions\Get-WebFile.ps1:66 char:3
2015-03-12 15:14:52,330 [ERROR] - + $res = $req.GetResponse();
2015-03-12 15:14:52,330 [ERROR] - + ~~~~~~~~~~~~~~~~~~~~~~~~~
2015-03-12 15:14:52,331 [ERROR] - + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
2015-03-12 15:14:52,331 [ERROR] - + FullyQualifiedErrorId : WebException
2015-03-12 15:14:52,354 [ERROR] - You cannot call a method on a null-valued expression.
2015-03-12 15:14:52,354 [ERROR] - At C:\ProgramData\chocolatey\helpers\functions\Get-WebFile.ps1:138 char:3
2015-03-12 15:14:52,355 [ERROR] - + $res.Close();
2015-03-12 15:14:52,356 [ERROR] - + ~~~~~~~~~~~~
2015-03-12 15:14:52,356 [ERROR] - + CategoryInfo : InvalidOperation: (:) [], RuntimeException
2015-03-12 15:14:52,357 [ERROR] - + FullyQualifiedErrorId : InvokeMethodOnNull
2015-03-12 15:14:54,374 [ERROR] - Chocolatey expected a file to be downloaded to
2015-03-12 15:14:54,375 [ERROR] - 'X:\Users\xxx\AppData\Local\Temp\chocolatey\android-sdk\android-sdkInstall.exe' but nothing exists at that
2015-03-12 15:14:54,375 [ERROR] - location.
2015-03-12 15:14:54,376 [ERROR] - At C:\ProgramData\chocolatey\helpers\functions\Get-ChocolateyWebFile.ps1:148 char:24
2015-03-12 15:14:54,376 [ERROR] - + if (!($fi.Exists)) {{ throw "Chocolatey expected a file to be downloaded to `'$ ...
2015-03-12 15:14:54,377 [ERROR] - + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2015-03-12 15:14:54,377 [ERROR] - + CategoryInfo : OperationStopped: (Chocolatey expe... that location.:String) [], RuntimeException
2015-03-12 15:14:54,378 [ERROR] - + FullyQualifiedErrorId : Chocolatey expected a file to be downloaded to 'X:\Users\xxx\AppData\Local\Temp\cho
2015-03-12 15:14:54,378 [ERROR] - colatey\android-sdk\android-sdkInstall.exe' but nothing exists at that location.
2015-03-12 15:14:54,618 [ERROR] - android-sdk install not successful.
2015-03-12 15:14:54,621 [ERROR] - Error while running 'C:\ProgramData\chocolatey\lib\android-sdk\tools\chocolateyInstall.ps1'.
See log for details.
2015-03-12 15:14:56,643 [WARN ] -
Chocolatey installed 0/1 package(s). 1 package(s) failed.
See the log for details.
2015-03-12 15:14:56,643 [ERROR] - Failures:
2015-03-12 15:14:56,645 [ERROR] - - android-sdk
I could create my own package with the chocolateyInstall.ps1 and chocolateyUninstall.ps1 listed on the package's web page and alter the URL, but that negates any benefit of using a package manager to simplify the process of managing programs and dependencies.
So I am wondering if there is some way that I can simply append a string that allows the URL through the proxy regardless of the file extension (to be clear, I know what this string is, I just don't know how to append it to the URL specified by the package).
This isn't a complete answer and I'm not sure how safe this answer is (in terms of surviving updates to Chocolatey itself), but it's resolved my immediate issue with the android-sdk package. Unfortunately, any package that implements its own download code bypasses this "fix".
I noticed the line in the error log that highlights one of the failure points as 2015-03-12 15:14:52,330 [ERROR] - At C:\ProgramData\chocolatey\helpers\functions\Get-WebFile.ps1:66 char:3 and wondered if I could alter the URL in that powershell script. After a bit of trial and error with the exact escaping that was needed for the appended string I managed to get it downloading the file, but the header check was still failing.
I then checked the other files in the helpers/functions/ directory and found Get-ChocolateyWebFile.ps1 which is what appears to call Get-WebFile.ps1 and also does the header check to see if it needs SSL.
So, I created a new powershell function file to perform the necessary URL rewrites in a function named Get-ProxyUrl and added this line to Get-ChocolateyWebFile.ps1 after the section that checks for 32bit/64bit URL but before the header check on the URL (line 101 in my version 0.9.9.2 file).
$url = Get-ProxyUrl($url)
I then also added it to the very beginning of the Get-WebFile function definition in Get-WebFile.ps1 to capture any direct calls to that function.
So, this will allow me to fix any packages that use Install-ChocolateyPackage, Get-ChocolateyWebFile or Get-WebFile, but still leaves some packages - such as JDK8 - that specify their own file download code and still fail.
So, a better solution would capture any URLs from a Chocolatey install... probably the only way to do this would be to install a local proxy server that chocolatey can use that would transform the URL before being passed on