2 Star 11 Fork 2

zkyTech/iOS14-widgets-for-scriptable

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
Apache-2.0

如果本项目对你有帮助,欢迎在Github点个star表示支持。

联系邮箱:zhangkunyuan@hotmail.com ,PR请提交到Github

iOS 14小组件

使用方法

安装scriptable

安装App Store中的Scriptable

安装脚本

下方各组件的章节内有对应脚本的安装链接,点击下载后用Scriptable APP打开。选择Add to my scripts即可。

使用

  1. 安装scriptable后会自动创建几个Demo脚本,其中有一个脚本是Random Scriptable API,先点击运行一次这个脚本。

  2. 在桌面创建小组件 选择 scriptable

  3. 编辑 小组件,点击选取 script 并选择前面导入的脚本。

小组件:bilibili最近更新番剧列表

效果预览

安装

下载安装脚本后,用scriptable打开

参数

小组件的parameter可以设置以下几个值

参数 必填 值/示例 说明
type 番剧/global/进口 进口番剧
国创/cn/国产 国产动画
all/全部 进口+国产
onlyFollowed 追番/true 仅显示已追
全部/false 未追番 + 已追番
uid 当onlyFollowed为追番/true时 必填 8165988 Bilibili账号的UID,如果要设置仅显示追番,必须同时设定这个值。同时要设置空间公开显示番剧订阅

获取uid:B站APP - 我的 - 点击头像 - 详情

在小组件的编辑界面,按照以下格式进行配置

// 配置格式
type,onlyFollowed,uid  //注意必须用英文逗号

// 示例
示例1: 国创,追番,8165988

示例2: cn,true,8165988

示例3: ,追番,8165988

示例4: ,true,8165988

示例5: 番剧,追番,8165988

示例6: global,true,8165988

示例7: 全部,追番,8165988

示例8: all,true,8165988

配置示例

小组件:LOL近期赛事列表

效果预览

安装

下载安装脚本后,用scriptable打开

小组件:深蓝SL03车辆状态

声明

  • 脚本所展示的信息不保证准确无误,锁车、充电、电量、油量等所有信息仅供参考,请勿将桌面组件展示的数据作为决策依据,由于脚本展示数据错误/误差造成的任何后果,本人概不负责。
  • 脚本需要使用深蓝APP的登录信息来获取数据,安装即代表您同意脚本使用您的登录信息。
    • 所有数据只会存储在您的iCloud云盘或者手机本地,不会上传到任何第三方服务器。

效果预览

特性:

  • 支持 中/小 桌面组件 以及 锁屏组件
  • 桌面小组件展示车辆数据: 电池续航、油箱续航、总里程、车内温度(仅纯电车型)、车辆位置、车辆锁定状态、车辆充电状态、车牌号
  • 主题支持自动跟随系统黑暗模式切换
  • 锁屏组件展示车辆数据: 电量、油量
  • 点击桌面/锁屏组件跳转到深蓝APP控车界面
  • 自定义数据块内容,选择电量百分比、油量百分比、综合续航、剩余流量等

车型颜色需要收集比对各种颜色车子的抓包数据来判断是哪个字段,目前没有足够的数据支撑,所以统一白色,当然,小组件提供了部分自定义选项,你可以自己选择组件风格、车辆颜色、替换车辆图片。

简约风格

模块化风格

自定义数据块

安装

为了节省你的时间,请认真阅读下面的操作步骤,并依照文档进行操作,跳过任何一个字都只会成倍地浪费你的时间。为了帮助小白理解,最下面有抓包操作流程图。

安装组件和获取参数的操作过程对小白来说有一定的难度,但是文档写这么长就是为了让更多的人能顺利装上,只要跟着文档一步步操作就能成功。新手大概需要5~10分钟。

认真阅读文档!不要跳过任何一步!

认真阅读文档!不要跳过任何一步!

认真阅读文档!不要跳过任何一步!

为了顺利打开下面的链接,请在safari浏览器中打开本页面

  1. 确保iCloud是开启状态,
  2. 安装Scriptable APP
  3. 下载桌面组件安装脚本后,用Scriptable打开
  4. 安装scriptable后会自动创建几个Demo脚本,其中有一个脚本是Random Scriptable API,先点击运行一次这个脚本。(如果没有看到Random Scriptable API脚本就在Gallery标签页 -> Great WIdgets里面添加)。
  5. 按照下面章节讲的方法获取Authorization并设置到脚本中。

参数

  • 桌面组件参数: Authorization
  • 锁屏组件参数: 模式
    • 非必填,可以填写:,默认显示电量
    • 请先设置好桌面组件再使用锁屏组件
教程

关注公众号查看视频教程

主题设置、自定义车辆图片、LOGO、型号文本...

目前支持自定义的内容:

  • 型号
  • LOGO
  • 车辆图片

车辆名称车牌号是通过API获取的,如果你没有在深蓝APP中设置车牌号,小组件就拉不到车牌数据。所以这两个需要你自己在深蓝APP中修改,修改后等待系统刷新小组件即可。

地图API获取(仅大号组件需要)

  1. 前往高德开放平台注册账号,并认证个人开发者
  2. 在[应用管理-我的应用]中创建一个应用命名为sl03_widget
  3. 点击应用右侧的添加按钮,key名称设置为sl03_widget_key,服务平台选择Web服务,提交确认
  4. 复制刚刚创建的key,输入到小组件的设置中,保存即可

常见问题

  1. SSL错误?

设置-通用-传输或还原iPhone-还原-还原网络设置

  1. 是不是自动刷新数据?

是,也不是。数据刷新分为两部分:1.你的车子把最新数据上传到深蓝APP的服务器数据库中,车子熄火断电后一般不会再更新数据,启动后会持续更新。2.小组件通过API获取数据库中的数据。

小组件只能控制第2部分的刷新,刷新频率由iOS系统自动调度控制。简单地说,你越关注小组件,小组件刷新频率越高。

小组件下方显示数据刷新时间就是为了在小组件信息滞后的时候提醒你这个数据不是最新的,避免引起进一步的误会。比如你刚锁车不到1分钟,可能看到小组件上面显示车辆是解锁状态,但是数据刷新时间能告诉你这是1分钟前的状态。

  1. 能不能手动刷新数据?

可以实现,但非常不优雅,实用性太低,暂时不考虑做这方面的教程。

方法简单点说就是通过快捷指令触发Scriptable的“刷新全部组件”。

  1. 能否控车?

可能有办法实现,但是鉴于法律责任风险,当前我不会去做更不会公开此类方法。

  1. 点击桌面组件跳转非要先打开一下Scriptable吗?

是的,目前无法绕过,这是IOS系统层面的限制,如果后续系统升级放开相关限制我会更新的。

点击锁屏组件可以直接跳转到深蓝APP。

  1. 为什么不做成独立的APP?

第一,时间成本,我的IOS开发经验不足,前端也不是主要专业方向,只是兴趣;第二,就算做出来了,不太可能通过AppStore的审核。

  1. 为什么不做成模拟登录深蓝账号来拿token,这样小白也轻松很多?

法律风险太大。

本项目部分样式基于bmw-scriptable-widgets开发,感谢作者的开源精神。

Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

简介

个人开发的ios桌面小组件 展开 收起
README
Apache-2.0
取消

发行版 (1)

全部
2年前

贡献者

全部

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zkytech/iOS14-widgets-for-scriptable.git
git@gitee.com:zkytech/iOS14-widgets-for-scriptable.git
zkytech
iOS14-widgets-for-scriptable
iOS14-widgets-for-scriptable
master

搜索帮助