Blockchain – Big Topic broken down to pieces

bccloud2

Blockchain is certainly not the latest buzzword any longer, it moved well forward on the Gartner Hype Cycle, passed the peak of inflated expectations and I am sure we will find it in the trough of disillusionment in the soon to be updated 2018 version. It is picked up by various industries looking for use-cases and applications. Unfortunately we are looking at Blockchain fatigue already, as there is much hype but little visible implementations outside the cryptocurrency space. I prefer projects that implement blockchain as the right tool for a particular problem over the “let’s see which business case we can throw blockchain at” approach.

In the aviation (airport) space I believe Blockchain has its appliance, but as previously stated I wont attempt to build an AODB with Blockchain as “database” for milestones just for the sake of integrating this technology. For some scenarios you certainly need immutability of data, but we can implement this with the means of other immutable data storage. It is also no point implementing a blockchain into a corporate network infrastructure with few nodes under the control of one entity, this does not fulfill the promise of distributed ledger and trust. A few use-cases that I see, usually involving multiple business parties:

  • Baggage tracking from end-to-end (goes well with IATA 753 effective since June 1st)
  • Service and contract management, billing (eg. groundhandler-airline)
  • Aircraft spare parts management (here the track of provenance have a huge impact)

Trying to understand blockchain can be overwhelming, ranging from Satoshi Nakamoto’s original whitepaper to a endless number of books, talks, websites.
One approach to understand the technology is to break it down into smaller pieces that are implementing proven existing technology or algorithms and understand how they come together eventually forming the much more complex blockchain.

I wont attempt to explain blockchain here, this is redundant, plenty of knowledgeable people have written books and articles you can refer to, but split it into some basic easy digestible portions, some coding included. Before attempting to code against real blockchain implementations, like Ethereum or Hyperledger, I will implement the most basic and simple blockchain first.

1. Hash

The most essential element of blockchain is a hash, a digital signature. A hash is a one way encryption,  once something is hashed there is no way to reverse the process and reveal the original text (decrypt it). Using the SHA (Secure Hash Algorithm), the most popular algorithm with its variants of 256, 384 and 512 bit, defined by NIST, we can convert a text (data) of any length to a 256 bit representation (for SHA256) which is represented by a 64 byte hex string. There is a number of libraries implementing the algorithm, below is the Apache DigestUtils version.

	private void testSHA(){

		String sha256hex = DigestUtils.sha256Hex("Jim Smith");
		System.out.println("\n1 SHA256: " + sha256hex);

		String sha256hex2 = DigestUtils.sha256Hex("jim smith");
		System.out.println("\n2 SHA256: " + sha256hex2);

		String sha256hex3 = DigestUtils.sha256Hex("jim smith and the lazy brown fox");
		System.out.println("\n3 SHA256: " + sha256hex3);

		String sha384hex = DigestUtils.sha384Hex("Jim Smith");
		System.out.println("\n4 SHA384: " + sha384hex);

		String sha512hex = DigestUtils.sha512Hex("Jim Smith");
		System.out.println("\n5 SHA512: " + sha512hex);
	}

resulting in

1 SHA256: 65742910cc03889474f1ee2c8f321a105603d0ae2f91070ffd95b35f8da88261
2 SHA256: bfae13266154ec3c4de5c09cf14358305e44f48d2156953723ebbb184a724499
3 SHA256: e5a4a1b8bd88eb7cf8bff9ee5dd235f87ef996262d4d0213c1387f6141ab9574
4 SHA384: c6e76ad773905c1eedb6a0bd9c0b1602a56928d1ce95d70190cd908797466b948dd342aa69dd0343251afece2e48bfc2
5 SHA512: f813c3d9deb66d4999f6839acc60eb6e2fff6a84266c02e0d4b183f5e56d9674c70b0b136f9e1388673cefbc9278f583e3a4c9803ef0c49f9af28aca60dae5ac

Important to notice:
– Change of one character in the original text produces a complete new hash.
– Independent from the length of the original text the hash has the same length.

2. Chained blocks

As the wording implies, there are blocks of information that are linked together. Sounds like a linked list, where every list entry is pointing to the next information. The chained blocks are linked differently, every block points to the hashed previous block.

For illustration I choose a typical baggage journey (simplified).

blockchain

A bag passes different key touchpoints and changes its custody a few times between the various parties during the handling. Every time there is a new milestone event we record it, eg. bag scanned by groundhandler at the chute at what time, and include the hash of the previous milestone. This way the lifecycle from bag drop at departure to bag delivery at destination is recorded in an immutable way and cannot be changed afterwards.

Pitfall: The bag journey is recorded in an immutable way, but the blockchain cannot verify or confirm the milestone actually happened. This falls into the responsibility of the overall design and service orchestration.

Let’s build a very simple application implementing the above blockchain for baggage handling.

A java class BagTransaction representing the bag attributes inclusive timestamp and the custody transfer.

package blockchaindemo;

import java.time.Instant;

import org.apache.commons.codec.digest.DigestUtils;

public class BagTransaction {

	private String bagTag;
	private String timeStamp;
	private String pnr;
	private String transferFrom;
	private String transferTo;

	private long blockID;
	private String blockHash;
	private String previousBlockHash;

	public BagTransaction(String bagTag, String pnr, String transferFrom, String transferTo, long blockID,
			String previousBlockHash) {
		super();
		this.bagTag = bagTag;
		this.timeStamp = Instant.now().toString();
		this.pnr = pnr;
		this.transferFrom = transferFrom;
		this.transferTo = transferTo;
		this.blockID = blockID;
		this.previousBlockHash = previousBlockHash;

		this.blockHash = createCurrentHash();
	}

	public String getHash() {
		return this.blockHash;
	}

	@Override
	public String toString() {
		return "BagTransaction [bagTag=" + bagTag + ", timeStamp=" + timeStamp + ", pnr=" + pnr + ", transferFrom="
				+ transferFrom + ", transferTo=" + transferTo + ", blockID=" + blockID + ", blockHash=" + blockHash
				+ ", previousBlockHash=" + previousBlockHash + "]";
	}

	private String createCurrentHash() {
		String returnHash = "";

		returnHash = DigestUtils.sha256Hex(
				this.bagTag + this.timeStamp + this.pnr + this.transferFrom + this.transferTo + this.previousBlockHash);

		return returnHash;
	}

}

Take note of the hashing method that includes all fields inclusive of the previous hash.

A java class BagDemoApp using the transaction class.

package blockchaindemo;

import java.util.Random;

public class BagDemoApp {

	public static void main(String[] args) {

		BagDemoApp demoApp = new BagDemoApp();
		demoApp.demo1();

	}

	public void demo1() {

		String myBagTag = randomBagTagID();
		String myPNR = randomPNR();

		String currentBagBlockHash = "";

		// Print Bag Tag (Genesis Block)
		BagTransaction bagTransaction1 = new BagTransaction(myBagTag, myPNR, Entity.NIL.name(), Entity.PAX.name(), 1,
				"0");
		currentBagBlockHash = bagTransaction1.getHash();

		// Bag Drop
		BagTransaction bagTransaction2 = new BagTransaction(myBagTag, myPNR, Entity.PAX.name(), Entity.AIRP.name(), 2,
				currentBagBlockHash);
		currentBagBlockHash = bagTransaction2.getHash();

		// Bag SEC Scan
		BagTransaction bagTransaction3 = new BagTransaction(myBagTag, myPNR, Entity.AIRP.name(), Entity.SEC.name(), 3,
				currentBagBlockHash);
		currentBagBlockHash = bagTransaction3.getHash();

		// Display Transactions
		System.out.println(bagTransaction1);
		System.out.println(bagTransaction2);
		System.out.println(bagTransaction3);

	}

	// HELPER METHODS --------------------------------------------

	public String randomPNR() {
		final String alphabet = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
		final int N = alphabet.length();

		Random r = new Random();
		StringBuffer tempPNR = new StringBuffer();

		for (int i = 0; i < 6; i++) {
			char nxtChar = alphabet.charAt(r.nextInt(N));
			while ((i == 0) && (Character.isDigit(nxtChar)))
				nxtChar = alphabet.charAt(r.nextInt(N));
			tempPNR.append(nxtChar);
		}
		return tempPNR.toString();
	}

	public String randomBagTagID() {
		String tempBagTag = "";

		long range = 9999999999L;
		Random r = new Random();
		long number = (long) (r.nextDouble() * range);

		tempBagTag = String.format("%010d", number);
		return tempBagTag;
	}

	public enum Entity {

		PAX {
			@Override
			public String toString() {
				return "Passenger";
			}
		},
		GH {
			@Override
			public String toString() {
				return "Groundhandler";
			}
		},
		AIRL {
			@Override
			public String toString() {
				return "Airline";
			}
		},
		AIRP {
			@Override
			public String toString() {
				return "Airport";
			}
		},
		SEC {
			@Override
			public String toString() {
				return "Security";
			}
		},
		NIL {
			@Override
			public String toString() {
				return "nil";
			}
		}

	}

}

Executing the application

BagTransaction [bagTag=1691462171, timeStamp=2018-08-12T08:02:25.745Z, pnr=ICSEAH, transferFrom=NIL, transferTo=PAX, blockID=1, blockHash=3ff736f7158d224db6e2e8ba25f3d50321903cd911646576f442a60f8c5872ed, previousBlockHash=0]
BagTransaction [bagTag=1691462171, timeStamp=2018-08-12T08:02:25.808Z, pnr=ICSEAH, transferFrom=PAX, transferTo=AIRP, blockID=2, blockHash=88dd4a2be3bc90ebce71635bedd6bcb63b326044e4bd49634a859a86458de243, previousBlockHash=3ff736f7158d224db6e2e8ba25f3d50321903cd911646576f442a60f8c5872ed]
BagTransaction [bagTag=1691462171, timeStamp=2018-08-12T08:02:25.808Z, pnr=ICSEAH, transferFrom=AIRP, transferTo=SEC, blockID=3, blockHash=ea7767ddb2dd7c2bfed4d3a038b9249e43df15a0396ff71da717783db9fee3c4, previousBlockHash=88dd4a2be3bc90ebce71635bedd6bcb63b326044e4bd49634a859a86458de243]

Please note, this is the most simple implementation of a blockchain for illustration purpose, it still misses a lot of features to pass to production, eg. mining, proof-of-work, etc.

In a second part might spin this a bit further. Stay tuned.

 

Disclaimer: This discussion, datamodel and sourcecode or application is for study purpose solely. It does not reflect or replicate any existing commercial product.

Advertisements

Design an AODB for a mobile server platform ?

5997469039_0736c09bd7_b

Mobile clients for AODB (Airport Operational Database) products running on tablets and mobile phones are a standard offering today. These clients allow convenient access to operational data while being on the floor, at the tarmac etc. I remember my first mobile AODB project more than 10 years back operating on a proprietary Nokia platform. Today it is not a major technology challenge any longer with current mobile hardware, platforms and libraries available at hand.
The remaining questions are often: How to design the app for a small screen landscape available, but facing a big amount of operational data ? What features does a mobile user really need, what info is key to be displayed, what updates need to be entered while being mobile ? How to simplify user interaction ? How to handle the data synchronization when being offline, aka in areas without wireless or mobile coverage ? Build a hybrid app or go native ?

I believe we at an interim stage of mobile computing at this moment, while current mobile apps replicate desktop applications (screen, mouse, keyboard) with the means of mobile interaction (touch, swipe, pinch,..), we still sorting out the next evolutionary step. Mobile computing on mobile phones, handhelds, wearable computing, smart watches, AR glasses etc. etc. Ruggedized devices became standard while smart watches are still not taking off.
The next (or this !) generation of mobile apps should make use of the mobile characteristics and sensors built-into most mobile hardware. A few ideas: Location awareness, the app should know where the user is at the apron and already open the relevant flight and information or support manual milestone recording. Depending on the users role, tasks should be highlighted to him/her, eg. a service manager that is closest to a problem location should be notified. NFC reader, barcode scanner and AR glasses should assist the user to identify cargo, baggage, vehicles, etc.

Putting aside this considerations, I like to engage in a little thought-experiment:
Can we run an AODB, aka the server, on a mobile phone (Android) ? (without using any external core service, eg. data storage or rule engine etc. Standalone only, allowing other clients to connect, simple interfaces only)
Lets play with pro and con argument and check on the feasibility.

Hardware

This topic triggered the discussion when comparing current hardware in mobile phones with server hardware 20+ years ago when the first generation of AODB products appeared. A standard server of that time was something like a Sun Ultra II with dual 200 MHz processors, 256 to 512 MB of RAM and maybe a SCSI rack with 3x 10GB diskspace, running Solaris, 32bit. Easily priced at 20.000 to 50.000U$ depending on configuration plus various commercial licenses.
Lets look at a current mobile phone like the Huawei P20, Octa-core (4×2.4 GHz Cortex-A73 & 4×1.8 GHz Cortex-A53) with 4GB of memory and 128GB of SD card space, coming at 600U$.

Operating System

Android is obviously not a server OS, it does not give us control over settings that we can rely on under Linux. We cant assign memory and priority, it is actually the OS that controls apps and services, going to the extend of terminating unused apps and similar. The only way of having a persistent app running is as service. Apps are living in sealed sandboxes, only a rooted device would give us more control.

Solution architecture

We cant build a multi-tier solution with the classical database, business logic and frontend layers. Android enforces monolithic applications, the only way to escape this is by building services and relying on ICP (AIDL, Intents, Binder). Anonymous shared memory is only available in Android 8+.

Database and Application/Web-Server

App-server ? Easy to answer, it does not exist. Maybe simple http server is possible.
Database ? Only a few solutions at hand, either the built-in SQLite, not really a DB known for performance, or some alternatives, mostly key-pair and relational DB’s and some NoSQL DB (Comparison chart here).

Scalability

We cant scale vertical, no adding of CPU’s or memory possible. Horizontal scaling would not be easy, unless we deploy more mobile phones to outsource certain services, but implementing a load-balancer would not be possible.

Availability

In terms of network connection we are limited to 1 wireless or (!) 1 mobile connection at a time, no redundancy. Power-failure is less of a problem, we have built-in battery that could last at least 1 hour under heavy usage. Android as OS is quite stable, it can run for prolonged periods, though it is uncertain if services running permanently with load create a problem.

Integration

Integration of interfaces with other systems is a bit more challenging. Though it is no problem to consume webservices, download from ftp server or receive emails as part of interface client, we will have a hard time to provide an interface, eg. to offer a webservice. There is no ESB running on Android.

Conclusion

It is definitely possible to run a very lightweight AODB solution without lots of fancy bells and whistles on a mobile phone, ideally to act both as server and client integrated into one solution (app). All under the premise to limit our requirements to a basic set of features like managing schedule, daily operations, milestone handling, simple resource management.
The longer I review this idea the more arguments I collect against this use-case, the platform is too limited to allow scaling, does not provide real server features and will not be able to run heavy services like rule engines, ESB, etc.
Maybe feasible for small scale operations at an airport with few commercial flights a day, some GA, few users and utilizing third party services in the cloud for billing, ESB, etc.

I suggest we rather invest our thinktank energy in building a serverless AODB by using orchestrated microservices and use the mobile platform solely as client.

Image: Creative Commons, National Library of Ireland on The Commons, “St. Albert at Dublin Airport, circa 1950”

Aviation API – Airline and Airport Webservices

The term API (Application programming interface) is not new, basically a defined access to a set of methods, subroutines and data-types made available by one component/service to be used/consumed by another component or application. You can think of API as the car manual and the library being the engine under the hood.

Since the early days of tinkering with the Windows DLL hell more than 20 years have passed, we have better tools and standards by now. In the space of native apps for Windows, Android and iOS we still work with libraries and SDK’s (still can be challenging when resolving dependencies and deployment).
In the world of web applications today we look mostly at RESTful Webservices responding in JSON or XML, a rather straight forward implementation, the only complexity depends on the authorization mode or the mapping of attributes. A lot of websites, portals, services or products expose their WS for usage by third parties, from Salesforce, Ebay, Amazon to Twitter and infinite more. While these mentioned samples operate independently or work as standalone services there is not much need for standardization of the payload, aka the structure of attributes, naming conventions etc. For others business domain there is a need of standardization of such, despite the availability of AIDX, AIDM and a few more data exchange models, there is no standard widely used in the (public) WS space in aviation.
I have to highlight in ACI ACRIS a Semantic Model is being actively developed and the Open API Shop exists as project as well.

I researched what webservices are currently offered to the public by airports and airlines, excluding the API’s of system vendors and travel platforms.
So far I found these webservices (last update 2018-07-06):

Airline

International Airline Group
British Airways, Iberia, Avios
https://developer.iairgroup.com/
Lufthansa https://developer.lufthansa.com/
Airfrance, KLM https://developer.airfranceklm.com/
Alaska Air
https://developer.alaskaair.com/
Transavia https://developer.transavia.com/
FlyDubai https://developer.flydubai.com/
Virgin Australia
https://developer.virginaustralia.com/
Ryanair https://developer.ryanair.com/
Turkish Airlines
https://developer.turkishairlines.com

Airports

Schiphol Airport
https://developer.schiphol.nl/
San Francisco Airport
https://www.flysfo.com/api
Frankfurt Airport
https://developer.fraport.de/
Svedavia Airports
https://apideveloper.swedavia.se/

Others

FAA US
https://app.swaggerhub.com/apis/FAA/ASWS/1.1.0
Flightaware
http://flightaware.com/commercial/flightxml

The usage terms and price models vary but basically all give some kind of developer access to evaluate the services and data at no cost.

To compare a few of the services using a flight status related call, omitting the authentication. The lack of standard, putting aside JSON response format and date format, is quite obvious. It might not be relevant in the space of individual apps to have the same response format, but if you want to combine data from various sources you have to handle the formats separately. Even the request format with the query parameter differs.

British Airways

https://api.ba.com/rest-v1/v1/flights;departureLocation=FRA;startTime=06:00;endTime=11:00

ba

Swedavia Airports

https://api.swedavia.se/flightinfo/v2/query?filter=airport eq ‘ARN’ and scheduled eq ‘180713’ and flightType eq ‘A’ and flightId eq ‘DY4572’

IMG122

Lufthansa

https://api.lufthansa.com/v1/operations/flightstatus/LH778/2018-07-13

IMG123

I also tried with RyanAir (still waiting for approval to get api key), Turkish Airlines (no flight status API), Schiphol (no webservice test available on the website).

Image: Creative Commons, Robert Yarnall Richie Photograph Collection, “Models with Oldsmobile Automobile, Lockheed 10B Electra, Delta Air Lines, 1940”

Airport Simulator on Android

Dont rise your expectation to high on this topic for now. Before jumping into the serious use cases for airport process and environment simulations, as well the gamification of enterprise environments, I will review some simulator apps available on Android and PC in a rather humorous way.

I just love simulators, it is amazing to see how current 3D and physic engines running on today’s powerful and affordable hardware can execute real-time simulations that were only possible in well equipped research labs 2 decades ago. I am experimenting with various 3D engines like Unity and CryEngine, both freely available as personal or educational version or for indie games.

OK, lets have a look at simulators available for the Android mobile platform. If you search for the term simulator you will get thousands of apps, and there is a simulator for almost everything and anything you never heard of before, though the majority is plain crap and only exists because Unity makes it so easy to create a game by clicking-together some assets and adjusting some properties, almost without the need to code. Most of them are just badly made and often only serve the purpose to bombard you with ads once installed or running.

We find 100’s of car, truck, train simulation apps, plus dozens of somewhat strange apps to simulate dogs, cats, dinosaurs, Fishing, Fork Lifts, shark attacks, Miami Crime, swimming trains, flying boats and tuk tuk’s and endless more objects.

Finetuning our search towards the term airport (vehicle) simulator we still reveal dozens of results. Here we have a selection of flying, airport construction and all kind of driving around the airport tasks. The majority is made with Unity engine and the free assets, one reason why most of these apps display the same assets like cars, trucks and planes.

AirportSimulator_13

Selection of simulator apps

Most of them have in common: Well rendered icons and preview images in the play store to catch your interest, generous with requested permissions and truckloads of ads.
Surprisingly all of them have downloads of well beyond 100.000 ! Guess we don’t know the uninstall-rate though, but if you look at the user comments you know.

AirportSimulator_30

Permissions galore inclusive to run as service during startup, snooping accounts and location, downloading files.

Here some actual screenshots of the often weird gameplay or scenery I found.

AirportSimulator_9

Factory Airport ? Not much room to maneuver. Where are taxiways, positions, gates ? But 3 Towers !

AirportSimulator_28

If your are short of pushbacks, go for a regular truck as fallback !

AirportSimulator_29

Personal pickup service for MIB passengers in Area 51 ?

AirportSimulator_3

Taking off from a construction site with speed limits and stop signs. Here the tower also a bit too close to the runway maybe.

AirportSimulator_19

Disembarking Zombie passengers walking down from the service staircase to the waiting Cobus(?)

AirportSimulator_11

Driving a heavy duty tow truck between the planes parked on the grass. Nothing else to do. Maybe one of these defunc airline desert airplane parking grounds ?

AirportSimulator_25

This time we drive an airport security car in a totally static airport. Someone forgot to add tarmac lines here ?

AirportSimulator_7

This plane looks like the airport fire brigade drill setup. But in this app all planes look like this model (front part is mocking a war train from the 1930’s). Not so standard cargo handling either.

AirportSimulator_32

Interesting, floating mobile stairs supported by a RC wreck. Walls at the tarmac ?

AirportSimulator_33

Winter wonderland. Random assets like palms, lamp posts and others stuff thrown at the scene. Big Christmas trees at the end of the runway… Walls again.

AirportSimulator_34

Gives the term Greenfield Airport a more genuine meaning ! Randomly appearing zombie passengers again. Leave the boarding gate through the window ?

AirportSimulator_35

Oh yes, that is a smart way to avoid a potential IP conflict with a famous airline ! Bonus: Floating bridge and you fly with a 1:5 scale plane ?

AirportSimulator_36

Smart parking, what to say ? Smart as in stacking cars on the back of a truck or smart as in placing this thing at the end of the runway ?

Conclusion: Dont expect anything when downloading these simulators, other than uninstalling it again and potentially being spied or bombarded with ads. None of the app I tried even remotely comes close to any real operations. These are games – confirmed – nothing else.

In the next blog entry we will look at Simulator Software available for Windows PC’s.

Stay tuned.

 

Dynamics of the Play Store

The first time I saw an Android Phone was in 2008 during the OSDC Conference in Sydney where one of the presenter from Google had a development phone with him that he showed to some of us. I remember people saying “sure Google making a mobile phone, dont waste my time…”. Guess I don’t need to tell the rest of the story almost 10 years later.

Soon after the conference in early 2009 the HTC Dream (or called G1 in some countries) was launched to public as first developer phone, I ordered one from Google because I was excited about a platform that you could develop for without buying in into a commercial platform. At that time the coding was possible with Netbeans or some Eclipse plugins and some manual tinkering and configuration, in 2010 I created the first application for the so-called Android Market to play with the physics of the release process.

I still have the HTC Dream, unfortunately not in a working condition anymore,  I bought the next developer phone in 2010, the Google Nexus One which was running Android Eclaire.

2017-11-26 16_50_05-T-Mobile_G1_launch_event_2.jpg (JPEG Image, 1346 × 1082 pixels)

Android HTC Dream 2009

The Android Market was still in its infancy, a mix of hello-world, irrelevant apps and spam all over the place. The whole platform was dominated by individual developers and not by major players. Below a 3 day statistics screenshot I made in 2010, you can see the numbers did not change significantly, in 1 day 40 apps where added, now it around 2000 to 4000 new apps a day. My app did show up in the “new app” section, something impossible to achieve today.

2017-11-26 17_02_27-statistics.ods - Excel

Android Market 2010

Anyway, it was and it continues to be an interesting experience, though I find it a pity it is so hard to get an independent created app get noticed.

Bck to today, I did some experiments with a new app that I just released. Getting my hands dirty with NFC development, I released a simple app, it it supposed to read NFC tags, the early version does nothing but checking if the hardware supports NFC, that’s a Java/Android no-brainer, a one method call. I invented an app name that did not exist in Google Search, I call it “NFCheckR” for the sake of finding out how fast it appears in the market and in Search. The first release is public within 2 hours on the Google Play, a day later it can be searched in both Google Play and Google Search. The search rank no. 1 is a link to the Google Play followed by dozens of links to dodgy third party sites offering the apps for download, obviously mirroring the Google Play site. Some of them offering weird descriptions as well. It claims it got 90 votes and 5 ratings, despite having only a single (1) download so far (which is no wonder, there are at least a 100 NFC tools).

2017-11-26 17_47_15-Clipboard

Google Search

 

The sites claim the app would run on Windows, Mac and other platforms. I recommend NOT to download from any of these sites !

2017-11-26 17_45_43-Download NFCheckR For PC Windows and Mac APK 0.1 - Free Tools Apps for Android

NFCheckR at third party website


History Lane

One of the first emails from Android Market:

2017-11-27 15_56_40-Clipboard

Android Market 2009

 

The Forgotten Sourcecode

I remember the first time I heard the term Public Domain software and Shareware somewhere between the late 1980′ and early 90’s. Towards the end of the Commodore C64 era, where software was almost solely commercial (and not affordable for the average secondary student) creating the vivid software “sharing platform” at the schoolyard as a solid first release of software piracy, I got my hands on my first IBM compatible PC running DOS. Soon after data CD-ROM’s appeared with Shareware, a legal way to use software. Magazines were published with CD-ROM’s attached and I remember regular visits to shareware shops selling nothing but legal CD-ROM’s, years before the internet was available to public. While Public Domain Software was totally free of any license and Shareware was more like a free-to-use model (sometimes under certain conditions or restrictions similar to today’s lite/free versions), it laid the foundation of what we know as Open Source today, in my opinion one of the most important elements of our software landscape. I recommend the title “The Cathedral and The Bazaar” by Eric S. Raymond, the 25 year old book describing the inner parts of open source, a lot of it still applies.

bazaar

The Cathedral and The Bazaar – 1999 Book by Eric S. Raymond

If you are keen to go on a time travel you can download the ISO image of a couple of these shareware CD’s from archive.org and have a hands-on session with 25 year old software, though I doubt you can execute all of them on current hardware and OS.

The640SharewareStudio

Shareware CD anno 1992 (archive.org)

Once the internet was in place platforms emerged where hobbyists could store the software repositories and releases of their software. One of the early ones I remember was Sourceforge which was launched in 1999, it still exists today (after changing ownership 3 times last few years). Few others were coming and going in the same space (BerliOS, Launchpad, java.net, Javaforge, Tigris.org, ..). Though not so dominating today anymore, due to number of alternatives, one of the most prominent is Github, Sourceforge still hosts a huge number of software, some of them quite prominent, it also was the starting platform of some rather known solutions (Pentaho, Firebird, Wireshark, Nagios, Notepad++,..). Over the years I created accounts for some of the platforms, and even forgot some of them, now I solely use Github. Recently I came across a simple tool that I created in 2008 to experiment with repositories in Java and noticed the tool is still there and it was downloaded over 2.300 times in the last nine years. Not that the tool does anything more magic than creating UUID’s and copy them to clipboard. It is just amazing to see, as long the platform does not disappear, the code lives on, no expiry attached.

2017-11-20 14_56_57-Download Statistics_ All Files

Do you have some old forgotten software treasures too?

2017-11-20 15_05_52-UUID Generator download _ SourceForge.net

Budget Android Phone Security Considerations

The market for Android phones and tablets (plus other devices) is huge, Android is dominating the market at almost 90%, followed by iOS around 10% and rest together less than 1%. Google claimed in May 2017 there are 2 billion active devices worldwide.
IT security for mobile devices is a huge topic and we face similar threats as in the desktop OS landscape with virus, trojan horses, backdoor apps and other malware. Some remarks about this at the end of the article.

The mobile phone manufacturer segment is still dominated by Samsung, followed by Huawei, LG, Motorola, to name a few. A medium range device with decent specs costs around $200 to $400.

Apart from the known brands there is wide range of china produced phones at a partially much lower price. Remark: The famous brands might produce as well in China but you pay a higher price for the brand in some sense.

Wouldn’t it be great to get a phone with good specs for less than $100,- ? Some of the brands are HOMTOM, Cubot, OUKITEL, Jesy, DOOGEE and other never-heard-of names.

The temptation is great to buy one of these phones, but it comes at a price. How do you value privacy and security ? Already end of 2016 these devices made it into the news because of sending user data over to servers in China.

A7_Connections_1

Android Phone connections

Lets get some hands-on and investigate with a current phone. I bought a phone for the sole purpose of development testing, not to use for calls or storing sensitive data. I decided to get a BLACKVIEW A7 PRO, available at U$ 70,- from various online stores.

Blackview A7 Pro Android Phone

The phone casing and screen makes a good first impression, the specs do not need to hide behind other medium range phones:

  • Android 7.0
  • MTK6737 1.3GHz, Quad Core
  • 2GB RAM
  • 16GB ROM
  • 4G/LTE with 2 sim card slots
  • 5″ HD screen

Out-of-the-box it comes with the default Android apps, access to the Google Playstore and without any visible bloatware.

Before getting too much excited lets take a look at the communication this device tries to establish after connecting to the internet. I installed a connection and communication inspection tool, these tools are available on the Playstore too. I do not recommend any specific tools here as some of these tools have questionable permission requests.

It does not take too much time before the device starts communicating with a server based in China.

2017-11-07 17_07_05-Screenshot_20171105-132835.png - Windows Photo Viewer2017-11-07 17_07_26-Screenshot_20171105-122804.png - Windows Photo Viewer

Both domains are registered with a hosting company, but you find plenty of news and forum entries if you google for them.

Most interesting is the pre-installed Beau _t_ ySnap application that is not only invisible as app to the user but permanently running in the background. You can find it with a package inspector. Looking at the permissions the application is not only hidden but also very generous with system access.

2017-11-07 17_12_34-Screenshot_20171106-082101.png - Windows Photo Viewer

Bea_u_tySnap permissions

Needless to say you cant restrict the permissions because it is not visible as app but part of the firmware. It also seem to request for hardware specific permissions.

2017-11-07 17_15_12-Screenshot_20171106-082133.png - Windows Photo Viewer

Lets look at the traffic and the data exchanged, seems the app tries to call home a few time per hour.

traffic2

 

Quite obviously they transmit some basic data un-encrypted, like version, current internet connection (wifi), the phone (A7Pro), timezone, screensize and they created a user id to identify the device (aka its user). IMSI and IMEI are not used, though the fields exist. There are some extra fields with encrypted info, I suspect the soc, scc, noc,.. fields might store the celltower info, which serves the coarse geoloaction even if you have GPS disabled.

The least I could do with this phone without rooting it, is to disable the Be_a_utySnap application. Do this by going to Setttings – Apps, enable the display of system apps, select Be_a_utySnap and disable it.

Besides this app, there is still the A_dU_ps FO_TA app and the M_T_K_Logger which are worth looking at. They cant be disabled. I have not caught them yet transferring data out.

Lessons learned

  • Cheap comes at a price. If you are concerned about privacy and security do not buy or use such a phone as your main device to access sensitive personal data or sites like online banking, etc. If you dont want to be tracked and data sold or given to other unknown parties this phone is not for you either. Though there is no guarantee expensive branded devices are protected or cannot be affected too.
    You can use the phone when you know how to disable the spyware elements (and still be careful) or root the phone and install another OS like LineageOS (which comes with separate risks).
  • Do not download applications (apk files) from outside the Google Playstore as the minimum protection and be careful even you download apps from the Playstore by looking at the permissions of the app. You dont need to get a malware infection if you allow a regular app do retrieve your contacts, phone identity and location without knowing what the company behind the app does with the data. GDPR might be irrelevant and impossible to enforce if the app is provided by a company in some non-EU country and has no proper business entity.

Comments on the Android threats landscape

Unlike in the Windows world where we learned the hard way to deal with virus and malware, pretty much securing the OS after treats materialized. Though the first viruses made their first public appearance in the 1980’s, only in 1990/91 the first serious antivirus products were established.
When Android was born some safe concepts were integrated, and with the newer releases more and more security measures were taken (please refer to the below links). Some key elements:

  • Apps run in a sandbox and cant access the OS.
  • Apps are deployed through a central repository (Playstore)
  • User can can control system access via permissions
  • Controlled inter-app communication

Certainly some user still break this by downloading apk files from outside the store, rooting the device, allowing all permissions, etc.

Recommended Reading