Commit 0812ac4a93
Unsigned
Layout: unified · split
web/src/components/form/FontAwesome.svelte +2 −1
| @@ -78,7 +78,8 @@ | ||
| 78 | 78 | |
| 79 | 79 | //Misc |
| 80 | 80 | ratingStar: solidIcons.faStar, |
| 81 | saveListing: solidIcons.faBookmark | |
| 81 | saveListing: solidIcons.faBookmark, | |
| 82 | noTrackers: solidIcons.faShieldCheck, | |
| 82 | 83 | }; |
| 83 | 84 | |
| 84 | 85 | export let iconName: string; |
web/src/components/things/AndroidDetailedInfo.astro added +164
| @@ -0,0 +1,164 @@ | ||
| 1 | --- | |
| 2 | ||
| 3 | import type { AndroidInfo } from '@utils/fetch-android-info'; | |
| 4 | import { formatDate, timeAgo } from '@utils/dates-n-stuff'; | |
| 5 | import FontAwesome from "@components/form/FontAwesome.svelte" | |
| 6 | ||
| 7 | ||
| 8 | interface Props { | |
| 9 | androidData: AndroidInfo; | |
| 10 | }; | |
| 11 | ||
| 12 | const { androidData } = Astro.props; | |
| 13 | ||
| 14 | function permissionToReadable(permission: string): string { | |
| 15 | return (permission | |
| 16 | .split('.') | |
| 17 | .pop() || '') | |
| 18 | .replace(/_/g, ' ') | |
| 19 | .toLowerCase() | |
| 20 | .split(' ') | |
| 21 | .map(word => word.charAt(0).toUpperCase() + word.slice(1)) | |
| 22 | .join(' ') | |
| 23 | } | |
| 24 | ||
| 25 | ||
| 26 | --- | |
| 27 | ||
| 28 | <div class="android-info-wrapper"> | |
| 29 | <div class="left"> | |
| 30 | <h4>Update Info</h4> | |
| 31 | <ul class="list-table"> | |
| 32 | <li> | |
| 33 | <span class="lbl">App</span> | |
| 34 | <span class="val"> | |
| 35 | <!-- <img width="20" src={`https://reports.exodus-privacy.eu.org/en/reports/${androidData.version_code}/icon`} alt="Android Icon" /> --> | |
| 36 | <a href={`https://play.google.com/store/apps/details?id=${androidData.handle}`}>{androidData.app_name}</a> | |
| 37 | </span> | |
| 38 | </li> | |
| 39 | <li> | |
| 40 | <span class="lbl">Creation Date</span> | |
| 41 | <span class="val">{formatDate(androidData.created)}</span> | |
| 42 | </li> | |
| 43 | <li> | |
| 44 | <span class="lbl">Last Updated</span> | |
| 45 | <span class="val">{formatDate(androidData.updated)}</span> | |
| 46 | </li> | |
| 47 | <li> | |
| 48 | <span class="lbl">Current Version</span> | |
| 49 | <span class="val">{androidData.version_name}</span> | |
| 50 | </li> | |
| 51 | {androidData.creator && ( | |
| 52 | <li> | |
| 53 | <span class="lbl">Creator</span> | |
| 54 | <span class="val">{androidData.creator}</span> | |
| 55 | </li> | |
| 56 | )} | |
| 57 | {androidData.downloads && ( | |
| 58 | <li> | |
| 59 | <span class="lbl">Downloads</span> | |
| 60 | <span class="val">{androidData.downloads}</span> | |
| 61 | </li> | |
| 62 | )} | |
| 63 | </ul> | |
| 64 | ||
| 65 | <h4>Trackers</h4> | |
| 66 | {androidData.trackers.length === 0 && ( | |
| 67 | <p class="all-good"> | |
| 68 | <FontAwesome iconName="noTrackers" /> | |
| 69 | No trackers found | |
| 70 | </p> | |
| 71 | )} | |
| 72 | <ul class="list"> | |
| 73 | {androidData.trackers.map((track) => ( | |
| 74 | <li title={track.code_signature}>{track.name}</li> | |
| 75 | ))} | |
| 76 | </ul> | |
| 77 | </div> | |
| 78 | ||
| 79 | <div class="right"> | |
| 80 | <h4>Permissions</h4> | |
| 81 | {androidData.permissions.length === 0 && ( | |
| 82 | <p class="all-good"> | |
| 83 | <FontAwesome iconName="noTrackers" /> | |
| 84 | No permissions required | |
| 85 | </p> | |
| 86 | )} | |
| 87 | <ul class="list"> | |
| 88 | {androidData.permissions.map((perm) => ( | |
| 89 | <li title={perm}>{permissionToReadable(perm)}</li> | |
| 90 | ))} | |
| 91 | </ul> | |
| 92 | </div> | |
| 93 | </div> | |
| 94 | ||
| 95 | ||
| 96 | <style lang="scss"> | |
| 97 | .android-info-wrapper { | |
| 98 | display: flex; | |
| 99 | flex-wrap: wrap; | |
| 100 | justify-content: space-between; | |
| 101 | gap: 1rem; | |
| 102 | .left, .right { | |
| 103 | width: calc(50% - 1rem); | |
| 104 | @media screen and (max-width: 768px){ | |
| 105 | width: 100%; | |
| 106 | } | |
| 107 | } | |
| 108 | } | |
| 109 | ||
| 110 | h3 { | |
| 111 | margin: 0; | |
| 112 | font-size: 1.6rem; | |
| 113 | } | |
| 114 | ||
| 115 | h4 { | |
| 116 | margin: 1rem 0 0 0; | |
| 117 | font-size: 1.2rem; | |
| 118 | } | |
| 119 | ||
| 120 | ul { | |
| 121 | padding-left: 0; | |
| 122 | list-style: none; | |
| 123 | max-height: 300px; | |
| 124 | overflow-y: auto; | |
| 125 | overflow-x: hidden; | |
| 126 | img { | |
| 127 | border-radius: var(--curve-sm); | |
| 128 | } | |
| 129 | .list-item { | |
| 130 | display: flex; | |
| 131 | flex-direction: column; | |
| 132 | margin-bottom: 0.5rem; | |
| 133 | } | |
| 134 | &.list-table { | |
| 135 | font-size: 0.9rem; | |
| 136 | padding-left: 0; | |
| 137 | li { | |
| 138 | display: flex; | |
| 139 | justify-content: space-between; | |
| 140 | padding: 0.1rem 0; | |
| 141 | .lbl { | |
| 142 | font-weight: 400; | |
| 143 | } | |
| 144 | .val { | |
| 145 | img { | |
| 146 | margin-right: 0.5rem; | |
| 147 | } | |
| 148 | } | |
| 149 | &:not(:last-child) { | |
| 150 | border-bottom: 1px solid #5f53f440; | |
| 151 | } | |
| 152 | } | |
| 153 | } | |
| 154 | &.list { | |
| 155 | list-style: circle; | |
| 156 | padding-left: 1rem; | |
| 157 | } | |
| 158 | } | |
| 159 | ||
| 160 | .all-good { | |
| 161 | color: var(--success); | |
| 162 | } | |
| 163 | ||
| 164 | </style> | |
web/src/components/things/SaveListing.svelte +22 −1
| @@ -33,17 +33,32 @@ | ||
| 33 | 33 | } |
| 34 | 34 | </script> |
| 35 | 35 | |
| 36 | <div class="wrapper-or-something"> | |
| 36 | 37 | <button |
| 37 | 38 | class={`save-container ${isSaved ? 'saved' : ''} ${showLabel ? 'label-button' : ''}`} |
| 38 | 39 | title={`Save ${serviceName}`} |
| 39 | 40 | on:click={toggleSave}> |
| 40 | 41 | {#if showLabel } |
| 41 | <span>Save</span> | |
| 42 | <span> | |
| 43 | {isSaved ? 'Saved' : 'Save'} | |
| 44 | </span> | |
| 42 | 45 | {/if} |
| 43 | 46 | <FontAwesome iconName="saveListing"/> |
| 44 | 47 | </button> |
| 45 | 48 | |
| 49 | {#if showLabel && isSaved } | |
| 50 | <div class="done-msg"> | |
| 51 | You can view all saved items in your <a href="/inventory">Inventory</a> | |
| 52 | </div> | |
| 53 | {/if} | |
| 54 | </div> | |
| 55 | ||
| 46 | 56 | <style lang="scss"> |
| 57 | .wrapper-or-something { | |
| 58 | display: flex; | |
| 59 | flex-direction: row-reverse; | |
| 60 | gap: 0.25rem; | |
| 61 | } | |
| 47 | 62 | .save-container { |
| 48 | 63 | cursor: pointer; |
| 49 | 64 | background: none; |
| @@ -90,4 +105,10 @@ | ||
| 90 | 105 | } |
| 91 | 106 | } |
| 92 | 107 | } |
| 108 | ||
| 109 | .done-msg { | |
| 110 | max-width: 165px; | |
| 111 | font-size: 0.8rem; | |
| 112 | opacity: 0.6; | |
| 113 | } | |
| 93 | 114 | </style> |
web/src/pages/[...listing].astro +13 −4
| @@ -8,6 +8,7 @@ import PrivacyPolicyDetails from '@components/things/PrivacyPolicyDetails.astro' | ||
| 8 | 8 | import WebsiteDetailedInfo from '@components/things/WebsiteDetailedInfo.astro'; |
| 9 | 9 | import DockerDetailedInfo from '@components/things/DockerDetailedInfo.astro'; |
| 10 | 10 | import IosAppDetailedInfo from '@components/things/IosAppDetailedInfo.astro'; |
| 11 | import AndroidAppDetailedInfo from '@components/things/AndroidDetailedInfo.astro'; | |
| 11 | 12 | import DiscordDetailedInfo from '@components/things/DiscordDetailedInfo.astro'; |
| 12 | 13 | import RedditDetailedInfo from '@components/things/RedditDetailedInfo.astro'; |
| 13 | 14 | import SocialShare from '@components/form/Social.astro'; |
| @@ -19,6 +20,7 @@ import { fetchTosdrPrivacy } from '@utils/fetch-privacy-policy'; | ||
| 19 | 20 | import { fetchWebsiteInfo } from '@utils/fetch-website-info'; |
| 20 | 21 | import { fetchDockerData } from '@utils/fetch-docker-instructions'; |
| 21 | 22 | import { fetchIosInfo } from '@utils/fetch-ios-info'; |
| 23 | import { fetchAndroidInfo } from '@utils/fetch-android-info'; | |
| 22 | 24 | import { fetchDiscordInfo } from '@utils/fetch-discord-info'; |
| 23 | 25 | import { fetchRedditInfo } from '@utils/fetch-reddit-info'; |
| 24 | 26 | import { parseMarkdown, formatLink } from '@utils/parse-markdown'; |
| @@ -42,6 +44,7 @@ const { | ||
| 42 | 44 | discordInvite, |
| 43 | 45 | subreddit, |
| 44 | 46 | iosApp, |
| 47 | androidApp, | |
| 45 | 48 | icon, |
| 46 | 49 | followWith, |
| 47 | 50 | securityAudited, |
| @@ -138,13 +141,13 @@ const makePaginationLinks = () => { | ||
| 138 | 141 | |
| 139 | 142 | const { previous, next } = makePaginationLinks(); |
| 140 | 143 | |
| 141 | ||
| 142 | 144 | const ignoredSites = ['github.gom', 'wikipedia.']; |
| 143 | 145 | |
| 144 | 146 | // Fetch detailed data about the services GitHub repo, privacy policy and website |
| 145 | 147 | const githubData = github ? await fetchGitHubStats(github) : null; |
| 146 | 148 | const privacyData = tosdrId ? await fetchTosdrPrivacy(tosdrId) : null; |
| 147 | 149 | const iosData = iosApp ? await fetchIosInfo(iosApp) : null; |
| 150 | const androidData = androidApp ? await fetchAndroidInfo(androidApp) : null; | |
| 148 | 151 | const discordData = discordInvite ? await fetchDiscordInfo(discordInvite) : null; |
| 149 | 152 | const redditData = subreddit ? await fetchRedditInfo(subreddit) : null; |
| 150 | 153 | const dockerData = await fetchDockerData(name); |
| @@ -232,12 +235,12 @@ const getApiEndpoint = () => { | ||
| 232 | 235 | <a href={iosApp}>{formatLink(iosApp)}</a> |
| 233 | 236 | </li> |
| 234 | 237 | )} |
| 235 | <!-- { androidApp && ( | |
| 238 | { androidApp && ( | |
| 236 | 239 | <li> |
| 237 | 240 | <b>Android App:</b> |
| 238 | <a href={androidApp}>{formatLink(androidApp)}</a> | |
| 241 | <a href={`https://play.google.com/store/apps/details?id=${androidApp}`}>{`https://play.google.com/store/apps/details?id=${androidApp}`}</a> | |
| 239 | 242 | </li> |
| 240 | )} --> | |
| 243 | )} | |
| 241 | 244 | { discordInvite && ( |
| 242 | 245 | <li> |
| 243 | 246 | <b>Discord Invite:</b> |
| @@ -306,6 +309,12 @@ const getApiEndpoint = () => { | ||
| 306 | 309 | <WebsiteDetailedInfo url={url} websiteInfo={websiteData} /> |
| 307 | 310 | </section> |
| 308 | 311 | )} |
| 312 | { androidData && ( | |
| 313 | <section> | |
| 314 | <h3>{name} Android App</h3> | |
| 315 | <AndroidAppDetailedInfo androidData={androidData} /> | |
| 316 | </section> | |
| 317 | )} | |
| 309 | 318 | { iosData && ( |
| 310 | 319 | <section> |
| 311 | 320 | <h3>{name} iOS App</h3> |
web/src/utils/fetch-android-info.ts added +46
| @@ -0,0 +1,46 @@ | ||
| 1 | ||
| 2 | const doubleCheckPackageName = (packageStr: string) => { | |
| 3 | return packageStr.includes('id=') ? packageStr.split('id=')[1] : packageStr; | |
| 4 | } | |
| 5 | ||
| 6 | export const fetchAndroidInfo = async (androidPackage: string): Promise<AndroidInfo | null> => { | |
| 7 | const endpoint = `https://android-app-privacy.as93.net/${doubleCheckPackageName(androidPackage)}`; | |
| 8 | try { | |
| 9 | return await fetch(endpoint).then((res) => res.json()); | |
| 10 | } catch (error) { | |
| 11 | console.error('Error fetching android data:', error); | |
| 12 | return null; | |
| 13 | } | |
| 14 | }; | |
| 15 | ||
| 16 | interface Tracker { | |
| 17 | id: number; | |
| 18 | name: string; | |
| 19 | description: string; | |
| 20 | creation_date: string; | |
| 21 | code_signature: string; | |
| 22 | network_signature: string; | |
| 23 | website: string; | |
| 24 | categories: string[]; | |
| 25 | documentation: string[]; | |
| 26 | } | |
| 27 | ||
| 28 | export interface AndroidInfo { | |
| 29 | handle: string; | |
| 30 | app_name: string; | |
| 31 | uaid: string; | |
| 32 | version_name: string; | |
| 33 | version_code: string; | |
| 34 | source: string; | |
| 35 | icon_hash: string; | |
| 36 | apk_hash: string; | |
| 37 | created: string; | |
| 38 | updated: string; | |
| 39 | report: number; | |
| 40 | creator: string; | |
| 41 | downloads: string; | |
| 42 | trackers: Tracker[]; | |
| 43 | permissions: string[]; | |
| 44 | } | |
| 45 | ||
| 46 | ||