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

Proposed by Evan on 2013-08-02
Status: Rejected
Rejected by: John Lenton on 2014-05-22
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 2013-08-02 Pending
Daisy Pluckers 2013-08-02 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 on 2013-08-02
567. By Evan on 2013-08-02

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

568. By Evan on 2013-08-02

Use the board on Android as part of the identitifer.

569. By Evan on 2013-08-02

Typo.

570. By Evan on 2013-08-02

Fix changelog entry.

571. By Evan on 2013-08-02

update the docstring one last time.

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.

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

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

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.

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.

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 on 2013-08-02

update the docstring one last time.

570. By Evan on 2013-08-02

Fix changelog entry.

569. By Evan on 2013-08-02

Typo.

568. By Evan on 2013-08-02

Use the board on Android as part of the identitifer.

567. By Evan on 2013-08-02

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

566. By Evan on 2013-08-02

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

565. By Evan on 2013-08-02

libandroid-properties-dev build-dep.

564. By Evan on 2013-08-02

Comment.

563. By Evan on 2013-08-02

Once more, without the memory corruption.

562. By Evan on 2013-08-02

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
1=== modified file 'Makefile'
2--- Makefile 2013-02-26 10:36:50 +0000
3+++ Makefile 2013-08-02 14:44:25 +0000
4@@ -7,12 +7,14 @@
5 $(CFLAGS) $(CPPFLAGS)
6 libwhoopsie_LIBS=$(shell pkg-config --libs glib-2.0) \
7 $(shell libgcrypt-config --libs) \
8+ -landroid-properties \
9 $(LDFLAGS)
10
11 whoopsie_CFLAGS=$(shell pkg-config --cflags gio-2.0 glib-2.0 libcurl) \
12 -g -Ilib -Wall -Werror -Os -DVERSION=\"$(VERSION)\" \
13 $(CFLAGS) $(CPPFLAGS)
14 whoopsie_LIBS=$(shell pkg-config --libs gio-2.0 glib-2.0 libcurl) -lcap \
15+ -landroid-properties \
16 $(LDFLAGS)
17 SOURCES=src/whoopsie.c \
18 src/utils.c \
19
20=== modified file 'debian/changelog'
21--- debian/changelog 2013-07-26 15:33:48 +0000
22+++ debian/changelog 2013-08-02 14:44:25 +0000
23@@ -1,3 +1,10 @@
24+whoopsie (0.2.17) UNRELEASED; urgency=low
25+
26+ * Use the Android serial number, manufacturer, model, and board number to
27+ form a system identifier, if they are available.
28+
29+ -- Evan Dandrea <ev@ubuntu.com> Fri, 02 Aug 2013 15:16:19 +0100
30+
31 whoopsie (0.2.16) saucy; urgency=low
32
33 * Continue to process the existing crash reports every two hours, not
34
35=== modified file 'debian/control'
36--- debian/control 2013-02-26 10:36:50 +0000
37+++ debian/control 2013-08-02 14:44:25 +0000
38@@ -9,6 +9,7 @@
39 libcap-dev,
40 libgtk-3-dev,
41 network-manager-dev (>= 0.9.4.0-0ubuntu1),
42+ libandroid-properties-dev,
43 python,
44 valgrind,
45 pyflakes
46
47=== modified file 'src/identifier.c'
48--- src/identifier.c 2013-01-31 14:39:18 +0000
49+++ src/identifier.c 2013-08-02 14:44:25 +0000
50@@ -1,3 +1,5 @@
51+#define _GNU_SOURCE
52+
53 #include <glib.h>
54 #include <gcrypt.h>
55 #include <sys/types.h>
56@@ -8,6 +10,7 @@
57 #include <string.h>
58 #include <stdio.h>
59 #include <fcntl.h>
60+#include <hybris/properties/properties.h>
61
62 #include "identifier.h"
63
64@@ -29,6 +32,27 @@
65 }
66
67 void
68+whoopsie_identifier_get_android_serial (char** res)
69+{
70+ /* Use the Android serial number (0000000000000000), manufacturer (Asus),
71+ * model (Nexus 7), and board (grouper) for a system identifier. */
72+
73+ static char serial[PROP_NAME_MAX];
74+ static char manufacturer[PROP_NAME_MAX];
75+ static char model[PROP_NAME_MAX];
76+ static char board[PROP_NAME_MAX];
77+
78+ property_get("ro.serialno", serial, "");
79+
80+ if (*serial != '\0') {
81+ property_get("ro.product.manufacturer", manufacturer, "");
82+ property_get("ro.product.model", model, "");
83+ property_get("ro.product.board", board, "");
84+ asprintf (res, "%s%s%s%s", serial, manufacturer, model, board);
85+ }
86+}
87+
88+void
89 whoopsie_identifier_get_mac_address (char** res, GError** error)
90 {
91 struct ifreq ifr;
92@@ -154,6 +178,11 @@
93
94 g_return_if_fail (res);
95
96+ whoopsie_identifier_get_android_serial (&identifier);
97+ if (identifier) {
98+ goto out;
99+ }
100+
101 whoopsie_identifier_get_system_uuid (&identifier, error);
102 if ((!error || !(*error)) && identifier)
103 goto out;

Subscribers

People subscribed via source and target branches

to all changes:
to status/vote changes: