How to write modified U-BOOT in to android firmware - android

I have a TV box on which my remote did not work.
I was able to solve the problem with all the buttons, except to add the power button.
i.e. the console could turn off, but I can't turn it on with the new remote.
After a little digging, I found information that the power button can only be added via u-boot.
I found the source code here
I was able to compile it, but I don't know how to add it to the console firmware.
Here I have a few questions in this regard.
How to add u-boot to a ready-made firmware image?
How do I prepare AOSP for the prefix I use? As I understand it, my manufacturer does not upload the source code for it, but 1000% of it is based on the Amlogic processor.
I will be glad of any information, books or videos on which I can advance on this issue.

Related

How to create a tv tuner library for android?

I have a K1 Plus android box which have a built-in dvb-t2` and dvb-s2 tuner in it. I want to create an app that gets and shows the channels from those tuners.
At first, I found about android's TV Input Framework(TIF). The sample app keeps crashing by calling a method that gets the available inputs of the device. Then, found out that it only work for real Android TVs. I looked for android libraries for that android box but didn't find anything. I looked for c libraries that can access the tuners but didn't find anything as well. I looked for code on how to access the hardware components of an android device and didn't find anything. I recently found about https://opencv.org/. I haven't read everything about it yet so I don't really know how to use it.
I found about https://git.linuxtv.org/v4l-utils.git from an answer to a SO question but it seems like it can only be used after installing it to an OS. I was able to compile it using CMake on android but it got missing header files.
I also found http://android4tv.iwedia.com. Unfortunately, it's also using TIF.
I'm trying to create something like kodi but I found out that it isn't really the one that gets the channels but kodi is getting it from a supported iptv box. I have zero knowledge about writing C but I'll try to make the code.
This is the box btw. http://www.videostrong.com/S905D+DVB(KI%20PLUS)/55.html
From my research, I found about HAL(Hardware Abstraction Layer). Do I need that for making my C code?
Update:
After months of research and not finding any quick way to implement a tv tuner library, I returned to my bookmarks from previous research. One of them is this. The first step from that SO answer is do a ls /dev/dvb/ on the device. Because I need to do it on the android box itself, I researched about android terminal apps and found Termux. Then I did the ls /dev/dvb/ command on Termux and it told that the resource was not found or it did not exist. Then I tried to just do a ls /dev/ command and luckily I got results. There's quite a lot of them and I found something related to dvb.
The dvb related results were:
dvb0.demux0
dvb0.demux1
dvb0.demux2
dvb0.dsc0
dvb0.dsc1
dvb0.dvr0
dvb0.dvr1
dvb0.dvr2
dvb0.net0
dvb0.net1
dvb0.net2
I can post the whole list but I'll post this more related (I think) results.
The results are quite different than the example of the link above because they only used dvb and not dvb0.
UPDATE:
I might use a usb tv tuner now based on a suggestion to me.
UPDATE:
Is there a list of standard and tv tuner related usb byte[] commands that I can look at? I already saw some but they are mostly for FTDI, serial or the really standard commands which I don't have really have any use.
It will probably take a lot of reverse engineering or a leaked documentation to achieve what you are trying to do.
Devices like the one you are working on usually use proprietery hardware with proprietery drivers for things like DVB, so making a third party app for a TV tuner is very hard.
First, you need to find out what kind of DVB chip / card this Android box has.
Then, you need to figure out how (on what kind of BUS) it is connected to the system.
If it is something generic, you may be able to talk to its driver, if not, you would need to write your own driver.
This is too complicated to explain in a SO post, but you could start by opening the box and looking at the components or by running commands like lsusb through ADB to try and identify the DVB component.
If the device already has a DVB app, you could try disassembling it, to find out how it works.
Good luck!

Changing and building parts of CyanogenMod

I have an assignment to take source code of CyanogenMod for certain device, to do some changes (at first, to disable tethering, set custom launcher that my team made, etc...). I managed to get source of CM, rebuilt it and flashed the device with it. I didn't use LineageOS deliberately, since its version is very unstable for this device.
Now, I wish to make some aforementioned adjustments and build ROM with these changes, could someone please point me to the right direction how to achieve it? I couldn't find anything similar to this on the net.
Thanks!
If it's not too late:
you need to find your phone here :
https://wiki.lineageos.org/devices/
and then go to https://wiki.lineageos.org/devices/addison/build
(change addison by your device codeName, which you can find in the "DEVICES" part of this website)
you will find all instructions to build lineageos from sources for your phone, you can then modify these sources to add your custom launcher, disable anything you want...
Cheers

How to connect wii balance board with android

How to connect Wii balance board with android?
Is there are any useful Library in android and how to use it?
My goal now is to connect it together and can receive data from it.
I'm new with android and Bluetooth development
I found this answer useful: Is it possible for an android device to read information from the wii controller and nunchuck? (quoted below with thanks to #Ben Mordue)
Have a look at this open source project:
http://code.google.com/p/android-bluez-ime/
Update:
I first installed the APK file on Galaxy Nexus and it works. I have checked the code out of the repo, and it builds fine, and it relatively easy to understand.
It comes in 3 projects - to use Wiimote, you need to install all 3 projects. The one is just used as a flag to allow the service to try for a Wiimote (considering not all ROMs support that level of HID interaction).
I also found these resources on WiiBrew.org:
http://wiibrew.org/wiki/Wiimote
http://wiibrew.org/wiki/Wii_Balance_Board
I used the Wiimote link to understand the Bluez-IME code.
Update 2:
Last night I got the board to communicate with my Android phone correctly. I did this by starting with the Bluez-IME code linked above, and modifying it based on the wiibrew.org info.
The trick is that the Balance Board is like a wiimote with an Extension. So its like a Nunchuk or Classic Controller, but just with a different device ID to look for.
For my initial demo, I just searched for all code that uses a Nunchuk, and duplicated it for a Balance Board. Then to initialise the MODE to use channel 0x32, as per the wiibrew Balance Board page.
Update 3:
I just stumbled across this app on the store: FitScales
And the developer has shared his code on github: paulburton / fitscales

Tcpreplay in Android?

I am performing some experiments where I want to replay a previously captured packet trace from Android. So far I have written my own application to replay the trace and get then answer back from the server. Timing accuracy is not a big problem as long as is within reasonable bounds (e.g., some milliseconds).
However, I would prefer to use a tested tool like tcpreplay. Is there any project that have ported tcpreplay to Android? Given that libpcap is available, there should be something available, but I could not find anything.
Thanks for your help
I'm the author of tcpreplay, and I can't say I'm aware of an Android port. Never owned an Android device so can't say one is coming anytime soon.
I've got it running on my tab, you need to install GNUroot and Debian no root, they are both from the same developer... After get it, open GNUroot, check emulate new root, create rootfs and run the rootfs, after this "apt-get install tcpreplay". If you want to capture use TpacketCapture in the play store, you can also get Tpacketcapture Pro to use the capture in only one app.
If you are planning to hack games don't publish it, cause this vulnerability can be easily patched...
any question email me.

Android screenshot - How to?

Is there any neat way of accessing screenshot of android device
programatically. I am looking for some 15-20fps.
I found one code
android\generic\frameworks\base\services\surfaceflinger\tests\screencap\scr eencap.cpp,
i built the executable and put it in /data and changed the mode 777
but when i tried to execute it using adb shell it gives the below error.
# chmod 777 test-screencap
chmod 777 test-screencap
# ./test-screencap test
./test-screencap test
screen capture failed: Function not implemented
I also know that we can access fb0 but its not a right method as suggested
by android team. Is it possible to access the screen shot at the frameworks
layer. I beleive surface flinger composes individual layers and gives it to
framebuffer.Where exactly this is done ? Can a application be able to access
such codes.
There are some java apps also which use ddms to actually capture this
framebuffer data without root access. But the fps is really poor.
I beleive there should be some or the other way of doing the above job.
Please suggest me some neat way of doing it. Suggestions are welcome.
What you are trying to do is not possible if you don't have a rooted phone, there is an app out there that does what you are trying, Screenshot ER. The latest OEM's are putting it into their /system/apps now... so you may be able to use their apps, check out this article for devices that have enabled this feature. Other than that your really stuck but there are implications with screen captures enabled as this could lead apps saving screen captures and sending that info out, enabling virus type apps...
Information for others .....Through Eclipse you can get a screen capture usig the DDMS perspective. If you take a look at the Eclipse DDMS code base its actually a stand-alone app too. You might be able to use this Java code then.
AdbHelper.getFrameBuffer(AndroidDebugBridge.getSocketAddress(), this);
Take a look at droid VNC Server
This is an open source project which you can clone the source code to your private PC. (http://github.com/oNaiPs/droid-VNC-server). I am investigating how VNC can do but It's really hard to do the same.
Read framebuffer content is an good solution also. But it just work with android <3.x only. I don't know how to fix it to work on android 4.x. If you know how (after see my suggestion) please share it here. Through my researching, I see that there are a lot of people looking for this.
Hope this helps.
nguyenminhbinh1602#gmail.com.
Android Freelancer.

Categories

Resources