Skip to content

Commit

Permalink
update flip phone branch to 3.3.1
Browse files Browse the repository at this point in the history
should work on all flip phones that require cts validations
  • Loading branch information
KFMDMSolutions committed Mar 29, 2023
1 parent fb3f968 commit 0d614e6
Show file tree
Hide file tree
Showing 32 changed files with 462 additions and 235 deletions.
Binary file modified .gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
Binary file modified .gradle/buildOutputCleanup/outputFiles.bin
Binary file not shown.
8 changes: 4 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ android {
buildToolsVersion "31.0.0"

defaultConfig {
applicationId "com.kfmdmsolutions.ivelt"
minSdkVersion 24
applicationId "com.android.cts.kfmdmsolutions.ivelt"
minSdkVersion 23
//noinspection OldTargetApi
targetSdkVersion 31
versionCode 13
versionName "3.3"
versionCode 14
versionName "3.3.1-plip"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}

Expand Down
16 changes: 8 additions & 8 deletions app/google-services.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
{
"project_info": {
"project_number": "85491187352",
"project_id": "ivelt-forums",
"storage_bucket": "ivelt-forums.appspot.com"
"project_number": "938346073653",
"project_id": "ivelt-furoms-a6",
"storage_bucket": "ivelt-furoms-a6.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:85491187352:android:2ef1a64709e2a3dafc5aed",
"mobilesdk_app_id": "1:938346073653:android:709f7b24c0a74974e1ab7c",
"android_client_info": {
"package_name": "com.kfmdmsolutions.ivelt"
"package_name": "com.android.cts.kfmdmsolutions.ivelt"
}
},
"oauth_client": [
{
"client_id": "85491187352-0buvu4ulo6v6htnh5lp2hovv6fsnt76u.apps.googleusercontent.com",
"client_id": "938346073653-2i0dt15m4sblkln65a38oi73o95r3g3q.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyC-C3QEc_4P-m3oLz3L71BkuvQezJxgaV4"
"current_key": "AIzaSyAw9dCyuvCu2Izt8CY4bDl1ix47uHZFCPs"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "85491187352-0buvu4ulo6v6htnh5lp2hovv6fsnt76u.apps.googleusercontent.com",
"client_id": "938346073653-2i0dt15m4sblkln65a38oi73o95r3g3q.apps.googleusercontent.com",
"client_type": 3
}
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
package com.kfmdmsolutions.ivelt;

import android.content.Context;

import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;

import org.junit.Test;
import org.junit.runner.RunWith;

import static org.junit.Assert.*;

/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.kfmdmsolutions.ivelt", appContext.getPackageName());
}
package com.android.cts.kfmdmsolutions.ivelt;

import android.content.Context;

import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;

import org.junit.Test;
import org.junit.runner.RunWith;

import static org.junit.Assert.*;

/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.kfmdmsolutions.ivelt", appContext.getPackageName());
}
}
12 changes: 6 additions & 6 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.kfmdmsolutions.ivelt">
package="com.android.cts.kfmdmsolutions.ivelt">

<uses-permission android:name="android.permission.INTERNET" />

Expand All @@ -24,13 +24,13 @@
android:name="firebase_crashlytics_collection_enabled"
android:value="false" />
<service
android:name=".NotificationService"
android:name="com.android.cts.kfmdmsolutions.ivelt.NotificationService"
android:exported="false"/>

<activity android:name=".SettingsActivity" />
<activity android:name="com.android.cts.kfmdmsolutions.ivelt.SettingsActivity" />
<activity

android:name=".SplashActivity"
android:name="com.android.cts.kfmdmsolutions.ivelt.SplashActivity"
android:theme="@style/SplashTheme"
android:exported="true">
<intent-filter>
Expand All @@ -40,7 +40,7 @@
<meta-data android:name="android.app.shortcuts"
android:resource="@xml/shorcuts"/>
</activity>
<activity android:name=".MainActivity"
<activity android:name="com.android.cts.kfmdmsolutions.ivelt.MainActivity"
android:launchMode="standard"
android:exported="true">
<intent-filter>
Expand All @@ -63,7 +63,7 @@
</activity>
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="com.kfmdmsolutions.ivelt.fileprovider"
android:authorities="com.android.cts.kfmdmsolutions.ivelt.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
Expand Down
78 changes: 60 additions & 18 deletions app/src/main/assets/add_button.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
function createButton(reference, customClass, title, text, onclick, itext="") {
'use strict';
function createButton(reference, customClass, title, text, onclick, itext) {
if (itext === undefined) {
itext = '';
}
let li = document.createElement('li');
let a = document.createElement('a');
let span = document.createElement('span');
Expand All @@ -24,6 +28,7 @@ function createButton(reference, customClass, title, text, onclick, itext="") {
return {li, a, span, i}
}


function getPMHref(id) {
let pm_button = document.querySelector(`#profile${id.replace("post_content", "")} .pm-icon`)
if (pm_button){
Expand All @@ -36,13 +41,14 @@ function addBtn(){
let btns = document.querySelectorAll('.post-buttons');
let isPosting = (window.location.href.includes("posting.php"));
var needUpdating = false;
btns.forEach(btn => {

Array.prototype.forEach.call(btns,function(btn) {
// Check if custom buttons have been added already, if yes ignore.
if(btn.getElementsByClassName('custom-btn').length > 0){
return;
}
needUpdating = true
btn.querySelectorAll('li.hidden:not(.responsive-menu)').forEach(b => {
Array.prototype.forEach.call(btn.querySelectorAll('li.hidden:not(.responsive-menu)'),function(b) {
if (b.getAttribute('class') == "hidden"){
b.removeAttribute('class')
}
Expand All @@ -53,15 +59,17 @@ function addBtn(){
let strippedId = id.replace("post_content", "")
strippedId = strippedId.replace("pr", "")
if (!isPosting){
addSimpleButton(btn, null, 'fa-share-alt', 'טייל מיט די תגובה','טייל מיט', `sharePost(${id})`)
if (android.isSharePostAvailable()){
addSimpleButton(btn, '#', 'fa-share-alt', 'טייל מיט די תגובה','טייל מיט', `sharePost(${id})`)
}
addCopyQuoteButton(btn, id.replace("post_content", ""))
let pm_href = getPMHref(id);
if (pm_href){
addSimpleButton(btn, pm_href, "fa-commenting", 'שיק א פריוואטע מעסעדזש', 'שיק א פריוואטע מעסעדזש')
}
}
let pingOnClick = `ping_user(${strippedId})`
addSimpleButton(btn, null, 'fa-at', 'דערמאן תגובה', 'דערמאן תגובה', pingOnClick)
addSimpleButton(btn, '#', 'fa-at', 'דערמאן תגובה', 'דערמאן תגובה', pingOnClick)
if (contentElement.innerHTML.includes("blockquote")) {
addQuoteLastButton(btn, isPosting);
}
Expand All @@ -76,7 +84,7 @@ function addBtn(){
let navUpdate = addDefaultPage();
if (needUpdating || navUpdate){
let navBar = document.querySelector('#nav-footer');
navBar.querySelectorAll('li.hidden:not(.responsive-menu)').forEach(si => {
Array.prototype.forEach.call(navBar.querySelectorAll('li.hidden:not(.responsive-menu)'),function(si) {
si.setAttribute('class', si.getAttribute('class').replace('hidden', ''))
})
navBar.removeChild(navBar.getElementsByClassName('responsive-menu').item(0))
Expand All @@ -90,21 +98,27 @@ function addSimpleButton(btn, href, customClass, title, text, onclick){
}

function getQuoteURL(btn){
let quoteButton = btn.querySelector('i.icon.fa-quote-left.fa-fw');
let quoteUrl = quoteButton.parentElement;
if (!quoteUrl){
return null;

try{
let quoteButton = btn.querySelector('i.icon.fa-quote-left.fa-fw');
let quoteUrl = quoteButton.parentElement;
if (!quoteUrl){
return null;
}
let href = quoteUrl.getAttribute('href');
return href;
}catch (e){

}
let href = quoteUrl.getAttribute('href');
return href;

}
function addCopyQuoteButton(btn, postID){
let href = getPMHref(postID) || getQuoteURL(btn)
if (!href){
addSimpleButton(btn, null, 'fa-copy', 'ציטיר אין אנדערע אשכול', 'ציטיר אין אנדערע אשכול', `copyQuoteParse("${postID}")`)
addSimpleButton(btn, '#', 'fa-copy', 'ציטיר אין אנדערע אשכול', 'ציטיר אין אנדערע אשכול', `copyQuoteParse("${postID}")`)
return;
}
addSimpleButton(btn, null, 'fa-copy', 'ציטיר אין אנדערע אשכול', 'ציטיר אין אנדערע אשכול', `copyQuote("${href}", "${postID}")`)
addSimpleButton(btn, '#', 'fa-copy', 'ציטיר אין אנדערע אשכול', 'ציטיר אין אנדערע אשכול', `copyQuote("${href}", "${postID}")`)
}
function addQuoteLastButton(btn, isPosting) {

Expand All @@ -126,19 +140,19 @@ function addQuoteLastButton(btn, isPosting) {
function hideButtons(){
let hidden = android.getHiddenElements()
let parsed = JSON.parse(hidden);
for (button of parsed){
for (let button of parsed){
hideButton(button)
}
}

function hideButton(selector){
let buttons = document.querySelectorAll(selector);
buttons.forEach(button => {
Array.prototype.forEach.call(buttons,function(button) {
if(selector == '.profile-contact'){
button.classList.add('app-hidden');
}else{
if(button.parentElement.parentElement.classList.contains('clone-first')){
button.parentElement.parentElement.parentElement.classList.add('app-hidden')
button.parentElement.parentElement.classList.add('app-hidden')
}
else{
button.parentElement.classList.add('app-hidden');
Expand Down Expand Up @@ -201,7 +215,10 @@ function copyQuoteParse(post_id){
android.copyToClipboard(`[quote="${username}"]${converter.feed(html)} [/quote] [url=${post_url}]מקור[/url]`)
}

function getPostDetails(post_id, prefix = 'p'){
function getPostDetails(post_id, prefix){
if (prefix === undefined) {
prefix = 'p';
}
var usernameE = document.querySelector(`#${prefix}${post_id} .username`)
if (!usernameE){
var usernameE = document.querySelector(`#p${prefix}${post_id} .username-coloured`)
Expand Down Expand Up @@ -298,8 +315,33 @@ function mozWrapApp(txtarea, open, close) {
return;
}

function addFocus(){
var element = document.querySelectorAll(".topic-tools ,.tools-icon, .spoilbtn");
for (let i = 0; i < element.length; i++) {
//x.setAttribute("style", "outline-style: inset;");
element[i].setAttribute("tabindex", "0");
element[i].addEventListener("focus", "hover", function () {
this.style.outline = "10px","dotted","yellow";
});
}
var imageElement = document.querySelectorAll(".postimage");
for (let i = 0; i < imageElement.length; i++) {
var parent = imageElement[i].parentNode;
var wrapper = document.createElement('a');
wrapper.setAttribute("href","");
wrapper.setAttribute("onclick","console.log('image clicked')");
wrapper.setAttribute("target","blank");
wrapper.setAttribute("rel","nofollow");
parent.replaceChild(wrapper, imageElement[i]);
wrapper.appendChild(imageElement[i]);


}
}

addBtn();
hideButtons();
addFocus();



Expand Down
14 changes: 10 additions & 4 deletions app/src/main/assets/add_settings_element.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

'use strict';
function addSettings(){
let quickLinks = document.querySelector('#quick-links') ;
if (!quickLinks){
Expand All @@ -16,17 +16,23 @@ function addSettings(){
settings.setAttribute('role', 'menuitem') ;
let settingsIcon = document.createElement('i') ;
settingsIcon.setAttribute('class', 'icon fa-gear fa-fw') ;
settingsTitle = document.createElement('span') ;
let settingsTitle = document.createElement('span') ;
settingsTitle.innerHTML = 'עפפ סעטטינגס' ;
settings.appendChild(settingsIcon) ;
settings.appendChild(settingsTitle) ;
settingsListItem.appendChild(settings) ;
list.append(settingsListItem);
try {
list.append(settingsListItem);
} catch (e) {
list.appendChild(settingsListItem);
}
}

function addCopyright(){
console.log(android.getVersionString())
let span = document.createElement("span")
span.innerText = "App by KF MDM v" + android.getVersionString();
span.dir = 'ltr';
span.innerText = 'App by KF MDM v '+android.getVersionString();
let copyright = document.querySelectorAll('.copyright').item(0);
if (copyright){
copyright.appendChild(span);
Expand Down

0 comments on commit 0d614e6

Please sign in to comment.