EVO FM TRANSMITTER TUTORIAL (needs dev work) - EVO 4G General

the evos Broadcom chip has a built in fm receiver and also a transmitter.
according to some threads and diagrams ive seen the transmitter does have a power source, it just doesnt have and software code to actually work.
like hdmi the hardware was there but there was no code set up, therefore we didnt have full hdmi out. it had to be built from scratch.
the hardware for the fm transmitter is there we just need some one to build the code for it.
some one please take this on!!
This tutorial was originally posted in > android development and hacking > android software development.
i am reposting it here in the evo forums for guidelines
its a nice tutorial but its old. i think it was for android 2.0 ive followed the tutorial but i couldnt get it working, and i by no means have the experience to switch things up and get it working.
[TUTORIAL] Reverse engineering HTC FM Radio for noobs (on EVO 4G)
Okay, I'm writing this because I want to help any other newbies trying to learn how to reverse engineer. The technical details involved in this are extremely daunting, so the purpose of this tutorial is to first explain in layman terms exactly what you're trying to accomplish and what to expect. Then we'll go over the details. That way you're not completely blind going into this. I'm fairly new to the scene, so I'm not as knowledgeable as everyone else. If you see any errors in my post, let me know so I can change. I'm going to assume you know a little bit of Java, can find your way around a computer, and know nothing about Android. The techniques used should work with other Android phones. For this tutorial I'm using Windows 7, Cygwin, and my stock (not rooted) EVO 4G mobile phone.
The FM tuner for the Evo is run by a Broadcom chip: BCM4329. This chip is pretty amazing in that it does wireless, bluetooth, and it has an FM receiver/transmitter. We're interested in the FM receiver / transmitter.
Now, all android phones are based on a Linux kernel. Basically they're Linux running computers. The Android operating system is then installed onto the linux system. Every app is then run off of Android.
Android is based on Java but it is not a Java system. It uses a virtual machine called Dalvik. Google did this to get around licensing issues with Sun Microsystems. So they pretty much invented their own machine language (called byte code) for the Java language. This makes things complicated for the reverse engineer because from what I've read, once Java is converted into this machine language or byte code, it can't be converted back.
So let's rehash.
If you were programming strictly in Java, you would see these extensions:
Java source code = .java
Compiled Java source code = Java byte code = .class
Compressed file to package your program = .jar (Java Archive)
But since you're programming in Android and Dalvik, you will see these:
Java source code = .java
Compiled Java source code = Dalvik byte code = .dex
Compressed file to package your program = .apk
(I haven't mentioned this, but HTC further Optimizes their .dex code)
Optimized Dalvik byte code = .odex
I'm writing all of these down because it's very easy to get confused with all of the extensions. (for me at least!). remember how I said once you go dex, you can't go back to java? That's where JesusFreke comes in. He's a senior member of XDA, and he created "baksmali" and "smali", two programs that can convert the Dalvik code back into a human readable format. These files have extensions of .smali
Decompiled Dalvik byte code = .smali
But what can you do with .smali files? That's where this other senior member, brut.all comes in: He developed apktool. apktool takes JesusFreke's work to the next level. This program in conjunction with NetBeans, actually lets you trace through any program using the .smali code taken from JesusFreke's programs!
apktool does this by converting those .smali files into "fake" .java files that can be used by the NetBeans (program that compiles and makes java programs) IDE. I say "fake" because apktool embeds the .smali code into java files as comments. However, once you attach a debugger to NetBeans, you'll see that the debugger will follow line by line every execution statement found in the smali code!
So...... you can take the program you want, plug it into Net Beans using a debugger (using the default ddms command provided by Android SDK), and you can trace everything you do in the program. I have it connected to my phone, so whenever I push a button while running my HTC FMRadio app or unplug my headphones,I see the corresponding response to the HTCFMRadio code I have loaded in NetBeans. I can now see in real-time how the program operates from my own interactions... JAM.
Technical Aspects: How to get from ground zero to tracing HTCFMRadio?
1.) Download Android SDK - Go to google development site and follow instructions: Make sure to download the latest Java JDK. Once that is installed, download NetBeans 6.8. Unfortunately, smali debugging does not work with the lastest versions of NetBeans.
Download the "Java SE" version for minimal space
http://netbeans.org/downloads/6.8/index.html
You can follow the rest of Google walkthrough and download Eclipse and ADT plugin, but it's not pertinent to this. You're going to be using adb and ddms from the android SDK extensively, so make sure the path for </android SDK/tools> is included in the PATH variable in your ENVIRONMENT SETTINGS. To get here, right click My computer, click properties, Advanced Settings, ENVIRONMENT SETTINGS.
2.) Search for 7z and download it. It is an awesome and free compression tool that will be extremely useful. It can be used to "unzip" .jar, .apk, and other compressed formats.
3.) Get the Radio app. You can do this by going to "shipped-roms" website, downloading the latest Supersonic image, and following the directions in the unlockr tutorial for HTC kitchens at the unlockr website... (once you have extracted the files from the image, you can look in the system/app and system/framework directories to get the files listed below) or:
you can pull the following files from your phone:
Using the command prompt type (and with phone plugged in, and with USB debugging enabled on phone):
adb pull /system/app/HtcFMRadio.odex
adb pull /system/app/HtcFMRadio.apk
adb pull /system/framework ./framework
This will put HtcFMRadio.odex and HtcFMRadio.apk in the current directory and create a framework directory with more files. A couple of the files in the framework are needed for the HtcFMRadio app, but for simplicity, we're just going to pull the whole directory.
Now that we have the files, we have to make a few changes to make the app installable and to be viewable by the debugger. To do this we have to decompile the .odex format into a human readable format we can edit. That brings us to:
3.) Download baksmali and smali from Project Hosting on Google Code (google search smali).
Usually an Android application is made up of one file, an apk file. Inside the apk file is an AndroidManifest.xml file, a classes.dex file (compiled Java code for the program), and other folders. The other folders contain either graphics or other .xml files that tell the program how it should look to the user. We don't have to worry about those for now. This is important because APKTOOL only opens programs set up this way. But wait up? We didn't download one .apk file, we downloaded an .apk file and an .odex file! What gives? Well, if you right click the apk file and open it (using 7z), you'll see that it's missing the classes.dex file. The dex file for the app is actually the HtcFMRadio.odex file we downloaded. So, to make this system app more like a nominal app, we have to find a way to convert the HtcFMRadio.odex to a classes.dex file. That's easy with baksmali and smali!
Once you download goto command prompt and type:
java -jar baksmali-<version>.jar -d framework -x HtcFMRadio.odex
(Remember to match baksmali-<version>.jar with the filename of baksmali you downloaded)
If done correctly, you should see a newly created \out directory
This creates an out\com\htc\fm directory with many .smali files.
Now let's reverse the process and put it back as a dex file. Type at command prompt:
java -jar smali-<version>.jar out -o classes.dex
If done correctly you'll see a newly created classes.dex.
now, right click on HtcFMRadio.apk (select 7z and open). Drag classes.dex into the file. Say yes to the prompt. Now you have a normal apk file APKTOOL can read!
4.) Download APKTOOL from Project Hosting on Google Code and the helper apps for your OS. (If you're extracting files for windows OS you should have apktool.bat and aapt.exe). Extract (again using 7z, don't you love this program?) apktool.jar (keep it as a jar file, don't extract the stuff inside of it), apktool.bat, and aapt.exe to the directory you're working on. To make things neat, you can also delete HtcFMRadio.odex (you don't need it anymore) and classes.dex (make sure you put it in the HtcFMRadio.apk file first!)
If this is the first time you're using apktool, then you have to install the htc framework so apktool can baksmali the Radio app. You only have to do this once:
apktool if ./framework/com.htc.resources.apk
Alright, at the command prompt:
apktool d -d HtcFMRadio.apk
This extracts the contents of HtcFMRadio.apk and places them in the HtcFMRadio directory. However, there are two major differences between this content and the content created in step 3. If you go into the smali directory you'll see that instead of .smali files, you'll see .java files. And if you go back and edit the AndroidManifest.xml file, you will also see that it's in text! Android applications convert their xml files to binary format. Now that APKTOOL has converted everything to an IDE friendly format, we can use NetBeans to edit everything. The first thing we're going to do is edit AndroidManifest.xml (using notepad) and add the following:
android:debuggable="true" to the Application tag.
IT should now look like this:
<application android:theme="@android:style/Theme.Black.NoTitleBar" android:label="@string/fm_app_name" android:icon="@drawable/fm_radio" android:taskAffinity="android.task.fmradio" android:description="@string/htc_corp" android:allowTaskReparenting="true" android:debuggable="true">
This permission lets the debugger watch the program while it's running on the phone.
We are going to run into two problems if we try to install this program. One is that Android doesn't let you install more than one copy of a system app. The second issue is that if we change the signature of our system app, then we'll have to change the signatures of our other system apps as well! Ahh.... So, to get around that, we're going to trick Android into thinking we have a completely new program. We're going to do that by renaming the com.htc.fm class to com.htc.modradio class. Next step:
5.) Cygwin (or Linux virtual machine)
The easiest way that I can think of to replace strings in multiple files is by using linux. You can most definitely do it in WIndows, but I dont know how. If you let me know how, I can put it in this tutorial.
(update: you can use Notepad++ to easily find/replace strings in multiple files for Windows. You still, however, want to download Cygwin if you're going to develop with Android-NDK.)
For now, just search for Cygwin (Cygwin is a program that lets you run Linux commands from a command prompt using your Windows directories), and install it. Make sure to have the Perl option selected. You'll need Perl to make the following commands work.
Once you get Cygwin up and running
cd <to your HtcFMRadio directory>
in my case it's
cd /cygdrive/c/Users/Jerry/Desktop/HtcFMRadio
now type the following commands in this order:
this command changes all occurances of htc/fm to htc/modradio in your xml and .java files.
find ./ -type f | xargs perl -pi -e 's/htc\/fm/htc\/modradio/g'
this command changes all occurances of htc.fm to htc.modradio
find ./ -type f | xargs perl -pi -e 's/htc.fm/htc.modradio/g'
If you don't follow this order, your source code will get messed up.
If using cygwin, a bunch of .bak files will be created. Using windows search, find all .bak files in your HtcFMRadio directory, then select them all and delete them (Make sure they are only files with .bak!)
Now just rename the fm directory to modradio. It is located in HtcFMRadio/smali/com/htc
Now go to your windows command prompt and type:
apktool b -d .\HtcFMRadio modradio.apk
Now sign and install modradio.apk on your phone.
adb install modradio.apk
If you have never signed before, then you need to use keytool and jarsigner. These two files are in your JDK directory, so make sure you include your JDK directory in the PATH variable of your ENVIRONMENT SETTINGS. (To get here, right click on My Computer, click Properties, Advanced Settings, Environment Variables. Once you make change, open up a new COMMAND prompt to see changes).
cd to the directory which has modradio.apk
now type:
keytool -genkeypair
Answer all questions, then use the same password for all password prompts.
Next type:
jarsigner -verbose modradio.apk mykey
Type in the password you created in the above step. Your apk should now be signed.
Next install:
adb install modradio.apk
Success!
6.) Testing the app on phone
Go to your phone and you'll now see a new FMRadio icon next to your first. Click on it and watch it open. It should now be able to play music. Keep it open.
7.) Using Netbeans
Go into HtcFMRadio and delete the build directory created by APKTOOL.
Now open up Net Beans and click on File, New Project, Select Java Project with Existing Sources, click on Next
Select HtcFMRadio directory for Project Folder, rename Project Name to whatever you want. Let's type in ModRadio. click on Next
Next to "Source Package Folders" click on "Add Folder" and select the smali directory.
Click Finish. For a quick tutorial by Brut.all, search APKTOOL in youtube and click on: Apktool Demo 2 - Smali improvements
Right click on Libraries. Click on "Add Jar / Folder". You want to add Android.Jar. Since I have Android 2.1 loaded I went to /platforms/android-7 located in my android SDK directory.
Your project is now ready for editting!
8.) Running the Debugger to trace through program.
Next go back to Windows command prompt and type ddms. This runs the Dalvik Debug Monitor. A window should open up. In the left hand side you should see com.htc.modradio. That's our app! To the right you're going to see 2 numbers, you're interested in the one to the right, 4 cells away from com.htc.modradio. This number is a port number, and you're going to use it to communicate with NetBeans. (In my case it is 8603)
Go back to NetBeans and click on Debug, Attach Debugger.
In the host field type: localhost
In the Port field: type in the second number you saw. (8603)
If everything is working you'll see a bug appear next to com.htc.modradio in the Dalvik Debug Monitor. Look at the bottom bar of NetBeans for feedback. If you get errors make sure the numbers match, or try port 8700 and make sure you select com.htc.modradio in the Dalvik Debug Monitor. Port 8700 is the default port used for whatever program you select in Dalvik Debug Monitor.
9.) Setting a breakpoint
I'm making this a seperate step because it is completely arbitrary. When creating a break point be sure to follow this rule:
You must select line with some instruction, you can't set breakpoint on lines starting with ".", ":" or "#".
Rather than looking for a spot to breakpoint, though, I'll tell you where to put one so you can quickly see how the debugger traces through the code. You aren't "REQUIRED" to do the next step, but if you want to trace you have to put a breakpoint somewhere.
In Net Beans click on the Project tab, click on Source Packages, com.htc.modradio, and then doubleclick on BroadcomFMTuner.java
We're going to insert a breakpoint. Scroll down to line 3226 and on your keyboard press: CTRL-SHIFT-F8, select line in dropdown box and hit ok. (To keep it simple, I usually look for "invoke" instructions to set breakpoints at)
Now go to your phone and click on the physical "back" button on your phone. This will clear the radio,(you should still be able to listen to music). Drag your status bar down. You should see a radio icon. Click on it again. The radio backgroudn will appear, but you wont' see any text or anything. Now go back to your netbeans application. You should now see debug options highlighted! Click on Step Over (F8) to step through!
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
found a pdf
for the chip set
http://pdf.eccn.com/pdfs/Datasheets/Broadcom/BCM4329.pdf
http://www.broadcom.com/products/Bluetooth/Bluetooth-RF-Silicon-and-Software-Solutions/BCM4329

I'm not a developer, but this would be cool to have..
-m

I agree with diomark. I don't code either, but i would LOVE to have this feature on my phone. I'd put up $20 to backup my support.

I agree...I've seen this question before, when the evo was released. I'm surprised no Dev has tried to attempt it. I'd throw $20 since it'd save me from buying an fm transmitter, plus it'd give me one more feature to brag about .

Two things come to mind..
First is there an antenna attached to the RF OUT for the transmitter? No antenna, no worky and possible damage to the chip itself. Judging from the FCC site there is no FM BC antenna.
Second is the FM transmitter FCC Type Accepted? Quickly looking at the FCC site I would say no.
https://gullfoss2.fcc.gov/oetcf/eas...e=N&application_id=939126&fcc_id='NM8PC36100'
https://gullfoss2.fcc.gov/eas/GetApplicationAttachment.html?id=1278204

possibly the antenna might be headphones attached just like the fm radio antenna.
it would be so nice to use the fm transmitter to send music through my car radio to my car speakers!!!!!!

I already have the double male phone plug from my phone to the car stereo, the whole point would be to be wireless.

look at the pdf i attached in the OP
3 things i find interesting are
1. FM receiver and transmitter (76 MHz to 108 MHz FM bands);
2. Programmable FM transmit output power
3. Transmit Output Power: 117 dbuV

adeyo said:
possibly the antenna might be headphones attached just like the fm radio antenna.
it would be so nice to use the fm transmitter to send music through my car radio to my car speakers!!!!!!
Click to expand...
Click to collapse
To receive yes. Transmit no. A transmitting antenna has to be cut a certain length to resonate at the frequency that it will be transmitting at. Otherwise you will toast the transmitter because the power going out to antenna could be reflected back into the chip. When RF has no place to go it generates heat (think microwave oven).
Some reading for those interesting.. http://en.wikipedia.org/wiki/Dipole_antenna

kf2mq said:
To receive yes. Transmit no. A transmitting antenna has to be cut a certain length to resonate at the frequency that it will be transmitting at. Otherwise you will toast the transmitter because the power going out to antenna could be reflected back into the chip. When RF has no place to go it generates heat (think microwave oven).
Click to expand...
Click to collapse
i got this from broadcom
heres the link
http://www.broadcom.com/press/release.php?id=1233460
read carefully.
it states that the fm does have an antenna
''the BCM4329 uses single-stream 802.11n to transmit and receive data''
it says it doesnt have multi antennas due to size and power consumption.
it has one antenna that it uses for everything.
The BCM4329 includes both FM transmit and receive capabilities. FM transmit enables consumers to stream music directly from a personal media players (PMPs) or mobile phone to car stereos or home theater systems without having to purchase special adapters or use bulky cables. FM receive is already a popular feature that enables consumers to obtain real-time traffic information as well as listen to music, news and sports broadcasts on their mobile phones.
The BCM4329 also integrates Bluetooth, which is already a ubiquitous feature in mobile phones and PMPs, enabling hands-free communications with wireless headsets, cordless data synchronization and stereo music streaming to headphones and speakers. Since Bluetooth and Wi-Fi operate in the same 2.4 GHz band, both the Broadcom BCM4325 and BCM4329 combination chips use innovative co-existence algorithms and a shared antenna system to minimize interference and provide even better performance than products that use separate Bluetooth and Wi-Fi solutions.
"Handset manufacturers are excited about the opportunities that 802.11n brings, but they are looking for single antenna solutions that meet stringent size and power requirements," said Chris Bergey, Director of Broadcom's Embedded WLAN line of business. "The BCM4329 is another example of how Broadcom is driving the industry towards combination solutions, not by delivering a one-size-fits-all technology, but by integrating the right mix of technologies for the right applications."
Technical Information
Since handheld devices lack the space, battery power and processing power to support 802.11n implementations with multiple antennas, the BCM4329 uses single-stream 802.11n to transmit and receive data. This significantly reduces the system's footprint and power consumption when compared to multi-stream solutions. Despite the use of a single antenna, the BCM4329 provides faster and more reliable wireless connections than current 802.11g products.

Missed a big thing there.. FM Broadcast operates from 87.9MHz to 107.9MHz. Bluetooth and Wifi operate around 2.4-2.5GHz. The single antenna solution is for BT+Wifi, and FM but they do not share the same antenna. Your headphones act like a 1/4 wave end-loaded dipole antenna. A fullwave FMBC antenna is about 4 meters (approx 12ft) tall, and Bluetooth/WiFi is about 11cm (approx 4-5 inches) tall.
More importantly looking at the datasheet
The FM receiver/transmitter does share a common antenna. You are correct. The next big thing is the FM transmitter FCC Type Certified for use in the US? I haven't had a chance to look through the cert for the EVO. If it is not then it's use would be illegal here in the US.

kf2mq said:
The FM receiver/transmitter does share a common antenna. You are correct. The next big thing is the FM transmitter FCC Type Certified for use in the US? I haven't had a chance to look through the cert for the EVO. If it is not then it's use would be illegal here in the US.
Click to expand...
Click to collapse
Have to watch out for those people riding around to see if your licensed to transmit fm radio in your car

aimbdd said:
Have to watch out for those people riding around to see if your licensed to transmit fm radio in your car
Click to expand...
Click to collapse
ROFL! I was just thinking the same thing. This would be AWESOME!!

aimbdd said:
Have to watch out for those people riding around to see if your licensed to transmit fm radio in your car
Click to expand...
Click to collapse
And you never know who works for the FCC either that's lurking on the board. But if the radio was not type certed, and you posted a how-to then you would in violation of XDA's TOS. Don't think Toast would be amused. Also it is not a matter of being licensed (due to the low output power). But operating a transmitter that maybe causing interference to other devices is what will get you in trouble. Jack with your neighbors medical telemetry, and see how quickly you'll get a visit from the FCC to inspect your station (radio) eventually. Without getting into too much detail, you could get slapped with a NAL which you have 10 days to respond. The FCC can drag you to Federal court. You can get fined starting at $7500 per day. All things aside you'll more than likely not get caught but Murphy does have his day. Then you'll come on XDA *****ing that you got fined, and/or your phone got confiscated. Then everyone on XDA will have a good round of lulz at your expense.
Sent from my PC36100 using Tapatalk

IF performing this mod is the same as having and using a FM transmitter for personal use then I don't think anyone is going to get into trouble.

Bioxoxide said:
IF performing this mod is the same as having and using a FM transmitter for personal use then I don't think anyone is going to get into trouble.
Click to expand...
Click to collapse
Provided that the transmitter was tested, and approved by the FCC yes no problem. I'd be the first to mess with it. But if it isn't there has to be a reason why not. It could be sending out spurious interference which in turn could cause problems with other electronic devices or even with the phone itself. That's my point. I don't think there are many here on XDA that are RF Engineers much less have a working knowledge of radios.
Much like back in the heyday of CB radio. You had people with recipes for modding their radios that were passed around. So you had the average Joe with no test equipment, and no knowledge. Just the golden screwdriver. Next thing you know it their radio sounds like crap, interfering several channels up and down, or letting out the magic smoke.

so the fcc can approve a phone with an untested/unapproved fm transmitter that is also found in ipads and other phones?
UPDATE: crap so i guess it's the final application that is approved by the fcc and if transmit function is not part of the final application it doesn't get tested. RATS!

kf2mq said:
Provided that the transmitter was tested, and approved by the FCC yes no problem. I'd be the first to mess with it. But if it isn't there has to be a reason why not. It could be sending out spurious interference which in turn could cause problems with other electronic devices or even with the phone itself.
Click to expand...
Click to collapse
There doesn't have to be anything. They didn't want that feature, so why test it?

@ kf2mq
please stop voicing your opinions on this topic.
im trying to get a dev to work on this so we all can have a very nice sable feature not have you stomp it in the ground.
first you posted and said it did not have an antenna which after very little research i found documents and diagrams showing that in fact it does
now your trying to tell me the fcc has to approve it?
wtf?
if it wasnt already approved by the fcc broadcom would not have been able to produce the chip with the fm transmitter in the first place
stop trolling on my posts.
thank you.

Nice haha.
Could try posting it in general with dev needed in the title.
Sent from my PC36100 using XDA Premium App

Related

Looking for C/C++ Compiler for WM6

I recently got myself an ATT Tilt (Kaiser), which I plan on taking with me to a conference in Europe next month, and I'm not planning on taking a laptop so I can travel lightly afterwards. The phone currently has WM6 on there (I'm not going to play with flashing the ROM until after my trip).
To the point: I want a C/C++ compiler on my phone that I can use for potentially testing a few things over there (assuming the application I have in mind will work, but that's another story). I'm assuming that if I get the compiler working, it will have access to the standard C libs, including network stack.
I've tried PocketGCC, but I can't get it to work. The cabs from pocketgcc.sourceforge.net install fine, but the CMD Prompt won't open (I click on the icon and nothing happens).
Searching these boards, the only reference I've found was to http://www.mobilitysite.com/boards/business-development/135816-pocket-c.html#post1187340, but the links it points to for getting the various files no longer work.
Any suggestions or alternate links on how to get a working compiler on my smartphone?
As a backup, is CeGCC the best option for pre-compiling for the phone? Anyone know if it runs under 64-bit linux? Or if not, under win32 cygwin? Ideally, I'd love to have a cygwin-equivalent on the phone...but I guess that'll be deprecated with Android later on.
Thanks,
- David
Hi David,
I'm also looking for this and the best aproach was a DOS emulator (I think it is called Pocket DOS and there is another one that is free but don't remember the name) and Turbo C. I used it just to test very basic software that was just displayed in the DOS windows. But it was a really really little software (a couple of FORs and couple of variable incrementing), it was not fast to copile/run.
Hope this helps a little.
there is a cool project here, it's C#, not C++ but it might be of interest.
This one is supposed to be C++, but it is old and you may have problems with it. From what I recall, the command shell isn't compatible with wm6, but if you look around you may be able to find one to replace it that works.
Here is a command shell that's supposed to work with WM5/6
Good luck and let us know if you find anything else.
Also, the link to Mamaich's Version on that page you referenced works
Digicrat said:
I
is CeGCC the best option for pre-compiling for the phone? Anyone know if it runs under 64-bit linux?
Click to expand...
Click to collapse
mingw32ce (cegcc) is used to compile haret and roadmap (afaik vlc too).
It runs on amd64 very well. Have not tried it on my old DEC alpha.
Thanks for the quick responses.
edgar: PocketDOS looks interesting, but where can I find versions of Turbo C/C++ compatible with the pocketPC?
The program I'll be testing is actually a simple command-line C application, but it does use networking, UDP to be precise.
The link to Mamiach's link works on that page, but not the links on there for PocketConsole, PocketCMD, or the .bat files, though the bat files can be taken from the rar file itself.
I tried the PocketConsole and PocketCMD versions from the pocketgcc.sourceforge.net site again, and managed to get them (mostly) working after changing the reg key value.
I tried the PocketGCC cab file from gforge. It kind of works, but the test program won't compile. I still had to manually set the path for this, and for some reason it doesn't include gcc but calls the various other parts of it.
I'll try uninstalling the PocketGCC Cab and extracting Mamiach's version again and see if I have better luck with that later in the week and see how that goes.
Looks like I got it working for the most part.
Compilation is slow, but I don't want to waste space on the internal memory extracting all those .rar libs, unless I can get it installed/moved to the SD card later and adjust the paths accordingly (using spaces in file paths is always annoying).
I'm using Mamiach's version of GCC from the link above (extracted to /pgcc), plus PocketConsole and PocketCMD cabs from the pocketgcc.sourceforge.net distribution.
The only lingering (and annoying) issue is that it does not save the PATH setting after closing the cmd prompt.
Correction, I just noticed another more important issue. After switching programs, the CMD prompt seems to disappear. If I open another application, and then close that program, it will take me back to the CMD prompt. However, if I return to the "Today" screen, that prompt is still open but I can't get it back. It does not appear in that little task-switcher icon, nor in the detailed 'Task Manager'.
Any ideas?
Thanks
Update:
I just installed Dotfred's Task Manager. It looks like the problem is that the CMD prompt is being seen as a Process and not as an application. Now the question is can I change that...

Whiskers

[Map Overview]
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
​
Green dots represent Access Points
Blue dots represent Bluetooth Devices
Map updates on page refresh and is based on user uploads.​
[About]
Whiskers is an educational PocketPC application under the GNU/GPL license which tries to exploit all the hardware available on most common PDAs providing a link between different features such as GPS-Bluetooth-Wireless. Generally whiskers was built with radio reconnaissance in mind as help for geocachers or wardrivers but also as penetration and audit tool. There is support for in depth device scanning, triggering actions based on filters when certain devices are in range, centralized GPS logging with search functions for private or public databases and much more.
[Requirements]
WM5 onward
Compact Framework 3.5
Microsoft Bluetooth Stack (?unconfirmed?)
[Features]
Continuous scanning for Wireless and Bluetooth
Device logging (open, save etc..)
Bluejacking (two supported methods, more to come soon).
Autojacking
Device scripting, triggering specific actions when a device is in range based on filters such as device name, address, device class (laptop, phone, smartphone whatever...).
GPS logging based on GPX file with centralized database
Ability to contribute to the database: scan and upload to the central database.
Searching for devices in the database by name, address and Wireless or Bluetooth radio.
More to come
[Screenshots]
​ [Download]
Stable releases are those who were thoroughly tested by several people. They don't contain the latest features, modifications or bugfixes but they are bound to work and be compatible. Snapshot releases are development releases with new features and enhancements and are thus prone to not work correctly. In either case, if you've found a bug, please report it and I'll fix it asap! The stable releases also contain the source code. You can find the most recent cab file after you extract the archive at WhiskersCAB/Release/WhiskersCAB.CAB
[Stable]
HERE or HERE
[Snapshots]
Top most is the most recent version! If you post bug reports please post them for the top most version in the list below. The others below the top most are there just for history purpose. Please download the top most as it contains the recent changes and bugfixes.
http://rapidshare.com/files/203178761/Whiskers-200902272712.CAB
http://rapidshare.com/files/195599015/Whiskers-200908024416.CAB
http://rapidshare.com/files/194612862/Whiskers-200902060010.CAB
http://rapidshare.com/files/193026445/Whiskers-200902024318.CAB
http://rapidshare.com/files/192192948/Whiskers-200901310821.CAB
http://rapidshare.com/files/191631039/Whiskers-200901301416.CAB
http://rapidshare.com/files/190308621/Whiskers-200901273619.CAB
http://rapidshare.com/files/188808467/Whiskers-200901243517.CAB
[ SVN ]
You can always grab the latest SVN version from HERE. Please note that this will change in time and is considered the most unstable version of Whiskers. If you just want to browse the repository, you can do so HERE.​
[TODO]
- Add documentation
- Test on different platforms (other than mine)
[Changes]
current:
0.1:
Initial release
[More]
http://www.sourceforge.net/projects/whiskers
[Install]
If you downloaded the CAB file, just copy to your device and install as normal. In case you've downloaded the stable version, you'll find the CAB file in WhiskersCAB/Release and you can copy it to your device and install.
[Uninstall]
Just uninstall from add/remove programs.
[Credits]
My first thanks go to the xda-developers forum for providing continuous support and testing for Sunscape. I am pretty sure no project would have gotten very far without this invaluable input. Secondly, I want to thank the creator of btCrawler for being an inspiration and going down as a true martyr when the eh... "German Law of Cybercrime" got him. I feel you c0rnholio!
-*-​
[Documentation]
In this documentation I will refer to the screenshots in the initial post. If you look at the tabs at the bottom you'll see four of them: "Scan", "Jack", "Script" and "Track". I'll try to walk you through all of those step-by-step since currently there is no documentation.
Scan
This is the main tab of Whiskers. It will not only scan for devices whether Bluetooth or Wireless but you will also be able to do various things with the found devices.
For a quick start, your bluetooth and/or wireless adapter has to be switched on. Whiskers doesn't do this for you and should fail silently if it doesn't find the adapter turned on.
Then you can just hit the Scan button and Whiskers will start to scan for devices or access points around you.
You can press "Clear" to flush current found devices or press "Delete" to remove individual devices from the list. Naturally, if Whiskers is scanning it will probably find the device again.
The input box right next to the Start button is the scanning time interval measured in milliseconds. That is, the time for which Whiskers will pause between scanning. You can set it at your convenience but 1000ms (1s) is quite a good value.
The Open / Save buttons you can use to open a saved list or store a saved list.
Let's move on to the Comm tab.
Comm
This tab is meant for communicating with other users using Whiskers. Although it's only based on bluetooth and hence the short range, it may come in handy when other Whiskers features will be implemented.
To communicate with a device, first make sure you've scanned it using the Scan tab, enter your message in the box below and click Send. If the other device is using Whiskers and is in listening mode, after a couple of tries your message should appear on your screen and on the other device's screen.
To receive messages, you must have clicked the Start Listening button which will make Whiskers listen to all incoming messages.
And now the Jack tab.
Jack
This tab is meant for jacking / autojacking. I have some development ideas which I won't divulge just yet but for the time being only this form of eh... annoyance is possible. The whole concept started from quite an old java applet I used to have on my mobile phone... You could set it to jack a message continuously and you'd just stroll around and it would jack any device which came in range.
To jack a device (only bluetooth devices, of course) you select a device in the Scan tab, then select the Jack method, either pairing or file, enter your message (the shorter the message the better!) and press the Jack button.
To autojack, you enter your message and and select a jacking logic (rotation - Whiskers will rotate in a round-robin fashion going through all devices, first in - Whiskers will jack any "new" device it finds, random - Whiskers will randomly select devices from the Scan tab) and press the Start AutoJack button. If you switch to the Scan tab you will see which device Whiskers is currently jacking. The time to live (TTL) is how much Whiskers will wait for a timeout while jacking a device (10 000ms, 10 seconds should give enough time to properly jack a device).
Please use this feature responsibly Let's move on to the Script tab.
Script
The purpose of this feature is to execute certain commands when a specific device is detected. You can search for a specific address, device name, type of device (the drop down boxes will help you choose), and whether it should be a BT (Bluetooth) device or an AP (access point).
To add a script, you may choose to fill any or none of the filters. You can search for a device name... Or maybe just a device class... Then you write or browse for an executable and fill in any optional parameters and click Add. You can later add the script by just clicking the script in the big box.
The next step is to enable scripts by clicking the Enable Scripts button. The time frequency (in milliseconds) is how often the scripts will trigger on the devices it finds.
That's it for the Script tab.
Track
Uh. This is a difficult one. The Track tab, given you have a GPS device, will log at what latitude and longitude it found a device. It will store this in a GPX file along with the device name and device address. Optionally, of course, once you've gathered some data, you may choose to press the Upload button which will upload the GPX file to a central server [I'll explain this more in the next post]. Given that some user spotted a specific device and has uploaded it to the server, you can search for devices using the search feature. This will place dots on the map [They may be hard to see on the default map, and I'm sorry for this, I'm still searching for solutions] at the respective locations. You can then choose to save the map with the dots using the Save button or you can clear all the dots by pressing the Reset button.
[Considerations]
You can use the program to scan for devices continuously. I used it to track around and discover what devices people are using. Needless to say that some had quite funny names or just adverts. I also picked up a TomTom device from a car. It's quite interesting and does fulfill some voyeuristic pleasure I guess. It's impressive though how many devices I've found... Tons of them, pages and pages of scrolling.
You can use the program to jack devices eh... In an educational manner, of course. Or to autojack while Whiskers discovers new devices. Please don't over-abuse it since it can be pretty annoying. In comparison to btCrawler or Bloover or whatever, Whiskers is meant to be the first tool before you use any of those. Bluesnarfing on newer devices is quite possible IF and only IF the user has accepted to pair with you. From then on, you could use one of those nifty tools which grant you access to all the cool and nasty features. I've seen a lot of discussion about being able to snarf without the user having to accept the pairing and, from what I've seen, sadly there is no such tool. Whiskers will try to get you paired but development in this department is halted for the time being.
The tracking feature currently uses my personal server. In time, when things get more stable I'll also publish the server-side part of Whiskers so you can make your own server (I have to, this is OpenSource). Of course, the search feature is only useful if you have a big enough database. It will also be possible to add your own maps rather than the default map.
[Pinboard]
The requirements state you need Microsoft Bluetooth Stack however, Whiskers relies on a third party library for Bluetooth management so it's not yet certain if it supports other stacks too.
Bluetooth and/or Wireless must be turned on or Whiskers won't report any device.
Currently I don't have many devices in the database for the Track tab. You are free to upload anything and if you want that file for yourself I'll send it happily. For the time being you can try searching for "khan" and type BT or "Wireless" and type AP. It will place some points in the UK and Romania. Once again, sorry, the dots are really small and hard to spot. What you could do is press the Save button, save the file and then view it on your computer screen. The dots should be light greenish and light blueish...
After using this program, please check in Settings -> System -> Device ID that your device name is still there. On a crash it may just leave the jack message there. Simply rename it back to what it was before.
[ Program may crash if you press the Upload or Search button and don't have an active internet connection. This will be fixed soon, I just wanted it to crash to spot some bugs but I forgot it on. The next unstable CAB will just fail gracefully ] - fixed.
Of course, with scanning on, the Scan tab will clutter up with devices that aren't in range anymore. Just save the log if you like and hit the clear button and it will update with devices currently in range.
There is currently no report whether the upload was successful or not and the same for the search. If you do choose to upload, make sure you search for a device you just uploaded using the search feature. If the upload was successful, it should show up.
The current Track logic is: if we found a new device and if we have a fix, log to GPX file. Best practice is to start tracking and then scanning. Once Whiskers has a satellite fix, it will log new devices to the GPX file. Once you hit the Track button, Whiskers will try to get a lock as fast as it can. Of course, as for any GPS device, it's good to try it while outside.
Looks interesting!
I feel like some "auditing".
Might it be an idea to have a direct link to the cab, so one doesn't have to download the whole VS solution?
Thanks!
EDIT:
First find:
Needs .Net CF 3.5 I think, not 2.0. Or at least it gave an error that required NETCFv35.Messages.EN.wm.cab to be installed to show the error.
l3v5y said:
Looks interesting!
I feel like some "auditing".
Might it be an idea to have a direct link to the cab, so one doesn't have to download the whole VS solution?
Thanks!
Click to expand...
Click to collapse
Hey l3v5y, nice to see you on a new quest! Yes, everything is a bit shaky at the moment but I'm updating the posts as fast as I can. Also, you may want to wait for some documentation because there is currently NONE. A lot of stuff needs explaining. For a quick start though: you need to turn on your bluetooth and/or your wireless (the program doesn't do this automatically for you). I hope you have a MS stack. I rely on some external libraries and I'm not sure what they have under the hood. Thanks!
EDIT: Bingo, I'll update to 3.5 thanks!
I'm getting this:
Code:
Whiskers.exe
DirectoryNotFoundException
An error message cannot be displayed because an optional resource assembly containing it cannot be found
at System.IO.__Error.WinIOError()
at System.IO.FileStream..ctor()
at System.IO.FileStream..ctor()
at System.Drawing.Bitmap..ctor()
at Whiskers.Whiskers..ctor()
at Whiskers.Program.Main()
...and I have NETCFv35 and NETCFv35.Messages both installed. How do I tell what bluetooth stack I have? I have a Sprint Touch Pro. Thanks!
cspannos said:
I'm getting this:
Code:
Whiskers.exe
DirectoryNotFoundException
An error message cannot be displayed because an optional resource assembly containing it cannot be found
at System.IO.__Error.WinIOError()
at System.IO.FileStream..ctor()
at System.IO.FileStream..ctor()
at System.Drawing.Bitmap..ctor()
at Whiskers.Whiskers..ctor()
at Whiskers.Program.Main()
...and I have NETCFv35 and NETCFv35.Messages both installed. How do I tell what bluetooth stack I have? I have a Sprint Touch Pro. Thanks!
Click to expand...
Click to collapse
You're doing fine, sorry the CAB file is broken: Give me 5 minutes, I'll upload the fix.
EDIT: Ok, fixed and uploaded. Please try again...
SevenRains said:
[More]
http://sourceforge.net/projects/whiskers/
Click to expand...
Click to collapse
That link takes me to http://sourceforge.net/projects/sunscape/
http://sourceforge.net/project/down...&filename=Whiskers-0.1.zip&use_mirror=surfnet
..bbut archive is broken, idd..or i am broken, lol..
circuit breaker said:
That link takes me to http://sourceforge.net/projects/sunscape/
Click to expand...
Click to collapse
Fixed now. That was pretty strange...
SevenRains said:
Fixed now. That was pretty strange...
Click to expand...
Click to collapse
hheh, still sunscape site..
nothin said:
http://sourceforge.net/project/down...&filename=Whiskers-0.1.zip&use_mirror=surfnet
..bbut archive is broken, idd..or i am broken, lol..
Click to expand...
Click to collapse
Yes, it seems that mirror screwed up the archive. You can try the:
http://sourceforge.net/projects/whiskers
and follow the download links. Sourceforge takes a while to replicate the file to all mirrors. It seems that the surfnet mirror broke the file.
EDIT: I'll see if I can re-add the zip file to sourceforge. Don't know what they did with it...
EDIT: Ok, I re-added the file to sourceforge, it should be ok after it replicates. I'll add the source to opening post for convenience.
EDIT: Mirror for source/stable added to opening post.
nothin said:
hheh, still sunscape site..
Click to expand...
Click to collapse
You're kidding Should be fixed now...
EDIT: sourceforge really screwed up my files...
Sorry peeps, I think I'm done with messing around with the release files. It's always like this at the beginning. Sourceforge took an older version (which would crash like the cab file did) and replicated that instead of the proper release.
Please use the CAB file. At the moment the CAB and the stable release are identical. I replaced the CAB with the proper version.
Initial post updated!
Last minute fix for Script handling.
Initial post updated!
And another fix for an occasional NullReferenceException.
Initial post updated!
This seems like an excellent sort of application, thank you for all your hard work.
I am just wandering if the latest version works on the Trinity?
I have installed the .CAB from the release folder but when I try the jack or auto jack feature the program crashes. I have turned bluetooth on and also left it off before trying but the same problem, also do i need beam on or off? or am I just not doing something simple.
Thank you for your help in advance
jab1a said:
This seems like an excellent sort of application, thank you for all your hard work.
I am just wandering if the latest version works on the Trinity?
I have installed the .CAB from the release folder but when I try the jack or auto jack feature the program crashes. I have turned bluetooth on and also left it off before trying but the same problem, also do i need beam on or off? or am I just not doing something simple.
Thank you for your help in advance
Click to expand...
Click to collapse
Hello, thanks for taking interest in Whiskers!
If you didn't get a crash when pressing the scan button, then the libraries are working correctly and Whiskers should definitely work on your device.
The release version had some bugs which have been fixed in the new Snapshot releases. Could you please try the latest snapshot release? (Whiskers-200901273619.CAB at the top will do fine!)
If you are still gettting a crash with the latest snapshot, could you please provide a few lines from the crash? (You can access those by pressing Details when the crash screen comes up)
Please tell me if this works for you!
Ok I have just installed Whiskers-200901273619.CAB and im getting the same problem. On the first tab (scan) I can hit scan but nothing happens, a few titles at the bottom are greyed out but thats it until I hit hit stop. If I go to the jack tab and hit jack or start autojack then it frezzes for a second and then crashes, here are a few lines from the details section:
Whiskers.exe
ArgumentOutOfRangeException
ArgumentOutOfRangeException
Parameter name: index
at
System.Collections.Array.get_Item(Int32 Index)
at
Does this help or do you need more?
Thank you again for your help
I posted too soon, the scan function is working and is picking up access points, but the jack feature is still the same

[APP] Native Android web server 1.1 - updated! (folder browsing, basic AUTH)

Hello,
I've managed to compile a small native web server for Android (but for now only tested on Sony X10 with 2.3.3 version). You will need root.
The main advantage is that you can quickly share photos / documents from your phone as long as there's WiFi available. The other phone needs just to have WiFi and a browser.
It is an Android port of the webserver source code found here: http://www.jbox.dk/sanos/webserver.htm which comes under BSD License.
Download
webserver-1.1.zip
Archive contents
webserver – Android binary
LICENSE – initial BSD License
android_port.patch – BSD licensed patch for webserver.c
README.txt – description on how to install / compile.
Installing
Since most mobile carriers block incoming traffic, you won’t probably be able to access your phone via GSM/3G data connection, only over WiFi.
You need to unpack the archive, and extract the webserver binary to a directory of your choice. Then:
Code:
adb push webserver /sdcard/
adb shell
su
cd /system/bin
cp /sdcard/webserver .
chmod 755 webserver
./webserver -u <username> -p <password> -s <port>
To stop just kill its pid ...
If you run in Terminal Emulator, just send it a Ctrl-C and it will exit.
Screenshots
Starting up the webserver (runs by default on port 80) and navigating to /sdcard/DCIM folder in the browser:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
For more information about the porting process please check my website.
Change log
v1.0 - 21 Aug 2011
Initial port to Android
v1.1 23 - Aug 2011
Added command line options
Added listing of all local IPs (please check screenshot, it reports IPs and interfaces when starting up. Helps a lot to find out the WiFi IP, tun.ko is detected and works too)
Added Basic HTTP authentication for security
PS: if you have other rooted Android phones, I'm very interested in feedback if this works or not. I did not use anything specific to X10.
Thank you,
viulian said:
Hello,
I've managed to compile a small native web server for Android (but for now only tested on Sony X10 with 2.3.3 version). You will need root.
PS: if you have other rooted Android phones, I'm very interested in feedback if this works or not. I did not use anything specific to X10.
Thank you,
Click to expand...
Click to collapse
good to see someone working on not so generic stuff.... would like to help you with stuff althogh i am not that good at java.
Will be checking the webserver out....
i don't have any other phone however i am in a process of purchasing some tabs so might help you then....
Thank you for feedback
Don't know if it will work in tablets (I did not test it on 3.0, only 2.3.3) .. but yes, if you will root them, please give it a shot!
Did you install this on your own X10? I need some pics.
silveraero said:
Did you install this on your own X10? I need some pics.
Click to expand...
Click to collapse
Yes and I've also tested it on X10. I've attached two screenshots to the first post of the thread. Please check them:
a) I have started webserver within Terminal Emulator
b) Then I navigated to the photos folder, in the browser (192.168.1.6 is phone's IP over WiFi).
viulian said:
Yes and I've also tested it on X10. I've attached two screenshots to the first post of the thread. Please check them:
a) I have started webserver within Terminal Emulator
b) Then I navigated to the photos folder, in the browser (192.168.1.6 is phone's IP over WiFi).
Click to expand...
Click to collapse
just a quick comment
when you copy it to system/bin
you don't need to cd or ./
you cna directly run webserver
EDIT : i would suggest you do one more change.
right now if i understand correctly this can pose a security risk....
as it can give you all folders any file effectively all data any location...
Make changes such that which ever folder you navigate and start webserver from only that folder and its subfolders are accessiblle on webserver.
webserver is already in bin so we can run from anywhere
so if i want to share /sdcard/share
cd /sdcard/share
webserver
hope that will help.
anantshri said:
just a quick comment
when you copy it to system/bin
you don't need to cd or ./
you cna directly run webserver
Click to expand...
Click to collapse
My bad! Yes, I was testing in /system/test when porting, and by reflex I typed it. I will leave it like that in descriptions, but you are right of course
anantshri said:
right now if i understand correctly this can pose a security risk....
as it can give you all folders any file effectively all data any location...
Click to expand...
Click to collapse
It's a difficult decision to start adding security to folders ...
Because next question will be: but I want to access more folders! Or, yes, I want everything but I also want to exclude these and these ... And just like any software product, more time will be spent fool-proofing it. Because if you add configuration files, then you need a ton of error messages (and support for noobs) to explain what is wrong and how to fix it.
This is just a working proof of concept. It works, and it uses so little memory as compared to other Java apps that might do the same thing ...
I also thought of security (since I wouldn't want to start it on a public WiFi) but to add support for username and password - as even allowing some folders is still risky 'cos anybody than then browse all the photos.
On my todo list:
a) add file upload feature (fork()-ing is unstable on Android, so CGI support can't be done reliably - it will have to be built in)
b) add support for username and password.
c) sorting (alphabetically and folders first).
viulian said:
My bad! Yes, I was testing in /system/test when porting, and by reflex I typed it. I will leave it like that in descriptions, but you are right of course
Click to expand...
Click to collapse
I was adding more while you replied
EDIT : i would suggest you do one more change.
right now if i understand correctly this can pose a security risk....
as it can give you all folders any file effectively all data any location...
Make changes such that which ever folder you navigate and start webserver from only that folder and its subfolders are accessiblle on webserver.
webserver is already in bin so we can run from anywhere
so if i want to share /sdcard/share
cd /sdcard/share
webserver
hope that will help.
why not just swiftp ?
phillu97 said:
why not just swiftp ?
Click to expand...
Click to collapse
alternatives the more the merrier.
anantshri said:
alternatives the more the merrier.
Click to expand...
Click to collapse
haha, finee okays. but i enjoy the GUI and all .
phillu97 said:
why not just swiftp ?
Click to expand...
Click to collapse
Well, this is a completely different approach. Native (.c) compile, very fast and extremely low memory footprint.
It is not ment for the masses. Google wants people to use Java / DalvikVM. What I (as a developer) want is to get closer to hardware instead of being abstracted away. While it is true that interface with good implementation wins (Apple proves it), it is very good that we can still go low level.
Second, FTP is limited. You can only connect to download.
In future, if people like webserver and keep providing feedback, HTTP is more powerful:
a) interact with phone - contacts, call logs, send sms from browser, etc
b) have cached previews when browsing the photos - this you cannot over FTP.
c) compression
d) no data/command channels to slow down interaction.
As said, this is a proof of concept, and not offered as an alternative to "SwiFTP" and the rest.
hmmm i see your point
but swiftp has proxy servers and you can upload :S
will test out tho. and will hit thanks when near comp
Sent from my X10i using XDA Premium App
viulian said:
It's a difficult decision to start adding security to folders ...
Because next question will be: but I want to access more folders! Or, yes, I want everything but I also want to exclude these and these ... And just like any software product, more time will be spent fool-proofing it. Because if you add configuration files, then you need a ton of error messages (and support for noobs) to explain what is wrong and how to fix it.
This is just a working proof of concept. It works, and it uses so little memory as compared to other Java apps that might do the same thing ...
I also thought of security (since I wouldn't want to start it on a public WiFi) but to add support for username and password - as even allowing some folders is still risky 'cos anybody than then browse all the photos.
On my todo list:
a) add file upload feature (fork()-ing is unstable on Android, so CGI support can't be done reliably - it will have to be built in)
b) add support for username and password.
c) sorting (alphabetically and folders first).
Click to expand...
Click to collapse
Why not just virtually create a .htaccess inside of each folder?
Do that, and you can get user accounts, directory blocking, etc.
Mayazcherquoi said:
Why not just virtually create a .htaccess inside of each folder?
Do that, and you can get user accounts, directory blocking, etc.
Click to expand...
Click to collapse
this is not a direct fork of apache so .htaccess support will not be an easy stufff to make... so we can let the dev think about how to implement a check....
SwiFTP works with FTP right? Some1 know Wifi FileExplorer?
What i miss with those 2 apps is Add Hoc support! I want to Acces one phone with another over Wifi! Would be perfect over http because it also works to an Iphone. Sadly most apps like that wont work while Barnacle theters WiFi.
P.S. Dont have a PC here, you can compile a APK? Or that wont Work because its not java?
It will work, and APK can launch a native file but I wanted as close to bare minimum as possible.
However, I will only have time to investigate tonight when I get back home ..
New version released !
v1.1
Added command line options
Added listing of all local IPs (please check screenshot, it reports IPs and interfaces when starting up. Helps a lot to find out the WiFi IP, tun.ko is detected and works too)
Added Basic HTTP authentication for security
Download
webserver-1.1.zip
I've also updated the first post of the thread with new screenshots (Hit Ctrl-R to reload the screenshots in case you have the old ones in the cache).
Whilst some will disagree with me this would be awesome to bundle with MySQL and PHP servers...
Apache, MySQL, and PHP running on mobile...not so much for hosting a website but for developement...our devices are getting more and more powerful and would be cool to develop websites on the phone using a mobile version of lamp and an HTML/PHP ide like a mobile dreamweaver/expressions web...that and we already have photoediting software...
Not saying it'd be practical but would be nice...and I think it would come in handy from time to time...
Sent from my PC36100 using Tapatalk
ebbinger_413 said:
Whilst some will disagree with me this would be awesome to bundle with MySQL and PHP servers...
Click to expand...
Click to collapse
Actually
I downloaded the php-for-android bundle and which comes with php 5.3.3 compiled native.
The native php executable lies hidden, since it is intended for SL4A to detect and invoke it; I want to do the same thing, but only from this web server. Initially GET only - and later POST too.
The following issues are make it difficult to have full featured Linux alongside Android:
a) Google's poor implementation of fork / pthread. It is so poor, they insist people should not use it.
Here are some insights: http://groups.google.com/group/android-ndk/browse_thread/thread/1dfa066e20175c5a/e4c79372d365f5e3.
Dianne Hackborn, Android framework engineer, was hinting to actually limit even the basic one that exists, if people "abuse" it. http://comments.gmane.org/gmane.comp.handhelds.android.ndk/2132
b) Google implementation of bionic (many things lack) makes it difficult to port from Linux. Standard libraries are missing (libcrypt / base64 / ... ) and so on.
We'll see but with the avoidance attitude towards low level access (Google need people to use all the location services and ads based apps) I am a bit skeptical that they will ease transition to glibc.
At least to leave it as is ...

[XAP][SOURCE] Native Toast Notification Launcher

This is a very simple application that enables you to specify any kind of Uri to launch. This is done through creating a Toast notification that, when clicked on, will execute the specified Uri. This uses a native method outside of the regular SDK; the standard methods available in the SDK that you'd normally use to create a Toast notification are restrictive in what kind of Uri you can specify. By using the native method not part of the SDK, these limitations can be by-passed.
I've attached both the XAP and the source code. The source project contains three projects:
CShellChromeAPI: The C++/CLI project which calls the native un-documented method
NativeToastLauncher: The .NET wrapper which simplifies the interaction with the C++/CLI project
NativeToastLauncherApp: The test application used to quickly launch any Uri
You'll notice I've hard-coded a default Uri when you launch the application: this will open the Windows Phone 8 "About" page.
To run this, you'll need to side load the XAP which requires a dev unlocked device...
Can I use any system GUID to launch?
djtonka said:
Can I use any sytem GUID to launch?
Click to expand...
Click to collapse
Any registered app GUID yes. You'd do app://GUID/_default (or replace the _default with the particular task to run - in most cases, that's _default).
@cpuguy this is awesome, thanks!
If you guys are looking for GUIDS and default tasks, they are all in the app's WMAppMAnifest.xml. the "ProductID" is the GUID and the "DefaultTask Name" property contains the name of the default task.
Hopefully we can use this to find a program to exploit.
Sent from my Nokia 521 using XDA Windows Phone 7 App
Does anyone happen to have a list of the ID's for the system and settings apps? Obviously, I can't go into the code and get these without messing with the file system. If no one has them, then I can just trial/error until I get some...
If you download the registry hives located at http://forum.xda-developers.com/showthread.php?t=2393883 , you can load the Software hvie and search for "app://" That will give you a few system files you can launch.
EDIT:
I posted a zip file of the default ones in a new thread.
IF anyone has tethering blocked, see if you can get it to work by launching this URI app://5B04B775-356B-4AA0-AAF8-6491FFEA5629/Default
compu829 said:
If you download the registry hives located at http://forum.xda-developers.com/showthread.php?t=2393883 , you can load the Software hvie and search for "app://" THat will give you a few system files you can launch.
Click to expand...
Click to collapse
Im only seeing the app:// function used on the system settings options after going through the regsistries so far.
aclegg2011 said:
Im only seeing the app:// function used on the system settings options after going through the regsistries so far.
Click to expand...
Click to collapse
that's what I saw too. I am having way more luck finding cool stuff in the extracted ffu. Take a look at the zip file in the new thread I started.
compu829 said:
that's what I saw too. I am having way more luck finding cool stuff in the extracted ffu. Take a look at the zip file in the new thread I started.
Click to expand...
Click to collapse
yea, I saw the new thread. Hopefully somebody can find a exploit in all that. It executes some cool files. Too bad there wasn't a cmd.exe file on our phones that we can execute.
aclegg2011 said:
yea, I saw the new thread. Hopefully somebody can find a exploit in all that. It executes some cool files. Too bad there wasn't a cmd.exe file on our phones that we can execute.
Click to expand...
Click to collapse
actually..there is! but it's stuck in a WIM. It inflates it on an "as-needed" basis.
I am hoping that we can use the backgroundworker to run some stuff elevated
compu829 said:
I am hoping that we can use the backgroundworker to run some stuff elevated
Click to expand...
Click to collapse
But they all are pretty much isolated. It is unlikely that you will be able to run anything elevated
aclegg2011 said:
yea, I saw the new thread. Hopefully somebody can find a exploit in all that. It executes some cool files. Too bad there wasn't a cmd.exe file on our phones that we can execute.
Click to expand...
Click to collapse
Not only is there a CMD.exe, but there are other interesting things like a BSOD screen, Control Panel, registry keys referencing desktop (A future exploit I might attempt), and even native EXEs (We knew about native EXEs since WPs release).
Why does this launcher not work with "normal" toasts: {YOUR-APP-GUID} and "/Page1.xaml"? Only with empty GUID and full path.
Similarly, any chance this could be used to open arbitrary XAML pages, rather than just the ones defined in the app manifest? For example, something like what was posted in another thread (http://forum.xda-developers.com/showpost.php?p=45265419&postcount=56) using the following URI: app://5edbdbbc-2ab2-df11-8a2f-00237de2db9e/_default#/View/APNSettingPage.xaml to launch a hidden page in the Connection Setup app. I don't know if that's a weird behavior of CS or if its universally possible (and while it feels lazy to ask, I'm at work right now). There are a bunch of "hidden" pages in the ATIV S Diagnosis app, some of which would be very useful, but the navigation code for them is blocked or outright missing. If we could invoke those directly... There are probably a bunch of other such hidden gems in other OEM apps too.
Yes you can. The way I found the one in the HTC app was by loading the dlls in JetBrain's dotPeek. Then I looked for the xaml files. It is all a relative URI based on what dotPeek/the app "sees". The only thing the manifest states is where the default entry point is for the page. Basically I looked in the manifest file for how it calls the "default" page. and then replace it with the relative URI for the other page you want.
If you guys want, I can write up a simple tutorial. I just have an HTC 8x, so my hands are tied. If someone can figure out how to deflate an nbh file so I can browse it, that'd be fantastic! I found a "dead" 521 on eBay that I am thinking of picking up for research since there are way more tools for Nokia.
compu829 said:
Yes you can. The way I found the one in the HTC app was by loading the dlls in JetBrain's dotPeek. Then I looked for the xaml files. It is all a relative URI based on what dotPeek/the app "sees". The only thing the manifest states is where the default entry point is for the page. Basically I looked in the manifest file for how it calls the "default" page. and then replace it with the relative URI for the other page you want.
If you guys want, I can write up a simple tutorial. I just have an HTC 8x, so my hands are tied. If someone can figure out how to deflate an nbh file so I can browse it, that'd be fantastic! I found a "dead" 521 on eBay that I am thinking of picking up for research since there are way more tools for Nokia.
Click to expand...
Click to collapse
That's correct. I have been navigating to various - normally unreachable - XAML pages in quite a few of the Nokia apps. I gave an example of that in a different thread:
Code:
app://[COLOR="Navy"][B]2377fe1b-c10f-47da-92f3-fc517345a3c0[/B][/COLOR]/[COLOR="Orange"][B]_default[/B][/COLOR]#/[COLOR="Green"][B]Launcher[/B][/COLOR];component/[COLOR="DarkRed"][B]MainPage.xaml[/B][/COLOR]
In this example, I launch the Nokia extras+info app (2377fe1b-c10f-47da-92f3-fc517345a3c0) with the default entry point (_default) which, as @compu829 stated, can found in the app's manifest. Following that, you can add "#/" (not sure if either the hash-tag or slash can be taken out or both are required to work but I know with both, it does work) to the URI to specify a particular XAML file you'd like to open. Following the "#/", you get to specify the assembly (i.e. the .DLL in the XAP file) in which the XAML file is located (Launcher). And finally, you add ";component/" followed by the full path to the XAML as defined in the embedded resource file (MainPage.xaml).
-W_O_L_F- said:
Why does this launcher not work with "normal" toasts: {YOUR-APP-GUID} and "/Page1.xaml"? Only with empty GUID and full path.
Click to expand...
Click to collapse
I presume your reference to the "empty GUID" is for the first parameter of my static Launcher.LaunchToast method? That first parameter is, as far as I can see, ignored for the actual toast launch. If I'd have the signature of the "Shell_PostMessageToast" method, I could perhaps understand what it does but, without it, I just knew it wanted a GUID (passed to it as a string) and that that GUID could be an empty one. I reversed engineered the signature from that native method (found in ShellChromeAPI.dll) by taking a look at another native assembly calling it. Naturally, this only tells shows me how that method is being called but doesn't return the name of the parameters. If I remember correctly, the assembly calling that method was passing its own application GUID... I could have done the same but, I didn't see what use it had so I decided to keep passing it an empty GUID.
The format of the toast is different most likely because that's the raw toast launching method. The other format you're used to is the more developer friendly one that's sanitized prior to launching it (so you can't launch another app directly).
Success!
@GoodDayToDie , this is exactly what I'm trying to do! And here is result:

[WIP] Tilandis: It's like TileCreator Proxy, but better.

DOWNLOAD HERE: https://github.com/lavacano201014/tilandis/releases
Tilandis
A drop in replacement for TileCreator Proxy​
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Overview
TileCreator is one of several UWP apps designed to allow you to pin custom tiles to your start menu. The way these apps work is they launch a companion app (in TileCreator's case, TileCreator Proxy) that's associated with a specific protocol, and that companion app is what actually launches programs.
The problem is, while TileCreator itself works well, TileCreator Proxy is terrible. This isn't intended to be a jab at the developer, but let's be real - having to use .lnk or .bat files for half your programs isn't exactly the best experience.
The base problem here is working directories: Many programs assume their working directory will always be the directory they've been installed to. In most cases, they're right, since Windows shortcuts (.lnk) use the directory of the executable as the default working directory. TileCreator Proxy, however, launches processes within its own working directory, which is some space directory in the middle of absolutely nowhere sensible. I've mentioned this to the developer, and it hasn't been fixed, and now that developer hasn't logged in since November. It's incredibly likely that the developer has real life problems that he's prioritized over his development work. And I can't blame him. But this problem needed fixing, so Tilandis is here to fix it.
Project Status
What Works:
Link management
Creating links
Deleting links
Replacing existing links (with -f)
Launching links
Protocol registration (so you can use it with TileCreator)
Arguments and working directories (including automatically defaulting to executable's directory)
Command line interface
Automatically closing TileCreator behind you (at the moment, ONLY TileCreator - planning to make this configurable)
Running links as administrator
The GUI
What's Planned (but doesn't work yet)
Link validation (at the moment, Tilandis just accepts stuff willy nilly, which includes a few characters that aren't legal for filenames or link names. For now, it's up to you not to include the : or / characters in your link names.)
Live tile companionry (waiting for a UWP implementation first)
Installation
Go to the link at the top of the post, and download the latest version's installer.
Run said installer.
That's it. Next section.
Usage
The basic procedure:
Open a command prompt (this one doesn't need to be administrator) and navigate to where you put Tilandis. If you put it in C:\Users\Your_Name_Here, this may done for you if you use PowerShell.
If you need to specify arguments, you can specify them with -a (e.g. `-a "-sw -noborder"`). If you need to specify a working directory that differs from the default (if you're not sure, then no you don't), you can specify that too, with -w (e.g. `-w "C:\Program Files"`). These options go alongside the basic command line.
FAQ&FSS (Frequently Asked Questions and Frequently Said Statements)
Why should I use this over TileCreator?
You misunderstood the post. Read it again.
Can I use this with some other UWP app, like Better StartMenu?
Yes! Simply install the app, launch a tile with it, and see what Windows spits out. It should come up with "You'll need a new app to open this <something>." That "something" is the protocol you tell Tilandis to register with:
Code:
tilandis -r <something>
Why should I use this (alongside something like TileCreator) over some program that uses visualmanifests.xml?
VisualManifests.xml doesn't support wide or large tiles. Also, although no working implementation currently exists, the UWP app method is capable of displaying "live" tiles (meaning they update every so often, like official Windows store apps).
Are you going to make a UWP (Metro) app to go with Tilandis?
Doubtful. In my opinion, the UWP side of things is already well covered as it is, for being this early on in Windows 10's life. However, I might later just for the laughs, or if nobody ever gets around to implementing live tiles. If I do implement one, I'll look into throwing in jump lists too while I'm at it (because hey, jump lists).
Is it buggy?
I've been using release builds alongside TileCreator as my daily driver for start tiles since I first got link launching to work. I've had no problems. That said, I have no extra-paranoid security software, and do not currently test the automatic replacement of existing TileCreator Proxy installations.
I'm getting an error (or maybe more than one) about some MS or VC DLL missing.
You're missing the 2015 VC++ redist. Make sure you install the 64 bit one, this is a 64 bit application.
Wait what? Why is it a 64 bit app?
It's 2016. If you're on a 64 bit processor, you should be running a 64 bit OS by now. 32 bit emulation is 1:1 perfect, and Windows hasn't had 16 bit applications since it ran on top of DOS, so there's no reason you should need a 32 bit OS on a 64 bit processor. If your processor is only 32 bit, you're officially retrocomputing.
I've actually got some reason to be running a 32 bit OS.
The source is on GitHub, under the MIT license unless I find one I like better. It's the whole solution, just clone the repo, open it in Visual Studio 2015, set it to x86 and press F7. I don't do anything bizarre with my solution or toolchain, should just spit out a 32 bit Tilandis.exe. You can even build it on a 64 bit computer for a 32 bit system.
Please note that bugs that only occur when running a 32 bit build of Tilandis will not be fixed. They are, however, extremely unlikely.
Does it support URLs? Non-executable files?
Yes. Internally, it just feeds the path, args, and working directory to ShellExecute(), so it should be able to launch nearly anything you can double click on in File Explorer with its appropriate program, or open any URL you feed it.
As an example, to launch TF2 through Steam:
I looked at your source code, it's terrible.
I never claimed it was good code, I just claimed I had better functionality. But C++ is definitely not my forte, since my native programming language is Python. And I was stoned for a lot of this project. But it works, and I'm honest about it (even though it's only my word for it), so in the end I still get at LEAST a C+ for this.
I can't seem to get past the fourth step of installation. I've moved the file into multiple locations, used both powershell and command prompt, but I never get a response after typing the command. Running it as an administrator has no noticeable effect on either command prompt or powershell.
Any idea what could be wrong?
Not working for me
After quite a bit of testing, I think I've figured it out. I'll detail my steps and see if anyone can figure anything out from there.
Go to the link at the top of the post to download the latest executable.
Place the executable anywhere. I personally placed it in the TileCreator Proxy installation folder, which for me is found at "C:\Program Files (x86)\TileCreator".
Open an administrator PowerShell and change the directory to wherever you put Tilandis. For me, the command to do this was cd "C:\Program Files (x86)\TileCreator" .
At this point, run the command in the original post. I don't know what the command does entirely, it seems like it would change something, but it doesn't as far as I can tell. I had to run it using .\Tilandis -r TileCreator as the original command left out the location of Tilandris which seems to be needed in PowerShell.
After this, you can close PowerShell.
Open PowerShell (administrator never hurts) and navigate to where your placed Tilandris.
Create a new link using the command .\Tilandis -n MyLinkName -p "C:\Link\To\The\Desired\Executable.exe"
Tilandris will then create a file called links.json that seems to be unusable by TileCreator. Changing links.json to links.config seems to allow it to be accepted and used normally.
Import the new config.config into TileCreator and you will be able to make tiles. This still points to TileCreator Proxy, which I imagine would not be the case if step four of the original process worked, but I can't figure it out.
Setup a tile how you normally would.
I hope we get a reply from the creator, as I'm positive this isn't how this is supposed to work.
What the command "tilandis -r tilecreator" is supposed to do is modify the Windows registry (that's why it needs administrator, it's supposed to spit an error message if it fails to edit the registry but due to a bug it's silent either way) to register Tilandis with the same protocol TileCreator uses to talk to TileCreator Proxy. I didn't test whether or not it would work if you already had TileCreator Proxy installed because I kind of figured Windows would just overwrite it for me. I don't know why I could have expected that... :V
Please open regedit and delete the key HKEY_CLASSES_ROOT\tilecreator (neither TileCreator nor its proxy keeps any configuration in this key, your tiles are safe), then try "tilandis -r tilecreator" as administrator again. This time, it should go straight to Tilandis without bothering with TileCreator Proxy as a middleman. (I'm surprised TCP accepted my JSON in the first place, I wasn't trying for compatibility). And sorry I'm late, I couldn't remember what password I used for this account and XDA's forgot password page has a broken captcha.
I can confirm that I have this working successfully now. I didn't find the registry entry you mentioned, but that is probably because I decided to delete TileCreator until you had replied to me.
Once you get the TileCreator window closing behind you, I think you've got a very solid replacement for the proxy. Well done, your work is much appreciated. Just don't forget your password this time!
New release! Changelog provided at the link.
The tl;dr is the "run as admin" switch (-A) is now implemented, and Tilandis will now close TileCreator (and at the moment only TileCreator) as it goes.
I'm also considering drafting a separate protocol, "tilectl", allowing UWP apps to create links in Tilandis (and any other proxy app that chooses to implement it) for you. Imagine a program like TileCreator being able to not only pin tiles with whatever image you want, but being able to configure what that tile actually launches without having to launch the other app and set it up yourself!
#NotDead
I knew eventually you would all get frustrated with having to use the CLI all the damn time, so I'm writing a control application for everyone. I'll probably also try and fix protocol registration while I'm at it, because man, that really oughta just work
Any updated info any time soon ?
DroidShift79 said:
Any updated info any time soon ?
Click to expand...
Click to collapse
Good news: There are boxes! And buttons!
Bad news: They don't do anything yet (or I'dve released it already). I'm sorry I'm not faster, I've got a bunch of real life issues that I'm battling at the moment. But, I'm here! And I haven't forgotten!
That's very much a placeholder GUI at the moment, eventually I'm going to come up with something that actually manages tiles properly. Might even build that UWP app after all.
(that's weird, I was sure XDA had an automatic merge for double posts. oh well)
Nice to hear from you.
Don't stress yourself. RealLife always go first!
Take all the Time you need @lavacano201014
Anyway, don't tease us
lavacano201014 said:
I'm sorry I'm not faster, I've got a bunch of real life issues that I'm battling at the moment. But, I'm here! And I haven't forgotten!
Click to expand...
Click to collapse
Hey man, loving the progress. Eager to try out the GUI, but don't let this effect your life (which you seem to not let it be doing, I just wanted to give you a reminder that it's okay.)
Good work!
It's finished!

Categories

Resources