Solution for sending Whatsapp via sqlite "INSERT INTO"
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"的更多相关文章
- SQLite Insert 语句(http://www.w3cschool.cc/sqlite/sqlite-insert.html)
SQLite Insert 语句 SQLite 的 INSERT INTO 语句用于向数据库的某个表中添加新的数据行. 语法 INSERT INTO 语句有两种基本语法,如下所示: INSERT IN ...
- sqlite "insert or replace" 和 "insert or ignore" 用法
insert or replace:如果不存在就插入,存在就更新insert or ignore:如果不存在就插入,存在就忽略只对UNIQUE约束的字段起作用.举例:建表:CREATE TABLE T ...
- sqlite insert select 联合使用
insert into encoder_config (name,value,chengji,parents) select name,value,chengji,parents from media ...
- SQLite使用教程8 Insert 语句
http://www.runoob.com/sqlite/sqlite-insert.html SQLite Insert 语句 SQLite 的 INSERT INTO 语句用于向数据库的某个表中添 ...
- Sqlite—插入语句(Insert)
SQLite 的 INSERT INTO 语句用于向数据库的某个表中添加新的数据行. 基本语法:INSERT INTO TABLE_NAME VALUES (value1,value2,value3, ...
- Send a WhatsApp Message programatically -- Tasker WhatsTasker
Here is My code snippet: Uri mUri = Uri.parse("smsto:+9876543210"); Intent mIntent = new I ...
- SQLite的基本使用
SQLite 创建表 SQLite 的 CREATE TABLE 语句用于在任何给定的数据库创建一个新表.创建基本表,涉及到命名表.定义列及每一列的数据类型. 语法 CREATE TABLE 语句的基 ...
- SQLite学习笔记(十二)&&虚拟机指令
上篇文章简单讨论了虚拟机的原理,这篇文章我们详细讨论下指令,具体从几种典型的SQL语句来看看每种SQL对应的指令流,以及每个指令的含义.通过explain语句,可以看到语句对应的指令流:通过pragm ...
- Windows 上如何安装Sqlite
对SQLite文明已久,却是从来没使用过,今天就来安装试用下. 一.安装 下载地址:http://www.sqlite.org/download.html 将Precompiled Binaries ...
随机推荐
- python基础--random模块
python使用random生成随机数 下面是主要函数random.random()用于生成一个0到1的随机符点数: 0 <= n < 1.0random.randint(a, b)生成的 ...
- C语言位域——精妙使用内存
参考链接 https://blog.csdn.net/yanbober/article/details/8697967 https://blog.csdn.net/Tommy_wxie/artic ...
- 洛谷P2261余数求和
传送门啦 再一次见证了分块的神奇用法,在数论里用分块思想. 我们要求 $ ans = \sum\limits ^{n} _{i=1} (k % i) $ ,如果我没看错,这个题的暴力有 $ 60 $ ...
- Kubernetes 部署kafka ACL(单机版)
一.概述 在Kafka0.9版本之前,Kafka集群时没有安全机制的.Kafka Client应用可以通过连接Zookeeper地址,例如zk1:2181:zk2:2181,zk3:2181等.来获取 ...
- 20165203《Java程序设计》第七周Java学习总结
20165203<Java程序设计>第七周Java学习总结 教材学习内容总结 第11章 JDBC与MySQL数据库 MySQL数据库管理系统 MySQL数据库管理系统,简称MySQL,是世 ...
- vue.js学习 自定义过滤器使用(1)
在这个教程中,我们将会通过几个例子,了解和学习VueJs的过滤器.我们参考了一些比较完善的过滤器,比如orderBy 和 filterBy.而且我们可以链式调用过滤器,一个接一个过滤.因此,我们可以定 ...
- 20165333实验三 敏捷开发与XP实践
实验内容 一.参考 http://www.cnblogs.com/rocedu/p/6371315.html#SECCODESTANDARD 安装alibaba 插件,解决代码中的规范问题. 在IDE ...
- 【AtCoder】AGC005F - Many Easy Problems
题解 我们把一个点的贡献转化为一条边的贡献,因为边的数量是点的数量-1,最后再加上选点方案数\(\binom{n}{k}\)即可 一条边的贡献是\(\binom{n}{k} - \binom{a}{k ...
- Caffe训练AlexNet网络,精度不高或者为0的问题结果
当我们使用Caffe训练AlexNet网络时,会遇到精度一值在低精度(30%左右)升不上去,或者精度总是为0,如下图所示: 出现这种情况,可以尝试使用以下几个方法解决: 1.数据样本量是否太少,最起码 ...
- C#实例 Unity依赖注入使用
Unity是一个轻量级的可扩展的依赖注入容器,支持构造函数,属性和方法调用注入.Unity可以处理那些从事基于组件的软件工程的开发人员所面对的问 题.构建一个成功应用程序的关键是实现非常松散的耦合设计 ...