Merge lp:~ev/whoopsie/android-serial into lp:whoopsie

Proposed by Evan
Status: Rejected
Rejected by: John Lenton
Proposed branch: lp:~ev/whoopsie/android-serial
Merge into: lp:whoopsie
Diff against target: 103 lines (+39/-0)
4 files modified
Makefile (+2/-0)
debian/changelog (+7/-0)
debian/control (+1/-0)
src/identifier.c (+29/-0)
To merge this branch: bzr merge lp:~ev/whoopsie/android-serial
Reviewer Review Type Date Requested Status
Canonical Foundations Team system identifier composition Pending
Daisy Pluckers Pending
Review via email: mp+178306@code.launchpad.net

Description of the change

Uses libandroid-properties to use the Android serial number, manufacturer, model, and board as the system identifier (falling back to the first non-loopback MAC address).

Feedback on the selection of hardware-static strings welcome. I'm trying to seed the sha512sum with sufficient data to create a low risk for collision.

To post a comment you must log in.
lp:~ev/whoopsie/android-serial updated
567. By Evan

Use a bit more information on Android to seed the sha512.

568. By Evan

Use the board on Android as part of the identitifer.

569. By Evan

Typo.

570. By Evan

Fix changelog entry.

571. By Evan

update the docstring one last time.

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

For devices that have sim card capability, they also have IMEI number assigned (world-wide unique across all devices), which is used by SIM cards when authenticating with 3G and GSM networks. It's used to blacklist stolen devices and make them essentially bricks (well, not able to authenticate with 3G/GSM). Thus if available that should be used to uniquely identify the device in-additionto/instead of proposed methods. IMEI is also android independant and portable between all devices that have sim cards (Eg. laptops with sim cards).

Ubuntu System Settings already has methods to fetch IMEI number.

Revision history for this message
Evan (ev) wrote :

Following what @xnox said, ubuntu-system-settings uses the QtMobility APIs to fetch the IMEI number. This in turn seems to use NetworkManager's DBus API to find the first GSM device and return its IMEI:

http://www.qt.gitorious.org/qt-mobility/qt-mobility/blobs/master/src/systeminfo/linux/qsysteminfo_linux.cpp#line471

Revision history for this message
Evan (ev) wrote :

ofono does provide us with an interface to the IMEI, but it's currently broken in the case when there's no SIM inserted:

https://bugs.launchpad.net/ubuntu/+source/ofono/+bug/1210502

Revision history for this message
Evan (ev) wrote :

It's been pointed out by Adam that we probably want to concatenate the IMEI with some other data, like the MAC address, if we are to use it. An IMEI doesn't give you a particularly large range.

Revision history for this message
John Lenton (chipaca) wrote :

For the record, this work and ensuing comments was the starting point for https://code.launchpad.net/~chipaca/whoopsie/brofono which has now landed.

Revision history for this message
John Lenton (chipaca) wrote :

(setting it to "rejected" because people keep on asking when this branch is going to land...)

Unmerged revisions

571. By Evan

update the docstring one last time.

570. By Evan

Fix changelog entry.

569. By Evan

Typo.

568. By Evan

Use the board on Android as part of the identitifer.

567. By Evan

Use a bit more information on Android to seed the sha512.

566. By Evan

Use the Android serial number for a system identifier, if it is
available.

565. By Evan

libandroid-properties-dev build-dep.

564. By Evan

Comment.

563. By Evan

Once more, without the memory corruption.

562. By Evan

Initial commit of work to use the android serial number as the crash db identifier.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'Makefile'
--- Makefile 2013-02-26 10:36:50 +0000
+++ Makefile 2013-08-02 14:44:25 +0000
@@ -7,12 +7,14 @@
7 $(CFLAGS) $(CPPFLAGS)7 $(CFLAGS) $(CPPFLAGS)
8libwhoopsie_LIBS=$(shell pkg-config --libs glib-2.0) \8libwhoopsie_LIBS=$(shell pkg-config --libs glib-2.0) \
9 $(shell libgcrypt-config --libs) \9 $(shell libgcrypt-config --libs) \
10 -landroid-properties \
10 $(LDFLAGS)11 $(LDFLAGS)
1112
12whoopsie_CFLAGS=$(shell pkg-config --cflags gio-2.0 glib-2.0 libcurl) \13whoopsie_CFLAGS=$(shell pkg-config --cflags gio-2.0 glib-2.0 libcurl) \
13 -g -Ilib -Wall -Werror -Os -DVERSION=\"$(VERSION)\" \14 -g -Ilib -Wall -Werror -Os -DVERSION=\"$(VERSION)\" \
14 $(CFLAGS) $(CPPFLAGS)15 $(CFLAGS) $(CPPFLAGS)
15whoopsie_LIBS=$(shell pkg-config --libs gio-2.0 glib-2.0 libcurl) -lcap \16whoopsie_LIBS=$(shell pkg-config --libs gio-2.0 glib-2.0 libcurl) -lcap \
17 -landroid-properties \
16 $(LDFLAGS)18 $(LDFLAGS)
17SOURCES=src/whoopsie.c \19SOURCES=src/whoopsie.c \
18 src/utils.c \20 src/utils.c \
1921
=== modified file 'debian/changelog'
--- debian/changelog 2013-07-26 15:33:48 +0000
+++ debian/changelog 2013-08-02 14:44:25 +0000
@@ -1,3 +1,10 @@
1whoopsie (0.2.17) UNRELEASED; urgency=low
2
3 * Use the Android serial number, manufacturer, model, and board number to
4 form a system identifier, if they are available.
5
6 -- Evan Dandrea <ev@ubuntu.com> Fri, 02 Aug 2013 15:16:19 +0100
7
1whoopsie (0.2.16) saucy; urgency=low8whoopsie (0.2.16) saucy; urgency=low
29
3 * Continue to process the existing crash reports every two hours, not10 * Continue to process the existing crash reports every two hours, not
411
=== modified file 'debian/control'
--- debian/control 2013-02-26 10:36:50 +0000
+++ debian/control 2013-08-02 14:44:25 +0000
@@ -9,6 +9,7 @@
9 libcap-dev,9 libcap-dev,
10 libgtk-3-dev,10 libgtk-3-dev,
11 network-manager-dev (>= 0.9.4.0-0ubuntu1),11 network-manager-dev (>= 0.9.4.0-0ubuntu1),
12 libandroid-properties-dev,
12 python,13 python,
13 valgrind,14 valgrind,
14 pyflakes15 pyflakes
1516
=== modified file 'src/identifier.c'
--- src/identifier.c 2013-01-31 14:39:18 +0000
+++ src/identifier.c 2013-08-02 14:44:25 +0000
@@ -1,3 +1,5 @@
1#define _GNU_SOURCE
2
1#include <glib.h>3#include <glib.h>
2#include <gcrypt.h>4#include <gcrypt.h>
3#include <sys/types.h>5#include <sys/types.h>
@@ -8,6 +10,7 @@
8#include <string.h>10#include <string.h>
9#include <stdio.h>11#include <stdio.h>
10#include <fcntl.h>12#include <fcntl.h>
13#include <hybris/properties/properties.h>
1114
12#include "identifier.h"15#include "identifier.h"
1316
@@ -29,6 +32,27 @@
29}32}
3033
31void34void
35whoopsie_identifier_get_android_serial (char** res)
36{
37 /* Use the Android serial number (0000000000000000), manufacturer (Asus),
38 * model (Nexus 7), and board (grouper) for a system identifier. */
39
40 static char serial[PROP_NAME_MAX];
41 static char manufacturer[PROP_NAME_MAX];
42 static char model[PROP_NAME_MAX];
43 static char board[PROP_NAME_MAX];
44
45 property_get("ro.serialno", serial, "");
46
47 if (*serial != '\0') {
48 property_get("ro.product.manufacturer", manufacturer, "");
49 property_get("ro.product.model", model, "");
50 property_get("ro.product.board", board, "");
51 asprintf (res, "%s%s%s%s", serial, manufacturer, model, board);
52 }
53}
54
55void
32whoopsie_identifier_get_mac_address (char** res, GError** error)56whoopsie_identifier_get_mac_address (char** res, GError** error)
33{57{
34 struct ifreq ifr;58 struct ifreq ifr;
@@ -154,6 +178,11 @@
154178
155 g_return_if_fail (res);179 g_return_if_fail (res);
156180
181 whoopsie_identifier_get_android_serial (&identifier);
182 if (identifier) {
183 goto out;
184 }
185
157 whoopsie_identifier_get_system_uuid (&identifier, error);186 whoopsie_identifier_get_system_uuid (&identifier, error);
158 if ((!error || !(*error)) && identifier)187 if ((!error || !(*error)) && identifier)
159 goto out;188 goto out;

Subscribers

People subscribed via source and target branches

to all changes:
to status/vote changes: