My App using sqlite doesn't work on Android 4.2+ - Java for Android App Development

Hi everyone,
I''m facing a problem with my app. I alwys tested it with Android 4.1.2 on my galaxy note and it work perfectly, but since some days I updated my phone to android 4.3 and the application stopped to work: it works but it seems there is a problem with database. the view is blank and it seems that the db is empty.
I think theo problem is due to path and multi-users (available since Android 4.2, doesn't work also on Galaxy S4 of my friend with 4.2.2).
I tried to find a solution but doesn't found anything.
Even on the debug I haven't useful log. the only error I receive is the following:
API call with unopened database connection pointer
I think is due to a permission of the access the the right path, but it's very strange.
My phone is not rooted.
thank you for the help.

Maybe share the source code, where you open the db file?

shows us your source code

Related

[Q] Eclipse - check API specific code ?

Does anyone know how I can get Eclipse to check my code & see if all the API calls will work on a specific revision ? I've just written some code that used -
Code:
.getTextContent()
on an XML node. Worked fine on my (2.2) phone, but others were getting "Force Close" errors. I eventually worked out they had Andy 2.1, and getTextContent() was introduced in 2.2. OK, I rewrote it to use
Code:
.getNodeValue()
as I want it to run on their phones.
Is there any way I can get Eclipse to check my code against the Min SDK Version, to ensure all of it will work ? Sorry if its an obvious question, but its really annoying me. Thanks.

Rooted GT-I9300 with 4.3, dialer (secret) codes won't work

I have problem with dialer codes. Even the simplest ones (*#06# or *#0000#) won't work.
I have upgraded from 4.1.2 to 4.3, and yesterday upgraded more recent version of 4.3 (I9300XXEMG4, I9300OXAGMK6, I9300XXUGNB4) but problem persists.
I edited /efs/carrier/HiddenMenu to contain ON and also tried adding the line to /system/build.props. Then shutdown and battery away. Still the codes won't work.
I have installed programs from Google Play to launch the menu programmatically, with no success whatsoever.
Any help would be highly appreciated.
Do I have to downgrade to 4.1.2?
ari
PS. The bottom line reason for this is that the WLAN doesn't work because of the interference of another phone (S2+) and I would like to try and change the hidden properties and perhaps be able to use the WLAN with my phone.
As far as I know the only way the 2 devices can interfere on wifi is by having the same ip or mac address.
Sent from my GT-I9300 using Tapatalk

[Q] Encrypt phone feature bugged on Defy starting from 4.0

Hi Guys,
Has anyone tried the encryption feature found in Security settings? I'm using a recent nightly CM11 from Quarx/Blechd0se (Thanks, brilliant work!) quite stably for days now, but fail to make the encrypt phone function work...
When fully charged and USB powered, which are requirements, the successive encrypt phone buttons end up on a green android picture. This screen misses text and a progress bar which should normally appear on top of the screen, as seen on some screenshots. Even left for several hours, nothing progresses and a simple press on back button cancels action immediately which proves nothing has been encrypted in the meanwhile.
Took a Catlog and the only interesting message is the following:
Code:
01-02 01:34:23.732 E/Cryptfs ( 1197): Cannot get size of block device
In case it helps, find attached the output of mount command : View attachment mnt.txt
Could you have a look / help me out? (add to bug list if it applies)
In fact, for me, this function needs to be activated for connecting to my professional mails ...
Thanks in advance! :good:
Cheers
Further tested...
Hello all,
Just some more info... I flashed back to Quarx' CM9 and quickly tested once more the encryption and face the same problem but I didn't catlog, neither checked the mounts... Then I flashed Epsylon3's CM9 and quickly checked with the same result too...
But then I checked at catlog and now I get another type of error... Which is interesting and maybe promising as I already read some posts about this message...
Code:
04-14 21:11:13.101 E/Cryptfs ( 2219): Orig filesystem overlaps crypto footer region. Cannot encrypt in place.
Problem seems to be more general than only Quarx/Blechd0se's CM11 but a friend uses a CM9 flavor on a Samsung Galaxy S and has encrypted the phone successfully...
All in all it's linked with the filesystem (block device or not), how it is formated (yaffs/ext3/ext4) and mounted (mount/mount_all)...
Some interesting reading on jira.cyanogenmod.org/browse/CYAN-87 (not linked, I don't have 10 posts yet)...
Hope to find, test and come back with some more info soon...:fingers-crossed:
Cheers!

[Q] Reverse engineering app communication

Hello there,
i would like to get informations about the communication of an app, as it is using a VERY big amount of bandwith. And I'm curious.. I want to understand the complete communication.
I tried mitmproxy but it seems, that it is using a hardcoded proxy internally. So i thought about a different approch:
Adding Logging to the app itself.
The App is using a stripped down version of the okhttp lib (github.com:square/okHttp), that contains (in versions 1.5.0 to 1.6.0) the Request class. The constructor seems to not be changed in the app.
github.com/square/okhttp/blob/parent-1.5.0/okhttp/src/main/java/com/squareup/okhttp/internal/http/Request.java
I would like to add logging capability to the constructor in th compiled .class . Something like
Log.d("AppTarget",url.getProtocol()+"://"+url.getHost()+":"+url.getPort()+url.getPath()+" "+method);
at the end of the constructor.
1) Is this a good idea? (Or are there better ways? )
2) How to do this? Of course: I have to edit the bytecode. But more like: how to do this.
3) I have attached a compiled version of the lib
A wonderfull day
Mimoja
Well decompiling the app, adding the logging lines and recompiling wont work i suppose, because apktool etc dont return working code.
If you have another rooted android phone by chance, you should try intercepter-ng app found here on xda, works great as mitm tool to get other wifi device's traffic
--------------------
Phone: Nexus 4
OS: rooted Lollipop LRX21T
Bootloader: unlocked
stock Recovery

Weloop Tommy Smartwatch (FAQ/Updates/Hacks)

The purpose of this thread is to have all information regarding the Weloop Tommy, gathered, fresh and to the point.
(i am not affiliated with Weloop)
Please read both post number 1, 2 and search thread before asking questions thank you.
FAQ
Q:What is the latest firmware?
[Release] black watch v3.19 firmware update notifications [Copy link]
This update to the firmware update, the client does not update the current firmware version v3.18 firmware watches friends can try to use the old client detects the firmware update.
Update:
Solve watches restart, restore factory settings watches language will change.
Download Link:
iOS client 2.079: http://fir.im/iosobt
Android client 1.29.3702b: http://fir.im/andobt
Unofficial file archive of WeLoop Tommy. APK-Files with ending "b" are BETA http://www.wtf.li/
Q: When is the next app update
A: Weloop v. 3.0 will be released as closed beta 7the of March 2015 we don't know when there will be an open english release....
the extensive update 3.0 have,
better health monitoring
profiles
sleep monitoring
more alarms weekdays/weekend
and more.
(see attached pictures for app version 3.0 UI improvements
Q: What does the settings do?
- Backlight
24H: Backligth always turns on when button is pressed
Nite: Backligth turns on when button is pressed at night time (from 17–8)
Off: Backligth Always Off
- Motion
24H: Motion detection always on (backlight turns on when motion is detected)
Nite: Motion detection on at night time (from 17-8)
Off: Motion detection Off
- Night
On: Notification vibration disabled at night (from 23–8)
Off: Notification enabled at night
- O Clock
On: every whole hour the watch will vibrate. 12'O'clock etc.
Off: Off
- Fitness
On: Fitness functionality on
Off: Off
- Language
Chinese
English
- Anti Loss
On: Alarm when Phone is out of BT range
Off: Off
Q: Is there Cyrillic support
A: Yes
Q: The GoClever Ecos Chronos is the same watch right?
A: Yes it is on the hardware side, and you can with a "hack" install the firmware from the ECOS on the Tommy. (see next post for How to.!)
Awesome Weloop Review by VECTRON
http://forum.xda-developers.com/smartwatch/other-smartwatches/weloop-tommy-smartwatch-looks-best-t2864444
Troubleshooting
Q: i can not update my watch/its stuck/acting weird
Have you tried to reset the watch? there are 3 ways to do it
Restart watch from app. under update there is a restart button (it says reset but it restarts and keeps all your settings)
Reset from watch (Last menu point, this resets everything)
Hard reset (connect charge cable and press up and down button to reset)
Force OTA update:
Connect your watch to the charger. (watch must be charging)
Press all 3 buttons on the side simultaneously
Release the 2 side buttons, and keep the middle button pressed until you get the upgrade connecting display. (this might take some seconds)
Delete connection from phone
Connect and pair from app and upgrade
If you are on an Android device and it cannot connect, try an ios device, and vice versa
Q: The watch keeps switching back to chinese
More people have experienced that if the language is non english the watch will reset to chinese. Changing the phone OS to english stops the watch from switching to Chinese.
"Hacks"
How to make your own watchfaces:
user fcsabika has created a cool tool to create your own watchfaces
WeLoop Tommy Watchface Creator
attached are also some watchfaces made by user ruicoel filename "project rui.zip"
How To install GoClever Chronos ECO firmware on Weloop tommy (android only)
Download latest ECO firmware to phone
Disconnect Watch from phone, install ECO app
Go to “Check For Upgrade”
Tap on the middle circle six times
“Select a firmware file___ [Browse]”
Watch must be in forced OTA
Update watch.
You can flash between weloop and Goclever firmware (always be careful and follow instructions when flashing, i take no responsibility for bricked or exploding watches...)
To install weloop firnware, follow same instructions but use weloop app instead.
PROJECT OPEN FIRMWARE (please make sure you understand what this is and what it does before you attemtp to flash your watch)
Make a Weloop Tommy an open source sport watch that can be used without a mobile phone. Want to see a heart rate when running, cycling speed and cadence when cycling or number of laps while swimming? Help to make it possible! LINK
This project is divided into six phases:
Phase 1: find out and document watch pinout so it will be possible to communicate with screen, accelerometer and a flash memory from a custom firmware. DONE
Phase 2: write a custom firmware that will print sample text on a screen and expose a BLE service. Firmware will be flashed using SWD connector. DONE
Phase 3: make it possible to upload a custom firmware using OTA. This will save the waterproof case from destruction. DONE
Phase 4: update softdevice to the newest version (S110 8.0.0). Add possibility to switch to other softdevice (S120/S130) DONE
Phase 5: create a "terminal" firmware that allows to control what is displayed on a watch from an android/iOS app. IN PROGRESS
Phase 6: create a "standalone" firmware using S130 softdevice that can connect to external sensors (HRS, CSCS etc) without a phone. TODO
Go support developer Krzysiek
Goclever APK & FW file is attached to this post.
Latest Chronos ECO firmware 3.18
http://www.chronos.goclever.com:8080/fileServer/firmware/CHRONOSECO_V3.18_1.bin
Chronos ECO app (android)
https://play.google.com/store/apps/details?id=com.yf.foreign.goclever
Chronos ECO IOS app
https://itunes.apple.com/th/app/goclever-chronos-eco/id955306578?mt=8
BUGS & Annoyances
Notification not always deleted from phone when deleted on watch
Watch freezes sometimes
Being able to set the night time manually would be great (This can be done with the Goclever fw)
I'm no Dev so I'm not sure if this is of any help. While updating the watch I wanted to ensure my screen stayed on so I was tapping the screen.
If you tap the center of the percentage 6 times a pop up appears for you to select your update file. If you select browse it gives you access to a bunch of folders that appear to be inside the app or maybe the watch itself. I tried it several times and 6 is the magic number to make the option appear or disappear. It doesn't work if the watch isn't upgrading it's firmware.
Hope it can be of some use
skiiermike said:
I'm no Dev so I'm not sure if this is of any help. While updating the watch I wanted to ensure my screen stayed on so I was tapping the screen.
If you tap the center of the percentage 6 times a pop up appears for you to select your update file. If you select browse it gives you access to a bunch of folders that appear to be inside the app or maybe the watch itself. I tried it several times and 6 is the magic number to make the option appear or disappear. It doesn't work if the watch isn't upgrading it's firmware.
Hope it can be of some use
Click to expand...
Click to collapse
Thanks was this working on ios or android?,
will add to FAQ
taleboblen said:
Thanks was this working on ios or android?,
will add to FAQ
Click to expand...
Click to collapse
Android.
Thx
Thnx for the information, all working ok on my samsung s4, get the last version v3.18.
thx again
backlight
first of all thanks for this thread :good:
the nite backlight on my tommy watch actually comes on after 5PM (17:00)
i am from Slovakia, phone language is English, time zone CET (GMT+1)
interesting to see that yours turns on after 23:00
chsustik said:
first of all thanks for this thread :good:
the nite backlight on my tommy watch actually comes on after 5PM (17:00)
i am from Slovakia, phone language is English, time zone CET (GMT+1)
interesting to see that yours turns on after 23:00
Click to expand...
Click to collapse
Thanks for the update. i decrypted some of the information from the official Weloop FAQ. and yes i can now confirm that you are right. it turns on from 17-8 thanks again. I have now updated the FAQ with the correct time for all Night settings. :good:
Hello! Can someone make last CHRONOS ECO apk link to download? I cant download it from google play.
k0ra said:
Hello! Can someone make last CHRONOS ECO apk link to download? I cant download it from google play.
Click to expand...
Click to collapse
Hi , the chronos eco app is not compatible with the Weloop Tommy.
Brand new Tommy, it was paired with my phone but the connection was unstable, so I tried and forced an OTA update, watch is "Updating... 0 pct" but now the phone cannot detect the watch any more
Resetting the watch will restart it in ota update mode again!
Any help appreciated...
l.capriotti said:
Brand new Tommy, it was paired with my phone but the connection was unstable, so I tried and forced an OTA update, watch is "Updating... 0 pct" but now the phone cannot detect the watch any more
Resetting the watch will restart it in ota update mode again!
Any help appreciated...
Click to expand...
Click to collapse
Happened to me also, try to delete connection under bluetooth settings on device. now connect to to weloop and pair from Weloop app. keep trying and then go to update. again persistence is key. keep trying to update suddenly it will connect and update.
Whas the watch on latest firmware when you tried the force OTA?
are you on android or ios see if there is an updated App for you phone. see link on OP for beta APK.
let me know if it works.
watch was not on latest firmware, cant' remember which version it had.
I'm on android, also v1.24 does not help as check for updates does not go beyond "Checking version...".
k0ra said:
Hello! Can someone make last CHRONOS ECO apk link to download? I cant download it from google play.
Click to expand...
Click to collapse
l.capriotti said:
watch was not on latest firmware, cant' remember which version it had.
I'm on android, also v1.24 does not help as check for updates does not go beyond "Checking version...".
Click to expand...
Click to collapse
Try to update the Weloop app, latest is 1.27.
kill weloop app
delete bt connection from phone.
Open weloop app
conmect and update. Keep trying it can take a couple of times.
If all fails if possible try with other device and or ios device
update: I used an iphone and after a few retries I got it on v3.18.
back to android, but the pairing and the sync is problematic, to say the least, on my Huawei P7...
skiiermike said:
I'm no Dev so I'm not sure if this is of any help. While updating the watch I wanted to ensure my screen stayed on so I was tapping the screen.
If you tap the center of the percentage 6 times a pop up appears for you to select your update file. If you select browse it gives you access to a bunch of folders that appear to be inside the app or maybe the watch itself. I tried it several times and 6 is the magic number to make the option appear or disappear. It doesn't work if the watch isn't upgrading it's firmware.
Hope it can be of some use
Click to expand...
Click to collapse
If it's allowing you to select an update file, surely it is showing you the file system of the phone? Otherwise, you'd have no way to put a firmware update file there to select. My understanding would be this allows you to install a firmware update file stored on your phone, although I can't test this for sure as my Android phone is currently being repaired. There's some discussion about this here and that thread also contains a very small amount of analysis on the firmware file (VERY small amount, basically just analysing the name of the binary file), and another app that is apparently in some way related (link).
For what I can glean from the description of that app (seemingly made by the manufacturer of the SoC [System on a Chip] used in the WeLoop Tommy), it would appear that devices using the SoC (including the Tommy) have three firmwares: "bootloader", "soft device" and "application". The one embedded within the WeLoop app apk has the name "ble_app_ancs.bin"; ble stands for bluetooth low energy and ancs apparently stands for apple notification centre services. That leaves "app" - my guess would be this is the "application firmware". I'm not entirely sure the roles of the "bootloader" and "soft device" firmwares, but my guess is the one or other allows the device to get into "DFU mode" (or "OTA mode" as it seems to be referred to also), meaning in theory it should perhaps be possible to recover from any bricks arising from flashing dodgy application firmwares.
So potentially there is the option of reverse engineering the firmware (easily obtained from here: http://wtf.li/ - mirror of the APKs of the app [each of which contain a version of the firmware], and also one version of the firmware (the .bin file) separately), and creating a custom/modified one, while still being able to recover (because bootloader & soft device should be untouched). However, I have neither the expertise nor the time to look into that.
Without an Android phone with which to run either of the apps right now, I can't poke about too much (I only received my Tommy today), but once I get my phone back I'll maybe try and see if I can find anything else interesting. I'd like to see if I can figure out any way to get access to the watch faces, and see if they can be reverse engineered in any way, for example.
EDIT: Here is the output of strings run on the firmware binary from the latest version of the app on http://wtf.li : http://pastebin.com/X7TQXTb3 - nothing particularly interesting, a few filenames of the source files and a few other strings seen in the watch interface and stuff.
EDIT: A couple of URLs accessed by the app (seemingly related to updating):
http://au.umeng.com/api/check_app_update
http://www.yfsmart.com/weloopInterface/getFirmware.do
I can't see anything on these sites, my guess would be they need query strings parameters or something (not really sure what, some way of identifying that the app is accessing the site) to actually do anything.
EDIT: Hmm... http://www.yfsmart.com/weloopInterface/firmware_Upload.jsp - this site seems to allow you to upload a firmware. I wonder if it allows anyone to upload a firmware, which would then be downloaded by everyone when they check for updates? Certainly seems rather insecure...There's a bunch of other pages at http://www.yfsmart.com/weloopInterface/ haven't looked through them all yet.
EDIT: From what I can glean from this page ("SoftDevices" section under the "Development Tools and Software" tab), it seems like the "soft device" firmware is essentially a bit like a library, it's a precompiled binary supplied by Nordic (company that makes chip inside Tommy) which provides all the networking functions etc. which the "application" firmware uses. So:
Code:
application = front end UI (basically, the part WeLoop made)
soft device = "library" via which application can access hardware etc.
bootloader = initial part of firmware that loads SD + app firmwares
So the only really interesting part is probably the application firmware, the part that is in the WeLoop app. That's the code that actually "matters", the rest is just low level stuff. For actually changing the interface or whatever, modifying the app firmware would be all that's needed (for example, to increase the font size or the back light duration etc.).
SifJar said:
If it's allowing you to select an update file, surely it is showing you the file system of the phone? Otherwise, you'd have no way to put a firmware update file there to select. My understanding would be this allows you to install a firmware update file stored on your phone, although I can't test this for sure as my Android phone is currently being repaired. There's some discussion about this here and that thread also contains a very small amount of analysis on the firmware file (VERY small amount, basically just analysing the name of the binary file), and another app that is apparently in some way related (link).
For what I can glean from the description of that app (seemingly made by the manufacturer of the SoC [System on a Chip] used in the WeLoop Tommy), it would appear that devices using the SoC (including the Tommy) have three firmwares: "bootloader", "soft device" and "application". The one embedded within the WeLoop app apk has the name "ble_app_ancs.bin"; ble stands for bluetooth low energy and ancs apparently stands for apple notification centre services. That leaves "app" - my guess would be this is the "application firmware". I'm not entirely sure the roles of the "bootloader" and "soft device" firmwares, but my guess is the one or other allows the device to get into "DFU mode" (or "OTA mode" as it seems to be referred to also), meaning in theory it should perhaps be possible to recover from any bricks arising from flashing dodgy application firmwares.
So potentially there is the option of reverse engineering the firmware (easily obtained from here: http://wtf.li/ - mirror of the APKs of the app [each of which contain a version of the firmware], and also one version of the firmware (the .bin file) separately), and creating a custom/modified one, while still being able to recover (because bootloader & soft device should be untouched). However, I have neither the expertise nor the time to look into that.
Without an Android phone with which to run either of the apps right now, I can't poke about too much (I only received my Tommy today), but once I get my phone back I'll maybe try and see if I can find anything else interesting. I'd like to see if I can figure out any way to get access to the watch faces, and see if they can be reverse engineered in any way, for example.
EDIT: Here is the output of strings run on the firmware binary from the latest version of the app on http://wtf.li : http://pastebin.com/X7TQXTb3 - nothing particularly interesting, a few filenames of the source files and a few other strings seen in the watch interface and stuff.
EDIT: A couple of URLs accessed by the app (seemingly related to updating):
http://au.umeng.com/api/check_app_update
http://www.yfsmart.com/weloopInterface/getFirmware.do
I can't see anything on these sites, my guess would be they need query strings parameters or something (not really sure what, some way of identifying that the app is accessing the site) to actually do anything.
EDIT: Hmm... http://www.yfsmart.com/weloopInterface/firmware_Upload.jsp - this site seems to allow you to upload a firmware. I wonder if it allows anyone to upload a firmware, which would then be downloaded by everyone when they check for updates? Certainly seems rather insecure...There's a bunch of other pages at http://www.yfsmart.com/weloopInterface/ haven't looked through them all yet.
EDIT: From what I can glean from this page ("SoftDevices" section under the "Development Tools and Software" tab), it seems like the "soft device" firmware is essentially a bit like a library, it's a precompiled binary supplied by Nordic (company that makes chip inside Tommy) which provides all the networking functions etc. which the "application" firmware uses. So:
Code:
application = front end UI (basically, the part WeLoop made)
soft device = "library" via which application can access hardware etc.
bootloader = initial part of firmware that loads SD + app firmwares
So the only really interesting part is probably the application firmware, the part that is in the WeLoop app. That's the code that actually "matters", the rest is just low level stuff. For actually changing the interface or whatever, modifying the app firmware would be all that's needed (for example, to increase the font size or the back light duration etc.).
Click to expand...
Click to collapse
Thank you for the insights and findings its all very promising. :good:
On a sidenote:
I talked to one of my colleagues who is an engineer (i'm not a dev but a Designer), it seems like we in the office are playing around with the exact same SOC from NordicSemiconducter. we tried one of the apps from the google play store and it connects to the weloop(see attached pic). The app was called "nRF Master Control Panel", tried the other apps from NordicSC but no luck.
Hopefully there will be some sort of SDK with the v3.0 release on the 30th...
I got my Android phone back today, and haven't tinkered too much with Tommy just yet, but I can confirm that the file system you are browsing when you tap the percentage 5 times during an update is just the phone file system. It browses from root (i.e. /), rather than /sdcard or whatever, which is the standard, user accessible partition, hence there are some folders etc. you may not recognise, but amongst them will be "sdcard" which will take you to your regular storage (note: this is the case on phones without a micro SD card as well), where you could easily place an update file.
SifJar said:
I got my Android phone back today, and haven't tinkered too much with Tommy just yet, but I can confirm that the file system you are browsing when you tap the percentage 5 times during an update is just the phone file system. It browses from root (i.e. /), rather than /sdcard or whatever, which is the standard, user accessible partition, hence there are some folders etc. you may not recognise, but amongst them will be "sdcard" which will take you to your regular storage (note: this is the case on phones without a micro SD card as well), where you could easily place an update file.
Click to expand...
Click to collapse
Thanks for the confirmation. :good:
taleboblen said:
Troubleshooting
Force OTA update:
Connect your watch to the charger.
Press all 3 buttons on the side simultaneously
Release the 2 side buttons, and keep the middle button pressed until you get the upgrade connecting display. (this might take some seconds)
Delete connection from phone
Connect and pair from app and upgrade
If you are on an Android device try an ios device, and vice versa
Click to expand...
Click to collapse
I tried to use the OTA update to go from 3.17 to 3.18 (on Android) but Tommy stuck on screen "WeLoop ... Udating 0%", my smartphone (HTC M8) with its APP (latest version) dont find the Tommy and it remains bricked, how do I restart it? I tried all combinations, but remains on the screen, help me!

Categories

Resources