Monday, May 16, 2011

 

Looting Android's log files

Hello, my faithful droogsreaders. Been awhile since I've posted here, because I've been super-busy, mostly writing code. But I'm off travelling for a couple of months shortly (Ethiopia, France, Ladakh) so I thought I'd leave you with a little Android/Bluetooth tidbit before I go:

In theory, any Android 2.1-or-later device can open serial port protocols to any Bluetooth device. In practice, though, a bunch of handset manufacturers have, for reasons known to them alone, crippled their Bluetooth stack so that they can't Discover (a word with a loaded meaning in Bluetooth) any device with a generic (ie set to 0) Bluetooth class.

How annoying, no? However, it turns out that - even on those devices - you can pair with and connect to those devices, if you know their address. "But Jon," you say, "how can I get their address, if the Discovery process has been crippled?"

Well. It turns out that the Qualcomm drivers in question, when they ignore the generic Bluetooth devices, do write to the Android log file the fact that they are ignoring it. So all you need to do is mine your log files for the address. How do you do that? So glad you asked.

First, add to your AndroidManifest:

<uses-permission android:name="android.permission.READ_LOGS" />


Second, use this method:

private Set checkLogs() {
HashSet devices = new HashSet();
if (mAdapter==null)
return devices;

//check the logs
Log.i(""+this, "Log check...");
try {
Process process = Runtime.getRuntime().exec("logcat -d *:e");
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(process.getInputStream()));
String line;
String deviceAddress=null;
while ((line = bufferedReader.readLine()) != null) {
if (line.indexOf("0x00 - skip it") > 0) {
int end = line.indexOf("] class");
int start = line.indexOf("Device [");
if (start>=0)
start=start+"Device [".length();
deviceAddress = line.substring(start, end);
Log.i(""+this, "Found "+deviceAddress+" in log");
BluetoothDevice device = mAdapter.getRemoteDevice(deviceAddress) ;
devices.add(device);
//String deviceName = device.getName()==null ? device.getAddress() : device.getName();
//Util.DoToast(Main.this, "Discovered device "+deviceName);
}
}
bufferedReader.close();
process.destroy();
return devices;
}
catch(IOException ex) {
Log.e(""+this, "Error checking logs - "+ex);
ex.printStackTrace();
return null;
}
}


...and finally, just connect to the device explicitly:


btSocket = device.createRfcommSocketToServiceRecord(GatewayManagerConversation.uuid);
btSocket.connect();


...and that should trigger the pairing process, and after pairing, you can connect to the device (which will be in your local cache of paired devices, as normal.)

Hope that helps!

Labels: , ,


Comments:
I took the same log file approach, but I have written an AsyncTask that kicks of discovery, and they retrieves just those devices that were 'skipped' during that discovery. This will avoid finding multiple devices, and won't require the user to kick of a discovery in the phone settings first :)

You can find it here.
 

anks for sharing this informative content.,
Leanpitch provides online training in Agile team facilitation during this lockdown period everyone can use it wisely.

Agile team facilitation

ICP ATF
 
Nice Blog. Thanks for sharing with us. Such amazing information.

Main causes for failure in digital marketing strategy
 
I never heard about this method. I will try this but first I have to complete some projects of Hrm Dissertation Editing Services Uk. Then I will definitely give it a try and give my opinion on this method.
 
Well, you shared outstanding information about the android log files. I never heard anything about android log files, but I am sure this information might be helpful for Android users. I will share this post with my younger brother, and he will try this method of looting android log files.
Best Assignment Writing Services
 
스포츠토토티비
스포츠토토


This really is such a awesome write-up. I’ve been looking for this information for quite a while now and then finally stumbled upon your internet site. Thanks so much for posting this, this has helped me out tremendously. By the way I love the style of the blog, looks good, did you create it all by yourself?

 
토토사이트
프로토


Wow! After all I got a web site from where I can actually get valuable information regarding my study and knowledge.|
 
Such a very nice post. Top assignment help

 
Great Blog! I have go through all the content of this blog.This is really helpful and informative for me and all the readers.We are offering an online business management research topics ideas for those students,who have interested to avail this service at a cheap price.

 
This is very nice guys! I would love to recommend you a beautiful service for homework! If you need some help, just text to them personal statement professional and be ready for help! They rally know how to it!
 
Thank you for this informational post. I really like your content. Keep Posting. If your Roadrunner Email Not Working with Outlook and looking for technical help. Please contact us.
 
Most students who only have one lesson at a time use research paper writers to free up their time by writing any kind of written paper on it for a small fee.I am glad that I found a site where I can easily order various essays.
 
Want to make best assignment in civil engineering assignment help get it done with help of our professional who provide you best content also provide your assignment on time with best price.
 
The bedroom is a place for intimacy and privacy. One of the best ways to ensure both is by using a Queen Size Bed instead of sharing one with your partner. The designer full-size beds at Grayson Living are an elegant way to keep up the romance in your life, but also maintain that private space where you can retreat when you need it most.
 
Our business is dedicated to introducing companies to potential partners and helping them grow. We consult with our clients on their business SBLC discounting in Dubai and challenges, and we think that client collaboration and co-development is the best way to achieve successful and long-lasting outcomes.
 
interactive SPAs, we ensure responsivenessWeb Development dubai and cross-browser compatibility, as well as live up to users’ high expectations in agility and performance.
 
Grayson Luxury offers a wide selection of Modern Accent Chairs that can bring elegance to any living room. Whether you are looking for a traditional style or something more contemporary, our luxury furnishings have the perfect option for your needs.
 
Most of the top martial arts schools are successful in instructing children, adults, and individuals of all ages and ability levels, from beginners to black belts.

 
You explained it nicely and the best part is providing the code. Thanks sharing the code. It is much helpful. Keep sharing more tech tidbits like this and update us also. Halifax DUI VA
 
I like this brilliant and informative post. I will surely ask my other study abroad consultants fellows to read your content.
 
It's great to hear from you and I'm looking forward to hearing about your travels! Your Android/Bluetooth tip sounds intriguing - I'm always interested in learning more about technology. And if you need any IT services while you're away, leadingit company in Dubai is a trusted company in Dubai that can help keep your technology running smoothly.
 
Interesting to learn about the limitations of Bluetooth on some Android devices. Safe travels on your upcoming adventures! By the way, if you need to get your car detailed before or after your trip, Ottawa Car Detailing provides high-quality services.

 
These restrictions can disrupt the discovery process and hinder the full potential of Bluetooth technology. Similarly, in Jeddah, the availability of luxury chocolate in Jeddah delights connoisseurs with their exquisite flavors and textures, providing a sensorial experience that transcends boundaries and limitations.
 
Hey droogsreaders! Hope you've been well. Before I head off on my travels, here's a cool Android/Bluetooth tidbit: did you know that by integrating private & public notary services Dubai, we can enhance security and streamline authentication processes? It's an exciting development that could revolutionize how we verify and authorize transactions. Safe travels to me, and catch you all soon!
 
Hasten cleanse we are highly especialized in tank cleaning houston
 

Great job on your blog!

BCL GLOBIZ
Best Accounting and Bookkeeping Services in Dubai


 
Your blogs are really good and interesting. It is very great and informative. It turns out that the Qualcomm drivers in question, when they ignore the generic Bluetooth devices, do write to the Android log file the fact that they are ignoring it. So all you need to do is mine your log files for the address. How do you do that? So glad you asked.
I got a lots of useful information in your blog Bankruptcy lawyer fairfax va. Keeps sharing more useful blogs..
 
If you need any legal help, kindly visit our page. Abogado DUI Halifax VA
 
The article about looting Android's log files is an intriguing read for tech enthusiasts. While you delve into the world of Android logs, remember to keep your car clean and shining with a visit to Car Wash Ottawa. Maintain your car's performance and appearance, just like you explore the depths of Android's logs!
 
The concept of looting Android's log files unveils the intricate layers of data security and vulnerabilities. Just as experts delve into logs for insights, rely onFracsite catering services in Monahans Texas to provide nourishing meals that fuel the energy of workers at the heart of operations. Prioritize safety
 
Exploring Android's log files can be like uncovering hidden secrets, much like the rejuvenation you'll experience at Facial Services For Men In Mississauga. It's a journey into the depths of your device's operations, and with the right insights, you can optimize its performance just as you'd enhance your skin's health with a professional facial service.
 
Looting Android's log files can provide invaluable insights for developers and users alike, just as legrand arteor dubaioffers advanced solutions for electrical and home automation needs. Both demonstrate the importance of efficiency and precision in the digital and real worlds.
 
Exploring the intricacies of looting Android's log files! As we delve into mobile technology, let's also address the significance of environmental safety. Explorevapor mitigation Texas for state-of-the-art solutions that prioritize a clean and secure atmosphere. #AndroidLogs #VaporMitigationTexas #EnvironmentalSafety #TechInnovation
 
Exploring Android's log files is an insightful endeavor, shedding light on system intricacies. Just as you delve into the details, savor the richness of a cup brewed from premium order coffee online in dubai A perfect pairing of tech exploration and indulgence for a well-rounded experience!
 
Ramma Foundation Repair is your trusted partner for expert Foundation Repair Edmonton. We specialize in delivering lasting solutions for a secure and stable foundation, ensuring the integrity of your property.
 
Crafting a compelling SOP FOR BACHELORS programs requires finesse. It's about weaving your journey into a captivating narrative that showcases your passion, determination, and aspirations. Embrace this opportunity to articulate your unique story and ambitions eloquently.
 
Nice Blog! Engage in vibrant discussions on assignment samples through blog commenting. Share insights, seek advice, and connect with a community of learners, enriching your academic journey with diverse perspectives and expertise.
 

Nice Blog! Explore a world of coding excellence with programming assignment help Join the discussion through blog commenting, sharing insights, seeking assistance, and connecting with a community passionate about mastering programming challenges. Elevate your coding skills and collaborate with like-minded enthusiasts in this dynamic online space.
 
Fascinating read! I had no idea about the wealth of information hiding in Android log files. Your breakdown of the process makes it seem almost like a digital treasure hunt. Can't wait to try this out myself and see what secrets my phone is hiding!

Thanks for sharing this useful blog! law offices near me

 
Nice Blog! In the dynamic realm of global opportunities, the Statement of Purpose SOP for work visa stands as a critical element in the journey toward professional advancement. This nuanced document goes beyond a mere formality, serving as a personalized narrative that encapsulates your professional journey, aspirations, and commitment to your chosen field.
 
Looting Android's log files unveils the intricacies of system diagnostics, offering insights into the digital world. Just as this exploration delves into the Android realm, simplify your mornings with the ease of order coffee online in dubai Transform your wake-up routine into a seamless experience, ensuring the perfect brew is just a click away, adding a touch of technological efficiency to your daily dose of caffeine.
 
Thank you so much for your thorough instruction to New York State Divorce Forms. Your thorough explanations and step-by-step breakdown made an intimidating task appear much more doable. We appreciate you offering such a helpful tool to people navigating the difficulties of getting a divorce in New York. Strongly advised for anyone looking for clarity! New York State Divorce Forms

 
Looting Android's log files" involves extracting and examining the system logs stored on an Android device to diagnose issues, monitor performance, or gather information for debugging purposes.
abogado de accidentes de camiones
abogado de flsa
trucking accident lawyer

 
Excellent article. It is Very interesting to read. I really love to read such a nice article. Thanks! keep rocking.

 
Elevate your brand's digital footprint with CMOLDS, the leading mobile app development company in Dubai. Our expert team specializes in crafting bespoke mobile solutions tailored to your business needs, ensuring unparalleled user experiences and technological excellence. Partner with us to unlock the full potential of your digital presence in Dubai's thriving tech ecosystem.
 
I've never heard of this strategy. I will try it, but first I must accomplish several Hrm easy online shopping Then I will definitely try it and share my thoughts on this strategy.
 
This blog was very enlightening, thank you

nashriyaturdu/
 

Post a Comment

Subscribe to Post Comments [Atom]





<< Home

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]