Giter Site home page Giter Site logo

Comments (12)

bk138 avatar bk138 commented on July 23, 2024

This would require rebuilding the app each time settings are changed? Doesn't https://github.com/bk138/droidVNC-NG?tab=readme-ov-file#how-to-pre-seed-preferences do the same?

from droidvnc-ng.

stegl83 avatar stegl83 commented on July 23, 2024

In my opinion, the local file is a different scenario. The MDM is not able to put the json file in this directory.
BUT:
The feature of trigger the vnc-server by intent and configuring the settings by the intents "datacontainer" is really great. Maybe this can be used for a workaround:
I could extend my app so it can be configured by MDM and pass these Settings to VNCServer per Intent.
I will try out and close this issue when it's working.

from droidvnc-ng.

bk138 avatar bk138 commented on July 23, 2024

Good morning and thanks for your answer! If you get it to work, please leave a few notes here; might be interesting to others as well.

from droidvnc-ng.

stegl83 avatar stegl83 commented on July 23, 2024

Hi again,
I just think about the approach: I need the randomly on the device generated access key to setup the settings from my app by intent. Right? When yes, this is a big problem.

The goal is to make a mass deployable configuration which can be rolled out by MDM.
When every device has a different access key, it is useless to pass the access key by MDM to my app on the device fleet so it can trigger vncServer.

The only way would be to setup the same access key on every device. There is not much saving here compared to setup the whole configuration by json-file.

My next step is to request my MDM-vendor if there is a way to drop the json-File on the described location. I let you know the answer.

from droidvnc-ng.

bk138 avatar bk138 commented on July 23, 2024

Hi again, I just think about the approach: I need the randomly on the device generated access key to setup the settings from my app by intent. Right? When yes, this is a big problem.

It would be, but you can preseed the access key via the JSON, see the docs at https://github.com/bk138/droidVNC-NG?tab=readme-ov-file#how-to-pre-seed-preferences

from droidvnc-ng.

stegl83 avatar stegl83 commented on July 23, 2024

The MDM-vendor confirms that there is no way to put the json file by MDM.
I tried another workaround and my app tried accessing the directory - even if MANAGE_EXTERNAL_STORAGE is definied and explicitly permitted - the app can not access this app-specific directory. This aligns with https://developer.android.com/training/data-storage/manage-all-files.
The only use case for using the json to setup the vnc-app is copy it by usb on the directory on the device.
But that is not a solution for me.

I think, configure the app by using managed settings is the only way that fits the needs of the described MDM-scenario.
Please consider about this feature.

from droidvnc-ng.

bk138 avatar bk138 commented on July 23, 2024

@stegl83 Are there any docs/examples/best-practices for the requested feature? Are you representing a company that would fund this?

from droidvnc-ng.

stegl83 avatar stegl83 commented on July 23, 2024

Hi,
I just prepared the restriction-files for you. In .NET MAUI / Visual Studio you have to put them like this:

image

In Java it will be similar. After building the App and publishing to the store, the MDM will evaluate this new metadata and the configuration UI will look like this:

image

restriction_values.xml:

<?xml version="1.0" encoding="utf-8" ?>
<resources>
	<string name="net.christianbeier.droidvnc_ng_config">Configuration</string>
	<string name="net.christianbeier.droidvnc_ng_config_desc">Configuration for DroidVNC</string>
	<string name="net.christianbeier.droidvnc_ng_EXTRA_ACCESS_KEY">Access Key</string>
	<string name="net.christianbeier.droidvnc_ng_EXTRA_ACCESS_KEY_default"></string>
	<string name="net.christianbeier.droidvnc_ng_EXTRA_PORT">Port</string>
	<string name="net.christianbeier.droidvnc_ng_EXTRA_PORT_default">5900</string>
	<string name="net.christianbeier.droidvnc_ng_EXTRA_PASSWORD">Password</string>
	<string name="net.christianbeier.droidvnc_ng_EXTRA_PASSWORD_default"></string>
	<string name="net.christianbeier.droidvnc_ng_EXTRA_SCALING">Scaling</string>
	<string name="net.christianbeier.droidvnc_ng_EXTRA_SCALING_default"></string>
	<string name="net.christianbeier.droidvnc_ng_EXTRA_VIEW_ONLY">ViewOnly</string>
	<string name="net.christianbeier.droidvnc_ng_EXTRA_VIEW_ONLY_default">false</string>
	<string name="net.christianbeier.droidvnc_ng_EXTRA_SHOW_POINTERS">Show Pointers</string>
	<string name="net.christianbeier.droidvnc_ng_EXTRA_SHOW_POINTERS_default">true</string>
	<string name="net.christianbeier.droidvnc_ng_EXTRA_FILE_TRANSFER">File Transfer</string>
	<string name="net.christianbeier.droidvnc_ng_EXTRA_FILE_TRANSFER_default">false</string>
</resources>

app_restrictions.xml:
`

	<restriction
	  android:key="EXTRA_ACCESS_KEY"
	  android:title="@string/net.christianbeier.droidvnc_ng_EXTRA_ACCESS_KEY"
	  android:defaultValue="@string/net.christianbeier.droidvnc_ng_EXTRA_ACCESS_KEY_default"
	  android:restrictionType="string"/>

	<restriction
	  android:key="EXTRA_PORT"
	  android:title="@string/net.christianbeier.droidvnc_ng_EXTRA_PORT"
	  android:defaultValue="@string/net.christianbeier.droidvnc_ng_EXTRA_PORT_default"
	  android:restrictionType="integer"/>

	<restriction
	  android:key="EXTRA_PASSWORD"
	  android:title="@string/net.christianbeier.droidvnc_ng_EXTRA_PASSWORD"
	  android:defaultValue="@string/net.christianbeier.droidvnc_ng_EXTRA_PASSWORD_default"
	  android:restrictionType="string"/>

	<restriction
	  android:key="EXTRA_SCALING"
	  android:title="@string/net.christianbeier.droidvnc_ng_EXTRA_SCALING"
	  android:defaultValue="@string/net.christianbeier.droidvnc_ng_EXTRA_SCALING_default"
	  android:restrictionType="string"/>

	<restriction
	  android:key="EXTRA_VIEW_ONLY"
	  android:title="@string/net.christianbeier.droidvnc_ng_EXTRA_VIEW_ONLY"
	  android:defaultValue="@string/net.christianbeier.droidvnc_ng_EXTRA_VIEW_ONLY_default"
		android:restrictionType="bool"/>

	<restriction
	  android:key="EXTRA_SHOW_POINTERS"
	  android:title="@string/net.christianbeier.droidvnc_ng_EXTRA_SHOW_POINTERS"
	  android:defaultValue="@string/net.christianbeier.droidvnc_ng_EXTRA_SHOW_POINTERS_default"
		android:restrictionType="bool"/>

	<restriction
	  android:key="EXTRA_FILE_TRANSFER"
	  android:title="@string/net.christianbeier.droidvnc_ng_EXTRA_FILE_TRANSFER"
	  android:defaultValue="@string/net.christianbeier.droidvnc_ng_EXTRA_FILE_TRANSFER_default"
		android:restrictionType="bool"/>

	<!-- add more settings if something missing --> 
</restriction>

`

from droidvnc-ng.

stegl83 avatar stegl83 commented on July 23, 2024

For reading this settings in the app, you have to use RestrictionsManager-API.
Here are the Docs: https://developer.android.com/work/managed-configurations?hl=de

from droidvnc-ng.

bk138 avatar bk138 commented on July 23, 2024

Thanks! Will go through this when I have so spare time. If you or your company need this in an expedited form, feel free to reach out to me via email.

from droidvnc-ng.

leandro-nomid avatar leandro-nomid commented on July 23, 2024

Hey @stegl83, I'm CEO and CTO of Nomid Tech, a MDM provider.
We are evaluating alternatives for remote access and stumbled upon this project and issue. Please reach us at [email protected] so we can discuss further the usage in your company.
I'm sure we can share experience and combine efforts to either contribute with a PR or fund this feature request.

from droidvnc-ng.

bk138 avatar bk138 commented on July 23, 2024

@leandro-nomid @stegl83 Would happily merge a PR that's generic enough for all users, or, if that's not possible, detailed documentation of setting things up.

from droidvnc-ng.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.