Skip to content
This repository has been archived by the owner on Sep 6, 2019. It is now read-only.

Easier license file import #1658

Closed
M66B opened this issue May 14, 2014 · 4 comments
Closed

Easier license file import #1658

M66B opened this issue May 14, 2014 · 4 comments

Comments

@M66B
Copy link
Owner

M66B commented May 14, 2014

            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <data android:scheme="file" />
                <data android:host="*" />
                <data android:mimeType="*/*" />
                <data android:pathPattern=".*\\key.license" />
                <data android:pathPattern=".*\\..*\\key.license" />
                <data android:pathPattern=".*\\..*\\..*\\key.license"
/>                            <!--- because "." is not like a regex-dot
... -->
                <data
android:pathPattern=".*\\..*\\..*\\..*\\key.license" />
            </intent-filter>
      Uri uri = intent.getData();
        File df = getFilesDir().getAbsoluteFile();
        String fi = uri.getEncodedPath();
        String fo = df + File.separator +
getString(getApplicationInfo().labelRes) + ".license";

Thanks @defim

@fda77
Copy link
Contributor

fda77 commented May 17, 2014

As you commited it, it will not work for path names with a "." (dot) in it for all Android APIs, like /sdcard/bug.me/XPrivacy_license.txt
See google or eg http://code.google.com/p/keepassdroid/issues/detail?id=262

@M66B
Copy link
Owner Author

M66B commented May 17, 2014

I have tested this and it works for me.

@fda77
Copy link
Contributor

fda77 commented May 17, 2014

I think it was fixed in some Android version, but idk when. Have you testet with Android 4.0?

@M66B
Copy link
Owner Author

M66B commented May 17, 2014

I can only test on KitKat.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants