Comments (4)
The app configuration has (and I think has always had) a minSdkVersion of 23 (6.0 Marshmallow),
Correct.
Here's an excerpt of an email I wrote on Dec. 14, 2021 in response to a question about the possibility of building SMS I/E for Android 4.3:
The original requirement of API >= 23 was due to the requirement introduced there to do run-time permission requests, and the necessary code to do those checks does not run on API < 23. This should be easy to get around, by simply removing the run-time permission requests (and relying on the manifest permission declarations, as early versions of Android did):
https://developer.android.com/about/versions/marshmallow/android-6.0-changes
https://devtut.github.io/android/runtime-permissions-in-api-23.htmlCurrently, there's also an API call to getOrCreateThreadId, introduced in API 23 as well:
https://developer.android.com/reference/android/provider/Telephony.Threads
as well as a bunch of other calls to the Telephony provider API, introduced in API 19:
https://developer.android.com/reference/android/provider/Telephony
So my guess is that getting it to work on API < 19 may require significant refactoring. Getting to 19 from 23 may be more manageable, if there's some relatively straightforward way of rewriting the call to getOrCreateThreadId and / or the code around it - see:
https://stackoverflow.com/questions/45070889/getorcreatethreadid-in-api-21
Even if there isn't, that call is only needed for importing MMS messages - exporting SMS and MMS messages, and importing SMS messages, do not require it, so if the MMS import code is simply removed, everything else should work at API 19.
Basically, the app has two function calls that require API level >= 23: requestPermissions
and getOrCreateThreadId
and thus will (I think) crash the app if invoked on a device with API level < 23.
When you ran the app on Android 4.4.4, I assume that you never hit the requestPermissions
call, since the requirement to ask for dangerous permissions at runtime was added in Android 6.0 (API level 23), and you never hit the getOrCreateThreadId
call since that's only used on import, not export.
Now that you've gotten me to consider the matter more carefully (thanks!), it seems that lowering minSdkVersion
to 19 should be fairly simple - just a matter of testing for API level >= 23 before calling requestPermissions
(or perhaps switching to the Activity.Compat
version of requestPermissions
) and disabling messages import on API level < 23. I'll try this out and update the app accordingly if it works.
from sms-ie.
It looks like the Android team has a Java backport of getOrCreateThreadId that would enable import functionality to be provided on earlier API levels. I personally have no need for import functionality on KitKat, but this might be an easy win for compatibility.
Thanks! I don't think I'm going to bother with it, though, unless I can find an official documented version, especially since I doubt that there is a great need for import functionality on KitKat.
from sms-ie.
Awesome, thank you!
from sms-ie.
It looks like the Android team has a Java backport of getOrCreateThreadId
that would enable import functionality to be provided on earlier API levels. I personally have no need for import functionality on KitKat, but this might be an easy win for compatibility.
from sms-ie.
Related Issues (20)
- Missing APK asset in v1.5.4 github release HOT 2
- Expected * bytes but received ** HOT 8
- Crash during import: "java.io.EOFException: End of input" HOT 4
- thanks! HOT 1
- Allow_voicemails? HOT 10
- Add support for monochromatic adaptive launcher icons HOT 3
- Latest release can't import JSON backup HOT 4
- Incorrect interpretation of SIM card slots HOT 2
- importing messages not possible HOT 8
- Silence XML plaintext backup conversion? HOT 31
- Toast notification does not fit HOT 4
- Trouble importing messages HOT 7
- [BUG] Cannot set this app as the default messaging app. HOT 6
- Contacts Import/Export support HOT 2
- Importing messages silently skips some based on sub_id HOT 15
- ExportWorker gets killed by Android 14 due to new excessive binder call tracker feature HOT 12
- BUILDING.md link in README.md is incorrect HOT 1
- Restoring Android 13 messages backup on Android 14. HOT 5
- delete old exports toggle doesn't delete exported contacts HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sms-ie.