Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.IllegalArgumentException: Invalid token limit #1111

Open
freedemocracy opened this issue Jun 14, 2024 · 3 comments
Open

java.lang.IllegalArgumentException: Invalid token limit #1111

freedemocracy opened this issue Jun 14, 2024 · 3 comments

Comments

@freedemocracy
Copy link

Please address this issue: it seems that Android has changed the implementation of its underlying code to prevent SQL injection, but your plugin does not provide compatibility for this situation. The Android version tested is 13, and the sqflite plugin version used is ^2.3.3+1.

@freedemocracy
Copy link
Author

图像 1

@alextekartik
Copy link
Contributor

sqflite does not do parsing so there is not much I can do here and I think parameters are not allowed for limit and offset. You should fix your query with something like:

'${(limit > 0) ? 'LIMIT $limit' : ''}${(offset > 0) ? ' OFFSET $offset' : ''}';

@freedemocracy
Copy link
Author

sqflite 不进行解析,因此我在这里能做的不多,而且我认为限制和偏移参数不允许。您应该使用类似以下内容修复查询:

'${(limit > 0) ? 'LIMIT $limit' : ''}${(offset > 0) ? ' OFFSET $offset' : ''}';

Sorry, I found the cause of the problem. It's not caused by the sqflite plugin, but by the ContentResolver.query

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants