rovo89 / XposedInstaller

3.87k stars 1.51k forks source link

Opening a module from url does not always work. #247

Open manvir-singh opened 9 years ago

manvir-singh commented 9 years ago

When opening a package from a url XposedInstaller is unable to find the module. So I looked into it and it turns out that the url is case sensitive. So for example I have a module with the package name "com.example.Example" then if I try and open the url "http://repo.xposed.info/module/com.example.example" XposedInstaller is unable to find the module unless I change the url to "http://repo.xposed.info/module/com.example.Example" then it works. If this is not a bug then it should be documented that the url is case sensitive.

rovo89 commented 9 years ago

I see where the confusion is coming from. The website creates the aliases with lowercase letters. I didn't think anyone would use uppercase letters (and I don't think it's a good idea), but it's the case for 21 modules. Usually, I prefer URLs to be completely lowercase, but for example GitHub also leaves the project name uppercase in URLs.

Unfortunately, the website also accepted any case, which may have led to the assumption that URLs are case-insensitive, which I think they're clearly not. I have installed a module that redirects to the correct URL now.

So the question is - should the website use mixed-case URLs? Or should the app look up the package case-insensitively when opened via URL? Both would not be too hard to achieve, just wondering what's cleaner.

manvir-singh commented 9 years ago

I know that having a package name with uppercase letters is not a good idea but some people are going to do it anyway. Like for example when I made my first xposed module I had not idea what I was doing. If I was you I would have the website use mixed-case URLs instead of changing the way the XposedInstaller looks it up, because this way you don't have to push a new update for XposedInstaller, also why make users device do more work then it has to, let the server handle the work. I know its not like its a very heavy task for the device to complete but it can add up along with other things. So for these reasons I would make the website use mixed-case URLs.

theknut commented 9 years ago

If he already installed a module to redirect to the package why not force lower case package names from now on. You are right, people may not know what they are doing. So working around their lack of knowledge doesn't solve the problem.

When I wrote my first module I googled for the package name convention. It says that package names are supposed to be your website in reverse order. Websites are lowercase. Am 20.12.2014 13:48 schrieb "Programming4life" notifications@github.com:

I know that having a package name with uppercase letters is not a good idea but some people are going to do it anyway. Like for example when I made my first xposed module I had not idea what I was doing. If I was you I would have the website use mixed-case URLs instead of changing the way the XposedInstaller looks it up, because this way you don't have to push a new update for XposedInstaller, also why make users device do more work then it has to, let the server handle the work. I know its not like its a very heavy task for the device to complete but it can add up along with other things. So for these reasons I would make the website use mixed-case URLs.

— Reply to this email directly or view it on GitHub https://github.com/rovo89/XposedInstaller/issues/247#issuecomment-67734769 .

rovo89 commented 9 years ago

Actually it does redirect to the lowercase URL right now - so if you simply copy and past the link and open it with Xposed Installer, it won't work. The package name has to stay mixed case as most likely all the Android APIs and comparisons are case-sensitive.

I'm thinking about adding a validation to reject package names with uppercase letters right when uploading a new module, to avoid any new modules from adopting a bad practice.

Existing modules could keep the uppercase letters. Maybe I can create uppercase aliases for them, but existing (lowercase) links obviously still wouldn't work with the app. So I tend to leave them as they are, and if any author of these modules wants to make their links work, they can change them to uppercase manually. The app would be able to open them and the websites redirects to the lowercase URL.

manvir-singh commented 9 years ago

Sounds good. That's what I ended up doing, making the url uppercase.