Is it possible build image from Android things's source code - build

My company develop some app on Android things past years.
I know Google alread had give up the project.
But my boss want to try if it possilbe to build the image from the source code, make our product lives more years.
Search on google, it seems have Android things's repo on
https://android.googlesource.com/platform/manifest/+/refs/heads/android-o-mr1-iot-release-1.0.14
I try
repo init
, and
repo sync
it success, good.
but after I type
lunch
I get some error like
pt#pt-VirtualBox:~/IOT_1.0.14$ lunch
You're building on Linux
Lunch menu... pick a combo:
Failed to find deps of android/soong/cmd/soong_ui: Error parsing directory "/home/pt/IOT_1.0.14/external/golang-protobuf/proto": open /home/pt/IOT_1.0.14/external/golang-protobuf/proto: no such file or directory
Which would you like? [aosp_arm-eng]
Failed to find deps of android/soong/cmd/soong_ui: Error parsing directory "/home/pt/IOT_1.0.14/external/golang-protobuf/proto": open /home/pt/IOT_1.0.14/external/golang-protobuf/proto: no such file or directory
enter image description here
I git clone the missing direct protobuf via
git clone
https://android.googlesource.com/platform/external/golang-protobuf/
I try lunch again, and get the error
pt#pt-VirtualBox:~/IOT_1.0.14$ lunch
You're building on Linux
Lunch menu... pick a combo:
Failed to compile android/soong/cmd/soong_ui: "/home/pt/IOT_1.0.14/prebuilts/go/linux-x86/pkg/tool/linux_amd64/compile -o /home/pt/IOT_1.0.14/out/.soong_ui_intermediates/github.com-golang-protobuf-proto/github.com/golang/protobuf/proto.a -p github.com/golang/protobuf/proto -complete -pack -nolocalimports -c 6 -trimpath /home/pt/IOT_1.0.14 /home/pt/IOT_1.0.14/external/golang-protobuf/proto/checkinit.go /home/pt/IOT_1.0.14/external/golang-protobuf/proto/decode.go /home/pt/IOT_1.0.14/external/golang-protobuf/proto/decode_gen.go /home/pt/IOT_1.0.14/external/golang-protobuf/proto/doc.go /home/pt/IOT_1.0.14/external/golang-protobuf/proto/encode.go /home/pt/IOT_1.0.14/external/golang-protobuf/proto/encode_gen.go /home/pt/IOT_1.0.14/external/golang-protobuf/proto/equal.go /home/pt/IOT_1.0.14/external/golang-protobuf/proto/extension.go /home/pt/IOT_1.0.14/external/golang-protobuf/proto/merge.go /home/pt/IOT_1.0.14/external/golang-protobuf/proto/messageset.go /home/pt/IOT_1.0.14/external/golang-protobuf/proto/proto.go /home/pt/IOT_1.0.14/external/golang-protobuf/proto/proto_methods.go /home/pt/IOT_1.0.14/external/golang-protobuf/proto/reset.go /home/pt/IOT_1.0.14/external/golang-protobuf/proto/size.go /home/pt/IOT_1.0.14/external/golang-protobuf/proto/size_gen.go /home/pt/IOT_1.0.14/external/golang-protobuf/proto/wrappers.go": exit status 2
1. /home/pt/IOT_1.0.14/external/golang-protobuf/proto/checkinit.go:8:2:
2. can't
3. find
4. import:
5. "google.golang.org/protobuf/internal/errors"
Which would you like? [aosp_arm-eng]
Failed to compile android/soong/cmd/soong_ui: "/home/pt/IOT_1.0.14/prebuilts/go/linux-x86/pkg/tool/linux_amd64/compile -o /home/pt/IOT_1.0.14/out/.soong_ui_intermediates/github.com-golang-protobuf-proto/github.com/golang/protobuf/proto.a -p github.com/golang/protobuf/proto -complete -pack -nolocalimports -c 6 -trimpath /home/pt/IOT_1.0.14 /home/pt/IOT_1.0.14/external/golang-protobuf/proto/checkinit.go /home/pt/IOT_1.0.14/external/golang-protobuf/proto/decode.go /home/pt/IOT_1.0.14/external/golang-protobuf/proto/decode_gen.go /home/pt/IOT_1.0.14/external/golang-protobuf/proto/doc.go /home/pt/IOT_1.0.14/external/golang-protobuf/proto/encode.go /home/pt/IOT_1.0.14/external/golang-protobuf/proto/encode_gen.go /home/pt/IOT_1.0.14/external/golang-protobuf/proto/equal.go /home/pt/IOT_1.0.14/external/golang-protobuf/proto/extension.go /home/pt/IOT_1.0.14/external/golang-protobuf/proto/merge.go /home/pt/IOT_1.0.14/external/golang-protobuf/proto/messageset.go /home/pt/IOT_1.0.14/external/golang-protobuf/proto/proto.go /home/pt/IOT_1.0.14/external/golang-protobuf/proto/proto_methods.go /home/pt/IOT_1.0.14/external/golang-protobuf/proto/reset.go /home/pt/IOT_1.0.14/external/golang-protobuf/proto/size.go /home/pt/IOT_1.0.14/external/golang-protobuf/proto/size_gen.go /home/pt/IOT_1.0.14/external/golang-protobuf/proto/wrappers.go": exit status 2
I read some tutorial about go language.
But I have no idea how to fix it.
It seems like a path problem.
thx, if any one can help.

Related

How to run the code using AFL on terminal

I have some of github that I am trying to run using AFL.
The code: https://github.com/karimmd/CScanner/tree/cfe7d08bf46b1eed0443f9e27bc089d68a830a45
I wanna run the project and find vulnerablities. I have put the github all files inside a folder code , so the file structure is CScanner-master/code/all the files here.
I am using this command on terminal :
hemlatamahaur#Hemlatas-MacBook-Pro desktop % afl-fuzz -i CScanner-master -o code ./input-testcode.c
afl-fuzz 2.56b by <lcamtuf#google.com>
[+] You have 4 CPU cores and 2 runnable tasks (utilization: 50%).
[+] Try parallel jobs - see /usr/local/Cellar/afl-fuzz/2.57b/share/doc/afl/parallel_fuzzing.txt.
[*] Setting up output directories...
[+] Output directory exists but deemed OK to reuse.
[*] Deleting old session data...
[+] Output dir cleanup successful.
[*] Scanning 'CScanner-master'...
[+] No auto-generated dictionary tokens to reuse.
[*] Creating hard links for all input files...
[*] Validating target binary...
[-] PROGRAM ABORT : Program './input-testcode.c' not found or not executable
Location : check_binary(), afl-fuzz.c:6873
It keep saying there is no file as input-testcode.c
I am new to AFL, so I might be doing it wrong. How do I run this code using AFL to find the vulnerabilities. Any help is very appreciated.
you have to build your code using afl-clang first
afl-clang
$ afl-clang input-testcode.c -o input-testcode .
Then:
$ afl-fuzz -i CScanner-master -o code ./input-testcode .
I hope it works
Afl-fuzz works on the executable

Having issues with Command CodeSign failed with a nonzero exit code giving me also Signing Identity: "-"

I'm learning how to code and I'm at a lesson where I'm building a "messaging app" called FlashChat, I've done everything according to my class but a couple of days ago I pressed Command B after I ran the app on simulator, and the following issue kept showing up and I haven't been able to fix it:
CodeSign /Users/XXXXXXXXXXXXX/Library/Developer/Xcode/DerivedData/Flash_Chat_iOS13-bccxjpmgzvggxgetotmpidocaviy/Build/Products/Debug-iphonesimulator/gRPC-C++/grpcpp.framework (in target 'gRPC-C++' from project 'Pods')
cd /Users/XXXXXXXXXXXXX/Desktop/Development/Flash-Chat-iOS13/Pods
export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
Signing Identity: "-"
/usr/bin/codesign --force --sign - --timestamp=none /Users/XXXXXXXXXXXXX/Library/Developer/Xcode/DerivedData/Flash_Chat_iOS13-bccxjpmgzvggxgetotmpidocaviy/Build/Products/Debug-iphonesimulator/gRPC-C++/grpcpp.framework
/Users/XXXXXXXXXXXXX/Library/Developer/Xcode/DerivedData/Flash_Chat_iOS13-bccxjpmgzvggxgetotmpidocaviy/Build/Products/Debug-iphonesimulator/gRPC-C++/grpcpp.framework: resource fork, Finder information, or similar detritus not allowed
Command CodeSign failed with a nonzero exit code
I have tried everything from previous threads from checking KeyChain to verifying files, check bundle identifiers, signing licenses and all other suggestions related to anything written on my issue, any other ideas?
Thanks!!!
Follow these steps:
Update all the pods.
Run this command from the terminal.
$ xattr -cr /Users/user_name/Desktop/Lab/Flash-Chat-iOS13/Pods/gRPC-C++
Go to ~Library/Developer/Xcode/DerivedData. Delete all the folders present in that. The issue might be because Xcode is trying to run a older version of the code.
I am also running the same Flash Chat app from Udemy class. The above steps fixed the issue for me.
Start by trying with step 3 directly. If that doesn't work try all the 3 steps in the sequence.

Method names changes in libstandalonelibwebviewchromium.so after build

I am using libstandalonelibwebviewchromium.so in my android application and when I am calling a native method it throws "java.lang.UnsatisfiedLinkError: No implementation" . I have looked into this issue and found out that name of the function is different in the library. I have used "nm -gD libstandalonelibwebviewchromium.so" command to list all the methods. For example :
method "org_chromium_base_library_1loader_LibraryLoader_registerNonMainDexJni" changed to "Java_J_N_MIOj213u".
How to configure chromium at the build time to preserve original library method name??
Please help....
Thank You,
Avishek Nath
//////////////////////////////////
EDIT
/////////////////////////////////
For the Android Chromium source checkout I have followed this link :
https://chromium.googlesource.com/chromium/src/+/master/docs/android_build_instructions.md
I have checked out Chromium source code for Android from github.
Then I ran these commands in ubuntu system
$ gclient sync
$ gn gen --args='target_os="android" target_cpu="arm" is_debug=false' out/Default
$ ninja -C out/Default webview_instrumentation_apk
After these command execution "libstandalonelibwebviewchromium.so" generated in the out/Default folder.
I have taken the libstandalonelibwebviewchromium.so in my project and kept it in the jniLibs folder.
I also ran this "nm -gD libstandalonelibwebviewchromium.so" command which gave a list of symbols but all of them are like "Java_J_N_MIOj213u".

Error while compiling workspace-d

I tried to install workspace-d on Windows 10 using Administrator privilege but failed.
Here is the error message.I haved installed dmd, dub and git.
PS C:\Users\U\Desktop\workspace-d-installer> .\workspace-d-installer.exe
Welcome to the workspace-d installation guide.
Make sure, you have dmd, dub and git installed.
Which external components do you want to install?
[1] DCD - auto completion
[2] DScanner - code linting
[3] dfmt - code formatting
Enter a comma separated list of numbers
Selected [all]:
Cloning workspace-d into C:\Users\U\AppData\Local\Temp\workspaced-install-635958600835730563
Checking out v2.6.0
Compiling...
Error: Error writing file '..\..\..\..\..\..\U\AppData\Roaming\dub\packages\painlesstraits-0.1.0\.dub\build\library-release-windows-x86-dmd_2071-92537C3AEFB87AC450BFCCEE2ECBED44\painlesstraits.lib'
dmd failed with exit code 1.
Error while compiling workspace-d.
This is a bug with workspace-d-installer. Even though it just runs the shell commands, it has some permission problems on windows. I have opened an issue on the project page if you want to do anything on it: https://github.com/Pure-D/workspace-d-installer/issues/2
The only solution right now is to manually clone each repository (workspace-d, dfmt, dscanner, dcd) and follow their build instructions. I'm trying to fix that issue so you can use workspace-d-installer.

wxWidgets-2.9.4\include and \lib\gcc_lib\mswu No such file or directory error on CodeBlocks

I'm trying to learn C++ programming with wxWidgets and CodeBlocks (with MinGW) and earlier today I succeeded in installing the software (after some trouble) to my Windows 7 computer with the guidance given to me in this post:
wxWidget 2.8.12 not working in Codeblocks
Later on the same day, I did the exact same steps on another Windows 7 machine and after creating a wxWidgets project and trying to compile and run it I got the following errors:
\wxWidgets-2.9.4\include: No such file or directory
\wxWidgets-2.9.4\lib\gcc_lib\mswu: No such file or directory
I have checked and these folders really do exist on those locations...so what seems to be the problem here again?...on the earlier post user asanth kumar guided me that if the steps given in the guide don't get the job done, then I'm missing an important compiler search path in my build options.
Ok, so what do I do? Where do I enter the search path? What is the search path, etc. I'm very new with wxWidgets and CodeBlocks so I don't know very much terminology. If anyone should know what to do, could you please give me like step by step instruction what to do e.g. like Click Project --> Build options --> ... and so on
I have used the latest CodeBlocks (12.11) and wxWidgets (2.9.4) installers
Thank you for any help :)
UPDATE:
here is the build log: (I'm using CodeBlocks 12.11 and wxWidgets 2.9.4)
-------------- Build: Debug in TEST (compiler: GNU GCC Compiler)---------------
windres.exe -I"C:\Users\Jonne\Omat ohjelmat\wxWidgets-2.9.4\include" -I"C:\Users\Jonne\Omat ohjelmat\wxWidgets-2.9.4\lib\gcc_lib\mswu" -J rc -O coff -i C:\Users\Jonne\DOCUME~1\CODEBL~1\TEST\resource.rc -o obj\Debug\resource.res
gcc: error: ohjelmat\wxWidgets-2.9.4\include: No such file or directory
gcc: error: ohjelmat\wxWidgets-2.9.4\lib\gcc_lib\mswu: No such file or directory
windres.exe: preprocessing failed.
Process terminated with status 1 (0 minutes, 0 seconds)
3 errors, 0 warnings (0 minutes, 0 seconds)
Here is also a picture where you can see Build options, global variables and build log on my CodeBlocks:
NOTICE FUTURE READERS: Install wxWidgets to a directory without whitespace in the path name. The problems in this post was because the directory path had spaces in it
When you create a wxWidgets project.Have you did this?
File->New->Project->wxWidgets Project->Click Go->Click on Next->click on the suitable wxWidgets 2...version->click Next->Give project Name->Click on Next->Click on Next
After that the Following below Screen comes in the Wizard. Give the wxWidgets Location(Path where You installed the wxWidgets 2.9.4)
After that click on Finish.
For Environment Variable Path Setting
Follow the Below Steps:
Right click on MyComputer->Click on Advanced Systems settings->click on Environment Variables->click on New->Give variable name=Path and variable value="C:\Program Files (x86)\CodeBlocks\MinGW\bin" -> click ok
`
Try The Following Steps.It will work.
Updates about Build settings:
I am having the same problem as this and I somehow solved my problem.
I transfer my wxWidget folder to another location path that don't have white space name on it's path. For example above, "C:\Users\Jonne*Omat ohjelmat*\wxWidgets-2.9.4\include"
the path has white space between Omat ohjelmat. Try transfering it where the path contains no white spaces. For me, I put it on C:\wxWidgets-3.1.2