dsh-pocket-ios 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +344 -0
- package/README.md +37 -2
- package/client/client.js +117 -0
- package/cordis.patch.yml +6 -0
- package/lib/index.js +16 -0
- package/package.json +50 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
GNU GENERAL PUBLIC LICENSE
|
|
2
|
+
Version 2, June 1991
|
|
3
|
+
|
|
4
|
+
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
|
5
|
+
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
6
|
+
|
|
7
|
+
Everyone is permitted to copy and distribute verbatim copies
|
|
8
|
+
of this license document, but changing it is not allowed.
|
|
9
|
+
|
|
10
|
+
Preamble
|
|
11
|
+
|
|
12
|
+
The licenses for most software are designed to take away your
|
|
13
|
+
freedom to share and change it. By contrast, the GNU General Public
|
|
14
|
+
License is intended to guarantee your freedom to share and change free
|
|
15
|
+
software--to make sure the software is free for all its users. This
|
|
16
|
+
General Public License applies to most of the Free Software
|
|
17
|
+
Foundation's software and to any other program whose authors commit to
|
|
18
|
+
using it. (Some other Free Software Foundation software is covered by
|
|
19
|
+
the GNU Lesser General Public License instead.) You can apply it to
|
|
20
|
+
your programs, too.
|
|
21
|
+
|
|
22
|
+
When we speak of free software, we are referring to freedom, not
|
|
23
|
+
price. Our General Public Licenses are designed to make sure that you
|
|
24
|
+
have the freedom to distribute copies of free software (and charge for
|
|
25
|
+
this service if you wish), that you receive source code or can get it
|
|
26
|
+
if you want it, that you can change the software or use pieces of it
|
|
27
|
+
in new free programs; and that you know you can do these things.
|
|
28
|
+
|
|
29
|
+
To protect your rights, we need to make restrictions that forbid
|
|
30
|
+
anyone to deny you these rights or to ask you to surrender the rights.
|
|
31
|
+
These restrictions translate to certain responsibilities for you if you
|
|
32
|
+
distribute copies of the software, or if you modify it.
|
|
33
|
+
|
|
34
|
+
For example, if you distribute copies of such a program, whether
|
|
35
|
+
gratis or for a fee, you must give the recipients all the rights that
|
|
36
|
+
you have. You must make sure that they, too, receive or can get the
|
|
37
|
+
source code. And you must show them these terms so they know their
|
|
38
|
+
rights.
|
|
39
|
+
|
|
40
|
+
We protect your rights with two steps: (1) copyright the software, and
|
|
41
|
+
(2) offer you this license which gives you legal permission to copy,
|
|
42
|
+
distribute and/or modify the software.
|
|
43
|
+
|
|
44
|
+
Also, for each author's protection and ours, we want to make certain
|
|
45
|
+
that everyone understands that there is no warranty for this free
|
|
46
|
+
software. If the software is modified by someone else and passed on, we
|
|
47
|
+
want its recipients to know that what they have is not the original, so
|
|
48
|
+
that any problems introduced by others will not reflect on the original
|
|
49
|
+
authors' reputations.
|
|
50
|
+
|
|
51
|
+
Finally, any free program is threatened constantly by software
|
|
52
|
+
patents. We wish to avoid the danger that redistributors of a free
|
|
53
|
+
program will individually obtain patent licenses, in effect making the
|
|
54
|
+
program proprietary. To prevent this, we have made it clear that any
|
|
55
|
+
patent must be licensed for everyone's free use or not licensed at all.
|
|
56
|
+
|
|
57
|
+
The precise terms and conditions for copying, distribution and
|
|
58
|
+
modification follow.
|
|
59
|
+
|
|
60
|
+
GNU GENERAL PUBLIC LICENSE
|
|
61
|
+
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
|
62
|
+
|
|
63
|
+
0. This License applies to any program or other work which contains
|
|
64
|
+
a notice placed by the copyright holder saying it may be distributed
|
|
65
|
+
under the terms of this General Public License. The "Program", below,
|
|
66
|
+
refers to any such program or work, and a "work based on the Program"
|
|
67
|
+
means either the Program or any derivative work under copyright law:
|
|
68
|
+
that is to say, a work containing the Program or a portion of it,
|
|
69
|
+
either verbatim or with modifications and/or translated into another
|
|
70
|
+
language. (Hereinafter, translation is included without limitation in
|
|
71
|
+
the term "modification".) Each licensee is addressed as "you".
|
|
72
|
+
|
|
73
|
+
Activities other than copying, distribution and modification are not
|
|
74
|
+
covered by this License; they are outside its scope. The act of
|
|
75
|
+
running the Program is not restricted, and the output from the Program
|
|
76
|
+
is covered only if its contents constitute a work based on the
|
|
77
|
+
Program (independent of having been made by running the Program).
|
|
78
|
+
Whether that is true depends on what the Program does.
|
|
79
|
+
|
|
80
|
+
1. You may copy and distribute verbatim copies of the Program's
|
|
81
|
+
source code as you receive it, in any medium, provided that you
|
|
82
|
+
conspicuously and appropriately publish on each copy an appropriate
|
|
83
|
+
copyright notice and disclaimer of warranty; keep intact all the
|
|
84
|
+
notices that refer to this License and to the absence of any warranty;
|
|
85
|
+
and give any other recipients of the Program a copy of this License
|
|
86
|
+
along with the Program.
|
|
87
|
+
|
|
88
|
+
You may charge a fee for the physical act of transferring a copy, and
|
|
89
|
+
you may at your option offer warranty protection in exchange for a fee.
|
|
90
|
+
|
|
91
|
+
2. You may modify your copy or copies of the Program or any portion
|
|
92
|
+
of it, thus forming a work based on the Program, and copy and
|
|
93
|
+
distribute such modifications or work under the terms of Section 1
|
|
94
|
+
above, provided that you also meet all of these conditions:
|
|
95
|
+
|
|
96
|
+
a) You must cause the modified files to carry prominent notices
|
|
97
|
+
stating that you changed the files and the date of any change.
|
|
98
|
+
|
|
99
|
+
b) You must cause any work that you distribute or publish, that in
|
|
100
|
+
whole or in part contains or is derived from the Program or any
|
|
101
|
+
part thereof, to be licensed as a whole at no charge to all third
|
|
102
|
+
parties under the terms of this License.
|
|
103
|
+
|
|
104
|
+
c) If the modified program normally reads commands interactively
|
|
105
|
+
when run, you must cause it, when started running for such
|
|
106
|
+
interactive use in the most ordinary way, to print or display an
|
|
107
|
+
announcement including an appropriate copyright notice and a notice
|
|
108
|
+
that there is no warranty (or else, saying that you provide a
|
|
109
|
+
warranty) and that users may redistribute the program under these
|
|
110
|
+
conditions, and telling the user how to view a copy of this License.
|
|
111
|
+
(Exception: if the Program itself is interactive but does not
|
|
112
|
+
normally print such an announcement, your work based on the Program
|
|
113
|
+
is not required to print an announcement.)
|
|
114
|
+
|
|
115
|
+
These requirements apply to the modified work as a whole. If
|
|
116
|
+
identifiable sections of that work are not derived from the Program,
|
|
117
|
+
and can be reasonably considered independent and separate works in
|
|
118
|
+
themselves, then this License, and its terms, do not apply to those
|
|
119
|
+
sections when you distribute them as separate works. But when you
|
|
120
|
+
distribute the same sections as part of a whole which is a work based
|
|
121
|
+
on the Program, the distribution of the whole must be on the terms of
|
|
122
|
+
this License, whose permissions for other licensees extend to the
|
|
123
|
+
entire whole, and thus to each and every part regardless of who wrote it.
|
|
124
|
+
|
|
125
|
+
Thus, it is not the intent of this section to claim rights or contest
|
|
126
|
+
your rights to work written entirely by you; rather, the intent is to
|
|
127
|
+
exercise the right to control the distribution of derivative or
|
|
128
|
+
collective works based on the Program.
|
|
129
|
+
|
|
130
|
+
In addition, mere aggregation of another work not based on the Program
|
|
131
|
+
with the Program (or with a work based on the Program) on a volume of
|
|
132
|
+
a storage or distribution medium does not bring the other work under
|
|
133
|
+
the scope of this License.
|
|
134
|
+
|
|
135
|
+
3. You may copy and distribute the Program (or a work based on it,
|
|
136
|
+
under Section 2) in object code or executable form under the terms of
|
|
137
|
+
Sections 1 and 2 above provided that you also do one of the following:
|
|
138
|
+
|
|
139
|
+
a) Accompany it with the complete corresponding machine-readable
|
|
140
|
+
source code, which must be distributed under the terms of Sections
|
|
141
|
+
1 and 2 above on a medium customarily used for software interchange;
|
|
142
|
+
or,
|
|
143
|
+
|
|
144
|
+
b) Accompany it with a written offer, valid for at least three
|
|
145
|
+
years, to give any third party, for a charge no more than your cost
|
|
146
|
+
of physically performing source distribution, a complete
|
|
147
|
+
machine-readable copy of the corresponding source code, to be
|
|
148
|
+
distributed under the terms of Sections 1 and 2 above on a medium
|
|
149
|
+
customarily used for software interchange; or,
|
|
150
|
+
|
|
151
|
+
c) Accompany it with the information you received as to the offer
|
|
152
|
+
to distribute corresponding source code. (This alternative is
|
|
153
|
+
allowed only for noncommercial distribution and only if you
|
|
154
|
+
received the program in object code or executable form with such an
|
|
155
|
+
offer, in accord with Subsection b above.)
|
|
156
|
+
|
|
157
|
+
The source code for a work means the preferred form of the work for
|
|
158
|
+
making modifications to it. For an executable work, complete source
|
|
159
|
+
code means all the source code for all modules it contains, plus any
|
|
160
|
+
associated interface definition files, plus the scripts used to
|
|
161
|
+
control compilation and installation of the executable. However, as a
|
|
162
|
+
special exception, the source code distributed need not include
|
|
163
|
+
anything that is normally distributed (in either source or binary
|
|
164
|
+
form) with the major components (compiler, kernel, and so on) of the
|
|
165
|
+
operating system on which the executable runs, unless that component
|
|
166
|
+
itself accompanies the executable.
|
|
167
|
+
|
|
168
|
+
If distribution of executable or object code is made by offering
|
|
169
|
+
access to copy from a designated place, then offering equivalent
|
|
170
|
+
access to copy the source code from the same place counts as
|
|
171
|
+
distribution of the source code, even though third parties are not
|
|
172
|
+
compelled to copy the source along with the object code.
|
|
173
|
+
|
|
174
|
+
4. You may not copy, modify, sublicense, or distribute the Program
|
|
175
|
+
except as expressly provided under this License. Any attempt
|
|
176
|
+
otherwise to copy, modify, sublicense or distribute the Program is
|
|
177
|
+
void, and will automatically terminate your rights under this License.
|
|
178
|
+
However, parties who have received copies, or rights, from you under
|
|
179
|
+
this License will not have their licenses terminated so long as such
|
|
180
|
+
parties remain in full compliance.
|
|
181
|
+
|
|
182
|
+
5. You are not required to accept this License, since you have not
|
|
183
|
+
signed it. However, nothing else grants you permission to modify or
|
|
184
|
+
distribute the Program or its derivative works. These actions are
|
|
185
|
+
prohibited by law if you do not accept this License. Therefore, by
|
|
186
|
+
modifying or distributing the Program (or any work based on the
|
|
187
|
+
Program), you indicate your acceptance of this License to do so, and
|
|
188
|
+
all its terms and conditions for copying, distributing or modifying
|
|
189
|
+
the Program or works based on it.
|
|
190
|
+
|
|
191
|
+
6. Each time you redistribute the Program (or any work based on the
|
|
192
|
+
Program), the recipient automatically receives a license from the
|
|
193
|
+
original licensor to copy, distribute or modify the Program subject to
|
|
194
|
+
these terms and conditions. You may not impose any further
|
|
195
|
+
restrictions on the recipients' exercise of the rights granted herein.
|
|
196
|
+
You are not responsible for enforcing compliance by third parties to
|
|
197
|
+
this License.
|
|
198
|
+
|
|
199
|
+
7. If, as a consequence of a court judgment or allegation of patent
|
|
200
|
+
infringement or for any other reason (not limited to patent issues),
|
|
201
|
+
conditions are imposed on you (whether by court order, agreement or
|
|
202
|
+
otherwise) that contradict the conditions of this License, they do not
|
|
203
|
+
excuse you from the conditions of this License. If you cannot
|
|
204
|
+
distribute so as to satisfy simultaneously your obligations under this
|
|
205
|
+
License and any other pertinent obligations, then as a consequence you
|
|
206
|
+
may not distribute the Program at all. For example, if a patent
|
|
207
|
+
license would not permit royalty-free redistribution of the Program by
|
|
208
|
+
all those who receive copies directly or indirectly through you, then
|
|
209
|
+
the only way you could satisfy both it and this License would be to
|
|
210
|
+
refrain entirely from distribution of the Program.
|
|
211
|
+
|
|
212
|
+
If any portion of this section is held invalid or unenforceable under
|
|
213
|
+
any particular circumstance, the balance of the section is intended to
|
|
214
|
+
apply and the section as a whole is intended to apply in other
|
|
215
|
+
circumstances.
|
|
216
|
+
|
|
217
|
+
It is not the purpose of this section to induce you to infringe any
|
|
218
|
+
patents or other property right claims or to contest validity of any
|
|
219
|
+
such claims; this section has the sole purpose of protecting the
|
|
220
|
+
integrity of the free software distribution system, which is
|
|
221
|
+
implemented by public license practices. Many people have made
|
|
222
|
+
generous contributions to the wide range of software distributed
|
|
223
|
+
through that system in reliance on consistent application of that
|
|
224
|
+
system; it is up to the author/donor to decide if he or she is willing
|
|
225
|
+
to distribute software through any other system and a licensee cannot
|
|
226
|
+
impose that choice.
|
|
227
|
+
|
|
228
|
+
This section is intended to make thoroughly clear what is believed to
|
|
229
|
+
be a consequence of the rest of this License.
|
|
230
|
+
|
|
231
|
+
8. If the distribution and/or use of the Program is restricted in
|
|
232
|
+
certain countries either by patents or by copyrighted interfaces, the
|
|
233
|
+
original copyright holder who places this Program under this License
|
|
234
|
+
may add an explicit geographical distribution limitation excluding
|
|
235
|
+
those countries, so that distribution is permitted only in or among
|
|
236
|
+
countries not thus excluded. In such case, this License incorporates
|
|
237
|
+
the limitation as if written in the body of this License.
|
|
238
|
+
|
|
239
|
+
9. The Free Software Foundation may publish revised and/or new
|
|
240
|
+
versions of the General Public License from time to time. Such new
|
|
241
|
+
versions will be similar in spirit to the present version, but may
|
|
242
|
+
differ in detail to address new problems or concerns.
|
|
243
|
+
|
|
244
|
+
Each version is given a distinguishing version number. If the Program
|
|
245
|
+
specifies a version number of this License which applies to it and
|
|
246
|
+
"any later version", you have the option of following the terms and
|
|
247
|
+
conditions either of that version or of any later version published by
|
|
248
|
+
the Free Software Foundation. If the Program does not specify a
|
|
249
|
+
version number of this License, you may choose any version ever
|
|
250
|
+
published by the Free Software Foundation.
|
|
251
|
+
|
|
252
|
+
10. If you wish to incorporate parts of the Program into other free
|
|
253
|
+
programs whose distribution conditions are different, write to the
|
|
254
|
+
author to ask for permission. For software which is copyrighted by the
|
|
255
|
+
Free Software Foundation, write to the Free Software Foundation; we
|
|
256
|
+
sometimes make exceptions for this. Our decision will be guided by the
|
|
257
|
+
two goals of preserving the free status of all derivatives of our free
|
|
258
|
+
software and of promoting the sharing and reuse of software generally.
|
|
259
|
+
|
|
260
|
+
NO WARRANTY
|
|
261
|
+
|
|
262
|
+
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO
|
|
263
|
+
WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
|
264
|
+
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
|
265
|
+
OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND,
|
|
266
|
+
EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
|
267
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
268
|
+
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
|
269
|
+
PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME
|
|
270
|
+
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
|
271
|
+
|
|
272
|
+
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
|
273
|
+
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
|
274
|
+
AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU
|
|
275
|
+
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
|
276
|
+
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
|
277
|
+
PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
|
278
|
+
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
|
279
|
+
FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF
|
|
280
|
+
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
|
281
|
+
DAMAGES.
|
|
282
|
+
|
|
283
|
+
END OF TERMS AND CONDITIONS
|
|
284
|
+
|
|
285
|
+
How to Apply These Terms to Your New Programs
|
|
286
|
+
|
|
287
|
+
If you develop a new program, and you want it to be of the greatest
|
|
288
|
+
possible use to the public, the best way to achieve this is to make it
|
|
289
|
+
free software which everyone can redistribute and change under these
|
|
290
|
+
terms.
|
|
291
|
+
|
|
292
|
+
To do so, attach the following notices to the program. It is safest
|
|
293
|
+
to attach them to the start of each source file to most effectively
|
|
294
|
+
convey the exclusion of warranty; and each file should have at least
|
|
295
|
+
the "copyright" line and a pointer to where the full notice is found.
|
|
296
|
+
|
|
297
|
+
<one line to give the program's name and a brief idea of what it does.>
|
|
298
|
+
Copyright (C) <year> <name of author>
|
|
299
|
+
|
|
300
|
+
This program is free software; you can redistribute it and/or modify
|
|
301
|
+
it under the terms of the GNU General Public License as published by
|
|
302
|
+
the Free Software Foundation; either version 2 of the License, or
|
|
303
|
+
(at your option) any later version.
|
|
304
|
+
|
|
305
|
+
This program is distributed in the hope that it will be useful,
|
|
306
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
307
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
308
|
+
GNU General Public License for more details.
|
|
309
|
+
|
|
310
|
+
You should have received a copy of the GNU General Public License
|
|
311
|
+
along with this program; if not, write to the Free Software
|
|
312
|
+
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
Also add information on how to contact you by electronic and paper mail.
|
|
316
|
+
|
|
317
|
+
If the program is interactive, make it output a short notice like this
|
|
318
|
+
when it starts in an interactive mode:
|
|
319
|
+
|
|
320
|
+
Gnomovision version 69, Copyright (C) year name of author
|
|
321
|
+
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
|
322
|
+
This is free software, and you are welcome to redistribute it
|
|
323
|
+
under certain conditions; type `show c' for details.
|
|
324
|
+
|
|
325
|
+
The hypothetical commands `show w' and `show c' should show the appropriate
|
|
326
|
+
parts of the General Public License. Of course, the commands you use may
|
|
327
|
+
be called something other than `show w' and `show c'; they could even be
|
|
328
|
+
mouse-clicks or menu items--whatever suits your program.
|
|
329
|
+
|
|
330
|
+
You should also get your employer (if you work as a programmer) or your
|
|
331
|
+
school, if any, to sign a "copyright disclaimer" for the program, if
|
|
332
|
+
necessary. Here is a sample; alter the names:
|
|
333
|
+
|
|
334
|
+
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
|
335
|
+
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
|
336
|
+
|
|
337
|
+
<signature of Ty Coon>, 1 April 1989
|
|
338
|
+
Ty Coon, President of Vice
|
|
339
|
+
|
|
340
|
+
This General Public License does not permit incorporating your program
|
|
341
|
+
into proprietary programs. If your program is a subroutine library, you
|
|
342
|
+
may consider it more useful to permit linking proprietary applications
|
|
343
|
+
with the library. If this is what you want to do, use the GNU Lesser
|
|
344
|
+
General Public License instead of this License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,38 @@
|
|
|
1
|
-
#
|
|
1
|
+
# dsh-pocket-ios(DSH 插件)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
在 DSH 的**设置 → 手机访问**里加入 iOS 客户端下载二维码与连接引导,把「手机访问」和
|
|
4
|
+
[DSH Pocket iOS](https://github.com/jqlong17/dsh-pocket-ios) 串起来。
|
|
5
|
+
|
|
6
|
+
## 它做什么
|
|
7
|
+
|
|
8
|
+
- 设置页新增「iOS 客户端」入口(`settings.section` 插槽,原生渲染);
|
|
9
|
+
- 在「手机访问」页的**局域网访问上方**尽力插入一张 iOS 卡片:下载二维码 + Release 链接 +
|
|
10
|
+
源码 zip 直链(DOM 注入,插入失败不影响上面的原生入口);
|
|
11
|
+
- `dependencies` 带 `dsh-pocket`,安装本插件会一并安装手机访问所需的 dsh-pocket。
|
|
12
|
+
|
|
13
|
+
## 安装
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# 电脑端:一条命令装齐(dsh-pocket + iOS 引导插件)
|
|
17
|
+
dsh plugin add dsh-pocket dsh-pocket-ios
|
|
18
|
+
|
|
19
|
+
# 若 dsh-pocket 已在用,只装本插件即可:
|
|
20
|
+
dsh plugin add dsh-pocket-ios
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
安装后重启 DSH(或按提示重启),打开 **设置 → 手机访问** 即可看到 iOS 入口。
|
|
24
|
+
|
|
25
|
+
> 为什么依赖 dsh-pocket 而不是复制它的 patch:复制上游 patch 会在上游变更时失真,且用户
|
|
26
|
+
> 单独安装 dsh-pocket 时会产生重复插件行;依赖 + 官方安装命令更稳。
|
|
27
|
+
|
|
28
|
+
## 手机端
|
|
29
|
+
|
|
30
|
+
iOS App 通过 GitHub Release 分发(自签安装):
|
|
31
|
+
|
|
32
|
+
<https://github.com/jqlong17/dsh-pocket-ios/releases>
|
|
33
|
+
|
|
34
|
+
装好后在 App 里扫描 dsh-pocket 的二维码即可连接本机 DSH。
|
|
35
|
+
|
|
36
|
+
## 许可
|
|
37
|
+
|
|
38
|
+
GPL-2.0(与上游 dsh-pocket 一致)。
|
package/client/client.js
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
window.__ModuleLoader__.load({
|
|
2
|
+
id: "dsh-pocket-ios",
|
|
3
|
+
factory: (require) => {
|
|
4
|
+
var module = { exports: {} };
|
|
5
|
+
var exports = module.exports;
|
|
6
|
+
var React = require("react");
|
|
7
|
+
|
|
8
|
+
var RELEASE_URL = "https://github.com/jqlong17/dsh-pocket-ios/releases/tag/0.0.1";
|
|
9
|
+
var DOWNLOAD_URL = "https://github.com/jqlong17/dsh-pocket-ios/archive/refs/tags/0.0.1.zip";
|
|
10
|
+
var QR_SVG = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"200\" height=\"200\" viewBox=\"0 0 33 33\" shape-rendering=\"crispEdges\"><path fill=\"#ffffff\" d=\"M0 0h33v33H0z\"/><path stroke=\"#000000\" d=\"M0 0.5h7m1 0h7m1 0h1m1 0h4m1 0h1m2 0h7M0 1.5h1m5 0h1m1 0h1m2 0h2m4 0h2m3 0h3m1 0h1m5 0h1M0 2.5h1m1 0h3m1 0h1m3 0h4m5 0h1m4 0h1m1 0h1m1 0h3m1 0h1M0 3.5h1m1 0h3m1 0h1m1 0h1m1 0h1m4 0h1m1 0h1m2 0h1m1 0h1m1 0h1m1 0h1m1 0h3m1 0h1M0 4.5h1m1 0h3m1 0h1m2 0h2m1 0h1m1 0h1m4 0h1m4 0h1m1 0h1m1 0h3m1 0h1M0 5.5h1m5 0h1m3 0h1m1 0h1m2 0h1m2 0h5m3 0h1m5 0h1M0 6.5h7m1 0h1m1 0h1m1 0h1m1 0h1m1 0h1m1 0h1m1 0h1m1 0h1m1 0h1m1 0h7M8 7.5h2m1 0h1m4 0h2m1 0h1M0 8.5h1m1 0h2m1 0h3m1 0h2m1 0h1m1 0h5m1 0h3m1 0h1m1 0h1m2 0h1m1 0h2M0 9.5h2m1 0h2m2 0h1m1 0h1m2 0h2m2 0h1m1 0h3m2 0h1m2 0h2m1 0h2m1 0h1M1 10.5h1m1 0h1m1 0h2m2 0h1m1 0h1m1 0h1m2 0h2m2 0h1m1 0h2m1 0h1m1 0h3m1 0h2M0 11.5h3m1 0h1m3 0h2m2 0h1m2 0h1m2 0h1m3 0h1m4 0h1m1 0h1m1 0h1M1 12.5h4m1 0h2m1 0h3m2 0h1m1 0h2m1 0h1m2 0h2m1 0h1m1 0h3M0 13.5h2m1 0h1m10 0h1m1 0h1m2 0h3m2 0h1m5 0h2M6 14.5h1m6 0h1m2 0h6m2 0h1m1 0h1m1 0h3M0 15.5h1m1 0h2m1 0h1m1 0h2m1 0h1m1 0h1m1 0h3m2 0h1m1 0h1m1 0h1m1 0h2m2 0h2M0 16.5h2m2 0h7m1 0h1m1 0h2m2 0h1m1 0h3m2 0h2m1 0h3M3 17.5h1m1 0h1m1 0h1m1 0h1m1 0h2m2 0h2m3 0h1m1 0h5m1 0h2m2 0h1M0 18.5h2m1 0h5m2 0h4m1 0h3m2 0h3m1 0h1m1 0h3m1 0h2M0 19.5h1m1 0h3m5 0h1m2 0h7m2 0h5m1 0h1m2 0h2M0 20.5h2m1 0h1m1 0h5m4 0h1m1 0h2m2 0h2m5 0h1m1 0h2m1 0h1M0 21.5h2m3 0h1m1 0h3m3 0h2m1 0h6m1 0h2m1 0h1m3 0h1m1 0h1M3 22.5h1m1 0h7m3 0h2m1 0h1m2 0h1m1 0h5m2 0h3M1 23.5h1m1 0h2m4 0h2m3 0h2m3 0h2m2 0h1m2 0h4m2 0h1M0 24.5h1m1 0h2m2 0h1m6 0h1m2 0h2m4 0h1m1 0h5m2 0h1M8 25.5h1m1 0h3m2 0h1m1 0h1m1 0h2m3 0h1m3 0h2M0 26.5h7m1 0h2m1 0h1m1 0h1m5 0h2m1 0h3m1 0h1m1 0h1m2 0h1M0 27.5h1m5 0h1m1 0h1m1 0h1m2 0h3m2 0h1m1 0h5m3 0h3M0 28.5h1m1 0h3m1 0h1m3 0h2m1 0h2m4 0h10m1 0h1M0 29.5h1m1 0h3m1 0h1m1 0h4m1 0h2m1 0h1m1 0h1m1 0h2m1 0h1m3 0h1m2 0h1m1 0h1M0 30.5h1m1 0h3m1 0h1m1 0h2m6 0h2m2 0h1m1 0h1m3 0h2m1 0h1M0 31.5h1m5 0h1m3 0h3m1 0h7m1 0h1m1 0h2m1 0h2m3 0h1M0 32.5h7m1 0h1m2 0h1m2 0h1m2 0h1m1 0h1m1 0h1m1 0h1m2 0h1m1 0h1m1 0h1\"/></svg>\n";
|
|
11
|
+
var CARD_ID = "dsh-pocket-ios-card";
|
|
12
|
+
|
|
13
|
+
function linkStyle(primary) {
|
|
14
|
+
return {
|
|
15
|
+
display: "inline-flex",
|
|
16
|
+
alignItems: "center",
|
|
17
|
+
gap: 6,
|
|
18
|
+
padding: "7px 12px",
|
|
19
|
+
borderRadius: 999,
|
|
20
|
+
fontSize: 13,
|
|
21
|
+
fontWeight: 600,
|
|
22
|
+
textDecoration: "none",
|
|
23
|
+
color: primary ? "#fff" : "#147A5E",
|
|
24
|
+
background: primary ? "#147A5E" : "rgba(20,122,94,.08)",
|
|
25
|
+
border: primary ? "1px solid #147A5E" : "1px solid rgba(20,122,94,.25)"
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function IOSCard() {
|
|
30
|
+
return React.createElement(
|
|
31
|
+
"div",
|
|
32
|
+
{ style: { display: "flex", gap: 18, alignItems: "flex-start", padding: 16, borderRadius: 14, border: "1px solid rgba(0,0,0,.08)", background: "rgba(20,122,94,.04)", marginBottom: 18 } },
|
|
33
|
+
React.createElement("div", {
|
|
34
|
+
style: { width: 132, height: 132, flex: "0 0 132px", background: "#fff", borderRadius: 10, padding: 8, border: "1px solid rgba(0,0,0,.06)", boxSizing: "border-box" },
|
|
35
|
+
dangerouslySetInnerHTML: { __html: QR_SVG }
|
|
36
|
+
}),
|
|
37
|
+
React.createElement(
|
|
38
|
+
"div",
|
|
39
|
+
{ style: { flex: 1, minWidth: 0 } },
|
|
40
|
+
React.createElement("div", { style: { fontWeight: 600, fontSize: 15, marginBottom: 6 } }, "在 iPhone 上使用 DSH"),
|
|
41
|
+
React.createElement(
|
|
42
|
+
"div",
|
|
43
|
+
{ style: { fontSize: 13, opacity: 0.72, lineHeight: 1.6, marginBottom: 10 } },
|
|
44
|
+
"用手机扫描二维码打开 DSH Pocket iOS 的 Release 页面,下载后用 AltStore / Sideloadly 或 Xcode 自签安装。装好后在 App 里扫描电脑上 dsh-pocket 的二维码即可连接本机 DSH。"
|
|
45
|
+
),
|
|
46
|
+
React.createElement(
|
|
47
|
+
"div",
|
|
48
|
+
{ style: { display: "flex", gap: 10, flexWrap: "wrap" } },
|
|
49
|
+
React.createElement("a", { href: RELEASE_URL, target: "_blank", rel: "noreferrer", style: linkStyle(true) }, "打开 Release 页面"),
|
|
50
|
+
React.createElement("a", { href: DOWNLOAD_URL, target: "_blank", rel: "noreferrer", style: linkStyle(false) }, "直接下载源码 zip")
|
|
51
|
+
)
|
|
52
|
+
)
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
var CARD_HTML =
|
|
57
|
+
'<div style="display:flex;gap:16px;align-items:flex-start;padding:16px;border-radius:14px;border:1px solid rgba(0,0,0,.08);background:rgba(20,122,94,.04);margin:0 0 16px 0;text-align:left">' +
|
|
58
|
+
'<div style="width:120px;height:120px;flex:0 0 120px;background:#fff;border-radius:10px;padding:6px;border:1px solid rgba(0,0,0,.06);box-sizing:border-box">' + QR_SVG + "</div>" +
|
|
59
|
+
'<div style="flex:1;min-width:0">' +
|
|
60
|
+
'<div style="font-weight:600;font-size:15px;margin-bottom:6px">在 iPhone 上使用 DSH</div>' +
|
|
61
|
+
'<div style="font-size:13px;opacity:.72;line-height:1.6;margin-bottom:10px">扫码打开 DSH Pocket iOS 的 Release 页面,下载后自签安装;装好后在 App 里扫描上方二维码连接本机 DSH。</div>' +
|
|
62
|
+
'<div style="display:flex;gap:10px;flex-wrap:wrap">' +
|
|
63
|
+
'<a href="' + RELEASE_URL + '" target="_blank" rel="noreferrer" style="display:inline-flex;align-items:center;padding:7px 12px;border-radius:999px;font-size:13px;font-weight:600;text-decoration:none;color:#fff;background:#147A5E">打开 Release 页面</a>' +
|
|
64
|
+
'<a href="' + DOWNLOAD_URL + '" target="_blank" rel="noreferrer" style="display:inline-flex;align-items:center;padding:7px 12px;border-radius:999px;font-size:13px;font-weight:600;text-decoration:none;color:#147A5E;background:rgba(20,122,94,.08);border:1px solid rgba(20,122,94,.25)">直接下载源码 zip</a>' +
|
|
65
|
+
"</div>" +
|
|
66
|
+
"</div>" +
|
|
67
|
+
"</div>";
|
|
68
|
+
|
|
69
|
+
/** 尽力把卡片插到「手机访问 → 局域网访问」上方;失败时不影响原生设置入口。 */
|
|
70
|
+
function insertCardInPocketPage() {
|
|
71
|
+
if (typeof document === "undefined") return;
|
|
72
|
+
if (document.getElementById(CARD_ID)) return;
|
|
73
|
+
var nodes = Array.prototype.slice.call(document.querySelectorAll("div,span,p"));
|
|
74
|
+
var label = null;
|
|
75
|
+
for (var i = 0; i < nodes.length; i++) {
|
|
76
|
+
var el = nodes[i];
|
|
77
|
+
if (el.childElementCount === 0 && (el.textContent || "").trim() === "局域网访问" && el.offsetParent !== null) { label = el; break; }
|
|
78
|
+
}
|
|
79
|
+
if (!label) return;
|
|
80
|
+
var container = label.parentElement;
|
|
81
|
+
for (var depth = 0; depth < 6 && container; depth++) {
|
|
82
|
+
if (container.querySelector("img,canvas,svg")) {
|
|
83
|
+
var card = document.createElement("div");
|
|
84
|
+
card.id = CARD_ID;
|
|
85
|
+
card.innerHTML = CARD_HTML;
|
|
86
|
+
container.insertBefore(card, container.firstChild);
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
container = container.parentElement;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
var observer = null;
|
|
94
|
+
function startObserver() {
|
|
95
|
+
if (typeof document === "undefined" || typeof MutationObserver === "undefined" || observer) return;
|
|
96
|
+
var run = function () { try { insertCardInPocketPage(); } catch (e) {} };
|
|
97
|
+
observer = new MutationObserver(run);
|
|
98
|
+
observer.observe(document.body, { childList: true, subtree: true });
|
|
99
|
+
run();
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function apply(ctx) {
|
|
103
|
+
try {
|
|
104
|
+
ctx.slots.inject("settings.section", function () {
|
|
105
|
+
return ctx.slots.register(
|
|
106
|
+
{ name: "settings.section", id: "pocket-ios", order: 0, label: function () { return "iOS 客户端"; } },
|
|
107
|
+
IOSCard
|
|
108
|
+
);
|
|
109
|
+
});
|
|
110
|
+
} catch (e) {}
|
|
111
|
+
startObserver();
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
module.exports = { apply: apply };
|
|
115
|
+
return module.exports;
|
|
116
|
+
}
|
|
117
|
+
});
|
package/cordis.patch.yml
ADDED
package/lib/index.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* dsh-pocket-ios 宿主入口。
|
|
3
|
+
* UI 全部在 client/client.js;宿主只做一次存在性检查,缺少 dsh-pocket 时给出提示。
|
|
4
|
+
*/
|
|
5
|
+
export const name = 'dsh-pocket-ios'
|
|
6
|
+
export const inject = []
|
|
7
|
+
|
|
8
|
+
export function apply(ctx) {
|
|
9
|
+
let hasPocket = false
|
|
10
|
+
try {
|
|
11
|
+
hasPocket = Boolean(ctx?.get?.('pocket'))
|
|
12
|
+
} catch {}
|
|
13
|
+
if (!hasPocket) {
|
|
14
|
+
ctx?.logger?.info?.('dsh-pocket-ios: 未检测到 dsh-pocket 服务;请确认已安装并启用 dsh-pocket(手机访问)插件。')
|
|
15
|
+
}
|
|
16
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,52 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-pocket-ios",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "在 DSH 设置页加入 iOS 客户端下载二维码与连接引导(配合 dsh-pocket + DSH Pocket iOS)",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "lib/index.js",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": "./lib/index.js",
|
|
9
|
+
"./client": "./client/client.js",
|
|
10
|
+
"./package.json": "./package.json"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"lib",
|
|
14
|
+
"client",
|
|
15
|
+
"cordis.patch.yml",
|
|
16
|
+
"README.md",
|
|
17
|
+
"LICENSE"
|
|
18
|
+
],
|
|
19
|
+
"keywords": [
|
|
20
|
+
"deepseek-harness",
|
|
21
|
+
"dsh",
|
|
22
|
+
"dsh-plugin",
|
|
23
|
+
"ios",
|
|
24
|
+
"mobile",
|
|
25
|
+
"pocket"
|
|
26
|
+
],
|
|
27
|
+
"dsh": {
|
|
28
|
+
"bundle": {
|
|
29
|
+
"patch": "./cordis.patch.yml"
|
|
30
|
+
},
|
|
31
|
+
"client": {
|
|
32
|
+
"inject": [
|
|
33
|
+
"@deepseek-ai/dsh-client-ui-slots"
|
|
34
|
+
],
|
|
35
|
+
"platform": "web"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"dsh-pocket": "^2.12.0"
|
|
40
|
+
},
|
|
41
|
+
"peerDependencies": {
|
|
42
|
+
"@deepseek-ai/cordis": "^4.0.1"
|
|
43
|
+
},
|
|
44
|
+
"engines": {
|
|
45
|
+
"node": ">=22"
|
|
46
|
+
},
|
|
47
|
+
"license": "GPL-2.0",
|
|
48
|
+
"repository": {
|
|
49
|
+
"type": "git",
|
|
50
|
+
"url": "git+https://github.com/jqlong17/dsh-pocket-ios.git"
|
|
51
|
+
}
|
|
52
|
+
}
|