Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
b25a38d
Initialization of CI/CD process
Apr 19, 2026
058aed3
Submodule line fix in build.yml
Apr 19, 2026
338f86e
Fix flutter version channel
Apr 19, 2026
58d395e
Convert giac from submodule to regular folder
Apr 19, 2026
4c1818b
Fixes for compiling
Apr 19, 2026
693771a
Remove giac submodule, add as regular folder with config.h
Apr 19, 2026
82582fd
giac_wrapper fix 🤧
Apr 19, 2026
33b468f
Fixing GIAC compiling errors
Apr 19, 2026
20c3712
Simplify includes to match Cmake directories
Apr 19, 2026
532297c
Giac_wrapper.cpp modified
Apr 19, 2026
faeabaf
proactive filtering of CMakeLists.txt
Apr 19, 2026
4ba04de
Further refining of GIAC
Apr 19, 2026
f1ae082
Added licenses for GIAC
Apr 19, 2026
c84d2d4
Giac for Android
Apr 19, 2026
6ac2e2c
GIAC is ready
Apr 19, 2026
f956045
Let us rewrite flutter GIAC
Apr 19, 2026
febceb2
Giac further fixes
Apr 19, 2026
c647773
Optimistic CMakeLists.txt fix
Apr 19, 2026
73820ef
Removed misc.cc from giac compilation
Apr 19, 2026
535ddc6
Closer to a good GIAC build
Apr 19, 2026
58d5d7a
Almost there
Apr 19, 2026
fef537b
Fixing usual.cc to note compiler response
Apr 19, 2026
f5ae506
Corrected CMakeLists.txt
Apr 19, 2026
d5edd14
Very last files
Apr 19, 2026
cda9388
Included stub headers to link succesfully
Apr 19, 2026
efec5f9
GOD IN YOU I TRUST
Apr 19, 2026
e662ffb
GOD IN YOU I TRUST
Apr 19, 2026
14e447a
Exclude vecteur.cc to get Android APK
Apr 19, 2026
012fb5f
THE OG CODE FIX
Apr 19, 2026
912614f
The buffer fix in global.cc
Apr 19, 2026
4ba6f25
Final fix
Apr 19, 2026
7e65d78
IT SHOULD WORK
Apr 19, 2026
b42e883
Fixed linker errors
Apr 19, 2026
2463e5e
Decrease artifact retention days from 30 to 29
Greatest9 Apr 19, 2026
d06d49c
Update build.yml
Greatest9 Apr 20, 2026
42eb4a0
Enhance build workflow with release tagging and publishing
Greatest9 Apr 20, 2026
9fb8e65
github merge fix
Apr 20, 2026
f4be745
Fix for permissions
Apr 20, 2026
ef00e88
Fix app launch errors
Apr 20, 2026
f998132
License manager.dart to work
Apr 20, 2026
a384792
Upgrades before version 1
Apr 20, 2026
e8982aa
Home screen.dart changed to render correctly
Apr 22, 2026
fe8f03d
Hopeful code infrastrucure fix
Apr 22, 2026
23d3541
Enhance release signing config with environment variable support
Greatest9 Apr 24, 2026
0fa8754
feat: enhance solver engine, UI, and add new theorems
Apr 24, 2026
d9977ff
Update license manager for Selar Webhook integration
Apr 24, 2026
d558763
Update license endpoint URL to latest Apps Script deployment
Apr 24, 2026
7b44114
Update license endpoint URL one final time
Apr 24, 2026
1c6272f
License screeen.dart problems
Apr 24, 2026
4c0a8a0
Fix URL launches for buy link and get the app to work✌ ️
Apr 24, 2026
137163e
l ogo
May 7, 2026
3d885ec
Mathgod logo
May 7, 2026
8ec4699
pattern
May 7, 2026
812c27f
Test: Code compilation testing
Greatest9 May 16, 2026
f5243da
Test: Code execution
Greatest9 May 16, 2026
fd745e0
test: code execution
Greatest9 May 16, 2026
c7e0682
Update README.md to correctly reference Giac License
Greatest9 May 18, 2026
573f3ea
Update README.md to reference GeoGebra
Greatest9 May 18, 2026
db34275
Update README.md
Greatest9 Aug 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
41 changes: 41 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Test Math God Build

on:
push:
branches: [ "main", "master" ]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: 📥 Checkout code
uses: actions/checkout@v4

- name: 🐧 Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'

- name: 📱 Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
cache: true

- name: 🔑 Decode Keystore
run: |
echo "${{ secrets.SIGNING_KEYSTORE_BASE64 }}" | base64 -d > android/mathgod-keystore.jks
shell: bash

- name: 📦 Install dependencies
run: flutter pub get

- name: 🔧 Test Build APK (Release Validation)
run: flutter build apk --release
env:
KEYSTORE_PASSWORD: ${{ secrets.SIGNING_KEYSTORE_PASSWORD }}
KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }}
KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
Binary file modified .gitignore
Binary file not shown.
36 changes: 25 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,31 @@
# mathgod
# MathGod 🧮

A new Flutter project.
[![Website](https://img.shields.io/badge/Website-mathgod--woad.vercel.app-blue?style=flat-square)](https://mathgod-woad.vercel.app/#home)
[![License: GPL v2](https://img.shields.io/badge/License-GPL%20v2-blue.svg?style=flat-square)](https://www.gnu.org/licenses/old-licenses/gpl-2.0.html)

## Getting Started
MathGod is an offline-first, high-performance symbolic mathematics and calculus solver built for mobile devices.

This project is a starting point for a Flutter application.
The primary mission of this project is educational empowerment—providing university students with a robust Computer Algebra System (CAS) that runs completely offline, mitigating the barriers of high data costs and unstable internet connectivity.

A few resources to get you started if this is your first Flutter project:
🌍 **Official Landing Page & Documentation:** [mathgod-woad.vercel.app](https://mathgod-woad.vercel.app/#home)

- [Learn Flutter](https://docs.flutter.dev/get-started/learn-flutter)
- [Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
- [Flutter learning resources](https://docs.flutter.dev/reference/learning-resources)
---

For help getting started with Flutter development, view the
[online documentation](https://docs.flutter.dev/), which offers tutorials,
samples, guidance on mobile development, and a full API reference.
## 🚀 The Engineering Behind MathGod

This application represents a novel integration architecture combining modern mobile UI frameworks with low-level symbolic math engines:

* **Frontend:** Built with Flutter, utilizing Dart FFI (Foreign Function Interface) to seamlessly bridge high-performance native layers.
* **Core Computing Kernel:** Powered by the Giac/Xcas C++ library developed by Bernard Parisse.
* **Native Compilation:** Implemented via custom `CMakeLists.txt` configurations to compile the native Giac source into an optimized Android Shared Object (`.so`) binary using the Android NDK.

---

## ⚖️ Open Source & Licensing

In strict compliance with the **GNU General Public License v2.0 (GPLv2)**, the complete integration layer, build scripts, and interface mechanics for this application are fully open-sourced here for the global developer community.

### Credits & Attribution

* **Giac/Xcas Core:** Developed by Bernard Parisse / Université Grenoble Alpes. Source and documentation: [Institut Fourier - Giac](https://www-fourier.ujf-grenoble.fr/~parisse/giac.html)
* **Android Build Dependencies:** The Android-specific pre-generated configuration headers and prebuilt GMP/MPFR static libraries used in this project were sourced from the [GeoGebra Giac fork](https://github.com/geogebra/giac). These files are not part of the original Giac project and are attributed to the GeoGebra team accordingly.
38 changes: 31 additions & 7 deletions android/app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
import java.util.Properties
import java.io.FileInputStream

// Load keystore properties
val keystoreProperties = Properties()
val keystorePropertiesFile = rootProject.file("key.properties")
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(FileInputStream(keystorePropertiesFile))
}

plugins {
id("com.android.application")
id("kotlin-android")
id("dev.flutter.flutter-gradle-plugin")
}

android {
namespace = "com.mathgod.app" // Changed from com.example.mathgod
namespace = "com.mathgod.app"
compileSdk = flutter.compileSdkVersion
ndkVersion = "28.2.13676358" // Fixed NDK version for Giac
ndkVersion = "28.2.13676358"

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
Expand All @@ -18,21 +28,36 @@ android {
jvmTarget = JavaVersion.VERSION_17.toString()
}

signingConfigs {
create("release") {
// Priority 1: key.properties (Local) | Priority 2: Env Vars (CI)
keyAlias = (keystoreProperties["keyAlias"] as? String) ?: System.getenv("KEY_ALIAS")
keyPassword = (keystoreProperties["keyPassword"] as? String) ?: System.getenv("KEY_PASSWORD")
storePassword = (keystoreProperties["storePassword"] as? String) ?: System.getenv("KEYSTORE_PASSWORD")

// Resolve keystore file path
storeFile = if (keystoreProperties.containsKey("storeFile")) {
file(keystoreProperties["storeFile"] as String)
} else {
// This matches the path created in your GitHub YAML
file("../mathgod-keystore.jks")
}
}
}

defaultConfig {
applicationId = "com.mathgod.app"
minSdk = flutter.minSdkVersion
targetSdk = flutter.targetSdkVersion
versionCode = flutter.versionCode
versionName = flutter.versionName

// NDK ABI filters (arm64-v8a covers all modern phones)
ndk {
abiFilters.add("arm64-v8a")
abiFilters.add("armeabi-v7a")
abiFilters.add("x86_64")
}

// CMake build for Giac
externalNativeBuild {
cmake {
cppFlags("-std=c++17 -fexceptions -frtti")
Expand All @@ -41,7 +66,6 @@ android {
}
}

// Point to CMakeLists.txt
externalNativeBuild {
cmake {
path = file("src/main/cpp/CMakeLists.txt")
Expand All @@ -51,7 +75,7 @@ android {

buildTypes {
release {
signingConfig = signingConfigs.getByName("debug")
signingConfig = signingConfigs.getByName("release")
isMinifyEnabled = true
isShrinkResources = true
proguardFiles(
Expand All @@ -64,4 +88,4 @@ android {

flutter {
source = "../.."
}
}
14 changes: 13 additions & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<uses-permission android:name="android.permission.INTERNET" />

<application
android:icon="@mipmap/ic_launcher"
android:icon="@mipmap/launcher_icon"
android:name="${applicationName}"
android:label="math_god">
<activity
Expand All @@ -28,7 +28,19 @@
android:value="2"/>
</application>

<!-- REQUIRED for url_launcher on Android 11+ (API 30+) -->
<queries>
<!-- For opening https links -->
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="https" />
</intent>
<!-- For opening http links (fallback) -->
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="http" />
</intent>
<!-- Your existing PROCESS_TEXT intent -->
<intent>
<action android:name="android.intent.action.PROCESS_TEXT"/>
<data android:mimeType="text/plain"/>
Expand Down
65 changes: 64 additions & 1 deletion android/app/src/main/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,81 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(GIAC_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/giac)

# ─── ABI → prebuilt path mapping ───────────────────────────────────────────────
if(ANDROID_ABI STREQUAL "arm64-v8a")
set(GIAC_ABI_DIR "arm-v8")
elseif(ANDROID_ABI STREQUAL "armeabi-v7a")
set(GIAC_ABI_DIR "arm-v7")
elseif(ANDROID_ABI STREQUAL "x86_64")
set(GIAC_ABI_DIR "x86-64")
elseif(ANDROID_ABI STREQUAL "x86")
set(GIAC_ABI_DIR "x86")
else()
message(FATAL_ERROR "Unsupported ABI: ${ANDROID_ABI}")
endif()

set(GIAC_PREBUILT_DIR ${GIAC_ROOT}/src/jni/prebuilt/android/${GIAC_ABI_DIR})
set(GIAC_HEADER_DIR ${GIAC_ROOT}/src/giac/headers/android/${GIAC_ABI_DIR})

include_directories(
${GIAC_ROOT}/src
${GIAC_ROOT}/src/giac
${GIAC_ROOT}/src/giac/headers
${GIAC_HEADER_DIR}
)

file(GLOB_RECURSE GIAC_SOURCES
"${GIAC_ROOT}/src/*.cpp"
"${GIAC_ROOT}/src/*.cc"
)

# ─── EXCLUDE EVERYTHING NOT NEEDED FOR CORE CAS ────────────────────────────────
# Test files
list(FILTER GIAC_SOURCES EXCLUDE REGEX ".*/test/.*")

# Graphics (plot.cc is needed, but opengl/gui/fltk/glut are not)
list(FILTER GIAC_SOURCES EXCLUDE REGEX ".*/opengl.*")
list(FILTER GIAC_SOURCES EXCLUDE REGEX ".*/gui.*")
list(FILTER GIAC_SOURCES EXCLUDE REGEX ".*/fltk.*")
list(FILTER GIAC_SOURCES EXCLUDE REGEX ".*/glut.*")

# GeoGebra-specific wrappers (not needed)
list(FILTER GIAC_SOURCES EXCLUDE REGEX ".*/geogebra.*")
list(FILTER GIAC_SOURCES EXCLUDE REGEX ".*GeoGebraCAS.*")

# Node.js bindings (not needed)
list(FILTER GIAC_SOURCES EXCLUDE REGEX ".*/nodegiac.*")

# Simple interface examples (not needed)
list(FILTER GIAC_SOURCES EXCLUDE REGEX ".*/simpleInterface.*")

# Only exclude files that genuinely cause compile errors
list(FILTER GIAC_SOURCES EXCLUDE REGEX ".*signalprocessing.*")
list(FILTER GIAC_SOURCES EXCLUDE REGEX ".*graphtheory.*")

# Demo files
list(FILTER GIAC_SOURCES EXCLUDE REGEX ".*-demo.*")
list(FILTER GIAC_SOURCES EXCLUDE REGEX ".*minigiac.*")

# ─── BUILD THE LIBRARY ─────────────────────────────────────────────────────────

add_library(giac SHARED
${CMAKE_CURRENT_SOURCE_DIR}/giac_wrapper.cpp
${GIAC_SOURCES}
)

# ─── FIX FOR global.cc fread error ────────────────────────────────────────────
set_source_files_properties(${GIAC_ROOT}/src/giac/cpp/global.cc PROPERTIES COMPILE_FLAGS "-U_FORTIFY_SOURCE")

target_compile_definitions(giac PRIVATE
HAVE_CONFIG_H=1
NO_GNUPLOT=1
NO_PARI=1
NO_FLTK=1
ANDROID=1
GIAC_COUT=0
_POSIX_C_SOURCE=200809L
_GNU_SOURCE
GIAC_GGB=1
)

target_compile_options(giac PRIVATE
Expand All @@ -37,12 +90,22 @@ target_compile_options(giac PRIVATE
-fexceptions
-frtti
-Wno-unused-function
-include unistd.h
-Wno-c++11-narrowing
)

find_library(log-lib log)
find_library(m-lib m)

# ─── Prebuilt GMP + MPFR ──────────────────────────────────────────────────────
add_library(gmp STATIC IMPORTED)
add_library(mpfr STATIC IMPORTED)
set_target_properties(gmp PROPERTIES IMPORTED_LOCATION ${GIAC_PREBUILT_DIR}/libgmp.a)
set_target_properties(mpfr PROPERTIES IMPORTED_LOCATION ${GIAC_PREBUILT_DIR}/libmpfr.a)

target_link_libraries(giac
mpfr
gmp
${log-lib}
${m-lib}
)
Expand Down
1 change: 0 additions & 1 deletion android/app/src/main/cpp/giac
Submodule giac deleted from f9cde6
6 changes: 6 additions & 0 deletions android/app/src/main/cpp/giac/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/local.properties
.gradle
.idea
.gems
build
/cbuild64/
14 changes: 14 additions & 0 deletions android/app/src/main/cpp/giac/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.gradle
.npmignore
.svn
ANDROID_README
build
build.gradle
giac-android
giac-gwt
gradle-scripts
LINUX_README
settings.gradle
node_modules
local.properties
emsdk
1 change: 1 addition & 0 deletions android/app/src/main/cpp/giac/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//registry.npmjs.org/:_authToken=${NPM_PSW}
Loading
Loading