I use something similar but thought I'd mention this 'bug' that can happen:
when you INSERT '%wa_message' into 'data', bear in mind your typed message will replace %wa_message.
if that typed message contains an apostrophe, your message won't send.
why?
the apostrophe effectively closes 'data' insert and the rest of the text isn't understood by sqlite.
examples:
'i'm not going to work' - won't work because only 'i' will be inserted into data,
sqlite won't know what to do with m not going to work'
'im not going to work' - on the other hand WILL work!

'this will work, won't it' - won't work because of the apostrophe, the text t it' will be left over and cause an error
'this will work, wont it' - will work

so be careful with apostrophes and sqlite whatsapp messages!
(this "bug" took me AGES to work out!)

On Sunday, 29 September 2013 16:17:01 UTC+1, Amos Wong wrote:Yo everyone!
I found this from Pockable : http://www.pocketables.com/forum/showthread.php?t=11947 which lead me to a Spanish forum : http://www.htcmania.com/showthread.php?p=8993462 
Origin : pepelolo38 
Since part of the commands are in Spanish, I thought of recreating them my Tasker [English] and share it here.

A3 ~ A9 below are copied and modified from the original source.

For this task, I use

  • SQLite Installer
  • Rooted Galaxy Nexus - Android 4.1
  • Whatsapp v2.11.23

Send Whatsapp (491)
Run Both Together
A1: Variable Set [ Name:%nummsg To:%arcomm Do Maths:Off Append:Off ] 
A2: Variable Split [ Name:%nummsg Splitter:[}{] Delete Base:Off ] 
A3: Variable Set [ Name:%wa_number To:%nummsg1 Do Maths:Off Append:Off ] 
A4: Variable Set [ Name:%wa_key_id To:%TIMES Do Maths:Off Append:Off ] 
A5: Variable Set [ Name:%wa_message To:%nummsg2 Do Maths:Off Append:Off ] 
A6: Variable Set [ Name:%wa_timestamp To:%TIMEMS Do Maths:Off Append:Off ] 
A7: Variable Set [ Name:%wa_received_timestamp To:%TIMEMS Do Maths:Off Append:Off ] 
A8: Run Shell [ Command:sqlite3 /data/data/com.whatsapp/databases/msgstore.db "INSERT INTO messages (key_remote_jid, key_from_me, key_id,status, needs_push, data, timestamp, media_url, media_mime_type, media_wa_type, media_size, media_name, latitude, longitude, thumb_image, remote_resource, received_timestamp, send_timestamp, receipt_server_timestamp, receipt_device_timestamp, raw_data, media_hash, recipient_count, media_duration, origin) VALUES ('%wa_n...@xxxxxxxxxxxxxx',1, '%wa_key_id-1' ,0,0,'%wa_message',%wa_timestamp,'','','0',0,'',0.0,0.0,'', '',%wa_received_timestamp,-1,-1,-1,0,'',0,0,0);" Timeout (Seconds):0 Use Root:On Store Output In: Store Errors In: Store Result In: ] 
A9: Kill App [ App:WhatsApp Use Root:On ]

Description

A1 ~ A2 :
For processing message received from Autoremote by joaomgcd [Ignore if you don't use it]
A3 ~ A7 : Setting up necessary variables
A8         : The command to insert data into msgstore.db
A9         : On my phone, this action is required for Whatsapp to send the message.
However, it doesn't seem to exit Whatsapp (My whatsapp will just to blank and come back again).

Note:
On my phone

    • It takes 30~40 seconds to send a message when my screen is off.
    • 10~12 seconds when Whatsapp is opened.
    • The message is not shown in Whatsapp's homepage. (It is shown in the conversation)
    • The entire task takes 1~2 seconds to run.

Solution for sending Whatsapp via sqlite "INSERT INTO"的更多相关文章

  1. SQLite Insert 语句(http://www.w3cschool.cc/sqlite/sqlite-insert.html)

    SQLite Insert 语句 SQLite 的 INSERT INTO 语句用于向数据库的某个表中添加新的数据行. 语法 INSERT INTO 语句有两种基本语法,如下所示: INSERT IN ...

  2. sqlite "insert or replace" 和 "insert or ignore" 用法

    insert or replace:如果不存在就插入,存在就更新insert or ignore:如果不存在就插入,存在就忽略只对UNIQUE约束的字段起作用.举例:建表:CREATE TABLE T ...

  3. sqlite insert select 联合使用

    insert into encoder_config (name,value,chengji,parents) select name,value,chengji,parents from media ...

  4. SQLite使用教程8 Insert 语句

    http://www.runoob.com/sqlite/sqlite-insert.html SQLite Insert 语句 SQLite 的 INSERT INTO 语句用于向数据库的某个表中添 ...

  5. Sqlite—插入语句(Insert)

    SQLite 的 INSERT INTO 语句用于向数据库的某个表中添加新的数据行. 基本语法:INSERT INTO TABLE_NAME VALUES (value1,value2,value3, ...

  6. Send a WhatsApp Message programatically -- Tasker WhatsTasker

    Here is My code snippet: Uri mUri = Uri.parse("smsto:+9876543210"); Intent mIntent = new I ...

  7. SQLite的基本使用

    SQLite 创建表 SQLite 的 CREATE TABLE 语句用于在任何给定的数据库创建一个新表.创建基本表,涉及到命名表.定义列及每一列的数据类型. 语法 CREATE TABLE 语句的基 ...

  8. SQLite学习笔记(十二)&&虚拟机指令

    上篇文章简单讨论了虚拟机的原理,这篇文章我们详细讨论下指令,具体从几种典型的SQL语句来看看每种SQL对应的指令流,以及每个指令的含义.通过explain语句,可以看到语句对应的指令流:通过pragm ...

  9. Windows 上如何安装Sqlite

    对SQLite文明已久,却是从来没使用过,今天就来安装试用下. 一.安装 下载地址:http://www.sqlite.org/download.html 将Precompiled Binaries ...

随机推荐

  1. DOS命令基础,包涵DOS库说明书

    20种常用的DOS命令小结 作者: 字体:[增加 减小] 类型:转载   DOS命令总共大约有一百个(包括文本编辑.查杀病毒.配置文件.批处理等),我们这里详细介绍二十个常用的DOS命令     先介 ...

  2. DOS命令大全(二)

    一般来说dos命令都是在dos程序中进行的,如果电脑中安装有dos程序可以从开机选项中选择进入,在windows 系统中我们还可以从开始运行中输入cmd命令进入操作系统中的dos命令,如下图: 严格的 ...

  3. KDE 下 U 盘挂载失败

    重装完 KDE 后发现在 dolphin 中无法挂载 U 盘了,提示 unable to authenticate.但是用 udisksctl 却可以挂载: yyc@TDesk run > ud ...

  4. day7异常处理

    异常处理 下面看一个简单例子: data = {} try: data["name"] except KeyError as e: #e是错误的相信信息,错误的原因 print(& ...

  5. 使用PHP写了一个图片分割等份工具,便于前台页面切图时使用。

    目的: 由于网站更新活动较频繁,其大多数以静态图片为主,设计人员在除了设计图后都要给前端制作人员再次切图从而达到页面加载图片缓慢的问题,为了减少工作量做了该工具. 功能: 上传一张图,将其分割成指定等 ...

  6. 东莞裕同&易普优APS项目启动啦!

    2018年6月21日,东莞裕同&易普优APS项目启动会在东莞裕同东城厂区正式召开.裕同东莞副总经理李总.PMC张经理.集团信息中心曾总.罗经理.易普优实施总监陈总.曹经理等参加了此次会议.这是 ...

  7. bzoj 1264 [AHOI2006]基因匹配Match dp + 树状数组

    思路:好难想啊, 考虑到应该从每个数字只有5个数字下手, 但是不知道到底该怎么写.. 首先我们将第一个串按数字的种类分类, 每一类里面有5个, 然后将第二个串里面的数字一个一个加,如果一个加入的第 i ...

  8. ubuntu 安装 eslint

    1. 安装 npm install -g eslint 安装结束后记住 /usr/local/bin/eslint -> /usr/local/lib/node_modules/eslint/b ...

  9. eclipse中运行 main 方法报错,找不到类

    eclipse (maven 项目)中运行 main 方法报错,找不到类 ** 发现:在 eclipse中的 "Marker" 控制面板中 ,发现问题所在 只要删除 maven 仓 ...

  10. 远程连接mysql root账号报错:2003-can't connect to MYSQL serve

    1.远程连接Linux系统,登录数据库:mysql -uroot -p(密码) 2.修改root账号的设置: GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDE ...