Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Make legacy kit recovery URL configurable

Neeraj Gupta49e0c9233d33
diff --git a/mobile/packages/legacy/assets/legacy_kit_sheet_ducky.png b/mobile/packages/legacy/assets/legacy_kit_sheet_ducky.png
new file mode 100644
index 0000000000..ce07b74219
Binary files /dev/null and b/mobile/packages/legacy/assets/legacy_kit_sheet_ducky.png differ
diff --git a/mobile/packages/legacy/assets/legacy_kit_sheet_ente_wordmark.svg b/mobile/packages/legacy/assets/legacy_kit_sheet_ente_wordmark.svg
new file mode 100644
index 0000000000..b4c093b203
--- /dev/null
+++ b/mobile/packages/legacy/assets/legacy_kit_sheet_ente_wordmark.svg
@@ -0,0 +1,8 @@
+<svg preserveAspectRatio="none" width="100%" height="100%" overflow="visible" style="display: block;" viewBox="0 0 52 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<g id="ente">
+<path d="M13.6522 10.6225H4.54194C4.98205 11.6998 5.9679 12.2384 7.49949 12.2384C8.43252 12.2384 9.23352 11.9294 9.90249 11.3113L13.0713 13.5364C11.7862 15.1788 9.89369 16 7.39386 16C5.1581 16 3.36245 15.3466 2.0069 14.0397C0.668968 12.7152 0 11.0464 0 9.03313C0 7.03755 0.660166 5.36869 1.9805 4.02653C3.30083 2.68437 4.98205 2.01329 7.02417 2.01329C8.99586 2.01329 10.6243 2.67554 11.9094 4.00004C13.1945 5.30688 13.8371 6.96692 13.8371 8.98015C13.8371 9.59825 13.7755 10.1457 13.6522 10.6225ZM4.48913 7.57618H9.5592C9.22472 6.33998 8.39731 5.72189 7.07698 5.72189C5.72144 5.72189 4.85882 6.33998 4.48913 7.57618Z" fill="#08C225"/>
+<path d="M22.8458 2.01329C24.307 2.01329 25.4777 2.5166 26.3579 3.52322C27.2557 4.51218 27.7046 5.90732 27.7046 7.70863V15.6291H23.3211V8.26492C23.3211 7.59384 23.1451 7.0817 22.793 6.7285C22.4409 6.35764 21.9568 6.17222 21.3406 6.17222C20.6541 6.17222 20.1171 6.38414 19.7298 6.80798C19.3601 7.21416 19.1753 7.80576 19.1753 8.5828V15.6291H14.7918V2.38415H19.1753V3.70865C19.9675 2.57841 21.191 2.01329 22.8458 2.01329Z" fill="#08C225"/>
+<path d="M37.1707 2.38415V6.59605H34.8169V10.4371C34.8169 11.0022 35.0105 11.3643 35.3978 11.5232C35.8027 11.6645 36.5245 11.7086 37.5632 11.6556V15.6291C34.9577 15.947 33.1092 15.7086 32.0178 14.9139C30.9615 14.0839 30.4334 12.6269 30.4334 10.5431V6.59605H28.4529V2.38415H30.4334V4.91285e-05L34.8169 0V2.38415H37.1707Z" fill="#08C225"/>
+<path d="M51.8152 10.6225H42.7049C43.145 11.6998 44.1308 12.2384 45.6624 12.2384C46.5954 12.2384 47.3964 11.9294 48.0654 11.3113L51.2342 13.5364C49.9491 15.1788 48.0566 16 45.5568 16C43.321 16 41.5254 15.3466 40.1698 14.0397C38.8319 12.7152 38.1629 11.0464 38.1629 9.03313C38.1629 7.03755 38.8231 5.36869 40.1434 4.02653C41.4638 2.68437 43.145 2.01329 45.1871 2.01329C47.1588 2.01329 48.7872 2.67554 50.0723 4.00004C51.3574 5.30688 52 6.96692 52 8.98015C52 9.59825 51.9384 10.1457 51.8152 10.6225ZM42.6521 7.57618H47.7221C47.3876 6.33998 46.5602 5.72189 45.2399 5.72189C43.8844 5.72189 43.0217 6.33998 42.6521 7.57618Z" fill="#08C225"/>
+</g>
+</svg>
diff --git a/mobile/packages/legacy/assets/legacy_kit_sheet_hero_bg_left.svg b/mobile/packages/legacy/assets/legacy_kit_sheet_hero_bg_left.svg
new file mode 100644
index 0000000000..4391442194
--- /dev/null
+++ b/mobile/packages/legacy/assets/legacy_kit_sheet_hero_bg_left.svg
@@ -0,0 +1,3 @@
+<svg preserveAspectRatio="none" width="100%" height="100%" overflow="visible" style="display: block;" viewBox="0 0 391.313 261.08" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path id="Vector 603" d="M100.825 16.7423C89.3842 12.8992 65.9279 8.0388 53.7133 9.41943C53.4861 9.43762 53.2608 9.45711 53.0374 9.47791C50.2404 9.74205 47.4969 10.2119 44.8567 11.1654C41.6934 12.3923 38.5974 14.0579 38.171 18.187C37.6557 22.7229 40.7641 30.3149 47.4568 39.4135C47.5127 39.4902 47.569 39.5668 47.6257 39.6434C51.3295 44.521 56.1801 48.3756 61.7919 51.2921C128.887 74.7961 204.788 43.3967 275.461 28.1796C276.366 27.9537 277.281 27.7263 278.2 27.4989C296.195 23.1062 318.272 17.7759 333.689 17.8481C333.819 17.8493 333.949 17.8505 334.076 17.8519C343.512 18.0333 351.16 18.2434 358.52 20.2837C358.747 20.354 358.956 20.4218 359.183 20.4998C359.447 20.5903 359.703 20.6838 359.951 20.7811C360.466 20.9859 360.846 21.1511 361.41 21.4463C361.981 21.7521 362.463 22.0522 363.014 22.5077C363.66 23.0676 364.171 23.5697 364.697 24.6382C365.189 25.66 365.309 26.9224 365.079 27.9573C364.817 29.0863 364.479 29.6188 364.049 30.2641C363.294 31.3245 362.457 32.0198 361.773 32.5508C358.843 34.7 356.289 35.7224 353.79 36.7781C335.928 43.7273 317.663 46.9958 299.245 49.7488C279.586 52.7924 258.861 54.7062 241.335 62.1385C239.263 63.162 237.352 64.4088 236.414 65.7205C235.56 67.0072 235.635 67.7717 236.747 69.4667C239.087 72.6278 243.572 75.3031 247.747 77.5427C256.594 82.1555 265.745 85.5783 275.245 88.9203C280.778 90.8468 286.387 92.6727 292.318 94.5122C304.217 98.2032 315.979 102.305 327.527 106.942C343.362 113.369 358.887 120.51 373.196 130.171C377.447 133.057 381.345 136.016 384.817 139.509C387.973 143.01 392.411 147.159 391.066 154.009C389.618 158.743 385.371 160.444 382.608 161.435C379.515 162.46 376.623 162.885 373.747 163.175C368.265 163.697 362.902 163.539 358.512 163.279C345.551 162.467 331.87 160.054 319.226 157.372C310.347 155.48 301.941 153.501 294.603 151.697C291.7 150.983 288.976 150.3 286.442 149.657C272.346 146.219 258.323 142.523 244.335 138.771C243.409 138.486 242.478 138.197 241.533 137.903C229.712 134.259 215.129 130.113 192.015 124.157C181.944 121.596 170.265 118.702 156.432 115.849C147.508 114.029 142.931 113.116 139.187 112.367C138.085 112.15 137.082 111.956 136.015 111.764C132.37 111.112 128.61 110.713 124.042 110.347C118.212 109.902 111.115 109.456 101.858 109.198C72.2132 108.703 59.8698 115.296 51.4451 119.588C49.2243 120.809 47.25 122.022 45.2919 123.309C45.0373 123.476 44.7865 123.642 44.5391 123.807C37.343 128.249 27.953 137.376 33.6373 144.745C36.6536 150.711 49.4999 159.144 59.3421 164.601C63.0771 166.726 68.1391 169.611 74.1275 173.051C80.3224 176.624 87.5008 180.782 95.014 185.609C114.019 197.841 122.63 207.319 127.982 215.861C129.518 218.358 130.733 220.748 131.768 223.302C133.551 227.692 134.837 233.008 134.86 238.801C134.814 243.744 134.415 248.663 131.161 253.69C126.652 260.616 117.771 261.603 111.839 260.88C105.623 260.217 100.083 258.351 95.6989 256.73C72.6656 247.254 52.8058 233.099 33.4928 218.614C23.5395 211.027 14.6719 203.307 8.34432 196.943C2.30934 190.754 -1.07133 186.55 0.305568 185.298C0.412165 185.753 4.47953 188.326 11.2833 193.596C18.3084 198.952 27.5271 206.005 37.4317 213.391C57.2588 227.935 77.9667 242.318 100.57 250.792C107.187 253.086 114.444 254.878 120.162 253.283C125.742 251.915 127.874 245.663 127.767 238.801C127.897 224.439 118.126 211.921 106.704 202.363C90.9062 189.127 71.925 179.577 53.6283 168.587C51.8082 167.489 49.807 166.253 47.9974 165.092C40.4231 160.165 32.3969 155.403 27.3489 146.65C24.8327 142.306 24.7541 136.108 26.9396 131.982C29.0563 127.68 31.9001 125.033 34.3823 122.85C37.1506 120.513 39.1012 119.2 41.6776 117.566C47.2804 114.074 52.2131 111.901 56.6721 110.233C61.0249 108.622 64.9412 107.506 68.9401 106.515C71.0615 105.991 74.0642 105.32 77.6026 104.73C92.2411 101.937 117.362 102.423 139.482 106.37C149.333 108.004 160.634 110.444 171.303 113.055C186.597 116.789 200.665 120.77 207.801 122.593C220.353 125.813 234.636 129.872 247.253 133.397C259.282 136.765 269.838 139.629 275.876 141.039C283.107 142.729 289.216 144.343 298.337 146.614C304.122 148.046 311.118 149.746 320.404 151.728C321.31 151.921 322.227 152.113 323.154 152.304C335.34 154.802 344.123 156.219 351.585 157.125C361.934 158.155 370.291 159.368 380.993 156.397C383.776 155.475 386.084 153.741 386.048 151.9C386.186 149.882 384.519 147.159 382.58 144.925C378.627 140.41 373.64 136.798 369.24 133.767C365.108 130.953 360.455 128.19 355.192 125.37C348.399 121.73 341.03 118.269 334.126 115.207C328.571 112.743 323.874 110.703 319.668 108.94C318.315 108.375 317.138 107.887 315.922 107.396C311.298 105.681 306.705 104.068 301.985 102.493C301.21 102.261 300.39 102.019 299.572 101.781C297.078 101.055 294.199 100.236 290.844 99.2901C288.533 98.6365 286.11 97.9287 283.602 97.1591C273.367 93.9972 264.58 90.8408 255.441 86.887C248.378 83.5665 240.944 80.935 233.553 73.6728C232.36 72.2869 231.156 70.6878 230.76 68.244C230.336 65.8451 231.536 63.2217 232.949 61.7293C235.892 58.5971 239.373 57.1197 242.748 55.7011C252.882 51.7725 263.146 49.8975 270.203 48.5994C272.865 48.1341 275.159 47.8401 277.444 47.5582C277.454 47.5571 277.464 47.556 277.474 47.555C277.63 47.5358 277.786 47.5165 277.941 47.4974C284.776 46.3292 291.612 45.2795 298.44 44.2466C308.81 42.6725 319.04 40.7112 329.185 38.1875C330.586 37.819 332.123 37.4036 333.522 37.0084C340.579 35.0358 347.24 32.7198 351.303 30.7928C352.335 30.3031 353.904 29.5763 355.545 28.6154C356.358 28.136 357.208 27.5815 357.852 27.0127C358.156 26.7495 358.417 26.4397 358.448 26.361C358.464 26.3345 358.415 26.3644 358.361 26.6057C358.306 26.8311 358.329 27.2319 358.443 27.5015C358.561 27.7878 358.651 27.8527 358.644 27.8565C358.628 27.8459 358.544 27.7821 358.39 27.696C358.011 27.4887 357.634 27.3346 356.984 27.1232C356.474 26.9609 355.809 26.7867 355.116 26.6384C354.496 26.506 353.792 26.3766 352.999 26.2542C350.148 25.819 346.91 25.5799 343.619 25.444C340.394 25.3136 337.108 25.2818 333.689 25.311C328.801 25.3598 323.392 26.0556 319.135 26.7417C314.798 27.4419 310.975 28.0315 306.725 28.7614C302.986 29.4003 298.852 30.1812 294.639 31.1603C292.478 31.6618 290.09 32.259 287.681 32.8766C285.534 33.4262 283.167 34.0398 280.753 34.6567C278.61 35.2041 273.406 36.4299 267.092 37.9567C263.081 38.9266 258.61 40.0182 253.841 41.1972C241.359 44.462 228.839 47.7378 216.267 50.848C213.669 51.5718 211.415 52.2324 209.641 52.8089C208.367 53.2227 207.292 53.6094 206.189 54.0038C204.688 54.5407 203.132 55.0945 200.959 55.7452C199.26 56.2539 197.236 56.7591 195.855 57.0182C195.213 57.139 194.714 57.2066 194.261 57.2679C193.742 57.3382 193.279 57.4006 192.724 57.5239C192.324 57.6129 191.914 57.7348 191.41 57.8836C190.604 58.121 189.556 58.429 187.937 58.7788C181.895 60.0849 175.04 61.4536 168.233 62.6847C160.725 64.0473 153.337 65.2177 147.362 66.084C140.778 67.0479 131.221 68.1091 121.609 68.6067C114.873 68.9662 108.14 69.0432 102.331 68.8756C96.6369 68.7169 90.731 68.3825 84.8974 67.6269C78.0225 66.7537 71.249 65.203 65.8446 63.1319C64.7761 62.7253 63.3637 62.0579 61.7358 61.1814C60.5707 60.5546 59.2814 59.8181 57.8175 58.9248C51.1807 55.4835 45.1428 50.6946 40.5819 44.5475C40.5467 44.5002 40.5116 44.453 40.4765 44.4058C40.3002 44.1973 40.1204 43.983 39.942 43.7695C39.9391 43.7662 39.9362 43.7629 39.9332 43.7596C36.486 38.9806 29.6747 33.2942 28.6567 19.21C28.7325 15.549 29.7667 13.0959 30.8962 11.2307C32.0571 9.38206 33.3358 7.95169 35.4128 6.30887C37.7142 4.49832 40.8071 2.96739 43.9482 1.98139C48.485 0.542377 53.5584 -0.0812159 58.5484 0.00842428C58.8809 0.0147338 59.2398 0.0237565 59.6151 0.0353589C63.2489 0.132268 68.4347 0.594842 73.5485 1.5682C88.7271 3.80287 103.462 7.74909 117.42 14.7448C121.219 16.815 125.044 18.8385 128.357 22.8592C141.201 35.2336 164.716 37.8286 184.262 37.3715C196.015 36.8781 207.129 34.4787 214.063 30.3306C221.055 26.2606 222.833 21.4353 223.683 21.7878C224.369 21.8117 224.033 27.9899 216.561 33.9435C209.205 39.8524 197.055 43.2 184.607 43.9048C164.381 44.4388 143.552 43.3647 125.178 30.2207C124.29 29.457 123.319 28.4873 122.529 27.5002C122.51 27.4761 122.491 27.452 122.471 27.4278C118.781 23.3913 111.569 20.4578 105.345 18.2292C103.833 17.6988 102.35 17.2142 100.825 16.7423Z" fill="#43E45B" fill-opacity="0.18"/>
+</svg>
diff --git a/mobile/packages/legacy/assets/legacy_kit_sheet_hero_bg_right.svg b/mobile/packages/legacy/assets/legacy_kit_sheet_hero_bg_right.svg
new file mode 100644
index 0000000000..b5045a18e8
--- /dev/null
+++ b/mobile/packages/legacy/assets/legacy_kit_sheet_hero_bg_right.svg
@@ -0,0 +1,3 @@
+<svg preserveAspectRatio="none" width="100%" height="100%" overflow="visible" style="display: block;" viewBox="0 0 160.786 145.471" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path id="Vector 604" d="M129.175 16.997C126.035 19.3227 119.556 21.6049 116.065 22.6377C116.002 22.6568 115.94 22.676 115.877 22.6952C115.066 22.941 114.286 23.1861 113.346 23.4725C111.184 24.1211 108.189 25.0352 101.946 26.3581C100.153 26.8172 98.3467 27.2549 96.5402 27.6696C87.3954 29.7645 78.1756 31.373 68.8846 32.6197C58.547 34.0056 48.2204 35.353 38.0322 37.0914C37.7895 37.14 37.5434 37.1896 37.2955 37.2399C32.5022 38.1989 26.6719 39.5603 23.0292 40.4205C18.3914 41.4952 15.3111 42.4217 12.9791 43.2591C-6.55073 48.7104 18.0653 59.9827 30.1235 65.0501C34.4764 66.848 38.9955 68.5421 43.7697 70.2081C47.7587 71.6015 52.3787 73.1167 56.46 74.3893C58.2681 74.9009 60.0676 75.3917 61.8254 75.8622C62.4915 76.0401 63.1422 76.2147 63.7766 76.3861C66.9818 77.2524 69.7485 78.0305 72.0297 78.748C77.6526 80.5127 83.7876 82.8453 88.305 84.6586C89.0429 84.9538 89.7038 85.2214 90.3813 85.4947C94.142 86.8722 97.5878 88.1794 101.324 89.6685C101.553 89.7986 101.783 89.9308 102.016 90.0654C104.863 91.7277 108.709 93.3469 114.478 96.0324C117.102 97.2604 119.861 98.5838 123.363 100.416C125.566 101.574 126.482 102.263 127.4 102.915C127.656 103.099 127.894 103.272 128.138 103.44C128.972 104.016 129.944 104.423 131.067 104.905C132.466 105.497 134.374 106.354 136.409 107.823C143.033 112.631 145.982 114.48 148.404 115.981C149.105 116.425 149.721 116.827 150.308 117.266C152.273 118.724 154.803 121.326 156.336 123.557C157.574 125.42 160.626 128.795 160.779 133.439C160.874 135.071 160.007 137.742 158.184 139.439C156.229 141.333 153.915 142.355 151.301 143.233C144.899 145.134 141.739 145.045 139.109 145.298C138.347 145.346 137.602 145.381 136.869 145.409C134.876 145.501 131.85 145.487 129.265 145.396C126.062 145.29 122.622 145.046 120.194 144.879C113.572 144.057 107.336 142.972 100.953 141.711C97.4803 141.025 94.7568 140.119 92.4845 139.044C90.2789 137.98 89.0876 136.915 89.2588 136.11C89.4245 135.303 90.9383 134.812 93.3596 134.676C95.8478 134.553 98.6658 134.724 102.1 135.27C108.637 136.297 114.942 137.127 121.623 137.727C129.506 138.398 137.529 138.801 144.936 137.849C150.026 137.311 155.19 134.99 154.421 132.877C154.401 132.604 154.344 132.279 154.233 131.901C153.076 128.891 149.55 125.612 147.315 123.673C145.369 121.989 143.895 120.708 142.658 119.651C141.822 118.939 141.036 118.298 140.17 117.697C139.697 117.369 139.064 116.943 138.334 116.467C135.232 114.416 129.767 111.187 124.717 108.25C122.465 106.93 119.939 105.425 117.362 103.965C113.882 101.973 110.315 100.088 108.592 99.3846C105.423 98.0783 101.87 96.4326 98.6938 95.0215C95.5754 93.637 93.033 92.5548 91.4184 92.0714C89.5295 91.5108 87.904 90.8156 85.665 89.8737C84.0834 89.2109 82.1248 88.3987 79.3578 87.3789C76.2664 86.2401 74.0769 85.3727 72.1818 84.6307C69.467 83.5741 67.5879 82.8485 64.4847 82.0586C63.0872 81.7043 61.6556 81.3326 60.254 80.9548C58.1385 80.3815 56.1829 79.799 54.5575 79.2391C53.2966 78.8052 51.9287 78.3722 50.426 77.8883C48.3305 77.2132 46.2104 76.5142 44.3728 75.8047C42.8818 75.2282 41.634 74.6232 40.479 74.0643C40.1257 73.8924 39.7895 73.7281 39.4652 73.5729C38.1996 73.1227 36.9692 72.6782 35.773 72.2401C35.5707 72.1926 35.3583 72.1441 35.1379 72.0933C34.0012 71.827 32.4484 71.4342 30.7586 70.87C28.1681 70.0101 25.6939 68.8989 23.3749 67.7861C21.7065 66.9814 19.4373 65.8692 17.3692 64.8805C15.8759 64.1697 13.9693 63.2529 12.405 62.4367C11.0436 61.7206 9.77752 60.9996 8.72896 60.3384C7.53444 59.5831 6.50037 58.8287 5.77755 58.2093C5.20345 57.7215 4.67443 57.1297 4.2702 56.6108C4.26846 56.6083 4.26674 56.6059 4.26501 56.6034C4.23666 56.5674 4.20829 56.5314 4.18035 56.4954C2.38066 54.752 0.234355 52.5828 0.00243258 48.9268C-0.0907941 45.1444 2.51467 42.6233 4.51301 41.0905C4.87727 40.7903 5.29605 40.4772 5.62856 40.2361C7.43365 38.9442 9.21614 38.0058 10.4407 37.2954C11.6154 36.574 15.0153 35.1642 18.5106 34.0363C20.8694 33.2636 23.1918 32.5868 25.1697 32.0038C26.285 31.673 27.4035 31.5198 28.5718 31.3679C29.6478 31.2295 30.7098 31.1043 31.8923 30.8314C32.477 30.6963 33.1351 30.5175 33.7884 30.3392C34.3691 30.181 34.9877 30.0147 35.6442 29.8601C36.2443 29.7183 37.6723 29.4995 39.4073 29.2537C40.4918 29.0993 41.745 28.9249 43.0511 28.7383C46.4363 28.0808 49.8583 27.4578 53.2725 26.8625C53.9689 26.6611 54.5689 26.4485 55.0355 26.2232C55.3703 26.0616 55.65 25.8872 55.9377 25.7089C56.3291 25.4661 56.7347 25.2153 57.3108 24.9771C57.7603 24.791 58.3019 24.662 58.6784 24.6538C58.8536 24.65 58.992 24.6719 59.1175 24.6917C59.2613 24.7144 59.3897 24.7345 59.5391 24.7108C59.6468 24.6937 59.7545 24.6461 59.887 24.5881C60.0985 24.4955 60.3739 24.3757 60.8098 24.3077C62.4316 24.0545 64.2845 23.8054 66.0918 23.5648C66.5764 23.5003 67.0579 23.4363 67.5311 23.3729C69.0161 23.174 70.4122 22.9712 71.5695 22.771C73.2841 22.4752 75.7592 22.1863 78.2323 21.8658C79.9785 21.6392 81.6502 21.4117 83.1557 21.1572C84.6178 20.9103 86.0462 20.5627 87.509 20.1992C89.248 19.7663 90.842 19.3505 92.3062 19.1297C92.5972 19.0862 92.9793 19.1293 93.4562 19.1822C93.7941 19.2197 94.1818 19.2617 94.6148 19.2823C96.4121 18.8696 98.1969 18.4471 99.9828 18.008C100.042 17.9755 100.104 17.9422 100.165 17.9086C100.166 17.9079 100.167 17.9073 100.168 17.9066C101.544 17.1475 103.4 16.1104 106.231 15.6471C106.934 15.5334 107.458 15.5402 107.891 15.5563C108.324 15.57 108.709 15.582 109.221 15.4545C109.798 15.3109 110.451 15.0251 111.184 14.6998C112.208 14.2444 113.253 13.7555 114.487 13.4708C114.569 13.4522 114.656 13.4323 114.747 13.4113C115.596 13.217 116.876 12.9075 118.173 12.7062C121.639 11.4449 125.583 9.79926 127.496 8.12132C127.664 7.96773 127.758 7.85464 127.78 7.83559C127.788 7.83216 127.772 7.8662 127.75 7.9454C127.722 8.03801 127.688 8.19888 127.689 8.39509C127.673 8.79216 127.903 9.27148 128.003 9.3613C128.114 9.48325 128.076 9.40191 127.961 9.31793C127.679 9.10517 127.185 8.8518 126.503 8.60036C125.939 8.38673 125.181 8.16247 124.473 7.98472C121.531 7.25895 118.381 6.86575 115.152 6.55865C111.943 6.26157 108.922 5.81032 106.726 5.17131C104.519 4.53294 103.128 3.75888 103.135 2.94974C103.128 2.14324 104.522 1.3554 106.789 0.77898C109.044 0.205121 112.182 -0.100799 115.576 0.0299568C118.217 0.130671 121.071 0.3227 123.762 0.698828C125.275 0.919303 126.608 1.15417 128.137 1.57287C129.66 2.06501 131.24 2.34477 133.351 4.27179C133.813 4.73409 134.209 5.1797 134.63 6.03125C135.386 7.50663 135.308 9.45904 134.828 10.6789C134.429 11.8111 133.787 12.6855 133.335 13.2551C133.085 13.5654 132.813 13.8673 132.551 14.1379C132.329 14.3723 132.101 14.5994 131.864 14.8217C131.383 15.2713 130.888 15.6844 130.462 16.0294C130.058 16.3561 129.594 16.6984 129.175 16.997Z" fill="#43E45B" fill-opacity="0.18"/>
+</svg>
diff --git a/mobile/packages/legacy/assets/legacy_kit_sheet_logo.svg b/mobile/packages/legacy/assets/legacy_kit_sheet_logo.svg
new file mode 100644
index 0000000000..5a4bf5b0f2
--- /dev/null
+++ b/mobile/packages/legacy/assets/legacy_kit_sheet_logo.svg
@@ -0,0 +1,7 @@
+<svg preserveAspectRatio="none" width="100%" height="100%" overflow="visible" style="display: block;" viewBox="0 0 30.5575 31.547" fill="none" xmlns="http://www.w3.org/2000/svg">
+<g id="Outer Logo">
+<rect id="Heart Icon" x="8.37332" y="8.38851" width="13.7786" height="16.7401" fill="#1C1C1C"/>
+<path id="Vector" d="M15.61 0.289638C17.1535 0.289638 18.6676 0.510718 20.109 0.947841H20.108C21.3974 1.31956 22.6337 1.89417 23.7828 2.6539C24.8955 3.38961 25.9086 4.28634 26.7935 5.31991C27.6702 6.3438 28.4033 7.48072 28.9723 8.69784C29.5512 9.93609 29.9489 11.2332 30.1529 12.5533L30.2008 12.8853C30.2969 13.6576 30.2899 14.4173 30.1793 15.1471C30.0508 15.9953 29.7847 16.7868 29.3863 17.4976C28.9744 18.2324 28.4316 18.8628 27.774 19.3687C27.2199 19.7951 26.5943 20.1224 25.9117 20.3502C26.6794 20.9606 27.2229 21.7946 27.4879 22.7623C27.7488 23.617 27.8126 24.4472 27.6666 25.2252C27.53 25.9525 27.2113 26.6317 26.7252 27.2428C25.8585 28.3321 24.5872 29.0585 23.4986 29.6109L23.4967 29.6119L23.4879 29.6168L23.484 29.6187L23.4752 29.6226C21.4563 30.5992 19.1633 31.152 16.8053 31.2418L16.8209 31.2574H16.1246L16.1236 31.2564C12.6342 31.2563 9.2876 30.2338 6.69882 28.3648L6.40292 28.1568C4.94134 27.0973 3.70046 25.7527 2.70956 24.1578C1.705 22.5408 1.0008 20.7394 0.61581 18.8053C0.235123 16.8917 0.18785 14.9538 0.475185 13.0475C0.772576 11.0739 1.41509 9.23695 2.38632 7.58944C3.68681 5.32325 5.64971 3.44786 8.06015 2.16269C10.3585 0.937266 12.9689 0.289684 15.61 0.289638ZM18.3004 20.8082H15.7369C14.777 20.8082 13.6939 20.8093 12.5943 20.8111C12.8833 20.9512 13.211 21.0659 13.5641 21.1568C14.2672 21.3379 15.0476 21.4176 15.775 21.4176C16.7406 21.4176 17.6984 21.285 18.4 21.0621H18.401L18.4273 21.0533C18.7844 20.9407 18.9852 20.8749 19.1607 20.8072C18.8645 20.8073 18.5766 20.8082 18.3004 20.8082ZM15.5328 10.0601C14.0524 10.0602 12.7838 10.5949 12.023 11.4547L12.3463 11.4557C13.64 11.4578 15.1064 11.4605 16.5094 11.4605C17.5003 11.4605 18.3516 11.4581 19.0836 11.4557C18.2925 10.5377 17.0569 10.1304 16.0123 10.0719L15.7769 10.065H15.7516V10.0641H15.7359V10.0631C15.6687 10.0607 15.6001 10.0601 15.5328 10.0601Z" fill="#1C1C1C" stroke="#1C1C1C" stroke-width="0.579677"/>
+<path id="Vector_2" d="M11.3556 19.432C14.9589 19.4217 18.6831 19.4323 22.2703 19.4236C23.2203 19.4197 24.1889 19.4163 25.1073 19.1513C27.9071 18.4282 29.2795 15.7908 28.7896 12.7701C28.0452 7.93838 24.4394 3.62881 19.716 2.27184C13.7782 0.467521 6.72309 2.79695 3.57956 8.28471C-0.0231441 14.3895 1.58836 23.1988 7.49073 27.2331C11.8003 30.3555 18.1243 30.6773 22.8743 28.3798C25.032 27.2847 27.0106 25.8931 26.1634 23.1493C25.6812 21.3426 23.8737 20.3487 22.1673 20.9324C21.6018 21.1013 21.0848 21.393 20.5686 21.6646C19.7974 22.0713 19.6589 22.1134 18.8194 22.3782C16.3924 23.1497 11.4831 23.0559 10.226 20.3867C10.0507 19.6203 10.7429 19.4314 11.3533 19.432H11.3558H11.3556ZM10.5844 12.7533C10.3166 12.6543 10.1383 12.3959 10.1518 12.1105C10.1589 11.8633 10.2697 11.6231 10.3849 11.4056C11.3823 9.53196 13.5903 8.60704 15.786 8.68373C17.8392 8.69651 19.9906 9.72118 20.8629 11.715C20.9294 11.8832 20.9712 12.0581 20.9491 12.2281C20.8869 12.6753 20.4782 12.8329 20.0771 12.8329C17.5317 12.8482 13.7062 12.8382 11.0615 12.8345C10.9084 12.8296 10.7388 12.814 10.5872 12.7545L10.5844 12.7534V12.7533Z" fill="white"/>
+</g>
+</svg>
diff --git a/mobile/packages/legacy/lib/models/legacy_kit_models.dart b/mobile/packages/legacy/lib/models/legacy_kit_models.dart
index 3afe037caf..79bf9ec50e 100644
--- a/mobile/packages/legacy/lib/models/legacy_kit_models.dart
+++ b/mobile/packages/legacy/lib/models/legacy_kit_models.dart
@@ -2,6 +2,8 @@ import "dart:convert";
import "package:ente_rust/ente_rust.dart" as rust;
+const String defaultLegacyRecoveryUrl = "https://legacy.ente.com";
+
enum LegacyKitRecoveryStatus {
waiting,
ready,
@@ -102,6 +104,7 @@ class LegacyKitPart {
class LegacyKit {
final String id;
final int noticePeriodInHours;
+ final String legacyUrl;
final List<LegacyKitPart> parts;
final int createdAt;
final int updatedAt;
@@ -110,6 +113,7 @@ class LegacyKit {
const LegacyKit({
required this.id,
required this.noticePeriodInHours,
+ required this.legacyUrl,
required this.parts,
required this.createdAt,
required this.updatedAt,
@@ -120,6 +124,9 @@ class LegacyKit {
return LegacyKit(
id: kit.id,
noticePeriodInHours: kit.noticePeriodInHours,
+ legacyUrl: kit.legacyUrl.trim().isEmpty
+ ? defaultLegacyRecoveryUrl
+ : kit.legacyUrl,
parts: kit.metadata.parts.map(LegacyKitPart.fromRust).toList(
growable: false,
),
diff --git a/mobile/packages/legacy/lib/pages/legacy_kit_page.dart b/mobile/packages/legacy/lib/pages/legacy_kit_page.dart
index 1ef9388082..1a25627653 100644
--- a/mobile/packages/legacy/lib/pages/legacy_kit_page.dart
+++ b/mobile/packages/legacy/lib/pages/legacy_kit_page.dart
@@ -242,6 +242,7 @@ class _LegacyKitPageState extends State<LegacyKitPage> {
_kit = LegacyKit(
id: _kit.id,
noticePeriodInHours: selectedDays * 24,
+ legacyUrl: _kit.legacyUrl,
parts: _kit.parts,
createdAt: _kit.createdAt,
updatedAt: _kit.updatedAt,
@@ -314,6 +315,7 @@ class _LegacyKitPageState extends State<LegacyKitPage> {
for (final share in sortedShares) {
final bytes = await const LegacyKitPdfService().buildRecoverySheet(
accountEmail: widget.accountEmail,
+ recoveryUrl: _kit.legacyUrl,
share: share,
allShares: shares,
);
@@ -347,6 +349,7 @@ class _LegacyKitPageState extends State<LegacyKitPage> {
}
final bytes = await const LegacyKitPdfService().buildRecoverySheet(
accountEmail: widget.accountEmail,
+ recoveryUrl: _kit.legacyUrl,
share: share,
allShares: shares,
);
diff --git a/mobile/packages/legacy/lib/services/legacy_kit_pdf_service.dart b/mobile/packages/legacy/lib/services/legacy_kit_pdf_service.dart
index 26653b5393..ed9e6cbeee 100644
--- a/mobile/packages/legacy/lib/services/legacy_kit_pdf_service.dart
+++ b/mobile/packages/legacy/lib/services/legacy_kit_pdf_service.dart
@@ -1,7 +1,7 @@
import "dart:convert";
-import "dart:typed_data";
import "package:ente_legacy/models/legacy_kit_models.dart";
+import "package:flutter/services.dart";
import "package:pdf/pdf.dart";
import "package:pdf/widgets.dart" as pw;
@@ -9,10 +9,23 @@ class LegacyKitPdfService {
const LegacyKitPdfService();
static const String _shareMetadataPrefix = "ente-legacy-kit-share-v1:";
+ static const String _assetRoot = "packages/ente_legacy/assets";
+ static const String _duckyAsset = "$_assetRoot/legacy_kit_sheet_ducky.png";
+ static const String _heroBgLeftAsset =
+ "$_assetRoot/legacy_kit_sheet_hero_bg_left.svg";
+ static const String _heroBgRightAsset =
+ "$_assetRoot/legacy_kit_sheet_hero_bg_right.svg";
+ static const String _logoAsset = "$_assetRoot/legacy_kit_sheet_logo.svg";
+ static const String _enteWordmarkAsset =
+ "$_assetRoot/legacy_kit_sheet_ente_wordmark.svg";
+ static const String _interRegularAsset = "assets/fonts/Inter-Regular.ttf";
+ static const String _interMediumAsset = "assets/fonts/Inter-Medium.ttf";
+ static const String _interBoldAsset = "assets/fonts/Inter-Bold.ttf";
static const PdfPageFormat _sheetPageFormat = PdfPageFormat(676, 900);
static const PdfColor _background = PdfColor.fromInt(0xFFFAFAFA);
static const PdfColor _green = PdfColor.fromInt(0xFF08C225);
+ static const PdfColor _heroBadge = PdfColor.fromInt(0xFF057C18);
static const PdfColor _dark = PdfColor.fromInt(0xFF212121);
static const PdfColor _black = PdfColor.fromInt(0xFF000000);
static const PdfColor _white = PdfColor.fromInt(0xFFFFFFFF);
@@ -21,17 +34,78 @@ class LegacyKitPdfService {
Future<Uint8List> buildRecoverySheet({
required String accountEmail,
+ required String recoveryUrl,
required LegacyKitShare share,
required List<LegacyKitShare> allShares,
}) async {
+ final assets = await _loadAssets();
final sortedShares = _sortedShares(allShares);
final pdf = _document(
keywords: _shareMetadata(share),
);
- pdf.addPage(_buildPage(accountEmail, share, sortedShares));
+ pdf.addPage(
+ _buildPage(accountEmail, recoveryUrl, share, sortedShares, assets),
+ );
return pdf.save();
}
+ static String displayRecoveryUrl(String recoveryUrl) {
+ final normalized = recoveryUrl.trim().replaceFirst(RegExp(r"/+$"), "");
+ if (normalized.isEmpty) {
+ return "legacy.ente.com";
+ }
+ return normalized.replaceFirst(RegExp(r"^https?://"), "");
+ }
+
+ Future<_SheetAssets> _loadAssets() async {
+ final interRegular = await _loadFont(_interRegularAsset);
+ final interMedium = await _loadFont(_interMediumAsset);
+ final interBold = await _loadFont(_interBoldAsset);
+ final baseFont = interMedium ?? interRegular;
+
+ return _SheetAssets(
+ duckyImage: await _loadImage(_duckyAsset),
+ heroBgLeftSvg: await _loadSvg(_heroBgLeftAsset),
+ heroBgRightSvg: await _loadSvg(_heroBgRightAsset),
+ logoSvg: await _loadSvg(_logoAsset),
+ enteWordmarkSvg: await _loadSvg(_enteWordmarkAsset),
+ theme: baseFont == null && interBold == null
+ ? null
+ : pw.ThemeData.withFont(
+ base: baseFont,
+ bold: interBold ?? baseFont,
+ ),
+ );
+ }
+
+ Future<String?> _loadSvg(String asset) async {
+ try {
+ return await rootBundle.loadString(asset);
+ } catch (_) {
+ return null;
+ }
+ }
+
+ Future<Uint8List?> _loadImage(String asset) async {
+ try {
+ final bytes = await rootBundle.load(asset);
+ return bytes.buffer.asUint8List(
+ bytes.offsetInBytes,
+ bytes.lengthInBytes,
+ );
+ } catch (_) {
+ return null;
+ }
+ }
+
+ Future<pw.Font?> _loadFont(String asset) async {
+ try {
+ return pw.Font.ttf(await rootBundle.load(asset));
+ } catch (_) {
+ return null;
+ }
+ }
+
pw.Document _document({required String keywords}) {
return pw.Document(
title: "Ente Legacy Kit",
@@ -53,20 +127,25 @@ class LegacyKitPdfService {
pw.Page _buildPage(
String accountEmail,
+ String recoveryUrl,
LegacyKitShare share,
List<LegacyKitShare> sortedShares,
+ _SheetAssets assets,
) {
return pw.Page(
pageFormat: _sheetPageFormat,
margin: pw.EdgeInsets.zero,
+ theme: assets.theme,
build: (context) {
final otherShares = sortedShares
.where((item) => item.shareIndex != share.shareIndex)
.toList(growable: false);
return _buildSheet(
accountEmail: accountEmail,
+ recoveryUrl: recoveryUrl,
share: share,
otherShares: otherShares,
+ assets: assets,
);
},
);
@@ -74,8 +153,10 @@ class LegacyKitPdfService {
pw.Widget _buildSheet({
required String accountEmail,
+ required String recoveryUrl,
required LegacyKitShare share,
required List<LegacyKitShare> otherShares,
+ required _SheetAssets assets,
}) {
final qrPayload = share.toQrPayload();
final copyCode = share.toCopyCode();
@@ -85,9 +166,9 @@ class LegacyKitPdfService {
child: pw.Column(
crossAxisAlignment: pw.CrossAxisAlignment.start,
children: [
- _header(),
+ _header(assets),
pw.SizedBox(height: 29),
- _hero(accountEmail, share),
+ _hero(accountEmail, share, assets),
pw.SizedBox(height: 32),
pw.Text(
"How to recover the account?",
@@ -98,7 +179,7 @@ class LegacyKitPdfService {
),
),
pw.SizedBox(height: 12),
- _recoveryBlock(qrPayload, copyCode, otherShares),
+ _recoveryBlock(qrPayload, copyCode, otherShares, recoveryUrl),
pw.Spacer(),
pw.Center(
child: pw.Text(
@@ -116,43 +197,44 @@ class LegacyKitPdfService {
);
}
- pw.Widget _header() {
+ pw.Widget _header(_SheetAssets assets) {
+ final logoSvg = assets.logoSvg;
+ final enteWordmarkSvg = assets.enteWordmarkSvg;
return pw.Row(
mainAxisSize: pw.MainAxisSize.min,
children: [
- pw.Container(
- width: 29,
- height: 29,
- decoration: pw.BoxDecoration(
- border: pw.Border.all(color: _black, width: 1.6),
- shape: pw.BoxShape.circle,
- ),
- child: pw.Center(
- child: pw.Text(
- "e",
- style: pw.TextStyle(
- color: _black,
- fontSize: 22,
- fontWeight: pw.FontWeight.bold,
+ logoSvg == null
+ ? _fallbackHeaderLogo()
+ : pw.SizedBox(
+ width: 29.4,
+ height: 30.4,
+ child: pw.SvgImage(svg: logoSvg),
),
- ),
- ),
- ),
pw.SizedBox(width: 10),
pw.Column(
crossAxisAlignment: pw.CrossAxisAlignment.start,
children: [
- pw.Text(
- "ente",
- style: pw.TextStyle(
- color: _green,
- fontSize: 22,
- fontWeight: pw.FontWeight.bold,
- ),
- ),
+ enteWordmarkSvg == null
+ ? pw.Text(
+ "ente",
+ style: pw.TextStyle(
+ color: _green,
+ fontSize: 22,
+ fontWeight: pw.FontWeight.bold,
+ ),
+ )
+ : pw.SizedBox(
+ width: 52,
+ height: 16,
+ child: pw.SvgImage(svg: enteWordmarkSvg),
+ ),
+ pw.SizedBox(height: 4),
pw.Text(
"Legacy Kit",
- style: const pw.TextStyle(color: _muted, fontSize: 12),
+ style: const pw.TextStyle(
+ color: _muted,
+ fontSize: 12,
+ ),
),
],
),
@@ -160,85 +242,130 @@ class LegacyKitPdfService {
);
}
- pw.Widget _hero(String accountEmail, LegacyKitShare share) {
+ pw.Widget _fallbackHeaderLogo() {
return pw.Container(
- width: 592,
- height: 213,
- padding: const pw.EdgeInsets.all(24),
- decoration: const pw.BoxDecoration(
- color: _green,
- borderRadius: pw.BorderRadius.all(pw.Radius.circular(24)),
+ width: 29,
+ height: 29,
+ decoration: pw.BoxDecoration(
+ border: pw.Border.all(color: _black, width: 1.6),
+ shape: pw.BoxShape.circle,
),
- child: pw.Row(
- crossAxisAlignment: pw.CrossAxisAlignment.center,
- children: [
- pw.SizedBox(
- width: 344,
- child: pw.Column(
- crossAxisAlignment: pw.CrossAxisAlignment.start,
- mainAxisAlignment: pw.MainAxisAlignment.center,
- children: [
- pw.Text(
- "HELD BY",
- style: const pw.TextStyle(
- color: _white,
- fontSize: 14,
- letterSpacing: 2.2,
- ),
- ),
- pw.SizedBox(height: 6),
- pw.Text(
- share.partName,
- style: pw.TextStyle(
- color: _white,
- fontSize: 32,
- fontWeight: pw.FontWeight.bold,
- ),
+ child: pw.Center(
+ child: pw.Text(
+ "e",
+ style: pw.TextStyle(
+ color: _black,
+ fontSize: 22,
+ fontWeight: pw.FontWeight.bold,
+ ),
+ ),
+ ),
+ );
+ }
+
+ pw.Widget _hero(
+ String accountEmail,
+ LegacyKitShare share,
+ _SheetAssets assets,
+ ) {
+ return pw.ClipRRect(
+ horizontalRadius: 24,
+ verticalRadius: 24,
+ child: pw.Container(
+ width: 592,
+ height: 213,
+ color: _green,
+ child: pw.Stack(
+ fit: pw.StackFit.expand,
+ children: [
+ if (assets.heroBgLeftSvg != null)
+ pw.Positioned(
+ left: 13,
+ top: -24,
+ child: pw.SizedBox(
+ width: 388,
+ height: 253,
+ child: pw.SvgImage(svg: assets.heroBgLeftSvg!),
),
- pw.SizedBox(height: 12),
- pw.Container(
- padding: const pw.EdgeInsets.symmetric(
- horizontal: 14,
- vertical: 8,
- ),
- decoration: const pw.BoxDecoration(
- color: PdfColor(0, 0, 0, 0.36),
- borderRadius: pw.BorderRadius.all(pw.Radius.circular(12)),
- ),
- child: pw.Text(
- "Legacy Kit for $accountEmail",
- style: const pw.TextStyle(color: _white, fontSize: 14),
- ),
+ ),
+ if (assets.heroBgRightSvg != null)
+ pw.Positioned(
+ left: 400.5,
+ top: -6.5,
+ child: pw.SizedBox(
+ width: 155,
+ height: 139,
+ child: pw.SvgImage(svg: assets.heroBgRightSvg!),
),
- pw.SizedBox(height: 14),
- pw.Text(
- "This sheet is one part of a recovery key. If $accountEmail loses access, this and any one other can recover their account.",
- style: const pw.TextStyle(
- color: PdfColor(1, 1, 1, 0.86),
- fontSize: 12,
- lineSpacing: 3,
- ),
+ ),
+ pw.Positioned(
+ left: 24,
+ top: 24,
+ child: _heroCopy(accountEmail, share),
+ ),
+ if (assets.duckyImage != null)
+ pw.Positioned(
+ left: 386,
+ top: 37,
+ child: pw.Image(
+ pw.MemoryImage(assets.duckyImage!),
+ width: 158,
+ height: 152,
+ fit: pw.BoxFit.contain,
),
- ],
+ ),
+ ],
+ ),
+ ),
+ );
+ }
+
+ pw.Widget _heroCopy(String accountEmail, LegacyKitShare share) {
+ return pw.SizedBox(
+ width: 344,
+ child: pw.Column(
+ crossAxisAlignment: pw.CrossAxisAlignment.start,
+ children: [
+ pw.Text(
+ "HELD BY",
+ style: const pw.TextStyle(
+ color: _white,
+ fontSize: 14,
+ letterSpacing: 2.24,
),
),
- pw.Spacer(),
+ pw.SizedBox(height: 9),
+ pw.Text(
+ share.partName,
+ style: pw.TextStyle(
+ color: _white,
+ fontSize: 32,
+ fontWeight: pw.FontWeight.bold,
+ lineSpacing: 0,
+ ),
+ ),
+ pw.SizedBox(height: 12),
pw.Container(
- width: 146,
- height: 146,
+ padding: const pw.EdgeInsets.symmetric(
+ horizontal: 14,
+ vertical: 8,
+ ),
decoration: const pw.BoxDecoration(
- color: _white,
- borderRadius: pw.BorderRadius.all(pw.Radius.circular(18)),
+ color: _heroBadge,
+ borderRadius: pw.BorderRadius.all(pw.Radius.circular(12)),
),
- child: pw.Center(
- child: pw.Text(
- "QR",
- style: pw.TextStyle(
- color: _green,
- fontSize: 42,
- fontWeight: pw.FontWeight.bold,
- ),
- ),
+ child: pw.Text(
+ "Legacy Kit for $accountEmail",
+ style: const pw.TextStyle(color: _white, fontSize: 14),
+ ),
+ ),
+ pw.SizedBox(height: 12),
+ pw.Text(
+ "This sheet is one part of a recovery key. If $accountEmail loses access, this and any one other can recover their account.",
+ style: const pw.TextStyle(
+ color: PdfColor(1, 1, 1, 0.86),
+ fontSize: 12,
+ lineSpacing: 3,
),
),
],
@@ -250,6 +377,7 @@ class LegacyKitPdfService {
String qrPayload,
String copyCode,
List<LegacyKitShare> otherShares,
+ String recoveryUrl,
) {
return pw.Container(
width: 592,
@@ -338,7 +466,7 @@ class LegacyKitPdfService {
),
_instruction(
"2.",
- "Go to legacy.ente.com and click Start recovery",
+ "Go to ${displayRecoveryUrl(recoveryUrl)} and click Start recovery",
),
_instruction("3.", "Scan the QR codes from both sheets"),
_instruction(
@@ -452,3 +580,21 @@ class LegacyKitPdfService {
..sort((a, b) => a.shareIndex.compareTo(b.shareIndex));
}
}
+
+class _SheetAssets {
+ final Uint8List? duckyImage;
+ final String? heroBgLeftSvg;
+ final String? heroBgRightSvg;
+ final String? logoSvg;
+ final String? enteWordmarkSvg;
+ final pw.ThemeData? theme;
+
+ const _SheetAssets({
+ required this.duckyImage,
+ required this.heroBgLeftSvg,
+ required this.heroBgRightSvg,
+ required this.logoSvg,
+ required this.enteWordmarkSvg,
+ required this.theme,
+ });
+}
diff --git a/mobile/packages/legacy/pubspec.yaml b/mobile/packages/legacy/pubspec.yaml
index 6405ebb1c0..f1cc69384b 100644
--- a/mobile/packages/legacy/pubspec.yaml
+++ b/mobile/packages/legacy/pubspec.yaml
@@ -52,6 +52,8 @@ dev_dependencies:
sdk: flutter
flutter:
+ assets:
+ - assets/
# This package is not meant to be published
publish_to: none
diff --git a/mobile/packages/legacy/test/legacy_kit_pdf_service_test.dart b/mobile/packages/legacy/test/legacy_kit_pdf_service_test.dart
index 8812c340a8..ed6cbaf2f5 100644
--- a/mobile/packages/legacy/test/legacy_kit_pdf_service_test.dart
+++ b/mobile/packages/legacy/test/legacy_kit_pdf_service_test.dart
@@ -32,6 +32,21 @@ void main() {
);
});
+ test("formats recovery URL for recovery sheet instructions", () {
+ expect(
+ LegacyKitPdfService.displayRecoveryUrl("https://legacy.ente.com/"),
+ "legacy.ente.com",
+ );
+ expect(
+ LegacyKitPdfService.displayRecoveryUrl(" http://localhost:3013/ "),
+ "localhost:3013",
+ );
+ expect(
+ LegacyKitPdfService.displayRecoveryUrl("https://legacy.example.com/r"),
+ "legacy.example.com/r",
+ );
+ });
+
test("builds individual legacy kit recovery sheet PDFs", () async {
final shares = [
_share(1, "Mom"),
@@ -44,6 +59,7 @@ void main() {
shares.map(
(share) => service.buildRecoverySheet(
accountEmail: "[email protected]",
+ recoveryUrl: "http://localhost:3013",
share: share,
allShares: shares,
),
diff --git a/mobile/packages/rust/rust/src/api/contacts.rs b/mobile/packages/rust/rust/src/api/contacts.rs
index 9a633eb11e..f64c21d3a3 100644
--- a/mobile/packages/rust/rust/src/api/contacts.rs
+++ b/mobile/packages/rust/rust/src/api/contacts.rs
@@ -390,6 +390,8 @@ pub struct LegacyKit {
pub variant: LegacyKitVariant,
/// Configured notice period in hours.
pub notice_period_in_hours: i32,
+ /// Public URL of the legacy recovery web app for this server.
+ pub legacy_url: String,
/// Decrypted owner metadata.
pub metadata: LegacyKitMetadata,
/// Kit creation timestamp.
@@ -406,6 +408,7 @@ impl From<CoreLegacyKit> for LegacyKit {
id: value.id,
variant: value.variant.into(),
notice_period_in_hours: value.notice_period_in_hours,
+ legacy_url: value.legacy_url,
metadata: value.metadata.into(),
created_at: value.created_at,
updated_at: value.updated_at,
diff --git a/rust/contacts/src/legacy_kit/mod.rs b/rust/contacts/src/legacy_kit/mod.rs
index d908f53d4e..53ba1da591 100644
--- a/rust/contacts/src/legacy_kit/mod.rs
+++ b/rust/contacts/src/legacy_kit/mod.rs
@@ -91,10 +91,12 @@ pub(crate) fn decode_legacy_kit_record(
) -> Result<LegacyKit> {
let owner_blob = decrypt_owner_blob(&response.encrypted_owner_blob, master_key)?;
let metadata = metadata_from_owner_blob(&owner_blob);
+ let legacy_url = response.legacy_url();
Ok(LegacyKit {
id: response.id,
variant: response.variant,
notice_period_in_hours: response.notice_period_in_hours,
+ legacy_url,
metadata,
created_at: response.created_at,
updated_at: response.updated_at,
diff --git a/rust/contacts/src/legacy_kit_models.rs b/rust/contacts/src/legacy_kit_models.rs
index 7895419d9f..f53746a9d6 100644
--- a/rust/contacts/src/legacy_kit_models.rs
+++ b/rust/contacts/src/legacy_kit_models.rs
@@ -114,6 +114,7 @@ pub struct LegacyKit {
pub id: String,
pub variant: LegacyKitVariant,
pub notice_period_in_hours: i32,
+ pub legacy_url: String,
pub metadata: LegacyKitMetadata,
pub created_at: i64,
pub updated_at: i64,
diff --git a/rust/contacts/src/legacy_kit_transport.rs b/rust/contacts/src/legacy_kit_transport.rs
index bcea8539df..7a15685cf3 100644
--- a/rust/contacts/src/legacy_kit_transport.rs
+++ b/rust/contacts/src/legacy_kit_transport.rs
@@ -5,6 +5,8 @@ use crate::legacy_kit_models::{
LegacyKitOwnerRecoverySession, LegacyKitRecoverySession, LegacyKitVariant,
};
+pub const DEFAULT_LEGACY_URL: &str = "https://legacy.ente.com";
+
#[derive(Debug, Clone, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct CreateLegacyKitRequest {
@@ -22,12 +24,25 @@ pub struct LegacyKitRecordResponse {
pub id: String,
pub variant: LegacyKitVariant,
pub notice_period_in_hours: i32,
+ #[serde(default)]
+ pub legacy_url: Option<String>,
pub encrypted_owner_blob: String,
pub created_at: i64,
pub updated_at: i64,
pub active_recovery_session: Option<LegacyKitRecoverySession>,
}
+impl LegacyKitRecordResponse {
+ pub fn legacy_url(&self) -> String {
+ self.legacy_url
+ .as_deref()
+ .map(str::trim)
+ .filter(|url| !url.is_empty())
+ .unwrap_or(DEFAULT_LEGACY_URL)
+ .to_owned()
+ }
+}
+
#[derive(Debug, Clone, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ListLegacyKitsResponse {
@@ -191,3 +206,45 @@ pub struct LegacyKitChangePasswordResponse {
#[serde(rename = "srpM2")]
pub srp_m2: String,
}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+
+ #[test]
+ fn legacy_kit_record_response_accepts_missing_legacy_url() {
+ let response = serde_json::from_str::<LegacyKitRecordResponse>(
+ r#"{
+ "id":"kit-id",
+ "variant":1,
+ "noticePeriodInHours":168,
+ "encryptedOwnerBlob":"owner-blob",
+ "createdAt":1,
+ "updatedAt":2,
+ "activeRecoverySession":null
+ }"#,
+ )
+ .unwrap();
+
+ assert_eq!(response.legacy_url(), DEFAULT_LEGACY_URL);
+ }
+
+ #[test]
+ fn legacy_kit_record_response_uses_configured_legacy_url() {
+ let response = serde_json::from_str::<LegacyKitRecordResponse>(
+ r#"{
+ "id":"kit-id",
+ "variant":1,
+ "noticePeriodInHours":168,
+ "legacyUrl":"http://localhost:3013",
+ "encryptedOwnerBlob":"owner-blob",
+ "createdAt":1,
+ "updatedAt":2,
+ "activeRecoverySession":null
+ }"#,
+ )
+ .unwrap();
+
+ assert_eq!(response.legacy_url(), "http://localhost:3013");
+ }
+}
diff --git a/server/config/example.yaml b/server/config/example.yaml
index 742d138e3c..a5d0264b46 100644
--- a/server/config/example.yaml
+++ b/server/config/example.yaml
@@ -68,6 +68,8 @@ apps:
# Set this to the URL where your accounts web app is running, primarily used for
# passkey based 2FA.
accounts: http://localhost:3001
+ # Set this to the URL where your legacy recovery web app is running.
+ legacy: http://localhost:3013
# Key used for encrypting customer emails before storing them in DB
#
diff --git a/server/configurations/local.yaml b/server/configurations/local.yaml
index e40683c01f..e741e5b934 100644
--- a/server/configurations/local.yaml
+++ b/server/configurations/local.yaml
@@ -113,6 +113,11 @@ apps:
# If you're running a self-hosted instance and wish to serve public memory shares,
# set this to the URL where your memories web app is running.
public-memories:
+ # Default is https://legacy.ente.com
+ #
+ # If you're running a self-hosted instance and wish to serve legacy kit recovery,
+ # set this to the URL where your legacy recovery web app is running.
+ legacy:
custom-domain:
# Default is my.ente.io
cname:
diff --git a/server/ente/legacy_kit.go b/server/ente/legacy_kit.go
index bfbe59a2b0..f26fdad0d5 100644
--- a/server/ente/legacy_kit.go
+++ b/server/ente/legacy_kit.go
@@ -34,6 +34,7 @@ type LegacyKit struct {
ID uuid.UUID `json:"id"`
Variant LegacyKitVariant `json:"variant"`
NoticePeriodInHours int32 `json:"noticePeriodInHours"`
+ LegacyURL string `json:"legacyUrl"`
// Base64(secretbox nonce || MAC || ciphertext) of owner-only part names and
// stored share payloads used for listing and downloading cards again.
EncryptedOwnerBlob string `json:"encryptedOwnerBlob"`
diff --git a/server/pkg/controller/legacy_kit/controller.go b/server/pkg/controller/legacy_kit/controller.go
index b95332dcd5..12fe90e664 100644
--- a/server/pkg/controller/legacy_kit/controller.go
+++ b/server/pkg/controller/legacy_kit/controller.go
@@ -19,6 +19,7 @@ import (
"github.com/ente-io/stacktrace"
"github.com/gin-gonic/gin"
"github.com/google/uuid"
+ "github.com/spf13/viper"
)
var validNoticePeriods = map[int]struct{}{
@@ -29,7 +30,10 @@ var validNoticePeriods = map[int]struct{}{
720: {},
}
-const maxActiveLegacyKits = 5
+const (
+ maxActiveLegacyKits = 5
+ defaultLegacyURL = "https://legacy.ente.com"
+)
type Controller struct {
Repo *legacykitrepo.Repository
@@ -312,6 +316,7 @@ func toLegacyKit(row *legacykitrepo.KitRow, session *legacykitrepo.RecoverySessi
ID: row.ID,
Variant: row.Variant,
NoticePeriodInHours: row.NoticePeriodInHrs,
+ LegacyURL: legacyURL(),
EncryptedOwnerBlob: row.EncryptedOwnerBlob,
CreatedAt: row.CreatedAt,
UpdatedAt: row.UpdatedAt,
@@ -323,6 +328,14 @@ func toLegacyKit(row *legacykitrepo.KitRow, session *legacykitrepo.RecoverySessi
return kit
}
+func legacyURL() string {
+ url := strings.TrimRight(strings.TrimSpace(viper.GetString("apps.legacy")), "/")
+ if url == "" {
+ return defaultLegacyURL
+ }
+ return url
+}
+
func toRecoverySession(row *legacykitrepo.RecoverySessionRow) ente.LegacyKitRecoverySession {
waitRemaining := row.WaitTill - timeutil.Microseconds()
if waitRemaining < 0 {
diff --git a/server/pkg/controller/legacy_kit/controller_test.go b/server/pkg/controller/legacy_kit/controller_test.go
index edd53f4abc..193d2f5e3f 100644
--- a/server/pkg/controller/legacy_kit/controller_test.go
+++ b/server/pkg/controller/legacy_kit/controller_test.go
@@ -8,9 +8,30 @@ import (
legacykitrepo "github.com/ente-io/museum/pkg/repo/legacy_kit"
timeutil "github.com/ente-io/museum/pkg/utils/time"
"github.com/google/uuid"
+ "github.com/spf13/viper"
"github.com/stretchr/testify/require"
)
+func TestLegacyURLUsesDefaultWhenUnset(t *testing.T) {
+ previousURL := viper.GetString("apps.legacy")
+ viper.Set("apps.legacy", "")
+ t.Cleanup(func() {
+ viper.Set("apps.legacy", previousURL)
+ })
+
+ require.Equal(t, defaultLegacyURL, legacyURL())
+}
+
+func TestLegacyURLUsesConfiguredURLWithoutTrailingSlash(t *testing.T) {
+ previousURL := viper.GetString("apps.legacy")
+ viper.Set("apps.legacy", " http://localhost:3013/ ")
+ t.Cleanup(func() {
+ viper.Set("apps.legacy", previousURL)
+ })
+
+ require.Equal(t, "http://localhost:3013", legacyURL())
+}
+
func TestToRecoverySessionReturnsRemainingWaitTime(t *testing.T) {
row := &legacykitrepo.RecoverySessionRow{
ID: uuid.New(),