mirror of
https://github.com/pezkuwichain/pezkuwi-wallet-android.git
synced 2026-11-20 01:26:11 +00:00
cb74f8cde0a346295e5b47c42672e5650a815149
8
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
8cbde5c422 |
Tell the reader when a .kurd page could not load a part from elsewhere (#38)
A .kurd page may load only from its own name, so a site built to pull a video, an image or a script from another server has that part missing, with nothing saying why. A script the wallet adds at the start of every .kurd document reports the page's own policy violations; the browser shows a note naming what kind of content was not loaded, until the reader closes it or leaves the page. Only the top frame of the .kurd page shown is heard, and only a block of a server other than the page's own counts: inline script, eval and data URLs are the page's doing, not a server it relies on. A page can post the report itself, but only to have the note shown about itself. |
||
|
|
425079281c |
Resolve and serve .kurd sites from verified content, never via DNS (#37)
* Resolve .kurd names on chain and keep them away from DNS and search The Navnisan pallet is live on Zagros People. The wallet now reads a name's record and every ancestor's at one finalized block, checks that each record sits under the parent its name implies, and judges validity the way the pallet does (expiry, 30-day grace for leases, a subname valid only under the registration it was set against). Records are decoded by hand, so a lookup does not depend on the chain's runtime being loaded; the decoder is tested against records read from the live chain, and namehash against the vectors the pallet pins. Names are read through the light client, which proves each value. The chain's own connection is RPC first, so it is not used for names. When the light client cannot answer, two RPC nodes on different hosts must return the same records; an answer reached that way is marked unverified, and an official, institutional, reserved or zone name is then refused rather than opened. The light client tracked its users with one set, so the RPC fallback releasing a chain would stop it under any other reader. Each holder now keeps its own lease. A .kurd host never reaches system DNS or the search engine: the search box offers no web address or search for it, and the DApp browser answers every request to such a host itself, including loadUrl and resources a page embeds. The DuckDuckGo query is now URL-encoded. * Verify .kurd site content block by block A name's content is an IPFS CID on chain; mirrors serve it as a CAR. Every block in the CAR is checked against its CID while it is read, and one block that does not match refuses the whole CAR, so a mirror can withhold content but cannot change it. Files are then assembled only by following CIDs taken from blocks already checked, starting from the CID the chain gave rather than the roots the CAR claims. Supported: CIDv1 and CIDv0, dag-pb and raw, sha2-256 and inlined identity blocks; UnixFS files of any chunking, plain directories and HAMT-sharded directories (murmur3-x64-64, as Kubo builds them). An ipns contenthash, a symlink, an escaping path segment or a file over 32 MiB is refused. Tested against CARs Kubo produced, taken unchanged from ipfs/gateway-conformance (MIT / Apache-2.0), including a 238-shard HAMT, a CAR with a missing block and nodes with their fields in either order; murmur3 also against Guava's reference vector. * Serve .kurd sites from verified content under their own origin The DApp browser now answers https://<name>.kurd itself: the name is resolved on chain, its content root fetched from IPFS trustless gateways as a CAR for the requested path, verified block by block, and only then served. The page's origin is the full name, so cookies, storage and permissions belong to that name alone, and every response carries a policy the wallet writes: nothing loads or connects outside the name, no workers, no framing. Gateways are tried in order and one that fails, withholds or changes a block is skipped. A gateway saying "not found" is believed only once the parent directory, verified, shows the name is absent. A directory is served through its index.html. The gateway list is the signed kurd/gateways.json from the config repository when it can be read, otherwise the gateways measured reachable from Turkiye; entries can only be https origins. Bad paths (dot segments, encoded slashes, malformed escapes, non-UTF-8) are refused before any lookup. A refused, missing or unavailable name, ipns content and feeds get their own status; a name's resolution is reused for a minute so one page does not resolve it once per resource. * Give the runtime component the app's HTTP client for .kurd content The site server fetches CARs over the shared client, so gateway requests use the same DNS-over-HTTPS-first resolver as the rest of the app. * Hear the DApp bridge only from the top frame of the page shown The polkadot-js and MetaMask bridges were exposed with addJavascriptInterface, which every frame of a page can call. A third-party frame inside an authorised DApp -- an ad, an embed -- could ask for the account list or a signature, and the request was shown in the DApp's name, because authorisation follows the page the tab shows. The bridges now use a web message listener: the WebView reports each message's origin and frame, and only a message from the top frame whose origin is the page shown is heard. On a WebView too old to report them, the bridge stays off instead of trusting the page. The bridge is also added before the tab's first load, since it reaches only documents loaded after it. * Let .kurd pages reach the chain through the wallet's connection A .kurd page may only connect to its own name, so it cannot open a node connection of its own. The provider half of the polkadot-js extension API (pub(rpc.listProviders, startProvider, send, subscribe, subscribeConnected)) now answers it over the wallet's connection to Pezkuwi and Zagros relay, Asset Hub and People, which falls back to the light client. Offered only when the tab shows a .kurd page, judged by the WebView's page rather than the message. Only calls that read state, estimate fees or submit an extrinsic the user already signed pass; key, peer and offchain methods do not. A subscription ends when the tab leaves the page's origin. Calls are answered off the request queue so a slow node does not hold up the page, and params are forwarded as the page wrote them rather than reparsed (a block number must not become 123.0). * Offer a typed .kurd name in DApp search as the name itself Typing a valid .kurd name now shows it under its own heading, with the shield and "resolved on chain, never sent to a search engine", and opens https://<name>/ in the browser. An invalid one is offered nowhere: not as a web address, not as a search. * Let runtime unit tests log a warning with its cause The test stand-in for android.util.Log had no w(tag, msg, throwable), so any code under test that logged a failure that way stopped with NoSuchMethodError instead of carrying on: the .kurd fetcher logs each gateway it skips. * Show what was verified about a .kurd page, and stop at what was not The address bar of a .kurd page carries a badge in place of the padlock: Official for a name Parliament gave, Registered for a bought one, Not verified for one the reader chose to open on two RPC nodes' word. Tapping it shows the block the name was proven at, the owner (a state institution or an account), the content CID, and a button to clear the site's storage, cookies and permissions. A page that did not open is replaced by a notice instead of a blank page: an official name that cannot be verified now (retry, never open), a name read through RPC nodes only (go back, or open anyway), an unregistered name, a name without a site, and content no mirror could deliver verifiably. Behind it the site server keeps each name's page state, set only by the page's own document, and holds back a name read through RPC nodes until the reader chooses to open it. Texts in Kurmanji, English and Turkish. * Warn before opening a .kurd name that imitates an official one Zone names are institutional by construction, and the commonest imitation folds the zone into the label: serok-gov.kurd or serokgov.kurd for serok.gov.kurd. When a typed name has such a candidate and the candidate resolves, proven, as an official name, search asks first: go to the official name, or open the typed one anyway. The check runs only for names with a candidate and gives up after a few seconds; the opened page still shows by its badge whether it is official. * Say on the signing screen what kind of .kurd name asks A signature requested from a .kurd page now names the page by its .kurd name with its kind: Official, Bought (not official) or Not verified. For a name that is not official, the reader is told to check the full name, since the state did not give it; for one opened without proof, to sign only when sure whose site it is. * Judge a DApp request by the page that sent it, not the page shown by then Bridge requests are handled one at a time, after they arrive. A page could send a request and navigate at once, and its request was then authorised, and named on the signing screen, as the next page's: a .kurd page could have its signature request shown as Official by moving to an official name. Every request now carries the origin the WebView reported for its message (the polkadot-js url the page writes is no longer read). A request whose origin is not the page shown when it is handled is refused, and the signing screen is built from the asking origin's own .kurd state, refusing as well if the tab has moved on. * Serve .kurd feeds from their publisher's newest signed release A feed name (a site that changes many times a day) carries its publisher's key and an anchor: the newest release the chain was told of. The wallet asks the gateways for the publisher's IPNS record, verifies each against the key the chain gives (never the key in the record or its name), refuses expired ones, V1-only ones and ones whose legacy fields contradict the signed data, and serves the newest release at or past the anchor. When none is confirmed, it serves the anchor itself and the browser says that a newer version could not be found; the release the chain already names is always served from the chain's root. Verification is tested against records Kubo signed, taken unchanged from ipfs/gateway-conformance (MIT / Apache-2.0). |
||
|
|
5c13c84eca |
Polkadot-js requests reach the wallet: bridge calls the registered interface (#35)
The WebView registers the polkadot-js interface as Pezkuwi_PolkadotJs, but the bridge script still called Nova_PolkadotJs. That call threw inside the page's message listener, so enable, account and signing requests never reached the app and every Substrate dApp waited forever with nothing on screen. Measured on a phone running 1.3.0: the request logged nothing on the native side. Both bridges now build their interface name from one function, and a test pins the bundled bridge script to the name the injector registers. |
||
|
|
7b8fd731f8 |
Release 1.3.0: DKS hub tiles open each app's own domain (#29)
* DKS hub: open each app on its own domain Seven tiles opened app.pezkuwichain.io routes or a front page while the app has a domain of its own. Each now opens that domain, even where the site is still a "coming soon" page, so the tile keeps its address when the site arrives: Wallet explorer front page -> cuzdan.pex.network P2P / Buy-Sell app/p2p -> buy-sell.pezkiwi.app B2B app/bereketli -> bereketli.pezkiwi.app Vote app/elections -> governance.pezkuwichain.io Proposals app/citizens/government-> governance.pezkuwichain.io Identity app/identity -> be-citizen.pezkiwi.app Forum app/forum -> forum.pezkuwichain.io B2B went through a sign-in bridge that only helps a user signed in to the web app, which the wallet's DApp browser never is: it loaded the whole web app, then forwarded to bereketli.pezkiwi.app anyway. * Release 1.3.0 Version 1.2.0 -> 1.3.0, with release notes in English, Turkish and Kurmanci for the Ecosystem Hub, the config that keeps working when GitHub is blocked, and the splash and deep link fixes. |
||
|
|
781b713257 |
Config keeps working when GitHub is unreachable: mirrors and a bundled chain list (#28)
* feat(network): fetch config from jsDelivr when raw.githubusercontent.com fails Every config file the app reads -- chains, assets, DApps, XCM, banners, token icons -- comes from raw.githubusercontent.com with no other source, so when that host cannot be reached a fresh install has no chains at all. ConfigMirrorInterceptor retries the same file on cdn.jsdelivr.net and then fastly.jsdelivr.net when the primary fails to connect or answers 403, 429, 451 or 5xx. A 404 is an answer and is returned as is. A host that failed is skipped for ten minutes so later requests do not each wait for its timeout. Mirror requests revalidate, so a mirror's long max-age cannot pin a copy in the HTTP cache after the primary is back. The shared OkHttp client and Coil's image client both carry it. * feat(runtime): start a first install from the chain list the APK was built with A first install has no chains until chains.json is fetched, and the fetch retries forever: with GitHub and its mirrors unreachable the wallet stays empty. The runtime module now bundles the live chains.json at build time (bundleChainsConfig, run before preBuild, falling back to jsDelivr and refusing anything that is not a non-empty JSON array). When the local database is empty, ChainSyncService tries the network once and, if that fails, applies the bundled list so the wallet opens; the fetched list then replaces it through the usual diff as soon as it arrives. * feat(dapps): show the bundled DApps catalog until one can be fetched The DApps catalog lived only in memory and every read waited on first(), so with the catalog URL unreachable the DApps screen waited forever. feature-dapp-impl now bundles dapps_full.json at build time. On the first sync the repository tries the network once and, if that fails, publishes the bundled catalog so every read returns; the fetched catalog replaces it as soon as it arrives. The download task moves to scripts/bundled-config.gradle and serves both the chain list and the DApps catalog. runtime and feature-dapp-impl unit tests return defaults for android.util.Log, which the fallback calls. * feat(network): resolve names over DNS-over-HTTPS first, system DNS as fallback A network that answers plain DNS with a wrong address decides where the app connects. The shared OkHttp client and Coil's client now resolve through EncryptedFirstDns: Google, Cloudflare and Quad9 over HTTPS, each reached by IP, then the system resolver if all of them fail, so no network is worse off. - A resolver whose request failed is skipped for ten minutes, so a network that blocks DoH pays the four-second timeout once. NXDOMAIN and SERVFAIL do not count as failures. - IPv4 addresses are returned first: DoH answers IPv6 whether or not the network has it, and OkHttp tries addresses in order. - IP literals and localhost never leave the device. WebSocket RPC (nv-websocket) still resolves through the system. * feat(config): verify signed config metadata, TUF style The rules the app will apply to config it fetches, not wired yet: - A root, signed by a threshold of root keys, names the keys that may sign the targets list and how many must. The APK carries the first root. - A new root is accepted one version at a time, signed by a threshold of the old root's keys and of its own, so keys can be replaced without a release and a lost targets key can be revoked. - The targets list gives the sha256 of each config file; it cannot go back a version, cannot jump more than 10,000 at once, and is refused once it or its root has expired. - Ed25519 over the payload bytes exactly as published (BouncyCastle, already a dependency); a key signing twice counts once; a key must match its id. * fix(config): parse metadata with the Gson API the app resolves JsonParser.parseString is not in the Gson version on the app's classpath; the instance parse method is, and behaves the same here. * test(runtime): add the Log.e overload with a throwable to the test shim The first-install fallback logs the failed fetch with its exception, and the shim only had the two-argument form, so the test hit NoSuchMethodError. * feat(config): refuse config files the signed list does not give SignedConfigInterceptor checks every JSON file from pezkuwi-wallet-utils against signed/targets.json, whichever host the mirrors got it from. A file the list does not give, or one without a verified list behind it, comes back as a 502, so callers keep the stored chains and bundled lists as they do when the source is unreachable. Newer roots are followed from signed/root.N.json; the targets version and the latest time seen are stored, so an older list cannot be replayed. Root keys may now be sr25519 wallet accounts: they sign through the wallet's message signing, which wraps the bytes in <Bytes>, and the SDK's schnorrkel verifies them. The APK carries root 1 as an asset, trusted as the APK is. |
||
|
|
280ccc3fd6 |
DApps: the Dijital Kurdistan Ecosystem Hub, a native screen (#24)
* DApps: the Dijital Kurdistan Ecosystem Hub, a native screen Tapping "Dijital Kurdistan" in the DApps tab used to open pezkuwichain.io in the browser. It now opens the hub first, inside the DApps tab so the wallet's bottom bar stays in view; the user picks an app there and it opens in the DApp browser. - Four sections: Finance (8), Governance (9), Education (4), Social (8). Each is a card with a glowing border in its colour (green, red, amber, blue), a header band with its name and app count, and a four-column grid of apps. - Apps open the same pages the web app's mobile home links to, at app.pezkuwichain.io, or their own sites: Wallet and Validators the explorer, Exchange pex.network, Delegation wekil.pex.mom, KurdAI kurdishtts.dks.news, Games games.pex.mom, Rewshenbir rewshenbir.pezkiwi.app. Music has no page yet: it is shown dimmed and does nothing when tapped. - The entry is recognised by its URL (pezkuwichain.io root, from wallet-utils dapps_full.json), so favourites open the hub too. Back, from the arrow or the system, closes the hub before it leaves the tab. - Strings in English, Turkish and Kurmanji, worded as the web app words them; other languages fall back to English. * DApps hub: open Music at music.dks.news Every app in the hub now has an address, so the dimmed, inert state for an app without one is gone along with its string. * DApps hub: open KurdMedia at dks.news --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
46d7e66f99 |
Fix open Dependabot and code scanning alerts (#21)
* build(rust): bump vulnerable crates in native binding lockfiles - rand 0.8.5 -> 0.8.6 (GHSA-cq8v-f236-94qc) in hydra-dx-math and sr25519-bizinikiwi - keccak 0.1.5 -> 0.1.6 (GHSA-3288-p39f-rqpv) in hydra-dx-math and sr25519-bizinikiwi - bytes -> 1.11.1 (GHSA-434x-w66g-qw3r) in hydra-dx-math and metadata_shortener - time 0.3.41 -> 0.3.47 (GHSA-r6v5-fh4h-64xc) in hydra-dx-math - tracing-subscriber 0.3.19 -> 0.3.20 (GHSA-xwfj-jgwm-7wp5) in hydra-dx-math Lockfile-only updates via cargo update --precise; Cargo.toml requirements are unchanged. time 0.3.47 pulls serde 1.0.229/serde_core and requires rustc 1.88, which the stable toolchain used by CI satisfies. * ci: restrict default GITHUB_TOKEN permissions to contents: read None of these workflows write through GITHUB_TOKEN: artifact upload, Firebase, S3, Play Store, gh-pages and the Appium dispatch all use their own credentials. Reusable workflows they call inherit the same cap. * fix(dapp): send only fixed, JSON-quoted error messages to dApp pages The polkadot.js responder forwarded Throwable.message of any rejection error to the page and both responders interpolated the message into JavaScript without escaping. Map polkadot.js rejections to a fixed public message (unknown errors become "Request failed"), give MetamaskError an explicit publicMessage, and quote both with JSONObject.quote so a message can no longer break out of the string literal. * ci: stop installing the removed legacy SDK 'tools' package android-actions/setup-android installs 'tools platform-tools' by default. sdkmanager now fails with "Failed to find package 'tools'", which aborts dependency installation for every build and lint job. Only platform-tools is needed; nothing in the workflows uses the legacy tools directory. |
||
|
|
a294aa1a6b |
Initial commit: Pezkuwi Wallet Android
Security hardened release: - Code obfuscation enabled (minifyEnabled=true, shrinkResources=true) - Sensitive files excluded (google-services.json, keystores) - Branch.io key moved to BuildConfig placeholder - Updated dependencies: OkHttp 4.12.0, Gson 2.10.1, BouncyCastle 1.77 - Comprehensive ProGuard rules for crypto wallet - Navigation 2.7.7, Lifecycle 2.7.0, ConstraintLayout 2.1.4 |