是否可以创建可操纵Android手机中文件的Google Apps脚本? [英] Is it possible to create a google apps script that manipulates a file in android phone?

查看:176
本文介绍了是否可以创建可操纵Android手机中文件的Google Apps脚本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我随时使用JuiceSSH与RaspberryPi建立SSH连接.我需要做的是将IP地址值交换到JuiceSSH配置文件中,并在IP地址更改的情况下将RaspberryPi发送该IP地址.我正在考虑使用Google Apps脚本,在该脚本中我可以从电子邮件中获取新的IP地址值.但是我不知道JuiceSSH应用程序在哪里保存配置.而且我也不知道我是否可以使用Google Apps脚本将任何文件操纵到Android手机中.

I am using JuiceSSH for making SSH connections to my RaspberryPi whenever I want. What I need to do is swap the IP address value into the JuiceSSH configuration file with the IP address that will be sent by RaspberryPi in case of IP address change. I am thinking about using a google apps script in which I can get the new IP address value from the e-mail. But I don't know where the JuiceSSH app holds the configurations. And I do not also know whether I can manipulate any file into an android phone using a google apps script.

推荐答案

Google Apps脚本无法直接访问除Google云端硬盘中的文件以外的任何文件.

Google Apps Script cannot directly access any files except those in your Google Drive.

您可以授权脚本间接更改JuiseSSH配置-如果可以的话...

You may be able to empower a script to indirectly change the JuiseSSH config - if you can...

  1. 弄清楚它在哪里.
  2. 在电话上设置Web服务器以接受传入的POST操作.
  1. Figure out where it is.
  2. Set up a web server on your phone to accept incoming POST operations.
    • See this LifeHacker blog.
    • When a valid POST is received, decode the payload and use it to update the local file.
    • There will be security issues with this!
  • 监视您的电子邮件,以获取有关Raspberry PI IP地址更改的消息.
  • 弄清楚如何跟踪手机的IP地址!
  • 将更新发布到您的手机上.
  • 定期重试,直到POST成功(因为电话连接不可靠)

另一种方法是让Google Apps Script WebService提供设备的当前地址;电话上的程序就可以定期与服务联系,以找到地址并更新文件.

Another approach would be to have a Google Apps Script WebService serve up the current address of the device; then a program on the phone could periodically reach out to the service to find out the address, and update the file.

当然,如果您使用名称而不是IP地址连接到Raspberry PI,则不必担心其中的任何一个.

Of course, if you connected to your Raspberry PI using a name instead of an IP address, you wouldn't have to worry about any of this.

这篇关于是否可以创建可操纵Android手机中文件的Google Apps脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆