Towards accurate ranging and versatile authentication for smart mobile devices