GitHub - wikimedia/apps-android-wikipedia: 📱The official Wikipedia app for Android!
github.com
external-link
📱The official Wikipedia app for Android! Contribute to wikimedia/apps-android-wikipedia development by creating an account on GitHub.

Wikipedia uses MediaWiki, a wiki engine which ProleWiki runs. I’m very new to coding, but I believe the Android app request data and content through APIs, which in theory could mean it’s possible to redirect to another wiki instance

@ksynwa
admin
link
33M

It won’t be easy. I guess if it was, then the app would allow you to select mediawiki instances. They mention is explicitly here:

Note that the app does not allow you to add custom mediawiki sites.

Outside of localization strings, this is where the url occurs in app/src/main. Seems to be hardcoded a fair bit:

app/src/main/AndroidManifest.xml:                <data android:host="*.wikipedia.org" android:pathPrefix="/wiki/" />
app/src/main/AndroidManifest.xml:                <data android:host="*.wikipedia.org" android:pathPattern="/zh.*" />
app/src/main/AndroidManifest.xml:                <data android:host="*.wikipedia.org" android:pathPattern="/sr.*" />
app/src/main/java/org/wikipedia/views/ImagePreviewDialog.kt:                        // If file page originally comes from *.wikipedia.org (i.e. movie posters), it will not have imageInfo and pageId.
app/src/main/java/org/wikipedia/dataclient/SharedPreferenceCookieManager.java:            } else if (domainSpec.endsWith("wikipedia.org")) {
app/src/main/java/org/wikipedia/dataclient/SharedPreferenceCookieManager.java:                // For sites outside the wikipedia.org domain, transfer the centralauth cookies
app/src/main/java/org/wikipedia/dataclient/SharedPreferenceCookieManager.java:                // from wikipedia.org unconditionally.
app/src/main/java/org/wikipedia/dataclient/Service.kt:        const val WIKIPEDIA_URL = "https://wikipedia.org/"
app/src/main/java/org/wikipedia/util/UriUtil.kt:                uri.authority!!.endsWith("wikipedia.org") &&
app/src/main/java/org/wikipedia/commons/FilePageFragment.kt:                        // If file page originally comes from *.wikipedia.org (i.e. movie posters), it will not have imageInfo and pageId.
app/src/main/java/org/wikipedia/page/Namespace.kt: * @see [Wikipedia:Namespace](https://en.wikipedia.org/wiki/Wikipedia:Namespace)
app/src/main/java/org/wikipedia/page/Namespace.kt: * @see [Namespaces reported by API](https://en.wikipedia.org/w/api.php?action=query&meta=siteinfo&siprop=namespaces|namespacealiases)
app/src/main/java/org/wikipedia/page/PageTitle.kt:        get() = getUriForDomain(wikiSite.authority().replace(".wikipedia.org", ".m.wikipedia.org"))
app/src/main/java/org/wikipedia/dataclient/WikiSite.kt: *  * English Wikipedia: HTTPS / en.wikipedia.org / en
app/src/main/java/org/wikipedia/dataclient/WikiSite.kt: *  * Chinese Wikipedia: HTTPS / zh.wikipedia.org / zh-hans or zh-hant
app/src/main/java/org/wikipedia/dataclient/WikiSite.kt: *  * Test Wikipedia: HTTPS / test.wikipedia.org / test
app/src/main/java/org/wikipedia/dataclient/WikiSite.kt: *  * Võro Wikipedia: HTTPS / fiu-vro.wikipedia.org / fiu-vro
app/src/main/java/org/wikipedia/dataclient/WikiSite.kt: *  * Simple English Wikipedia: HTTPS / simple.wikipedia.org / simple
app/src/main/java/org/wikipedia/dataclient/WikiSite.kt: *  * Correct: "test.wikipedia.org" / "test"
app/src/main/java/org/wikipedia/dataclient/WikiSite.kt: *  * Correct: "wikipedia.org", ""
app/src/main/java/org/wikipedia/dataclient/WikiSite.kt: *  * Correct: "no.wikipedia.org", "nb"
app/src/main/java/org/wikipedia/dataclient/WikiSite.kt: *  * Incorrect: "wikipedia.org", "test"
app/src/main/java/org/wikipedia/dataclient/WikiSite.kt:        if (("wikipedia.org" == authority || "www.wikipedia.org" == authority) &&
app/src/main/java/org/wikipedia/dataclient/WikiSite.kt:            authority = "en.wikipedia.org"
app/src/main/java/org/wikipedia/dataclient/WikiSite.kt:        // This prevents showing mixed Chinese variants article when the URL is /zh/ or /wiki/ in zh.wikipedia.org
app/src/main/java/org/wikipedia/dataclient/WikiSite.kt:        // Use default subdomain in authority to prevent error when requesting endpoints. e.g. zh-tw.wikipedia.org
app/src/main/java/org/wikipedia/dataclient/WikiSite.kt:        if (authority.contains("wikipedia.org") && subdomain().isNotEmpty()) {
app/src/main/java/org/wikipedia/dataclient/WikiSite.kt:            authority = subdomain() + ".wikipedia.org"
app/src/main/java/org/wikipedia/dataclient/WikiSite.kt:                // wikipedia.org
app/src/main/java/org/wikipedia/dataclient/WikiSite.kt:                // m.wikipedia.org

Camarada Forte
mod
admin
creator
link
23M

Yeah, I imagined. We’d need an experienced programmer on board for it, which unfortunately don’t have at the moment. But thanks for taking a look at it, comrade.

Muad'Dibber
admin
link
23M

I suppose, you could clone the repo and search for wikipedia’s url and see if its replaceable.

ProleWiki

A community related to the ProleWiki project.

Post in this community to request articles, provide suggestions and discuss ways to develop our project

  • 0 users online
  • 4 users / day
  • 5 users / week
  • 9 users / month
  • 14 users / 6 months
  • 94 subscribers
  • 50 Posts
  • 135 Comments
  • Modlog