[APP][UPD:3/06] ODM: Open Device Manager - Free, Open, Encrypted Android Dev Manager

Search This thread

gorcutt

Senior Member
Dec 22, 2010
274
44
Rio de Janeiro
Hi,

I tried ODM a few weeks ago and had the same problem as mentioned a few times above ("Server registration failed...").

Today I finally had time to debug and figured out that the problem was not the client side, but the server side!
I'm running odm-web on nginx, the app uses chunked post requests and nginx doesn't support requests without a Content-Length header.

If you also run odm-web on nginx, you can try a modified APK: https://github.com/berrnd/odm/raw/master/latest/odm.apk

I just removed the chunked transfer encoding, you can have a look at the changes made here: https://github.com/berrnd/odm/commit/57fe007300ebde529bc23e03e08d61a4d911348e

---
Bernd

This seems to be the problem I'm having but the server I host this application runs apache. I'll give it a try to see if it works.

Thanks.

Sent from my SM-P601 using XDA Premium HD app
 

Fmstrat

Senior Member
Aug 3, 2007
472
162
if i try on my phone , its succuss but if i try on Emulator error : TOKEN is blank. You likely need to update the Web application and/or restart the ODM app to re-register :( :( :( :(

This message comes up even if things are working. It was a hold-over from an upgrade path and I never eliminated the message. It's only relevant for older versions and I'll remove it at some point.

Ben
 

Fmstrat

Senior Member
Aug 3, 2007
472
162
So I finish recovering a family member's Gingerbread phone after they forgot their lock screen password; luckily it was registered with a GMail address and I was able to push down regular ADM, eventually. (It was not straightforward because the notifications were just not accessible.)

Then I start wondering, what about my phone, that has never touched the Play Store or GMail? "Wouldn't it be amazing if there were an easy self-hosted version of Android Device Manager with a web interface?"

"Nah," I thought, "no one would have gone to all that trouble for such a niche service, just for the few people who care about putting all their eggs in Google's basket."

Then one Ixquick search later, bam, there is your project, Open Device Manager, like a minor miracle. Bravo, Fmstrat!

So the next thing I do is check F-Droid, my only app store, and I'm disappointed to find it missing. Reading this thread, I see it's because you are still linking to Google Maps et al., so I guess I understand. But I too would encourage migration to a Google-free environment, if only so that there is some form of backup infrastructure if and when Google disappears/goes bad/starts charging/experiences downtime or breaches/etc.

Questions:

1. Is there a way to "push" ODM to a stock phone, in the same way that I was able to push ADM based only on the GMail association? (I realize some form of ADM may have been there, but there was an option to push and deploy a full version, for password reset etc. Without that, all that was available was ringing.) Maybe this question is simply clueless; please excuse any newbitude on my part.

2. Related to (1), is there a mechanism to register via an e-mail address (perhaps to a similarly self-hosted mail server) to enable easy ODM access? Ideally this might some day work hand in hand with the F-Droid repository itself?

3. My VPS is on Centos 5.9 with a couple of PHP versions including 5.3. That should be good to get started, yes?

4. Any thought to making ODM (a) a Webmin or similar hosting panel module, and/or (b) an RPM/DEB/etc. package and/or (c) a VM appliance? A webmin module would be great for me.

5. Also, is the APK served from the ODM web panel, or would I have to patch a link into the HTML to make it convenient to download via browser?

6. Is it possible that, in the short term, you could have a trimmed down version of ODM that WOULD make it into F-Droid, and perhaps retain just a subset of core functionality?

Thanks again for making this effort, Fmstrat; I think it looks and sounds great.

All great ideas, one day I may get to them. I've had a LOT of things going on lately so ODM has taken a back seat. The only way to get this into F-Droid is to ditch Google API all together. Since GCM only works with the Google API, and there are no other alternatives, this is the way we'll have to stay for now (It's the same reason TextSecure hasn't branched off, too). I considered WebSockets, but finally decided it would be better if I created an independent open source F-Droid encrypted notification system to replace GCM, then use that for ODM. That may end up being my next project.

Thanks,
Ben
 

Fmstrat

Senior Member
Aug 3, 2007
472
162
Hi!
I also can't register any devices. Website and user registration works fine. My provider is 1und1.de, maybe someone has a hint how to make it work?
The older version worked fine in this setup.
Cheers,
Alex

PS: Logcat also says "Server registration failed with invalid password"

I see a lot of invalid password posts going on. This is most likely due to a server configuration/mismatch issue, and it sounds like someone may have solved the problem with the content-header. I will look into that.

Thanks,
Ben
 

Fmstrat

Senior Member
Aug 3, 2007
472
162
i have an issue taking a photo.
if i click on "take a front/rear" photo, script is working for a few seconds. after, browser shows <img> like nothing was found on server (404 error).
where are those photos stored? which directory? maybe, writing permissions on any specific directory is missing? if i open url of image e. g. img-data.php?data=2&id=77 browser shows just nothing.
any ideas?

Usually this is due to some kind of timeout as the phone tries to send the data to the server. I've only been able to replicate it on very rare occurrences, so haven't been able to debug. Does it do this all the time for you?

Thanks,
Ben
 

Fmstrat

Senior Member
Aug 3, 2007
472
162
Hi,

I tried ODM a few weeks ago and had the same problem as mentioned a few times above ("Server registration failed...").

Today I finally had time to debug and figured out that the problem was not the client side, but the server side!
I'm running odm-web on nginx, the app uses chunked post requests and nginx doesn't support requests without a Content-Length header.

If you also run odm-web on nginx, you can try a modified APK: https://github.com/berrnd/odm/raw/master/latest/odm.apk

I just removed the chunked transfer encoding, you can have a look at the changes made here: https://github.com/berrnd/odm/commit/57fe007300ebde529bc23e03e08d61a4d911348e

---
Bernd

I saw this commit, and will look into merging it. Thanks for supporting the project.

Thanks,
Ben
 

Simeonn

Member
Jul 31, 2009
42
8
Hi,

I tried ODM a few weeks ago and had the same problem as mentioned a few times above ("Server registration failed...").

Today I finally had time to debug and figured out that the problem was not the client side, but the server side!
I'm running odm-web on nginx, the app uses chunked post requests and nginx doesn't support requests without a Content-Length header.

If you also run odm-web on nginx, you can try a modified APK: https://github.com/berrnd/odm/raw/master/latest/odm.apk

I just removed the chunked transfer encoding, you can have a look at the changes made here: https://github.com/berrnd/odm/commit/57fe007300ebde529bc23e03e08d61a4d911348e

---
Bernd
Hi!

Thx for your modification. It works on 1and1.fr and not the "official" one.
 

ohmer

Member
Apr 12, 2009
13
0
Québec, QC
Hello,

I'm looking to setup a device manager app on our Android tablets devices. Your app seem perfect for what I need except for a missing feature. I would need to be able to push/remove applications (custom apk build for internal uses in our company).

I also would like to avoid using the Google Play version for the OBM Android agent. I would use the same push feature to upgrade OBM on ours devices. Not because I don't like Google, but because I want to control the version that is installed on the devices, so I'm sure they are always compatibles with the server application*.

Thanks!
 

bart1708

New member
May 29, 2014
3
0
Usually this is due to some kind of timeout as the phone tries to send the data to the server. I've only been able to replicate it on very rare occurrences, so haven't been able to debug. Does it do this all the time for you?

Thanks,
Ben

Yes, it does it all the time. tried also to st chmod 777 to all directories, but did not help. where actually should the photos or videos be stored in? No it's not a timeout error, i paid attention to that the phone went not in standby. data connection (both wifi and 4g) always active. phone never been offline during my personal test.

By the way. thanks for sending the latitude and longitudes to mysql db. i have created a nice google map heatmap of my positions.
 

PascalA

Member
Jun 12, 2014
19
3
Hi,

Great purpose for this soft, thanks. Such a functionality while beeing forced to go into the Google stuff is not good (location tracking, Gmail account and more wonders..).

By the way, I've a blocker bug with the webapp:
Code:
[Fri Jul 18 10:08:01.903243 2014] [:error] [pid 6722] [client 192.168.0.1:8080] PHP Fatal error:  Undefined class constant 'MYSQL_ATTR_MAX_BUFFER_SIZE' in /var/www/odm/include/db.php on line 7

This appears on every http://localhost:8080/odm/ URL loading, leaving just a blank page in browser.

Reading this PHP issue ticket ( https://bugs.php.net/bug.php?id=52623&edit=1 ), I understand this variable must not be declared when using mysqlnd. Well, I'm running an Ubuntu Trusty Apache 2 + PHP5 install through apt.

In a nutshell:
Undefined class constant 'MYSQL_ATTR_MAX_BUFFER_SIZE' in /var/www/odm/include/db.php on line 7[

Not a bug, Solved -->
sudo aptitude install php5-mysql
(and maybe 'php5-dev' in addition)
 
Last edited:

PascalA

Member
Jun 12, 2014
19
3
Device: HTC Desire bravo (official android version : 2.2)
ROM: android 4.4.4 (evervolv nightlies)
Gapps: Banks minimal Gapps 4.4.4
Google account declared on device: No
Network link: Wifi


Also having a "TOKEN is blank" log when validating settings UI.

Logcat :
Registering.
E: SERVICE_NOT_AVAILABLE

And after a while:
Registering.
W/ActivityManager( 657): Unable to start service Intent { act=com.google.android.c2dm.intent.REGISTER pkg=com.google.android.gms (has extras) } U=0: not found

Ports to ensure opened, but with no better result (see https://developer.android.com/google/gcm/http.html 5228-5230

I test by hardware-back-buttoning to exit ODM, then by disabling/enabling its device manager, then app restart.

Fmstrat, can you tell if Gapps are required for the app to work? I don't think so, since it uses its own PlayServices jar. Also, is a Gmail account required? I also think no, cause the SENDER_ID is hard-coded in sources. Maybe it's been blacklisted for registering too many devices, or something alike?

With Gapps core and Google account bound to: --> app crashes at startup
 
Last edited:

zkvvoob

Senior Member
Apr 21, 2010
137
18
Embedding with ownCloud

Hello,

I'd very much like to have ODM as part of my ownCloud server, given that it itself is a way to avoid using cloud services we cannot control.

In view of this, could anyone help me figure out how to use the existent ownCloud user database, instead of having to register a special ODM one?

Thanks in advance!
 

zkvvoob

Senior Member
Apr 21, 2010
137
18
Hi,

I tried ODM a few weeks ago and had the same problem as mentioned a few times above ("Server registration failed...").

Today I finally had time to debug and figured out that the problem was not the client side, but the server side!
I'm running odm-web on nginx, the app uses chunked post requests and nginx doesn't support requests without a Content-Length header.

If you also run odm-web on nginx, you can try a modified APK: https://github.com/berrnd/odm/raw/master/latest/odm.apk

I just removed the chunked transfer encoding, you can have a look at the changes made here: https://github.com/berrnd/odm/commit/57fe007300ebde529bc23e03e08d61a4d911348e

---
Bernd

Hi,

I can also confirmed that the modded apk worked fine on an Apache server - unlike the original one which kept failing the registration.:good:

---------- Post added at 02:31 PM ---------- Previous post was at 01:48 PM ----------

Is there a way to see all the registered devices at once on the map?
 

Fmstrat

Senior Member
Aug 3, 2007
472
162
Hello,

I'd very much like to have ODM as part of my ownCloud server, given that it itself is a way to avoid using cloud services we cannot control.

In view of this, could anyone help me figure out how to use the existent ownCloud user database, instead of having to register a special ODM one?

Thanks in advance!

Your best bet in a situation like this is to set up an LDAP directory via openLDAP or Samba 4, then have ownCloud and ODM talk to that.

Thanks,
B.
 

TheTofu

Senior Member
Nov 14, 2012
351
129
Los Angeles
Samsung Galaxy Tab S5e
Your best bet in a situation like this is to set up an LDAP directory via openLDAP or Samba 4, then have ownCloud and ODM talk to that.

Thanks,
B.

Trying to get the server working, running lighttpd, getting a blank page and access log shows 500 error whenever I try to log in with app.

Was getting 411 error before but that modified apk seems to have fixed that, so I'm not really sure what's wrong since there's nothing in lighttpd's error log.

I did made sure php5-mcrypt and -curl are up to date.

Edit: Figured this out with the help of a friend, enabled php error displaying and the issue was the same as PascalA, make sure php5-mysql is up to date.
 
Last edited:

bart1708

New member
May 29, 2014
3
0
still issue with image upload

i still have an issue uploading a front or rear photo.
no imagefile (png or jpg) is uploaded to server.
to which directory are the files stored to? are there writing permissions missing?
 

ddomit

New member
Oct 9, 2014
3
0
Undefined class Constant

Hello,
I get the following error while trying to deploy on any mysql server (i have tried godaddy, db4free, and others), can you please help??

Undefined class constant ‘MYSQL_ATTR_MAX_BUFFER_SIZE’ in D:\Hosting\9149369\html\odm-web-master\odm\include\db.php on line 7

When I host it Locally with MAMP i dont have that issue, but i want to host it online so i can register devices.
Please help!!

Thanks!
Daniel

---------- Post added at 06:59 AM ---------- Previous post was at 06:44 AM ----------

Hello!!

I am having the same error you did! Fatal error: Undefined class constant 'MYSQL_ATTR_MAX_BUFFER_SIZE' in D:\Hosting\9149369\html\odm\include\db.php on line 7

Did you find a way to solve it without affecting other functions? Please let me know, i cant figure a way past this!:(:(

THanks

Daniel


bit of a problem with the sql file in the latest version. It doesnt run in phpmyadmin on my windows server,
so I edited the file removing the troublesome comments etc. The db constructed fine.
I then got a web error which when traced, led to db.php file. I replaced

$con = new PDO('mysql:dbname='.$DB_DATABASE.';host='.$DB_HOST.';charset=utf8', $DB_USER, $DB_PASSWORD, array(PDO::MYSQL_ATTR_MAX_BUFFER_SIZE=>1024*1024*50));

with

$con = new PDO('mysql:dbname='.$DB_DATABASE.';host='.$DB_HOST.';charset=utf8', $DB_USER, $DB_PASSWORD);

and then could register account, login, register a device. Hopefully replacing the lines above doesnt **** anything up. I installed the new apk, which seems to function on the device correctly, but the results are not received at the web client. Some of the web commands are switching off my ringer also instead of the function they were intended.
Really cool new functionality, and thanks for the rapid development.
 

marvon10

Member
May 8, 2010
27
0
Hello,

Same over here, tried running on WAMP and XAMP. When entering http:/127.0.0.1/odm i recieve the below errors:

Fatal error: Undefined class constant 'MYSQL_ATTR_MAX_BUFFER_SIZE' in C:\wamp\www\odm\include\db.php on line 7
Call Stack

# Time Memory Function Location
1 0.0010 148784 {main}( ) ..\index.php:0
2 0.0020 205656 dbconnect() ..\index.php:4

Any advise how to solve this? thanks a lot!
 

marvon10

Member
May 8, 2010
27
0
Hi,

Replaced line 7 in db.php with:
$con = new PDO('mysql:dbname='.$DB_DATABASE.';host='.$DB_HOST.';charset=utf8', $DB_USER, $DB_PASSWORD);

Restarted WAMP and entered localhost/odm Result:

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [1045] Accès refusé pour l'utilisateur: 'root'@'@localhost' (mot de passe: NON)' in C:\wamp\www\odm\include\db.php on line 7

PDOException: SQLSTATE[HY000] [1045] Accès refusé pour l'utilisateur: 'root'@'@localhost' (mot de passe: NON) in C:\wamp\www\odm\include\db.php on line 7
Call Stack

# Time Memory Function Location
1 0.0010 148784 {main}( ) ..\index.php:0
2 0.0020 205296 dbconnect( ) ..\index.php:4
3 0.0020 205728 __construct ( ) ..\db.php:7

Well i lost it :(
Anybody else who know how to fix this?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 71
    Hi all,


    -=> CURRENT STATUS 2014-03-06 <=-
    • Resolution selection for taking pictures
    • Video recording
    • Autofocus w/ timeout
    • Audio recording
    • Run shell commands and get responses
    • Hiding of launch icon
    • Download file to device
    • Download file from device
    • Elimination of Base64 encoding
    • Bug fixes for large file handling
    • Report location every X minutes (optional)
    • And a number of other things you'll probably never notice


    -=> UPDATE 2014-02-10 <=-
    • Camera code is rewritten, works on 4.0+ ROMS
    • Option to force location via GPS vs GPS+Network from web app
    • Change password feature (Must re-register devices after changing for security reasons)
    • When "check for updates" is on, a weekly check for outdated App and Web-app with response via push notification


    -=> UPDATE 2014-01-25 <=-
    • Web update: Zoom into image feature by opening new tab/window
    • Web update: Increased DB data size to store larger images
    • Web update: CSS updates to standardize across Chrome/Firefox/IE


    -=> UPDATE 2014-01-14 <=-
    • Added new version checking to Web panel. You must update config.php to the new version.
    • Most all functions are working except camera in 4.0 ROM force closing.

    -=> UPDATE 2014-01-13 <=-
    [*]Added version checking to APK
    [*]Added LDAP for enterprise support. You must update config.php to the new version.



    • -=> UPDATE 2014-01-12 5PM EST <=-
      • Updated to support basic authentication on ODM folder
      • Updated to specify a lock password and to use a token for encryption: You must update both the APK and the Web App, log into the web app, then open the new application. This will reset to token.


      -=> UPDATE 2014-01-12 11AM EST <=-
      • Fixed FC's on HTTP registrations

      -=> UPDATE 2014-01-11 <=-
      • Vimeo video uploaded for those with YT issues: https://vimeo.com/83928836
      • Force close issues should be resolved now (when registering).

      I thought I would release this here before I announced it on my site in case some developers would like to join in. Full information, download, github links, images, install/demonstration video, etc, can be found here: http://nowsci.com/odm


      Problems with the YouTube video? Try VIMEO instead: https://vimeo.com/83928836

      Open Device Manager, or ODM, is a fully free, open source, end-to-end encrypted alternative to Google's Android Device Manager that can be installed in right around 10 seconds. Building on the look and feel of the original ADM, ODM focuses on supporting additional features while giving users the security and privacy of a self-hosted, open source platform.

      ODM was created because of the lack of fully open source and secure device managers on the market. While there are solutions that offer open source web components, the Android Applications are not, and are known to use Google Analytics or ad networks that pull information such as IP address, all of which eliminate 100% privacy. ODM overcomes this by offering everything up for grabs on github. We will also be submitting the github repository to F-Droid, an alternative App Store that compiles open source applications directly from github, so you know you're getting a safe APK.

      Features include:
      • Open source web interface
      • Open source Android Application
      • All notifications/commands sent through Google are encrypted first
      • Full AJAX interface
      • 10 second server install
      • Multi-user support
      • Multi-device per user support
      • Last and previous locations
      • Google maps integration
      • Lock device
      • Take photos with rear and front cameras
      • Alert ringer to locate the phone
      • Receive an SMS to identify insertion of new SIM
      • Send a custom notification
      • Wipe device
      • Log of all previous activity

      screenshot.jpg


      All details can be found at: http://nowsci.com/odm

      GitHub for Android Application: https://github.com/Fmstrat/odm
      GitHub for Web Panel: https://github.com/Fmstrat/odm-web

      Thanks,
      Ben

      XDA:DevDB Information
      ODM: Open Device Manager, App for the Android General

      Contributors
      Fmstrat

      Version Information
      Status: Stable
      Current Stable Version: 0.3
      Stable Release Date: 2014-01-07

      Created 2014-01-07
      Last Updated 2014-08-19
    5
    BIIIIGGGG UPDATE on it's way.

    The next version is going to include:
    • Resolution selection for taking pictures
    • Video recording
    • Autofocus w/ timeout
    • Audio recording
    • Run shell commands and get responses
    • Hiding of launch icon
    • Download file to device
    • Download file from device
    • Elimination of Base64 encoding
    • Bug fixes for large file handling
    • Report location every X minutes (optional)
    • And a number of other things you'll probably never notice

    After this update, I'll be moving on to the UI updates as there are so many options now the menu system needs an alteration to fit nicely. Also I will be making it mobile friendly, and incorporating the viewing of the mobile version data via the App itself.

    Thanks,
    Ben
    3
    Web panel has been updated with CSS fixes, DB fixes for larger images, and a zoom feature when viewing images.
    2
    http://www.phpknowhow.com/basics/running-php-files/

    http://www.apachefriends.org/en/xampp.html


    dont forget to login to SSL localhost to getinto ODM after you upload it to htdocs in xampp
    this may help ;)
    2
    You can add an option to the web script to auto update itself and to host the apk so when an device running a old version of the apk, the newer version can be sideloaded to it and updated. And also it would be a good idea to get the sensor data like (accelerometer, gyroscope, proximity sensor) to get a better idee where the device is. And an option to listen to the mic, if it is possible.

    As timing would have it I've just updated the Web panel with a check for new version feature like the latest APK has. I won't go so far as to create an auto-update function, as that would require write permissions by the web user on the web folder, which could be a security issue. If this was a Python app, I might consider it, but not for PHP. Added two new feature requests:

    Record video: https://github.com/Fmstrat/odm/issues/11
    Record audio: https://github.com/Fmstrat/odm/issues/12

    Thanks,
    Ben