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 ...
随机推荐
- C# 托管资源 与 非托管资源
C# 托管资源 与 非托管资源 托管资源一般是指被CLR控制的内存资源,这些资源的管理可以由CLR来控制,.NET可以自动进行回收,主要是指托管堆上分配的内存资源.例如程序中分配的对象,作用域内的变量 ...
- mvn简单命令
导出maven项目依赖的jar包 mvn dependency:copy-dependencies -DoutputDirectory=lib 编译Java代码 mvn compile eclipse ...
- Linux入门(二)Shell基本命令
上一篇讲了普通用户切换到root用户,今天补充一点,对于Debian和Ubuntu用户,安装时候只有一个普通用户注册,在需要root权限时,我们可以在普通用户模式下输入sudo这个命令运行某些相关特权 ...
- 让你的 JMeter 像 LoadRunner 那样实时查看每秒事务数(TPS)、事务响应时间(TRT)
熟悉 LoadRunner 的朋友一定不会对其 TPS(每秒事务数).TRT(事务响应时间) 等视图感到陌生,因为这是压力测试最为关键的两个指标.JMeter 以其开源.轻巧.灵活.扩展性高等特性赢得 ...
- Jenkins的授权和访问控制
默认的Jenkins不包含任何的安全检查,任何人可以修改Jenkins设置,job和启动build等.显然地在大规模的公司需要多个部门一起协调工作的时候,没有任何安全检查会带来很多的问题. 在系统管理 ...
- hdu 3951 硬币围成一圈(博弈)
n个硬币围成一个环 每次只能取1-K个硬币 最后取完者胜 假如5个硬币 每次取1-2个情况1 先手取1个 后手取剩下4个中间2个 破坏了连续 虽然最后剩2个,但先手只能取一个 然后后再取一个 后手胜 ...
- GUC-8 小练习
import java.util.concurrent.locks.Condition; import java.util.concurrent.locks.Lock; import java.uti ...
- 【LOJ】#2541. 「PKUWC2018」猎人杀
题解 一道神仙的题>< 我们毙掉一个人后总的w的和会减少,怎么看怎么像指数算法 然而,我们可以容斥-- 设\(\sum_{i = 1}^{n} w_{i} = Sum\) 我们把问题转化一 ...
- bzoj 1233
先要了解一个结论,在多种可行的堆叠方案中,至少有一种能使层数最高的方案同时使得底边最短.即底边最短的,层数一定最高. dp[ i ] = min(sum[j - 1] - sum[i - 1]) j ...
- python和redis简单交互
python和redis简单交互 1.安装redis模块 pip3 install redis 2.redis模块简单使用: # /usr/bin/env python3 import redis c ...