Xamarin Android... is awesome

So, I recently found that Xamarin Android completely allows dynamic loading of assemblies.. and everything somehow seems to work properly.

Purely awesome. Try it out yourself:

                var wc = new WebClient();
                var bytes = wc.DownloadData("http://earlz.net/static/xamx/reftest.dll");
                var asm = Assembly.Load(bytes);
                Type type = asm.GetType("DynamicAsm.DynClass");
                var obj = Activator.CreateInstance(type);
                var res = (string)type.InvokeMember("Test",
                                  BindingFlags.Default | BindingFlags.InvokeMethod,
                                  null,
                                  obj,
                                  new object[] { count++ });
                button.Text = string.Format(res);

Despite Xamarin Studio and most of the things around it being buggy, the actual APIs are rock solid and awesome.

Posted: 9/16/2013 2:35:17 AM

Xamarin Android/Studio Bugs

Writing these down as I encounter them:

  1. If you have a .userprefs file, it will almost always freeze upon startup. Fix is to delete it
  2. Licensing is broken unless you're running as Xamarin Studio as an administrator
  3. If you have a space before the first tag(but after the ?xml bit) you'll get an exception thrown upon saving which appears to prevent saving...sometimes
  4. VI-mode is a long running joke. Instead of working, it just rickrolls you

All on Windows 8 64-bit

Posted: 8/6/2013 1:48:19 AM

NVG510 Fixer -- An Android Application

New Application/Method

Someone by the moniker of Blend3r contacted me with a new method of rooting both the NVG510 and NVG589 modems. It does require downgrading the firmware, but it looks easy enough to execute. He provides a Java app, or a write up on how to do it manually. I did a cursory check through the Java code while writing this, but he can of course change it at anytime. I trust him enough to link to him, but if you're security paranoid it is best to do the DIY method instead of using his app.

Anyway, his website is http://nvg589.tk/

Do not contact me about problems with his tool/method unless you think it's a virus or something like that (so I can unlink it). I looked through it and it makes sense to me, but I by no means support any of these. Don't ask me for help on how to do it, etc etc.

(the rest is left here for archival/historical purposes)

App was pulled from Google Play. The app violated Google's ToS out right, so there's nothing I can really do to appeal it and get it listed again. So, I'm making it free for everyone to download and side-load on their android device.

Download the latest binary release here: http://earlz.net/static/com.earlz.nvg510fixer.v2.2.apk

Also, this application is now open source! (albeit very dirty source code) You can find the source code on github.

I was selling it for $3 on Google Play, so if this app helps you, consider donating. My paypal address is earlz -at- earlz dot net. My Bitcoin address is 178DgR2aZcHeYHhXZwtvcJ5RD13Y6YMQBf, or my Dogecoin address is DLY7Vh8oDYLRxQLFAg2PruA15zFMRqoXGu.

About NVG510 Fixer

I get a lot of people coming to this site every day for fixing problems with the AT&T U-Verse NVG510 modem. I found the information to fix the common problems and root it. However, the procedure for fixing this is a bit technical. So, I made the Android application NVG510 Fixer. An Android application makes it a lot easier for you, but I also get to make a tiny bit of money along the way (have I mentioned there is a baby on the way!?)

First off, make sure the IP address of your modem is correct. If you don't know what an "IP Address" is, don't worry about it. This should only be different if you explicitly set it differently (which there is no reason to do)

Second, you'll need to enter in the password to the device. This should be written on a sticker on the modem labeled "Device Access Code". It should be a 10 digit number. Type that in.

What these buttons do

Now, you have a few different options:

  1. Enable Telnet -- If you know what this is, you may be interested in it (It'll be on port 23)
  2. Disable Telnet -- Everything here will enable telnet. It shouldn't be terribly dangerous to turn on since it's password protected, but if you're paranoid about security, you can disable it afterwards
  3. Fix Redirect -- This is the infamous "Potential Connection Issue" or /cgi-bin/redirect.ha problem that hijacks other websites and is extremely annoying. Click this button and you'll never see that page again(note: you may have to restart your computer/browser if you are currently seeing it)
  4. Enable UPnP -- If you're a gamer, this option is useful to you. This enables Universal Plug And Play, which is a long way of saying that you can have an Open NAT type without having to do anything else
  5. Reboot -- Finally, you can restart the modem remotely if you're feeling lazy

Potential Problems

There are a few different issues that could happen with this. I'll try to point you in the right direction

  • I keep getting "login appears to have been unsuccessful" -- Make sure you're using the "device access code", not the "wireless network key". Also, make sure that when you go to http://192.168.1.254 in your browser that you get the AT&T modem page.
  • I get "no route to host" -- Make sure your devices's wifi is connected to your NVG510 access point
  • I get "operation timed out" -- You might have to try pushing that button once more
  • I get "connection refused" -- sometimes it takes a few seconds to enable telnet(which every other button relies on). Wait a few seconds and try again
  • Your application force closes! -- That's not good :( Send me an email at earlz -at- (this website name) or post below in the comments and I'll try and fix it

After Factory Reset

If you (or AT&T) does a factory reset of your modem, you will have to do this again. However, if your modem loses power and resets, you shouldn't have to run this again

It didn't work!

If you were seeing the "potential connection issue" page, and afterwards your browser gives an error like "server timed out" or "host not reachable", then you may actually not have internet. In that case, call AT&T and hope for the best :) This application will not solve issues with your phone line!

If it didn't do what you wanted, request a refund!

Where is a free version?

I know it's a bit tacky to charge for such a simple application, but I think it's justified in this case. I've spent plenty of time getting to know the NVG510 and helping other people with it, as well as preparing all of the information for publication here. So, I think it's fair. If you don't like it, I will always provide the slightly more technical version for free. See this blog post for details on how to do that.

What's next

I'm not sure. I want to add DNS server fixing, but I don't think I'll be able to fit it in. I'm using Xamarin Android Starter Edition. As such, I have limitations on how complex and big I can make my application. If you want to donate $300 for me to obtain a full license, I'd love you forever :)

Factory Reset

This will completely reset your modem as if AT&T just shipped it to you. It will undo all configuration settings

Bridge Mode

Check the other published info (stub)

Posted: 8/3/2013 8:06:41 PM

Marketplaces Enforce Master-of-None Mentality

Marketplaces are great. On my Android phone I have, at my fingertips, a huge amount of applications that just work. Marketplaces provide us with a sense of security. To uninstall the app, there is guaranteed to be exactly one thing you must do. To install an app, there is exactly one way to install it. It is self contained, there are no dependencies I have to install. Configuration is non-existent, if at all. Discovering how to launch your app is straight forward. It just works.

Let's contrast that with a typical Linux system. I use Arch Linux. So, when I go to install an application, I use pacman -S someapp. And I cross my fingers and pray that it works. Usually it does. Sometimes I have to manually download and install things that aren't in this blessed "marketplace" of sorts. It's never as seemless as "closed" markets though. A linux application can do anything. It could corrupt my system(if I give it sudo), it could trash my home directory, it could install spam that I could never figure out how to uninstall.

These are two sides of a coin. They are naturally at ends. There isn't really a good way of curing these problems with Linux. Most people would say they aren't problems, but rather design choices(myself included).

marketplace

Dependencies... how I miss thee

So, what's this all about? If you look on the Android Marketplace, iOS AppStore, or god forbid the Windows Store, you'll see a stark difference compared to Arch Linux's packages. And no, it's not the open source aspect.

If you want to search through a file in Linux, you'll probably use something like

cat somefile | grep 'something'

you'll use the cat utility to read the file in and pipe the contents to grep, where grep will search across the file for "something".

How do you do that on Android? Or Windows 8/RT?

Basically, you can't. At least, not in a good way. With Android, file managers is possible, and most of them include some basic searching capabilities, but you won't get the power of grep. You won't be able to do awesome shit like you can by combining the strengths of different applications.

If I wanted to write a file search utility for Android, I'd have to first build a sub-par file browser to navigate to the file, and then implement my actual search functionality.

Markets enforce master-of-none mentality

I once had a magnificent plan to port my scripting language to Android. How much work would that require?

  1. File browsing/saving/loading
  2. Text editor (syntax highlighting, searching, etc. More than just a text box)
  3. My programming language

And that's just the start. If I want to provide APIs in my language to search in files, I have to implement that. If I want network access, I have to provide that. There is no netcat, or grep that people could utilize instead of my sub-par APIs.

Why netcat doesn't exist in markets

If you wanted to implement a netcat utility in any marketplace, it'd be fairly pointless. The power of netcat comes from being able to pipe it to other places that the original authors never even dreamed of. What's that, you want to make a TCP/IP proxy?

nc -l -p 8080 | nc example.com 80

You want something that can encrypt a file and send it off somewhere?

openssl aes-256-cbc -salt -e < file-to-transfer | nc example.com 9999

How would you do this in a marketplace application? Sure, maybe you could cobble together some solution like finding a dedicated TCP proxy. And then finding a file encrypter and a TCP/IP program that can send files... but this requires that someone developed such an application beforehand.

You can't just create some general purpose utility. You must create some "multi" purpose utility where you came up with all of the interesting use cases you could and implement them. If you missed one, then there just isn't a solution to that problem. There is no way to combine your program and some other program to solve the problem. It's all or nothing.

It's not just markets

If you notice, desktop Windows does this to a certain extent as well. It's I/O redirection is downright terrible. (although I hear Powershell is nice) This is probably why you see all-in-one applications everywhere. Linux has a general "air" about it that encourages you to make things modular and enable the utilization of other tools where possible.

However, marketplaces is the only place where this is actually enforced. Windows 8 has extremely limited IPC functions. Oh, you gave me a (very limited) search API that works across every application, big whoop. Windows 8 especially enforces it. Did you know that you can't make a general purpose text editor in Windows 8? Impossible. There is no way to open every file with a single application. They enforce you to declare which file extensions you'll be allowed to edit (and no, * doesn't work).

Finally, the bugs

Have you ever encountered a bug in a walled-garden application? Of course you have. Would you say you encounter them more than on desktop application? Probably. Developers can't worry about only one thing because if they don't implement it, then their application can't do it. You get a feature request in your netcat-want-to-be for sending text on-demand instead of files. Now you have to implement some kind of text editor. Now some people want to be able to return an automated response that returns the current date and time. Yea, good luck with keeping up with the wishes of your users.

Developers can't just worry about the one thing they do good. They also have to worry about all the things people might want to combine to make your application more useful. This is why I believe that most market applications have more bugs than their counterparts in desktop operating systems.

For the picky

Yes, I know I probably have some false assumptions, but I'm not far off. I'm no pro in Android and such. It's probably possible to do some rudimentary IPC and maybe even some kind of dependency stuff... but it's not the norm, and I know it's probably not easy for you OR the end user.

Posted: 4/30/2013 4:22:51 AM

New Platforms For Scripter2

Well, I went ahead and downloaded Mono For Android and the Windows Phone/XBox360 .Net SDK... and I have good news.

Scripter2 works right out of the box with Mono For Android. And it works with very minimal modifications when compiled for the XBox.(just had to reimplement ApplicationException and change a minor method call to use an array)

So, if you're looking for a scripting engine to run on those devices where regular .Net dynamic languages don't work, I have your (I think) only option.

I will probably be doing more testing with XBox and Mono For Android in the near future. My only worries are memory usage. I know performance won't be the best, but I already know some places to start improving performance, and I'll be profiling it a lot more in the future.

Posted: 6/27/2012 8:25:49 AM

Unity3D Failure

Despite Unity3D implying that Android deployment was available in the free version, they didn't specify that you also had to buy a $400 product to do it. So, it's back to the drawing board for that.

So, now I am looking at PhoneGap which lets me use HTML5 and Javascript for writing almost-native Android applications. I'm still researching, but it looks to be the best way to go for me. I already know a lot of HTML and Javascript, and I've been interested in experimenting with some HTML5 features. So, it appears to be the best of both worlds

Posted: 2/5/2012 12:25:18 AM

Not Dead

Don't worry faithful readers, I've not abandoned you! I've been busy trying to find a job, and doing some freelancing in the meantime. I don't plan on getting comment support for this site anytime soon, but maybe one day!

Also, as you can tell, that OpenBSD thumbdrive project never came to fruition. My current personal projects include: Yet Another Scripting Language, and an Android game using Unity3D. I started out doing some Android programming in Java... but I really am not too fond of Java, so when I saw a way to make a game for Android writing C# and it not costing $400, I knew I had to check it out

Posted: 2/2/2012 9:58:08 PM