Related
This is the Development and Downloads Thread for the ION Build of Android for our Kaisers.
Any Non Development Questions will be Ignored in this Thread
Only Development related content will be posted here.
All non development related questions need to be directed to this thread: Questions and Troubleshooting
First Thanks to Vilord for the work, and thanks to whoever he thanked (Martin, Okibi, etc etc)
Working:
Data Connection
Google Services
Call Waiting
GPU Graphics Acceleration
Work In Progress: (not by me)
Camera
GPS
WIFI
Instructions: (adapted from Vilord's vogue post)
For some people ROM and Radio make a difference in whether or not certain aspects of the phone work. I am using Shifu's 6.1 V08 WWE Naked ROM with Radio 1.65.24.36
Before I boot haret, while still in WinMo, I always complete 1 call, so I call my voice mail, then once it connects I hang up. I'm not sure if completing a call like this actually helps, but I do it anyway. If you are not able to make calls, try this step.
Step 1: Download the files:
-Download ExtractToRootOfSDCard.zip below and extract *everything* to the root of your SD card
-Download system-ion.img from below, rename it to system.img and put it in the root of your SD card
-Download zImage from below and put it in the root of your SD card
-Download the newest initrd.gz file, extract it to your SDCard and overwrite the initrd.gz file that was in the ExtractToRootOfSDCard.zip
Step 2: Run it!
-Run Haret, and it should boot into android.
Reports have shown that starting over with the fresh data file (data.gz) instead of using your existing data.img produces better results.
Be aware of the fact that it will take a long time to extract the data.img file from the data.gz archive during your first boot. It took about 5 minutes for me.
At first your orientation may not return to portrait mode after closing the keyboard, if this happens fix it by:
Going to Settings > Sound & Display > Under Display Settings UNCHECK "Orientation"
Download the system-ion.img file (then rename it to system.img put it in the root of your SD card)
Download the kernel aka zImage (then put it in the root of your SD card)
Download the latest initrd.gz file from Vilord's google code page
reserved for updates
reserved for updates
Thanks for the thread, I'll update this post later with my ION system.img that has the original key layout along with bash and busybox tools added. Other than that, it's the current one you posted.
For anyone new to developing Android, here's what to do (thanks to everyone for these scripts):
system.img
Code:
mkdir stock-system && mkdir temp
sudo mount -o loop system.img stock-system
genext2fs -d stock-system -b 300000 -a system.ext2
sudo mount -o loop system.ext2 temp/
[B]---Make Changes---[/B]
sudo mkfs.cramfs temp/ system.1.5.img
I've attached genext2fs as well (thanks dzo)
initrd.gz
Extract--
Code:
gunzip initrd.gz && cpio -i < initrd.cpio
Compress-- (within directory)
Code:
find ./ | cpio -H newc -o | gzip > ../myinitrd.gz
data.gz
Is simply a gzipped ext2 img file.
We've been putting busybox and bash into the initrd... since it doesn't take up much space it allows more customization of the initrd environment...
Could you let me know what of my vogue stuff doesn't work on kaiser and what you need to change to make it work? It may be easy to adapt the vogue stuff to be compatible with both.
Installed ok. With a couple notes:
During first boot, got stuck at the terminal screen with nothing happening after the Data.img was extracted.
Rebooted, booted fine.
Noticed that 320x480 looks retarded as a screen resolution for Kaiser
Reset resolution to 336x448 and rebooted.
Crashed in terminal with Oops #11 (seriously, thats what it said)
Reset resolution to 320x428 looks fine. I'll probably try a few higher resolutions to get more screen real-estate.
Also, I was initially not able to install items from the Market. They download fine, but when the 'install' starts, it throws an error. This may have to do with attempting to download two things at one time. I later retried the download and both items installed fine.
In initrd.gz/init file:
When it boots, it complains of "no telephony database. Will check for Android apn on next boot:"
Code:
SQLITE3="/bin/sqlite3"
[B]DB="/data/data/com.android.providers.telephony/databases/telephony.db"[/B]
if [ -e $DB ] ; then
if [ "`$SQLITE3 $DB 'SELECT numeric FROM carriers;' | grep 310995`" != "310995" ] ; then
echo Creating android apn
"$SQLITE3" "$DB" "INSERT INTO carriers VALUES(NULL, 'Android' , '310995' , '310' , '995' , 'internet' , '*' , '*' , '*' , NULL, NULL, NULL, NULL, 'null' , 'default' , 1);"
fi
else
[B] echo No telephony database. Will check for android apn on next reboot[/B]
fi
After that it says "chmod: 1000 no such file or directory."
Code:
if [ -d /data/app ] ; then
if [ -d /sdcard/AndroidApps ] ; then
echo Copying Applications
cp /sdcard/AndroidApps/* /data/app
[B] chown 1000 1000 /data/app/*[/B]
fi
fi
Example of Questions being asked in wrong thread
enatefox said:
...all the other stuff you said, then...
How can I debug bootup?
Click to expand...
Click to collapse
Please refer questions like this to the "Questions and Troubleshooting Thread"
enatefox said:
In initrd.gz/init file:
When it boots, it complains of "no telephony database. Will check for Android apn on next boot:"
Code:
SQLITE3="/bin/sqlite3"
[B]DB="/data/data/com.android.providers.telephony/databases/telephony.db"[/B]
if [ -e $DB ] ; then
if [ "`$SQLITE3 $DB 'SELECT numeric FROM carriers;' | grep 310995`" != "310995" ] ; then
echo Creating android apn
"$SQLITE3" "$DB" "INSERT INTO carriers VALUES(NULL, 'Android' , '310995' , '310' , '995' , 'internet' , '*' , '*' , '*' , NULL, NULL, NULL, NULL, 'null' , 'default' , 1);"
fi
else
[B] echo No telephony database. Will check for android apn on next reboot[/B]
fi
After that it says "chmod: 1000 no such file or directory."
Code:
if [ -d /data/app ] ; then
if [ -d /sdcard/AndroidApps ] ; then
echo Copying Applications
cp /sdcard/AndroidApps/* /data/app
[B] chown 1000 1000 /data/app/*[/B]
fi
fi
Click to expand...
Click to collapse
The chown line has been fixed and will be uploaded soon.
The no telephony database line should go away after first bootup. Does it not?
MBurris: the setupmodem.sh script you have must be an older version as I had already removed the lines you mentioned. Anything else?
now I understand, you want the stuff added back *in*
It is done, added to ppp-on-dialer where it belongs.
Also completely fixed the data.gz stuff by eliminating data.gz. Now the initrd will create a new data.img if there isn't one there.
support for data.img backups from bootup as well, just create a /sdcard/backup folder
@Vilord: Have you added the new stuff into your latest initrd.gz (on google download)?
Edit: After I used the latest files from google download all the files on my SD card are totally gone :s. I booted Android Original ION hero build, and back in Windows all files are gone on my SD card :s
Hi there, dunno if this belongs to the ION question and answer thread, but could anyone be able to make one of the roms with this:
http://android-unleashed.com/2009/06/htc-hero-theme-1-2-for-the-android-g1.html
Cause i think this theme would be very cool on this ion builds..
Still having issues with the phone not waking up.
Using pm.sleepmode=1, otherwise, as you know, the battery life lasts about 2 hours.
KAIS110
radem205 said:
@Vilord: Have you added the new stuff into your latest initrd.gz (on google download)?
Edit: After I used the latest files from google download all the files on my SD card are totally gone :s. I booted Android Original ION hero build, and back in Windows all files are gone on my SD card :s
Click to expand...
Click to collapse
I think this is due to corruption on the SD card, coupled with the creation of a large file (data.img). I'll post an updated initrd in an hour that has filesystem checking on the SD card before it tries to do anything else, that should avoid wiping out people's stuff.
EDIT: sorry, hit go advanced and post by accident and double posted
JeckyllHavok said:
Hi there, dunno if this belongs to the ION question and answer thread, but could anyone be able to make one of the roms with this:
http://android-unleashed.com/2009/06/htc-hero-theme-1-2-for-the-android-g1.html
Cause i think this theme would be very cool on this ion builds..
Click to expand...
Click to collapse
I'm with you. 3 threads and no real response at getting themes. I tried it myself by manually overwriting the apps, data files and framework as the update would but it hangs at boot or crashes mercilessly once the desktop appears beyond nonfunctional.
mburris, that's what prompted me to post the question about how to debug bootup. This is every bit a development issue. Those are signed apps that override the ION ones and they should "just work" so what's wrong and who's at fault . Plus it's hard for us to really troubleshoot users' issues with modems and startup without something better than dmesg. Then users can attach a log to their posts for us to look at.
Posted to the vogue people:
Okay the initrd.gz on google code has been updated yet again.
This time is a major update with repaired bell SMS (thank you Martin), new libgps (thank you Steven), and statically linked filesystem checks (that was me).
On my phone, it took about a minute to create a new data.img (*don't use data.gz!!!*)
You'll want to use martin's new zImage from here
MBurris, does it just work now, or is there still some tweaking for kaiser?
---
For themeing, it is *very* difficult to theme an ion build. Much easier to theme the opensource builds, but they aren't as fast.
For themeing, it is *very* difficult to theme an ion build. Much easier to theme the opensource builds, but they aren't as fast.
Click to expand...
Click to collapse
How difficult are we talking? Mssmision had two ION builds with Hero. What's involved?
Latest initrd and zImage:
336x448 resolution works again! SOOO much nicer than the non-4:3 included with the install package you posted...
Noticed the Blue LED blinks now... Something good coming?
Data, Market, Txt, calls, call-waiting, all work.
GoogleTalk works again,
runs SOOOO fast....
My phone has rebooted by itself twice since I installed Myn's Donut. Are there any logs or anything I can look at for clues as to why it's rebooting by itself? The last time it happened I think I was getting a call...
Anyone????
fldash said:
My phone has rebooted by itself twice since I installed Myn's Donut. Are there any logs or anything I can look at for clues as to why it's rebooting by itself? The last time it happened I think I was getting a call...
Click to expand...
Click to collapse
Mine has done that, i think it's a RAM thing
mrono said:
Mine has done that, i think it's a RAM thing
Click to expand...
Click to collapse
After reboot, do:
cat /proc/last_kmsg
If you want to post it here, then do:
cat /proc/last_kmsg > /sdcard/errlog
To put it on your sdcard (the rest is self-explanatory).
These errors are only for if it's a kernel issue. That spits out a log of the last thing the kernel was doing before it barfed. Random reboots are usually kernel issues.
Thanks... I've used linux sparingly (way back before it was user friendly), just can't really remember anything...
Code:
[ 5497.252398] r7:00000000 r6:c036dc28 r5:60000013 r4:00001000
[ 5497.252398] [<c0048fa8>] (audio_write+0x0/0x33c) from [<c00ac1ec>] (vfs_write
+0xb8/0x148)
[ 5497.252398] [<c00ac134>] (vfs_write+0x0/0x148) from [<c00ac340>] (sys_write+0
x44/0x70)
[ 5497.252398] r7:0000b618 r6:c443c620 r5:00000000 r4:00000000
[ 5497.252398] [<c00ac2fc>] (sys_write+0x0/0x70) from [<c00269e0>] (ret_fast_sys
call+0x0/0x2c)
[ 5497.252398] r8:c0026b64 r7:00000004 r6:0000adb8 r5:00001000 r4:00000000
[ 5497.252398] Code: e59f3020 e5952024 e5933000 e7923103 (e7930104)
[ 5497.252860] Kernel panic - not syncing: Fatal exception
[ 5497.262476] Rebooting in 3 seconds..audio timer expired
Hard to tell what exactly went wrong... do we need more info (further up?)...
fldash said:
Thanks... I've used linux sparingly (way back before it was user friendly), just can't really remember anything..
Hard to tell what exactly went wrong... do we need more info (further up?)...
Click to expand...
Click to collapse
Yes, you can attach files to this forum. Rename it to errlog.txt and attach it.
Had to zip it up.... let me know if you find anything out...
Looks like I was right... It happened right when I received a call...
Code:
[ 5497.233576] 7500 Audio: Ring
[ 5497.240610] audpp: enable(-1)
[ 5497.244540] Unable to handle kernel NULL pointer dereference at virtual address 00000030
min e has had a random rebooting problem too. Have you settled on what it is? Is it the kernel or the RAM?
Thanks...
Fix Modem / Baseband JB AT&T ONLY... Sure did fix my problem!
Diagnosis for: (Random) no sound; no phone connectivity such as: WIFI; BLUETOOTH; GSM.
Can happen: Flashing wrong fw; Flash failure.
NOTE: Android SDK is required, go to your OS below and view "prerequisites" for more information...
Windows 7 methodPrerequisites: Android SDK - Tools and SDK! (install here.)
Instructions:
(1. Make a folder in the directory "C:/" and name it "qinara."
(2. Download the following attachment below: "NON-HLOS.bin" (In the attachments / downloads section)
(3. Place "NON-HLOS.bin" in the "C:/qinara/" folder.
(4. Open a cmd prompt.
(5. Change Directory (CD) the cmd to your install location of Android SDK's Platform Tools (type it in to the command prompt.) to make
a command like the following example. Example: CD C:/users/YOUR-USERNAME/android/sdk/platform-tools
(6. Type the following command in...
Code:
fastboot flash modem C:/qinara/NON-HLOS.bin
(7. Wait for the modem to be sent and installed.
(8. Type the following command in...
Code:
fastboot reboot
(9. When the phone boots everything but gsm will be working, to fix it go to settings. From the main settings menu, go to mobile network. It
will freeze, press the home button. Once you press the home button open up recent apps by pressing the multi-tasking button.
it freezes.
(10. Open up your multi-tasking menu and open settings.
(11. Set "select network" to "automatic," then your done.
Ubuntu / Other Linux-distro methodPrerequisites: Android SDK - Tools only! (to install type the following cmds in terminal...)
Code:
sudo add-apt-repository ppa:nilarimogard/webupd8
Code:
sudo apt-get update
Code:
sudo apt-get install android-tools-adb android-tools-fastboot
Instructions:
(1. Make a folder in the directory "/home/USERNAME/" and name it "qinara."
(2. Download the following attachment below: "NON-HLOS.bin" (In the attachments / downloads section)
(3. Place "NON-HLOS.bin" in the "/home/USERNAME/qinara/" folder.
(4. Open a terminal.
(5. Type the following command in...
Code:
fastboot flash modem /home/USERNAME/qinara/NON-HLOS.bin
(6. Wait for the modem to be sent and installed.
(7. Type the following command in...
Code:
fastboot reboot
(8. When the phone boots everything but gsm will be working, to fix it go to settings. From the main settings menu, go to mobile network. It
will freeze, press the home button. Once you press the home button open up recent apps by pressing the multi-tasking button.
it freezes.
(9. Open up your multi-tasking menu and open settings.
(10. Set "select network" to "automatic," then your done.
Downloads
-NON-HLOS.bin
Ask any questions below... :fingers-crossed:
Kinda feels that way...but on the Linux instructions just use ~/qinara/NON-HLOS.bin instead of /home/USERNAME/qinara/NON-HLOS.bin
~/ means the users home directory
Also, and I'm gonna add this to my faq, but download the fastboot I linked, rename to moto-fastboot, place it in ~/bin and add that to $PATH in ~/.bashrc (or where ever your preferred disto prefers it to be)
My actual path line in .bashrc (the part above I'm referring to is in bold)
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/share/android/bin:/share/android/adt/sdk/tools:/share/android/adt/eclipse:/share/android/adt/sdk/platform-tools:$HOME/bin:"
For the curious, I keep all my Android stuff on its own partition (/share/android) so all I have to do is add those directories to my $PATH if I decide to disto hop. If you dualboot, you can do the same thing only set the partition as NTFS or ext2 (there's an windows ext2 driver). I disto hop about once a month.
Don't have access to my desktop right now trying to install my new ssd and put Linux mint on it. (Noticed your a Linux guy, do you like mint?) Anyways I'll be sure to add that in later. Thanks.
Sent from my MB886 using xda premium
Mints OK. I prefer Mint Debian, but I'm not a fan of Ubuntu. Pure Debian Stable and Testing is also a good choice.
Arch Linux and its derivatives are nice but aren't noob friendly and are prone to breakage due to being so bleeding edge. Manjaro is a noob friendly distro based on Arch repo snapshots with bug fixes.
About to hop to Slackware 14 myself. Gonna be my first time using it.
All the other distros I've used -- too long ago to be fair and relevant to what's out now.
help...
can you tell me its working or not cause i have some gsm problem no signal due to band change
(bootloader) Variable not supported!
target reported max download size of 31457280 bytes
Invalid sparse file format at header magi
sending sparse 'modem' (28172 KB)...
OKAY [ 2.430s]
writing 'modem'...
(bootloader) Unknown chunk type
FAILED (remote failure)
finished. total time: 3.720s
Oooooh Cool.....now after trying to find how to get out of the mess that created. I still dont have signal lol
i really need my signal back ...anyone could help me ,,,i am afraid this method does brick my phone ..and another question is if i install the stock rom from RSD lite , will i lost my root access???
yashrab said:
i really need my signal back ...anyone could help me ,,,i am afraid this method does brick my phone ..and another question is if i install the stock rom from RSD lite , will i lost my root access???
Click to expand...
Click to collapse
Yeah this method bricked my phone. I had to go back to stock through RSD, and lost root access. The good news is it was so easy to reacquire root thanks to Dan Rosenberg's programs.
Can I install stock though myth tool.. I think it does work just like RSD?.. Plz tell me cause I am totally noob in this part.. And I don't want to brick my phone..
Sent from my MB886 using xda premium
Moto Atrix work on any GSM carrier or.. ?
skeevydude said:
Mints OK. I prefer Mint Debian, but I'm not a fan of Ubuntu. Pure Debian Stable and Testing is also a good choice.
Arch Linux and its derivatives are nice but aren't noob friendly and are prone to breakage due to being so bleeding edge. Manjaro is a noob friendly distro based on Arch repo snapshots with bug fixes.
About to hop to Slackware 14 myself. Gonna be my first time using it.
All the other distros I've used -- too long ago to be fair and relevant to what's out now.
Click to expand...
Click to collapse
I have question. If I buy Moto Atrix HD will it possible to make it carrier-unlocked so I can use it here in Saudi Arabia where 90% devices are not carrier-locked?
lonesomedove said:
I have question. If I buy Moto Atrix HD will it possible to make it carrier-unlocked so I can use it here in Saudi Arabia where 90% devices are not carrier-locked?
Click to expand...
Click to collapse
You should be able to, but I'll tell ya that some users have gone through multiple places to get it unlocked since not all the unlock services have the updated unlock codes we need.
Nope
Code:
C:\Program Files\Android SDK\sdk\platform-tools>fastboot flash modem C:/qinara/NON-HLOS.bin
(bootloader) Variable not supported!
target reported max download size of 31457280 bytes
Invalid sparse file format at header magi
sending sparse 'modem' (28164 KB)...
OKAY [ 2.185s]
writing 'modem'...
(bootloader) Unknown chunk type
FAILED (remote failure)
finished. total time: 3.429s
Yup. Didn't work.
Any ideas?
BackDoorNoBaby said:
Code:
C:\Program Files\Android SDK\sdk\platform-tools>fastboot flash modem C:/qinara/NON-HLOS.bin
(bootloader) Variable not supported!
target reported max download size of 31457280 bytes
Invalid sparse file format at header magi
sending sparse 'modem' (28164 KB)...
OKAY [ 2.185s]
writing 'modem'...
(bootloader) Unknown chunk type
FAILED (remote failure)
finished. total time: 3.429s
Yup. Didn't work.
Any ideas?
Click to expand...
Click to collapse
You didn't use OUR fastboot. I have a link in our fastboot guide, and a direct link here.
/Thank you for posting the full terminal output, command and all.
//It helps
///Most just post "Help, Help, Help" X doesn't work.
Thanks
skeevydude said:
You didn't use OUR fastboot. I have a link in our fastboot guide, and a direct link here.
/Thank you for posting the full terminal output, command and all.
//It helps
///Most just post "Help, Help, Help" X doesn't work.
Click to expand...
Click to collapse
Got it. Thanks.
I'll check it out after my classes tonight and give an update.
Yup
Yup. That did it. Fixed the issue.
Back to my 4G!
Thanks again.
Anyone tried with CM10.2?
Nope. I know Cyanogenmod has issues at the moment, but I don't know if this will fix it.
Best I can say is to try it. Worst case: you reinstall the ROM. Or you can wait for a release version of CM 10 instead of a nightly.
I can say this didn't brick my phone, so you shouldn't have to worry about it. (but as always - no guarantee)
Sent from my Atrix HD using xda app-developers app
I really need help, I need something like this but for a company in Mexico. I tried this but it didn't worked.
Question if i reflash back to stock eith RSD LITE or myth tools will that fix my baseband i delete my baseband by accident
Dumb me
wcdma and lte network problem
i happen to own the mb886 the lte and wcdma used to work then i mistakenly went to change my base band to cellular (800-mhz) then the network went off so i changed it to (aus2 band (gsm-900/ dcs-1900/wcdma-850/wcdma-pcs-1900) but now am only able to get 2g or edge networks but am also in a 3g coverd area. can you guys please help me out
Hi all!
I have an asus memo pad me176cx. I did some stuff with it and now it seems bricked, but not fully (as I hope...).
But I am not very experienced user with android, so I have a few adjacent questions to define myself in root concepts.
On general - I tried to install debian linux on my tablet. Looking ahead - i managed to run installer. But in order...
My actions before i got brick.
I got an issue similar to this one after updates. There i saw that tablet has a kind of uefi. And i decided to run debian. Prepared usb-installer, connected that one and keyboard via OTG by hub(i have one with led indicator). I pressed F2 and power button on tablet, and saw uefi. There did boot override -> UEFI jet flash. And debian installer ran succesfully.
But after about a minute on-hub led becomes dark, as did flash led. Kbd was not working. At that moment i was on network config step and decided to reboot tablet. Power button about 10sec - and all over again. But after a while - same issue. It would not be nice if flash comes down while packages copying - I thought. And... Of cause boot into uefi to search some otg-power-options (btw i got same behaviour with otg in uefi and was forced to make changes quickly or reboot).
I don`t remember what option exactly i changed, but i have only hw buttons on tablet working. No otg at all (led is always dark now, no flash none kbd works), no touchscreen (i have twrp installed and checked there).
Finally, what works.
I can press vol+ - vol- - pwr, then see "Fastboot startnig... #1 #2 #3" on display - and get into some mode, called DNX (as i googled).
Code:
fastboot devices
shows my tablet. But i can flash only osloader partition. Other way - error, unsupported operation. Also i can command
Code:
fastboot boot droidboot.img
and get into bootloader. This case at the bottom of screen shown "Waiting for fastboot cmd...". But
Code:
fastboot devices
shows notheng. Any other fastboot commands stuck on "wating for any device...". But with vol-buttons i can choose recovery mode, then press power and get into twrp and look on "Swipe to allow filesystem modification". But as far as touchscreen dows not work (as otg-keyboard) - i can`t do anything else. adbd seems not started yet, as
Code:
adb devices
shows nothing (or micro-usb plug simply disabled with uefi). And that is all, i can`t do anything else...
In fine, my questions are:
Mode started by "vol+ - vol- - pwr" - does it DNX or fastboot? How to find out what commnds i can run there? (At the moment I know 2 only: flash osloader and boot). Why flash ESP, erase, even get [some_var] does not work here? Is there a way to re-flash or reset uefi settings from this mode?
Or any other ways to reset uefi? (as possible without microwave...)
Also, what difference between osloader and bootloader? I suggest that osloader is a partition and bootloader is a program placed in that partition. But what exactly i do with command "fastboot flash osloader efilinux.efi"?
Sorry for lot of text, but I actualy don`t know how this modes called and got confused. Any help would be appriciated.
Anyway, thanks a lot!
mk3pq28 said:
I don`t remember what option exactly i changed, but i have only hw buttons on tablet working. No otg at all (led is always dark now, no flash none kbd works), no touchscreen (i have twrp installed and checked there).
Click to expand...
Click to collapse
I think I've seen some option that changes the way USB OTG is set up. By changing it you have probably disabled USB OTG entirely now... :/
mk3pq28 said:
Mode started by "vol+ - vol- - pwr" - does it DNX or fastboot?
Click to expand...
Click to collapse
DNX
mk3pq28 said:
How to find out what commnds i can run there? (At the moment I know 2 only: flash osloader and boot). Why flash ESP, erase, even get [some_var] does not work here?
Click to expand...
Click to collapse
DNX is not a full fastboot implementation. It runs in the firmware, somewhere during early UEFI initialization. It's mostly designed for recovery when the (Android) bootloader is no longer working. The two commands you know are the only ones I'm aware of, sorry :/
mk3pq28 said:
Is there a way to re-flash or reset uefi settings from this mode?
Or any other ways to reset uefi? (as possible without microwave...)
Click to expand...
Click to collapse
I can imagine that it is possible but I have to admit that I don't know how. For example there is Intel® Platform Flash Tool Lite that allows re-flashing pretty much all of the device, but I'm not sure where you'd get the factory files. At the moment, I don't have any suggestions how to solve your problem... :/
mk3pq28 said:
Also, what difference between osloader and bootloader? I suggest that osloader is a partition and bootloader is a program placed in that partition. But what exactly i do with command "fastboot flash osloader efilinux.efi"?
Click to expand...
Click to collapse
osloader refers to the EFI application that is started. efilinux.efi is an Android bootloader for UEFI. In this case it's not actually written persistently somewhere, it is just loaded into RAM and then executed.
lambdadroid,
first of all - thanks a lot for your participating!
So, after your clarification I made a few suggestions.
lambdadroid said:
I can imagine that it is possible but I have to admit that I don't know how. For example there is Intel® Platform Flash Tool Lite that allows re-flashing pretty much all of the device, but I'm not sure where you'd get the factory files.
Click to expand...
Click to collapse
First one. I installed it and downloaded service firmware. Flash tool found my tablet and showed some info:
Plaform: Intel Corporation
Hardware: Intel Android AD
Status: DNX_OS
Connected on port: 0/1 (number of usb port, i think)
DnX SN: Baytrail<some>
Then i selected service firmware and flash tool showed me flash.xml in "flash file" field. Everything looks normal at the moment, until i pressed flash)
The only one record appeared in log below: "Failed to reboot the device. Flash failed". And i don`t know someshing else i can make here.
I am new here and can`t post links to outside, but i googled some more meaningful examples of log by my error. And as i understood chain of commands - flash tool does exactly same as i did. I.e. flashes osloader in dnx mode, then boots in fastboot and flashes another partitions there. Correct me if i`m wrong but it does not seems for my case, unfortunately
And the second one, more complex.
I had googled a lot about uefi and it`s settings location. I found out that "settings" made in uefi are stored in memory called NVRAM. It is non-volatile and can not be reset by battery disconnected (yes, i tried that, ofc). But there should be a flag called NVRAM_IS_VALID. And once it gets disabled - uefi is forced to reset all the settings to defaults next boot time. I`m not sure, but looks like my solution!
And I can suggest two ways of setting this flag.
lambdadroid said:
osloader refers to the EFI application that is started. efilinux.efi is an Android bootloader for UEFI.
Click to expand...
Click to collapse
First one - uefi shell. If i can replace bootloader, may it be a shell? I downloaded one from github (a link should be here ) but have no success yet. It`s size about 930kb, but my working one bootloader - is 2mb. And when i make flash - nothing happens:
Code:
# fastboot flash osloader Shell.efi
target didn't report max-download-size
sending 'osloader' (929 KB)...
Nothing more. Maybe there should be some special kind of uefi-shell for android? Or I can`t flash nothing but bootloder into osloader partition at all? But even if i`m succeed - i`m not sure that uefi would not disable otg before shell get running.
So my second and the last sugesstion. It`s fully theoretical, but... I need to write a custom efi app (.efi files are kind of applications for uefi, written in c, right?) that would be flashed into osloader and should disable NVRAM_IS_VALID flag (ohh, does that flag exists at all?...). Does it possible?
Anyway, thanks a lot for any help!
mk3pq28 said:
I installed it and downloaded service firmware. Flash tool found my tablet and showed some info:
Plaform: Intel Corporation
Hardware: Intel Android AD
Status: DNX_OS
Connected on port: 0/1 (number of usb port, i think)
DnX SN: Baytrail<some>
Then i selected service firmware and flash tool showed me flash.xml in "flash file" field. Everything looks normal at the moment, until i pressed flash)
The only one record appeared in log below: "Failed to reboot the device. Flash failed". And i don`t know someshing else i can make here.
I am new here and can`t post links to outside, but i googled some more meaningful examples of log by my error. And as i understood chain of commands - flash tool does exactly same as i did. I.e. flashes osloader in dnx mode, then boots in fastboot and flashes another partitions there. Correct me if i`m wrong but it does not seems for my case, unfortunately
Click to expand...
Click to collapse
Okay, yeah, that's very well possible. I've never used that tool and don't know what it does.
mk3pq28 said:
I had googled a lot about uefi and it`s settings location. I found out that "settings" made in uefi are stored in memory called NVRAM. It is non-volatile and can not be reset by battery disconnected (yes, i tried that, ofc). But there should be a flag called NVRAM_IS_VALID. And once it gets disabled - uefi is forced to reset all the settings to defaults next boot time. I`m not sure, but looks like my solution!
Click to expand...
Click to collapse
It makes sense that the settings are stored in the NVRAM. But that's about all I can comment on; I'm not sure if that flag exists on this tablet or even if it will reset to the correct results.
mk3pq28 said:
uefi shell. If i can replace bootloader, may it be a shell? I downloaded one from github (a link should be here ) but have no success yet. It`s size about 930kb, but my working one bootloader - is 2mb. And when i make flash - nothing happens:
Code:
# fastboot flash osloader Shell.efi
target didn't report max-download-size
sending 'osloader' (929 KB)...
Nothing more. Maybe there should be some special kind of uefi-shell for android? Or I can`t flash nothing but bootloder into osloader partition at all? But even if i`m succeed - i`m not sure that uefi would not disable otg before shell get running.
Click to expand...
Click to collapse
You may need to run "fastboot boot droidboot.img" (or any other image) too to have Fastboot run the EFI application. The Shell application will then likely ignore the additional boot image. However, as you mention, I believe that OTG will get disabled before the shell is running. The UEFI shell application is no different from the UEFI Setup as far as OTG is concerned. So if you are unable to enter the setup with F2 then the UEFI shell will probably not work either. So even if the Shell starts, I doubt that you will be able to run commands.
And no, there is no special kind of UEFI Shell for Android. This is all unrelated to Android actually.
mk3pq28 said:
It`s fully theoretical, but... I need to write a custom efi app (.efi files are kind of applications for uefi, written in c, right?) that would be flashed into osloader and should disable NVRAM_IS_VALID flag (ohh, does that flag exists at all?...). Does it possible?
Click to expand...
Click to collapse
That's actually something I considered suggesting yesterday. I decided against it because it's obviously not trivial and I'm not sure if EFI applications can actually access that flag or BIOS settings in general... However, I can assist you with how to write EFI applications in general. They are usually written in C and then compiled using some funky compiler flags and tools to .efi.
An example for a very simple EFI application is "bootstrap.efi" that is used in me176c-boot. The source for it is available at https://github.com/me176c-dev/me176c-boot/tree/master/bootstrap
In me176c-boot it runs as first EFI application and checks if the tablet was booted due to charger insertion; if yes then it sets an EFI variable. I'm not sure if the flag you mention is exposed as an EFI variable. However, persistent EFI variables are also stored in the NVRAM, so that might be something to look at. It's built using Meson (see meson.build). The build script might be of help to you.
lambdadroid said:
That's actually something I considered suggesting yesterday. I decided against it because it's obviously not trivial and I'm not sure if EFI applications can actually access that flag or BIOS settings in general...
Click to expand...
Click to collapse
But I don`t see any other kind of solution.
lambdadroid said:
It makes sense that the settings are stored in the NVRAM. But that's about all I can comment on; I'm not sure if that flag exists on this tablet or even if it will reset to the correct results.
Click to expand...
Click to collapse
I think it won`t get worse anyway, so...
Thanks a lot for your general information about efi. I took that and was able to get started. I did some experiments and had interesting results. Little notice - i`m on debian.
At first
I had installed gnu-efi and mason. Also googled "Hello world" in efi-style. I still cant post links to outside but the code is below. Looking ahead - had no result with one Print because it was closed very fast so i added a loop.
Code:
#include <efi.h>
#include <efilib.h>
EFI_STATUS
EFIAPI
efi_main (EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
{
InitializeLib(ImageHandle, SystemTable);
for (int i = 0; i < 5000; ++i)
{
Print(L"B It works!!!\r\n");
}
return EFI_SUCCESS;
}
Looks simple.
Also i took your meson.build and replaced file names with mine. But i got a few conpilation errors so i had removed some keys from target. Here it is:
Code:
project('tutorial', 'c')
arch = host_machine.cpu_family()
efi_include_dir = '/usr/include/efi'
efi_include = include_directories(
efi_include_dir,
join_paths(efi_include_dir, arch),
is_system: true
)
efi_lds = '/usr/lib/elf_' + arch + '_efi.lds'
efi_crt = '/usr/lib/crt0-efi-' + arch + '.o'
bootstrap_lib = shared_library('bootstrap',
'hello_efi.c',
include_directories: [efi_include],
objects: [efi_crt],
link_args: [
'-T', efi_lds,
'-nostdlib',
'-z', 'nocombreloc',
'-Wl,-Bsymbolic',
'-lefi', '-lgnuefi'
]
)
objcopy = find_program('objcopy')
custom_target('bootstrap.efi',
output: 'bootstrap.efi',
input: bootstrap_lib,
command: [objcopy,
'--target=efi-app-' + arch,
'-j', '.text',
'-j', '.sdata',
'-j', '.data',
'-j', '.dynamic',
'-j', '.dynsym',
'-j', '.rel',
'-j', '.rela',
'-j', '.reloc',
'@[email protected]', '@[email protected]'
],
install: true,
install_dir: ''
)
hello_efi.c contains source code from above.
This is my first meson build so if yoy see some obvious mistakes or excess options - i would be much appreciated if you point on them.
At second
I created builddir, commanded "meson" and "ninja" and got such output:
Code:
[1/3] Compiling c object '[email protected]/hello_efi.c.o'
../hello_efi.c: In function ‘efi_main’:
../hello_efi.c:13:9: warning: passing argument 1 of ‘Print’ from incompatible pointer type [-Wincompatible-pointer-types]
Print(L"B It works!!!\r\n");
^~~~~~~~~~~~~~~~~~~~
In file included from ../hello_efi.c:2:0:
/usr/include/efi/efilib.h:404:1: note: expected ‘CHAR16 * {aka short unsigned int *}’ but argument is of type ‘int *’
Print (
^~~~~
[3/3] 'Generating bootstrap.efi with a custom command.'
I am not very familiar with C and can`t get rid of warning to print my message properly. As far as Print requires CHAR16 pointer only first symbol is printed. How to properly get and array of CHAR16 from "a string"?
Anyway, it`s a bite of success.
And at third, final
I was very happy and connected tab (in DNX, ofc) with pc and commaned: "fastboot flash osloader bootstrap.efi".
Code:
target didn't report max-download-size
sending 'osloader' (44 KB)...
And nothing more. Command is still running untill tablet reboot. But!
I have another ont efilinux.efi was downloaded from somewhere. And it flashes correctly! The only difference is on size: 44KB vs 2MB.
I did some research with dd-util and found one interesting thing. It is allowed to flash osloader partition in dnx mode with completely any binary data within (nearly) 1MB .. 20MB. In this case "fastboot flash osloader ..." says OK twice and finishes properly.
So, my flow after compilation have a such look (2057216 - is a size of my working example efilinux.efi)
Code:
$ dd if=/dev/zero of=container.efi count=2057216 iflag=count_bytes
$ dd if=bootstrap.efi of=container.efi conv=nocreat,notrunc
# fastboot flash osloader container.efi
# fastboot boot droidboot.img
... and i have a char 'B' on screen printed 5000 times. I think it`s another one bite of success
But i can`t find any docs for efi.h (efilib.h). Which capabilities they provides? What is set of functinos?
There is another example with
Code:
uefi_call_wrapper(ST->ConOut->OutputString, 2, ST->ConOut, L"Hello World!\n");"
but it is not obvious how to work with uefi services in this way.
I googled that most of uefi settings are stored in "Setup" variable. I think it may be useful at least to print them. But don`t know how, yet.
I will google it further but in general i don`t know what is the next step should be.
Also i have an idea to use such trick to flash efi-shell. But didn`t tried yet.
mk3pq28 said:
At first
I had installed gnu-efi and mason. Also googled "Hello world" in efi-style. I still cant post links to outside but the code is below. Looking ahead - had no result with one Print because it was closed very fast so i added a loop.
Code:
#include <efi.h>
#include <efilib.h>
EFI_STATUS
EFIAPI
efi_main (EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
{
InitializeLib(ImageHandle, SystemTable);
for (int i = 0; i < 5000; ++i)
{
Print(L"B It works!!!\r\n");
}
return EFI_SUCCESS;
}
Looks simple.
Also i took your meson.build and replaced file names with mine. But i got a few conpilation errors so i had removed some keys from target. Here it is:
Code:
project('tutorial', 'c')
arch = host_machine.cpu_family()
efi_include_dir = '/usr/include/efi'
efi_include = include_directories(
efi_include_dir,
join_paths(efi_include_dir, arch),
is_system: true
)
efi_lds = '/usr/lib/elf_' + arch + '_efi.lds'
efi_crt = '/usr/lib/crt0-efi-' + arch + '.o'
bootstrap_lib = shared_library('bootstrap',
'hello_efi.c',
include_directories: [efi_include],
objects: [efi_crt],
link_args: [
'-T', efi_lds,
'-nostdlib',
'-z', 'nocombreloc',
'-Wl,-Bsymbolic',
'-lefi', '-lgnuefi'
]
)
objcopy = find_program('objcopy')
custom_target('bootstrap.efi',
output: 'bootstrap.efi',
input: bootstrap_lib,
command: [objcopy,
'--target=efi-app-' + arch,
'-j', '.text',
'-j', '.sdata',
'-j', '.data',
'-j', '.dynamic',
'-j', '.dynsym',
'-j', '.rel',
'-j', '.rela',
'-j', '.reloc',
'@[email protected]', '@[email protected]'
],
install: true,
install_dir: ''
)
hello_efi.c contains source code from above.
This is my first meson build so if yoy see some obvious mistakes or excess options - i would be much appreciated if you point on them.
At second
I created builddir, commanded "meson" and "ninja" and got such output:
Code:
[1/3] Compiling c object '[email protected]/hello_efi.c.o'
../hello_efi.c: In function ‘efi_main’:
../hello_efi.c:13:9: warning: passing argument 1 of ‘Print’ from incompatible pointer type [-Wincompatible-pointer-types]
Print(L"B It works!!!\r\n");
^~~~~~~~~~~~~~~~~~~~
In file included from ../hello_efi.c:2:0:
/usr/include/efi/efilib.h:404:1: note: expected ‘CHAR16 * {aka short unsigned int *}’ but argument is of type ‘int *’
Print (
^~~~~
[3/3] 'Generating bootstrap.efi with a custom command.'
I am not very familiar with C and can`t get rid of warning to print my message properly. As far as Print requires CHAR16 pointer only first symbol is printed. How to properly get and array of CHAR16 from "a string"?
Anyway, it`s a bite of success.
Click to expand...
Click to collapse
I believe the compiler argument that avoids this error is -fshort-wchar, but you seem to have removed all c_args: https://github.com/me176c-dev/me176c-boot/blob/master/bootstrap/meson.build#L33 All of these compiler arguments have a purpose, can you check which one is causing errors exactly and post the error here?
mk3pq28 said:
And at third, final
I was very happy and connected tab (in DNX, ofc) with pc and commaned: "fastboot flash osloader bootstrap.efi".
Code:
target didn't report max-download-size
sending 'osloader' (44 KB)...
And nothing more. Command is still running untill tablet reboot. But!
I have another ont efilinux.efi was downloaded from somewhere. And it flashes correctly! The only difference is on size: 44KB vs 2MB.
I did some research with dd-util and found one interesting thing. It is allowed to flash osloader partition in dnx mode with completely any binary data within (nearly) 1MB .. 20MB. In this case "fastboot flash osloader ..." says OK twice and finishes properly.
So, my flow after compilation have a such look (2057216 - is a size of my working example efilinux.efi)
Code:
$ dd if=/dev/zero of=container.efi count=2057216 iflag=count_bytes
$ dd if=bootstrap.efi of=container.efi conv=nocreat,notrunc
# fastboot flash osloader container.efi
# fastboot boot droidboot.img
Click to expand...
Click to collapse
That's weird, the size shouldn't matter at all. But it doesn't really matter, as long as it works.
mk3pq28 said:
But i can`t find any docs for efi.h (efilib.h). Which capabilities they provides? What is set of functinos?
There is another example with
Code:
uefi_call_wrapper(ST->ConOut->OutputString, 2, ST->ConOut, L"Hello World!\n");"
but it is not obvious how to work with uefi services in this way.
I googled that most of uefi settings are stored in "Setup" variable. I think it may be useful at least to print them. But don`t know how, yet.
I will google it further but in general i don`t know what is the next step should be.
Click to expand...
Click to collapse
Generally, the interface exposed by gnu-efi is according to the UEFI specification: http://www.uefi.org/sites/default/files/resources/UEFI Spec 2_7_A Sept 6.pdf
In there you can find a list of protocols you can use, e.g. search for the "OutputString" method used above.
uefi_call_wrapper is an implementation detail of gnu-efi, but basically it's uefi_call_wrapper(<method>, <number of parameters>, <parameters...>).
The main remaining question, and the one I can't really help you with is how you can reset your BIOS settings using the UEFI application API. Maybe something to look at first would be the "Variable Services" (see UEFI specification). Maybe you can change one of the EFI variables to restore the default BIOS settings.
lambdadroid said:
I believe the compiler argument that avoids this error is -fshort-wchar, but you seem to have removed all c_args: https://github.com/me176c-dev/me176c-boot/blob/master/bootstrap/meson.build#L33 All of these compiler arguments have a purpose, can you check which one is causing errors exactly and post the error here?
Click to expand...
Click to collapse
Yes, this key removed warning. Thanks.
lambdadroid said:
Generally, the interface exposed by gnu-efi is according to the UEFI specification: http://www.uefi.org/sites/default/files/resources/UEFI Spec 2_7_A Sept 6.pdf
In there you can find a list of protocols you can use, e.g. search for the "OutputString" method used above.
Click to expand...
Click to collapse
Exactly one i`m looking for. Thanks again!
Unfortunately there is nothing about NVRAM_IS_VALID there.
But there is a function called "ResetSystem()" (p.269). It should reset the entire platform as written in doc.
My code:
Code:
#include <efi.h>
#include <efilib.h>
EFI_STATUS
EFIAPI
#define SLEEP 100
efi_main (EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
{
InitializeLib(ImageHandle, SystemTable);
for (int i = 0; i < SLEEP; ++i)
{
Print(L"It works!!! #%d", i);
uefi_call_wrapper(ST->ConOut->OutputString, 2, ST->ConOut, L"\r\n");
}
int res = uefi_call_wrapper(RT->ResetSystem, 4, EfiResetCold, EFI_SUCCESS, 0, NULL);
for (int i = 0; i < SLEEP; ++i) Print(L"%d\r\n", res);
return EFI_SUCCESS;
}
}
Yes, i`d noticed that "The ResetSystem() function does not return".
But i`m not sure that i call it properly.
When i run the code above - it prints the message 100 times, then screen blinks and the next message appears: "EFILINUX ERROR [start_boot_logic:498] No valid target found.
Fallbacking to MOS" in about 3 sec. Looks like there no reboot in this case because of the intel logo is not shown. I have no system on my tablet, but it`s another story.
The main point is there is no black screen with intel logo for about 15-20 sec as in case of normal boot.
In addition i tried to change call with:
Code:
uefi_call_wrapper(RT->ResetSystem, 4, L"Wrong_argument", EFI_SUCCESS, 0, NULL)
and it prints "968832152" return code. Does it fail somewhere before ResetSystem() or exactly inside?
So am i calling this function correctly?
mk3pq28 said:
Yes, this key removed warning. Thanks.
Exactly one i`m looking for. Thanks again!
Unfortunately there is nothing about NVRAM_IS_VALID there.
But there is a function called "ResetSystem()" (p.269). It should reset the entire platform as written in doc.
My code:
Code:
#include <efi.h>
#include <efilib.h>
EFI_STATUS
EFIAPI
#define SLEEP 100
efi_main (EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
{
InitializeLib(ImageHandle, SystemTable);
for (int i = 0; i < SLEEP; ++i)
{
Print(L"It works!!! #%d", i);
uefi_call_wrapper(ST->ConOut->OutputString, 2, ST->ConOut, L"\r\n");
}
int res = uefi_call_wrapper(RT->ResetSystem, 4, EfiResetCold, EFI_SUCCESS, 0, NULL);
for (int i = 0; i < SLEEP; ++i) Print(L"%d\r\n", res);
return EFI_SUCCESS;
}
}
Yes, i`d noticed that "The ResetSystem() function does not return".
But i`m not sure that i call it properly.
When i run the code above - it prints the message 100 times, then screen blinks and the next message appears: "EFILINUX ERROR [start_boot_logic:498] No valid target found.
Fallbacking to MOS" in about 3 sec. Looks like there no reboot in this case because of the intel logo is not shown. I have no system on my tablet, but it`s another story.
The main point is there is no black screen with intel logo for about 15-20 sec as in case of normal boot.
In addition i tried to change call with:
Code:
uefi_call_wrapper(RT->ResetSystem, 4, L"Wrong_argument", EFI_SUCCESS, 0, NULL)
and it prints "968832152" return code. Does it fail somewhere before ResetSystem() or exactly inside?
So am i calling this function correctly?
Click to expand...
Click to collapse
I'm afraid ResetSystem() is not what you are looking for: ResetSystem() is only used to reboot the system, it does not "reset" any settings. So the screen flashes and you see that message because the tablet is restarted normally. (The bootloader you are using displays an error if you reboot without setting a "reboot target").
So you need to find some other method, or entirely different solution unfortunately. I just did a bit of research myself, but unfortunately didn't find anything of help..
EDIT: This method can be considered deprecated as now there is much easier and more effective solution thanks to the great u/HunterXProgrammer from Reddit. Check it here:
https://www.reddit.com/r/tasker/comments/11wi2om
OLD SOLUTION:
For a long long time I've been searching for a way to automate sending Whatsapp messages via Tasker. The previous method with inserting text into database doesn't work with newer Whatsapp versions and so far nobody was able/willing to fix it. But now, thanks to the whatsmeow library and the undeserved kindness of u/Black616Angel from Reddit, we finally have a working solution!
ROOT IS NOT REQUIRED, although it certainly makes things much easier.
REQUIREMENTS:
(1) Tasker
(2) Termux
(3) [FOR ROOTED USERS] A file manager with root access. I recommend MiXplorer.
(4) [FOR NON-ROOTED USERS] Termux:Tasker plugin (detailed configuration description here)
(5) One free place in Whatsapp multidevice feature
(6) A second device from which you will scan the QR code
INITIAL TERMUX SETUP:
(1) Open Termux, run apt update && apt upgrade and approve all when asked
(2) Run pkg install git
(3) Run git clone https://github.com/tulir/whatsmeow (this will clone the needed repository from Github to your device)
(4) Run pkg install golang and approve all when asked (it will download necessary tools to your device, around 800 MB)
PROCEDURE FOR ROOTED USERS:
(1) Open MiXplorer and go to /data/data/com.termux/files/home/whatsmeow/mdtest directory. Select main.go file and open it as text (in MiXplorer: OPEN AS... > Text > Text Editor). Find the line no. 114 (or very close) which should contain these signs: }(). Make a new line below and paste the following text there:
args := os.Args[1:]
if len(args) > 0 {
handleCmd(strings.ToLower(args[0]), args[1:])
return
}
Save the file and exit.
(2) Go back to Termux and enter cd whatsmeow/mdtest. Run go build command. Wait for the operation to be finished.
(3) Run ./mdtest command. If all has been done correct so far, you should see a QR code. Make a screenshot of it and send it to your secondary device. Then open Whatsapp on your main device, tap three dots in the right-upper corner, select Linked devices, select LINK A DEVICE and scan the QR code from your second device. You should see a new device linked, described as whatsmeow.
[Please note that the after a short while a new QR code is generated and the previous one gets invalid, so make this operation quickly.]
Go back to Termux. Exit the whatsmeow program by selecting CTRL on the Termux panel and tapping "c" on the keyboard.
(4) Open Tasker, create a task (name it as you wish) and add Run Shell action. In the Command field put the following text:
cd /data/data/com.termux/files/home/whatsmeow/mdtest && ./mdtest send <receipient_number_preceded_by_a_country_calling_code_without_"+"_sign">@s.whatsapp.net <your_message>
Edit above text according to your information. Example:
cd /data/data/com.termux/files/home/whatsmeow/mdtest && ./mdtest send [email protected] "My test message"
[If your message contains multiple lines, don't forget to put " sign at the beginning and the end of the message.]
You can also send images instead of just a text (optionally with a caption). Open Tasker, create a task (name it as you wish) and add Run Shell action. In the Command field put the following text:
cd /data/data/com.termux/files/home/whatsmeow/mdtest && ./mdtest sendimg <receipient_number_preceded_by_a_country_calling_code_without_"+"_sign">@s.whatsapp.net </exact/path/of/your/image.jpg> <[optional] any caption>
Edit above text according to your information. Example:
cd /data/data/com.termux/files/home/whatsmeow/mdtest && ./mdtest sendimg [email protected] /storage/emulated/0/image_example.jpg "My caption"
Mark Use root box. Go back to the task and run it by tapping the Play icon. If the message has been delivered to your recepient, you succeeded!
(5) If you want to send a message to a group instead of a single contact, you will need a precise jid ODE]number of this group. You can get it this way:
Make a test task in Tasker. Create a Shortcut action. Tap on the Magnifying glass icon and select Whatsapp: Whatsapp field, then select your group. In the command line of the Tasker action a string of signs will appear, among others the jid number of your group. It is located between jid= and %40.
Make another task (name it as you wish) with the Run Shell action. In the Command field put the following text:
cd /data/data/com.termux/files/home/whatsmeow/mdtest && ./mdtest send <jid_number_of_your_group>@g.us <your_message>
Edit above text according to your information. Example:
cd /data/data/com.termux/files/home/whatsmeow/mdtest && ./mdtest send [email protected] "My test message"
You can also send images to your groups instead of just a text. To do that, follow the pattern for the individual contact, but use the jid number of the group.
Mark Use root box. Go back to the task and run it by tapping the Play icon. If the message has been delivered to your recepient, you succeeded!
Now you can link your task to any profile as well as create additional tasks in order to automatically send different messages. Enjoy!
PROCEDURE FOR NON-ROOTED USERS:
(1) In Termux, enter cd whatsmeow/mdtest command. Then enter nano main.go command. The file editor will open. Find this block of text:
c := make(chan os.Signal)
input := make(chan string)
signal.Notify(c, os.Interrupt, syscall.SIGTERM)
go func() {
defer close(input)
scan := bufio.NewScanner(os.Stdin)
for scan.Scan() {
line := strings.TrimSpace(scan.Text())
if len(line) > 0 {
input <- line
}
}
}()
Below this block of text make a new line and paste the following text there:
args := os.Args[1:]
if len(args) > 0 {
handleCmd(strings.ToLower(args[0]), args[1:])
return
}
Save the file by selecting CTRL on the Termux panel and tapping "o" on the keyboard. Confirm by tapping ENTER. Exit the file by selecting CTRL on the Termux panel and tapping "x" on the keyboard.
(2) Make sure you are in the ~/whatsmeow/mdtest directory. Then run go build command. Wait for the operation to be finished.
(3) Run ./mdtest command. If all has been done correctly so far, you should see a QR code. Make a screenshot of it and send it to your secondary device. Then open Whatsapp on your main device, tap three dots in the right-upper corner, select Linked devices, select LINK A DEVICE and scan the QR code from your second device. You should see a new device linked, described as whatsmeow.
[Please note that the after a short while a new QR code is generated and the previous one gets invalid, so make this operation quickly.]
(4) Go back to Termux. Exit the whatsmeow program by selecting CTRL on the Termux panel and tapping "c" on the keyboard. You should return to the ~/whatsmeow/mdtest directory. Go back to the main directory by entering cd - command.
(5) Setup Tasker:Termux plugin. In Termux, enter the following commands:
$ mkdir -p /data/data/com.termux/files/home/.termux/tasker
$ chmod 700 -R /data/data/com.termux/files/home/.termux
Now, you have to grant Tasker the permission to run commands in Termux environment. You can do this in two ways:
- grant the permission manually in the device settings. Look at:
Android Settings > Apps > Tasker > Permissions > Additional permissions > Run commands in Termux environment
[The exact place of this permission may vary depending on the device model and software.]
- run the following commands on PC via Android Debug Bridge (ADB):
$ adb shell
$ pm grant net.dinglisch.android.taskerm com.termux.permission.RUN_COMMAND
[We assume you know how to use ADB. If not, please consult this page.]
(6) Go back to Termux. Enter cd .termux/tasker command. Make a new .txt file (name it as you wish) by entering nano <name_of_your_file>.txt command. In the editor, put the following text inside:
cd whatsmeow/mdtest
./mdtest send <receipient_number_preceded_by_a_country_calling_code_without_"+"_sign">@s.whatsapp.net <your_message>
Edit above text according to your information. Example:
cd whatsmeow/mdtest
./mdtest send [email protected] "My test message"
[If your message contains multiple lines, don't forget to put " sign at the beginning and the end of the message.]
You can also send images instead of just a text (optionally with a caption). In Termux, enter cd .termux/tasker command. Make a new .txt file (name it as you wish) by entering nano <name_of_your_file>.txt command. In the editor, put the following text inside:
cd /data/data/com.termux/files/home/whatsmeow/mdtest && ./mdtest sendimg <receipient_number_preceded_by_a_country_calling_code_without_"+"_sign">@s.whatsapp.net </exact/path/of/your/image.jpg> <[optional] any caption>
Edit above text according to your information. Example:
cd /data/data/com.termux/files/home/whatsmeow/mdtest && ./mdtest sendimg [email protected] /storage/emulated/0/image_example.jpg "My caption"
Save the file by selecting CTRL on the Termux panel and tapping "o" on the keyboard. Confirm by tapping ENTER. Exit the file by selecting CTRL on the Termux panel and tapping "x" on the keyboard.
(7) If you want to send a message to a group instead of a single contact, you will need the precise jid number of this group. You can get it this way:
Make a test task in Tasker. Create a Shortcut action. Tap on the Magnifying glass icon and select Whatsapp: Whatsapp field, then select your group. In the command line of the Tasker action a string of signs will appear, among others the jid number of your group. It is located between jid= and %40.
In Termux, enter cd .termux/tasker command. Make a new .txt file (name it as you wish) by entering nano <name_of_your_file>.txt command. In the editor, put the following text inside:
cd whatsmeow/mdtest
./mdtest send <jid_number_of_your_group>@g.us <your_message>
Edit above text according to your information. Example:
cd whatsmeow/mdtest
./mdtest send [email protected] "My test message"
You can also send images to your groups instead of just a text. To do that, follow the pattern for the individual contact, but use the jid number of the group.
Save the file by selecting CTRL on the Termux panel and tapping "o" on the keyboard. Confirm by tapping ENTER. Exit the file by selecting CTRL on the Termux panel and tapping "x" on the keyboard.
(8) Test your setup. Open Tasker and create a task with Plugin > Termux:Tasker action. Go to Configuration and in the Executable field at the top start typing the name of the file you have created (the full name should be shown as soon as you start typing). Select the file, then click on Save icon. Go back to the task and run it by tapping the Play icon. If the message has been delivered to your recepient, you succeeded!
Now you can link your task to any profile as well as create additional files in the ~/.termux/tasker directory in order to automatically send different messages. Enjoy!
PS. Credits go to whatsmeow creators as well as u/Black616Angel from Reddit who contributed massively to this method and without his help it wouldn't be possible at all. Check this Reddit thread for the reference.
Wow! What a write-up! Amazingly painful way just to send a message via WhatsApp. I really wish these messaging providers made things more open.
BinkXDA said:
Wow! What a write-up! Amazingly painful way just to send a message via WhatsApp. I really wish these messaging providers made things more open.
Click to expand...
Click to collapse
There are many autoresponders available on the market, INITIATING a message is difficult because Whatsapp doesn't provide API. This way isn't a simplest one, but at least it works with screen off using web interface.
Lord Sithek said:
There are many autoresponders available on the market, INITIATING a message is difficult because Whatsapp doesn't provide API. This way isn't a simplest one, but at least it works with screen off using web interface.
Click to expand...
Click to collapse
You finally managed to find a system to be able to send messages using Tasker
I need to ask you a question.
When I send messages with this system the person receiving cannot see the text correctly.
A warning comes out that says so:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
how can this problem be solved?
Thank you very much
westenlive said:
You finally managed to find a system to be able to send messages using Tasker
I need to ask you a question.
When I send messages with this system the person receiving cannot see the text correctly.
A warning comes out that says so:
View attachment 5728319
how can this problem be solved?
Thank you very much
Click to expand...
Click to collapse
I've seen that before, but honestly I have no idea why is this happening... Maybe unlinking and linking whatsmeow again would help or recreating Tasker action
Lord Sithek said:
I've seen that before, but honestly I have no idea why is this happening... Maybe unlinking and linking whatsmeow again would help or recreating Tasker action
Click to expand...
Click to collapse
ephemeral messages is the problem.
if they are enabled by this problem, by disabling ephemeral messages the problem is not there
cmq thanks for this great tool.
westenlive said:
ephemeral messages is the problem.
if they are enabled by this problem, by disabling ephemeral messages the problem is not there
cmq thanks for this great tool.
Click to expand...
Click to collapse
ohh good to know honestly I just compiled all the info into one post, I got a lot of help from more skilled users. You can read the Reddit thread as well and the posts from others:
https://www.reddit.com/r/tasker/comments/wcoc7h
Hi there! rooted device using SuperSU app here. i used the root guide, but when i run the shell command in tasker, nothing happens, the linked device whatsmeow shows "last active" the moment i uploaded the QR and not when i ran the shell command..... maybe i am doing something wrong?
EDIT: i made it! something weird was happeneing with main.go file.. the non-root explanation is more clear. thanks!
hernanbozzano said:
Hi there! rooted device using SuperSU app here. i used the root guide, but when i run the shell command in tasker, nothing happens, the linked device whatsmeow shows "last active" the moment i uploaded the QR and not when i ran the shell command..... maybe i am doing something wrong?
EDIT: i made it! something weird was happeneing with main.go file.. the non-root explanation is more clear. thanks!
Click to expand...
Click to collapse
Nice that you got it working, although root way is kinda easier to me I'm courious though what went wrong there
All who follow: Check the OP, there is much easier way to do the same now
I prefer this method.
Is much simpler.
But for a few days it hasn't been working for me.
Does this method work for you?
thanks
westenlive said:
I prefer this method.
Is much simpler.
But for a few days it hasn't been working for me.
Does this method work for you?
thanks
Click to expand...
Click to collapse
Sorry, but I switched to the new solution myself. Maybe you could try V2 of the new project since as far as I remember it was just kind of extended solution of mine:
https://www.reddit.com/r/tasker/comments/11a4k49
this system works really well.
I thank you so much.
it helps me so much with my work .
thank you brother
westenlive said:
this system works really well.
I thank you so much.
it helps me so much with my work .
thank you brother
Click to expand...
Click to collapse
Im glad I could help!